diff --git a/cobc/ChangeLog b/cobc/ChangeLog index 7aa41fa84..4eedde0d8 100644 --- a/cobc/ChangeLog +++ b/cobc/ChangeLog @@ -2,18 +2,14 @@ 2024-02-26 Boris Eng * codegen.c (output_strings_states, codegen_internal): - added structures for the data used by strings functions as local variables - in the C generated code - + added structures for the data used by strings functions as local variables + in the C generated code * parser.y (examine_format_variant, inspect_region): - function calls of strings functions have been replaced by calls to - multithreaded versions (using state structures instead of static variables) - - * typeck.c (cb_emit_inspect, cb_build_tallying_data, cb_build_tallying_all, - cb_build_tallying_leading, cb_build_tallying_trailing, cb_build_converting, - cb_emit_string, cb_emit_unstring, cb_build_unstring_into: - function calls of strings functions have been replaced by calls to - multithreaded versions (using state structures instead of static variables) + function calls of strings functions have been replaced by calls to + thread-safe versions (using state structures instead of static variables) + * typeck.c: a lot of functions have been changed in that file in order to + make them coherent with the above changes and all those changes are + omitted for more concision 2023-11-29 Fabrice Le Fessant diff --git a/cobc/Makefile b/cobc/Makefile new file mode 100644 index 000000000..af4f84a20 --- /dev/null +++ b/cobc/Makefile @@ -0,0 +1,1071 @@ +# Makefile.in generated by automake 1.16.5 from Makefile.am. +# cobc/Makefile. Generated from Makefile.in by configure. + +# Copyright (C) 1994-2021 Free Software Foundation, Inc. + +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + + + +# +# Makefile gnucobol/cobc +# +# Copyright (C) 2003-2012, 2014-2021 Free Software Foundation, Inc. +# Written by Keisuke Nishida, Roger While, Simon Sobisch +# +# This file is part of GnuCOBOL. +# +# The GnuCOBOL compiler is free software: you can redistribute it +# and/or modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# GnuCOBOL is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GnuCOBOL. If not, see . + +# aminclude_static.am generated automatically by Autoconf +# from AX_AM_MACROS_STATIC on Thu Feb 1 13:31:38 CET 2024 + + +am__is_gnu_make = { \ + if test -z '$(MAKELEVEL)'; then \ + false; \ + elif test -n '$(MAKE_HOST)'; then \ + true; \ + elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ + true; \ + else \ + false; \ + fi; \ +} +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) +pkgdatadir = $(datadir)/gnucobol +pkgincludedir = $(includedir)/gnucobol +pkglibdir = $(libdir)/gnucobol +pkglibexecdir = $(libexecdir)/gnucobol +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = x86_64-pc-linux-gnu +host_triplet = x86_64-pc-linux-gnu +bin_PROGRAMS = cobc$(EXEEXT) +subdir = cobc +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/ax_ac_append_to_file.m4 \ + $(top_srcdir)/m4/ax_ac_define_resolved.m4 \ + $(top_srcdir)/m4/ax_ac_print_to_file.m4 \ + $(top_srcdir)/m4/ax_add_am_macro_static.m4 \ + $(top_srcdir)/m4/ax_am_macros_static.m4 \ + $(top_srcdir)/m4/ax_check_define.m4 \ + $(top_srcdir)/m4/ax_check_gnu_make.m4 \ + $(top_srcdir)/m4/ax_code_coverage.m4 \ + $(top_srcdir)/m4/ax_file_escapes.m4 \ + $(top_srcdir)/m4/ax_prog_bison.m4 \ + $(top_srcdir)/m4/ax_prog_flex.m4 $(top_srcdir)/m4/codeset.m4 \ + $(top_srcdir)/m4/gettext.m4 $(top_srcdir)/m4/iconv.m4 \ + $(top_srcdir)/m4/intlmacosx.m4 $(top_srcdir)/m4/lib-ld.m4 \ + $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \ + $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ + $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ + $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/nls.m4 \ + $(top_srcdir)/m4/pkg.m4 $(top_srcdir)/m4/po.m4 \ + $(top_srcdir)/m4/progtest.m4 $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) +mkinstalldirs = $(SHELL) $(top_srcdir)/build_aux/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)" +PROGRAMS = $(bin_PROGRAMS) +am_cobc_OBJECTS = cobc.$(OBJEXT) ppparse.$(OBJEXT) pplex.$(OBJEXT) \ + parser.$(OBJEXT) scanner.$(OBJEXT) config.$(OBJEXT) \ + reserved.$(OBJEXT) error.$(OBJEXT) tree.$(OBJEXT) \ + field.$(OBJEXT) typeck.$(OBJEXT) codegen.$(OBJEXT) \ + help.$(OBJEXT) codeoptim.$(OBJEXT) replace.$(OBJEXT) +cobc_OBJECTS = $(am_cobc_OBJECTS) +am__DEPENDENCIES_1 = +cobc_DEPENDENCIES = $(top_builddir)/libcob/libcob.la \ + $(top_builddir)/lib/libsupport.la $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) +AM_V_lt = $(am__v_lt_$(V)) +am__v_lt_ = $(am__v_lt_$(AM_DEFAULT_VERBOSITY)) +am__v_lt_0 = --silent +am__v_lt_1 = +AM_V_P = $(am__v_P_$(V)) +am__v_P_ = $(am__v_P_$(AM_DEFAULT_VERBOSITY)) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_$(V)) +am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY)) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_$(V)) +am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY)) +am__v_at_0 = @ +am__v_at_1 = +DEFAULT_INCLUDES = -I. -I$(top_builddir) +depcomp = $(SHELL) $(top_srcdir)/build_aux/depcomp +am__maybe_remake_depfiles = depfiles +am__depfiles_remade = ./$(DEPDIR)/cobc.Po ./$(DEPDIR)/codegen.Po \ + ./$(DEPDIR)/codeoptim.Po ./$(DEPDIR)/config.Po \ + ./$(DEPDIR)/error.Po ./$(DEPDIR)/field.Po ./$(DEPDIR)/help.Po \ + ./$(DEPDIR)/parser.Po ./$(DEPDIR)/pplex.Po \ + ./$(DEPDIR)/ppparse.Po ./$(DEPDIR)/replace.Po \ + ./$(DEPDIR)/reserved.Po ./$(DEPDIR)/scanner.Po \ + ./$(DEPDIR)/tree.Po ./$(DEPDIR)/typeck.Po +am__mv = mv -f +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CFLAGS) $(CFLAGS) +AM_V_CC = $(am__v_CC_$(V)) +am__v_CC_ = $(am__v_CC_$(AM_DEFAULT_VERBOSITY)) +am__v_CC_0 = @echo " CC " $@; +am__v_CC_1 = +CCLD = $(CC) +LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +AM_V_CCLD = $(am__v_CCLD_$(V)) +am__v_CCLD_ = $(am__v_CCLD_$(AM_DEFAULT_VERBOSITY)) +am__v_CCLD_0 = @echo " CCLD " $@; +am__v_CCLD_1 = +am__yacc_c2h = sed -e s/cc$$/hh/ -e s/cpp$$/hpp/ -e s/cxx$$/hxx/ \ + -e s/c++$$/h++/ -e s/c$$/h/ +YACCCOMPILE = $(YACC) $(AM_YFLAGS) $(YFLAGS) +LTYACCCOMPILE = $(LIBTOOL) $(AM_V_lt) $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=compile $(YACC) $(AM_YFLAGS) $(YFLAGS) +AM_V_YACC = $(am__v_YACC_$(V)) +am__v_YACC_ = $(am__v_YACC_$(AM_DEFAULT_VERBOSITY)) +am__v_YACC_0 = @echo " YACC " $@; +am__v_YACC_1 = +YLWRAP = $(top_srcdir)/build_aux/ylwrap +SOURCES = $(cobc_SOURCES) +DIST_SOURCES = $(cobc_SOURCES) +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__uninstall_files_from_dir = { \ + test -z "$$files" \ + || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ + || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ + $(am__cd) "$$dir" && rm -f $$files; }; \ + } +man1dir = $(mandir)/man1 +NROFF = nroff +MANS = $(dist_man_MANS) +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) +# Read a list of newline-separated strings from the standard input, +# and print each of them once, without duplicates. Input order is +# *not* preserved. +am__uniquify_input = $(AWK) '\ + BEGIN { nonempty = 0; } \ + { items[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in items) print i; }; } \ +' +# Make sure the list of sources is unique. This is necessary because, +# e.g., the same source file might be shared among _SOURCES variables +# for different programs/libraries. +am__define_uniq_tagged_files = \ + list='$(am__tagged_files)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | $(am__uniquify_input)` +am__DIST_COMMON = $(dist_man_MANS) $(srcdir)/Makefile.in \ + $(top_srcdir)/aminclude_static.am \ + $(top_srcdir)/build_aux/depcomp \ + $(top_srcdir)/build_aux/mkinstalldirs \ + $(top_srcdir)/build_aux/ylwrap ChangeLog parser.c ppparse.c +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = ${SHELL} '/home/engboris/gnucobol/build_aux/missing' aclocal-1.16 +AMTAR = $${TAR-tar} +AM_DEFAULT_VERBOSITY = 1 +AR = ar +AS = as +AUTOCONF = ${SHELL} '/home/engboris/gnucobol/build_aux/missing' autoconf +AUTOHEADER = ${SHELL} '/home/engboris/gnucobol/build_aux/missing' autoheader +AUTOMAKE = ${SHELL} '/home/engboris/gnucobol/build_aux/missing' automake-1.16 +AWK = mawk +BDB_CFLAGS = +BDB_LIBS = +CC = gcc +CCDEPMODE = depmode=gcc3 +CFLAGS = -O0 -ggdb3 -fasynchronous-unwind-tables -pipe -fsigned-char -Wall -Wwrite-strings -Wmissing-prototypes -Wno-format-y2k +CJSON_CFLAGS = +CJSON_LIBS = -lcjson +COBC_CPPFLAGS = +COB_BIGENDIAN = no +COB_CC = gcc +COB_CFLAGS = -pipe -I/usr/local/gnucobol/include -Wno-unused -fsigned-char -Wno-pointer-sign +COB_CONFIG_DIR = ${datarootdir}/gnucobol/config +COB_COPY_DIR = ${datarootdir}/gnucobol/copy +COB_ENABLE_DEBUG = yes +COB_EXE_EXT = +COB_FIX_LIBTOOL = +COB_HAS_64_BIT_POINTER = yes +COB_HAS_CURSES = yes +COB_HAS_ISAM = db +COB_HAS_JSON = no +COB_HAS_XML2 = yes +COB_LDFLAGS = +COB_LIBRARY_PATH = ${exec_prefix}/lib/gnucobol +COB_LIBS = -L${exec_prefix}/lib -lcob +COB_MODULE_EXT = so +COB_OBJECT_EXT = o +COB_PATCH_LEVEL = 0 +CODE_COVERAGE_CFLAGS = +CODE_COVERAGE_CPPFLAGS = +CODE_COVERAGE_CXXFLAGS = +CODE_COVERAGE_ENABLED = no +CODE_COVERAGE_LIBS = +CPP = +CPPFLAGS = +CSCOPE = cscope +CTAGS = ctags +CURSES_LIBS = -lncursesw +CYGPATH_W = echo +DEFS = -DHAVE_CONFIG_H +DEPDIR = .deps +DIFF_FLAGS = --strip-trailing-cr +DLLTOOL = false +DSYMUTIL = +DUMPBIN = +ECHO_C = +ECHO_N = -n +ECHO_T = +EGREP = /usr/bin/grep -E +ETAGS = etags +EXEEXT = +FGREP = /usr/bin/grep -F +GCOV = +GENHTML = +GETTEXT_MACRO_VERSION = 0.20 +GMP_CFLAGS = +GMP_LIBS = -lgmp +GMSGFMT = : +GMSGFMT_015 = : +GREP = /usr/bin/grep +HELP2MAN = ${SHELL} '/home/engboris/gnucobol/build_aux/missing' help2man +INSTALL = /usr/bin/install -c +INSTALL_DATA = ${INSTALL} -m 644 +INSTALL_PROGRAM = ${INSTALL} +INSTALL_SCRIPT = ${INSTALL} +INSTALL_STRIP_PROGRAM = $(install_sh) -c -s +INTLLIBS = +INTL_MACOSX_LIBS = +JSON_C_CFLAGS = +JSON_C_LIBS = -ljson-c +LCOV = +LD = /usr/bin/ld -m elf_x86_64 +LDFLAGS = -Wl,-z,relro,-z,now,-O1 +LEX = ${SHELL} '/home/engboris/gnucobol/build_aux/missing' flex +LEXLIB = +LEX_OUTPUT_ROOT = +LIBCOB_CPPFLAGS = -I/usr/include/libxml2 +LIBCOB_LIBS = -lgmp -lxml2 -lncursesw -ldb-5.3 +LIBICONV = -liconv +LIBINTL = +LIBOBJS = +LIBS = +LIBTOOL = $(SHELL) $(top_builddir)/libtool +LIPO = +LN_S = ln -s +LTLIBICONV = -liconv +LTLIBINTL = +LTLIBOBJS = +LT_SYS_LIBRARY_PATH = +MAKE = make +MAKEINFO = ${SHELL} '/home/engboris/gnucobol/build_aux/missing' makeinfo +MANIFEST_TOOL = : +MKDIR_P = /usr/bin/mkdir -p +MPIR_CFLAGS = +MPIR_LIBS = +MSGFMT = : +MSGMERGE = : +MSGMERGE_FOR_MSGFMT_OPTION = --no-location --quiet +NM = /usr/bin/nm -B +NMEDIT = +OBJDUMP = objdump +OBJEXT = o +OTOOL = +OTOOL64 = +PACKAGE = gnucobol +PACKAGE_BUGREPORT = bug-gnucobol@gnu.org +PACKAGE_NAME = GnuCOBOL +PACKAGE_STRING = GnuCOBOL 3.3-dev +PACKAGE_TARNAME = gnucobol +PACKAGE_URL = https://www.gnu.org/software/gnucobol/ +PACKAGE_VERSION = 3.3-dev +PATH_SEPARATOR = : +PERL = perl +PKG_CONFIG = /usr/bin/pkg-config +PKG_CONFIG_LIBDIR = +PKG_CONFIG_PATH = +POSUB = po +PROGRAMS_LIBS = +QUOTE_INCLUDE_FLAG = +RANLIB = ranlib +RC = +SED = /usr/bin/sed +SET_MAKE = +SHELL = /bin/bash +STRIP = strip +USE_NLS = yes +VERSION = 3.3-dev +XGETTEXT = : +XGETTEXT_015 = : +XGETTEXT_EXTRA_OPTIONS = +XML2_CFLAGS = -I/usr/include/libxml2 +XML2_CONFIG = +XML2_LIBS = -lxml2 +YACC = yacc +YFLAGS = +abs_builddir = /home/engboris/gnucobol/cobc +abs_srcdir = /home/engboris/gnucobol/cobc +abs_top_builddir = /home/engboris/gnucobol +abs_top_srcdir = /home/engboris/gnucobol +ac_ct_AR = ar +ac_ct_CC = gcc +ac_ct_DUMPBIN = +am__include = include +am__leading_dot = . +am__quote = +am__tar = $${TAR-tar} chof - "$$tardir" +am__untar = $${TAR-tar} xf - +bindir = ${exec_prefix}/bin +build = x86_64-pc-linux-gnu +build_alias = +build_cpu = x86_64 +build_os = linux-gnu +build_vendor = pc +builddir = . +configured_make = make +datadir = ${datarootdir} +datarootdir = ${prefix}/share +docdir = ${datarootdir}/doc/${PACKAGE_TARNAME} +dvidir = ${docdir} +exec_prefix = ${prefix} +host = x86_64-pc-linux-gnu +host_alias = +host_cpu = x86_64 +host_os = linux-gnu +host_vendor = pc +htmldir = ${docdir} +ifGNUmake = +ifnGNUmake = +includedir = ${prefix}/include +infodir = ${datarootdir}/info +install_sh = ${SHELL} /home/engboris/gnucobol/build_aux/install-sh +libdir = ${exec_prefix}/lib +libexecdir = ${exec_prefix}/libexec +localedir = ${datarootdir}/locale +localstatedir = ${prefix}/var +mandir = ${datarootdir}/man +mkdir_p = $(MKDIR_P) +oldincludedir = /usr/include +pdfdir = ${docdir} +prefix = /usr/local/gnucobol +program_transform_name = s,x,x, +psdir = ${docdir} +runstatedir = ${localstatedir}/run +sbindir = ${exec_prefix}/sbin +sharedstatedir = ${prefix}/com +srcdir = . +sysconfdir = ${prefix}/etc +target_alias = +top_build_prefix = ../ +top_builddir = .. +top_srcdir = .. +cobc_SOURCES = cobc.c cobc.h ppparse.y pplex.c parser.y scanner.c config.c \ + reserved.c error.c tree.c tree.h field.c typeck.c codegen.c help.c \ + config.def flag.def warning.def codeoptim.def ppparse.def \ + codeoptim.c replace.c + + +#cobc_SOURCES = cobc.c cobc.h ppparse.y pplex.l parser.y scanner.l config.c +AM_CPPFLAGS = -I$(top_srcdir) -I$(top_builddir)/lib -I$(top_srcdir)/lib \ + $(COBC_CPPFLAGS) + +AM_CFLAGS = $(CODE_COVERAGE_CFLAGS) +cobc_LDADD = $(top_builddir)/libcob/libcob.la \ + $(top_builddir)/lib/libsupport.la \ + $(PROGRAMS_LIBS) $(CODE_COVERAGE_LIBS) + +dist_man_MANS = cobc.1 +COBC = cobc$(EXEEXT) + +# sources that needs to be built *before* any other file +# note: we actually want their header files... +BUILT_SOURCES = ppparse.c parser.c +EXTRA_DIST = pplex.l scanner.l ppparse.h parser.h +MAINTAINERCLEANFILES = pplex.c scanner.c ppparse.h parser.h cobc.1 +CLEANFILES = parser.output ppparse.output +#GITIGNOREFILES := $(GITIGNOREFILES) $(CODE_COVERAGE_OUTPUT_FILE) $(CODE_COVERAGE_OUTPUT_DIRECTORY) +#code_coverage_v_lcov_cap = $(code_coverage_v_lcov_cap_$(V)) +#code_coverage_v_lcov_cap_ = $(code_coverage_v_lcov_cap_$(AM_DEFAULT_VERBOSITY)) +#code_coverage_v_lcov_cap_0 = @echo " LCOV --capture" $(CODE_COVERAGE_OUTPUT_FILE); +#code_coverage_v_lcov_ign = $(code_coverage_v_lcov_ign_$(V)) +#code_coverage_v_lcov_ign_ = $(code_coverage_v_lcov_ign_$(AM_DEFAULT_VERBOSITY)) +#code_coverage_v_lcov_ign_0 = @echo " LCOV --remove /tmp/*" $(CODE_COVERAGE_IGNORE_PATTERN); +#code_coverage_v_genhtml = $(code_coverage_v_genhtml_$(V)) +#code_coverage_v_genhtml_ = $(code_coverage_v_genhtml_$(AM_DEFAULT_VERBOSITY)) +#code_coverage_v_genhtml_0 = @echo " GEN " "$(CODE_COVERAGE_OUTPUT_DIRECTORY)"; +#code_coverage_quiet = $(code_coverage_quiet_$(V)) +#code_coverage_quiet_ = $(code_coverage_quiet_$(AM_DEFAULT_VERBOSITY)) +#code_coverage_quiet_0 = --quiet + +# sanitizes the test-name: replaces with underscores: dashes and dots +#code_coverage_sanitize = $(subst -,_,$(subst .,_,$(1))) +#AM_DISTCHECK_CONFIGURE_FLAGS := $(AM_DISTCHECK_CONFIGURE_FLAGS) --disable-code-coverage +CODE_COVERAGE_BRANCH_COVERAGE = 1 +CODE_COVERAGE_LCOV_OPTIONS = --no-external +HELPSOURCES = help.c config.def flag.def warning.def $(top_srcdir)/configure.ac +HELP2MAN_OPTS = --info-page=$(PACKAGE) +all: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) all-am + +.SUFFIXES: +.SUFFIXES: .c .l .lo .o .obj .y +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/aminclude_static.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu cobc/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu cobc/Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ + esac; +$(top_srcdir)/aminclude_static.am $(am__empty): + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): +install-binPROGRAMS: $(bin_PROGRAMS) + @$(NORMAL_INSTALL) + @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ + fi; \ + for p in $$list; do echo "$$p $$p"; done | \ + sed 's/$(EXEEXT)$$//' | \ + while read p p1; do if test -f $$p \ + || test -f $$p1 \ + ; then echo "$$p"; echo "$$p"; else :; fi; \ + done | \ + sed -e 'p;s,.*/,,;n;h' \ + -e 's|.*|.|' \ + -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ + sed 'N;N;N;s,\n, ,g' | \ + $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ + { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ + if ($$2 == $$4) files[d] = files[d] " " $$1; \ + else { print "f", $$3 "/" $$4, $$1; } } \ + END { for (d in files) print "f", d, files[d] }' | \ + while read type dir files; do \ + if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ + test -z "$$files" || { \ + echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ + $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ + } \ + ; done + +uninstall-binPROGRAMS: + @$(NORMAL_UNINSTALL) + @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ + files=`for p in $$list; do echo "$$p"; done | \ + sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ + -e 's/$$/$(EXEEXT)/' \ + `; \ + test -n "$$list" || exit 0; \ + echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ + cd "$(DESTDIR)$(bindir)" && rm -f $$files + +clean-binPROGRAMS: + @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \ + echo " rm -f" $$list; \ + rm -f $$list || exit $$?; \ + test -n "$(EXEEXT)" || exit 0; \ + list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ + echo " rm -f" $$list; \ + rm -f $$list + +cobc$(EXEEXT): $(cobc_OBJECTS) $(cobc_DEPENDENCIES) $(EXTRA_cobc_DEPENDENCIES) + @rm -f cobc$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(cobc_OBJECTS) $(cobc_LDADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +include ./$(DEPDIR)/cobc.Po # am--include-marker +include ./$(DEPDIR)/codegen.Po # am--include-marker +include ./$(DEPDIR)/codeoptim.Po # am--include-marker +include ./$(DEPDIR)/config.Po # am--include-marker +include ./$(DEPDIR)/error.Po # am--include-marker +include ./$(DEPDIR)/field.Po # am--include-marker +include ./$(DEPDIR)/help.Po # am--include-marker +include ./$(DEPDIR)/parser.Po # am--include-marker +include ./$(DEPDIR)/pplex.Po # am--include-marker +include ./$(DEPDIR)/ppparse.Po # am--include-marker +include ./$(DEPDIR)/replace.Po # am--include-marker +include ./$(DEPDIR)/reserved.Po # am--include-marker +include ./$(DEPDIR)/scanner.Po # am--include-marker +include ./$(DEPDIR)/tree.Po # am--include-marker +include ./$(DEPDIR)/typeck.Po # am--include-marker + +$(am__depfiles_remade): + @$(MKDIR_P) $(@D) + @echo '# dummy' >$@-t && $(am__mv) $@-t $@ + +am--depfiles: $(am__depfiles_remade) + +.c.o: + $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< + $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +# $(AM_V_CC)source='$<' object='$@' libtool=no \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(AM_V_CC_no)$(COMPILE) -c -o $@ $< + +.c.obj: + $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` + $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +# $(AM_V_CC)source='$<' object='$@' libtool=no \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(AM_V_CC_no)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +.c.lo: + $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< + $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +# $(AM_V_CC)source='$<' object='$@' libtool=yes \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(AM_V_CC_no)$(LTCOMPILE) -c -o $@ $< + +.y.c: + $(AM_V_YACC)$(am__skipyacc) $(SHELL) $(YLWRAP) $< y.tab.c $@ y.tab.h `echo $@ | $(am__yacc_c2h)` y.output $*.output -- $(YACCCOMPILE) + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs +install-man1: $(dist_man_MANS) + @$(NORMAL_INSTALL) + @list1=''; \ + list2='$(dist_man_MANS)'; \ + test -n "$(man1dir)" \ + && test -n "`echo $$list1$$list2`" \ + || exit 0; \ + echo " $(MKDIR_P) '$(DESTDIR)$(man1dir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(man1dir)" || exit 1; \ + { for i in $$list1; do echo "$$i"; done; \ + if test -n "$$list2"; then \ + for i in $$list2; do echo "$$i"; done \ + | sed -n '/\.1[a-z]*$$/p'; \ + fi; \ + } | while read p; do \ + if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; echo "$$p"; \ + done | \ + sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ + -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \ + sed 'N;N;s,\n, ,g' | { \ + list=; while read file base inst; do \ + if test "$$base" = "$$inst"; then list="$$list $$file"; else \ + echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \ + $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst" || exit $$?; \ + fi; \ + done; \ + for i in $$list; do echo "$$i"; done | $(am__base_list) | \ + while read files; do \ + test -z "$$files" || { \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man1dir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(man1dir)" || exit $$?; }; \ + done; } + +uninstall-man1: + @$(NORMAL_UNINSTALL) + @list=''; test -n "$(man1dir)" || exit 0; \ + files=`{ for i in $$list; do echo "$$i"; done; \ + l2='$(dist_man_MANS)'; for i in $$l2; do echo "$$i"; done | \ + sed -n '/\.1[a-z]*$$/p'; \ + } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ + -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ + dir='$(DESTDIR)$(man1dir)'; $(am__uninstall_files_from_dir) + +ID: $(am__tagged_files) + $(am__define_uniq_tagged_files); mkid -fID $$unique +tags: tags-am +TAGS: tags + +tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + set x; \ + here=`pwd`; \ + $(am__define_uniq_tagged_files); \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: ctags-am + +CTAGS: ctags +ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + $(am__define_uniq_tagged_files); \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" +cscopelist: cscopelist-am + +cscopelist-am: $(am__tagged_files) + list='$(am__tagged_files)'; \ + case "$(srcdir)" in \ + [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ + *) sdir=$(subdir)/$(srcdir) ;; \ + esac; \ + for i in $$list; do \ + if test -f "$$i"; then \ + echo "$(subdir)/$$i"; \ + else \ + echo "$$sdir/$$i"; \ + fi; \ + done >> $(top_builddir)/cscope.files + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags +distdir: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) distdir-am + +distdir-am: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) check-am +all-am: Makefile $(PROGRAMS) $(MANS) +installdirs: + for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) install-am +install-exec: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." + -rm -f parser.c + -rm -f ppparse.c + -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) + -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) +clean: clean-am + +clean-am: clean-binPROGRAMS clean-generic clean-libtool clean-local \ + mostlyclean-am + +distclean: distclean-am + -rm -f ./$(DEPDIR)/cobc.Po + -rm -f ./$(DEPDIR)/codegen.Po + -rm -f ./$(DEPDIR)/codeoptim.Po + -rm -f ./$(DEPDIR)/config.Po + -rm -f ./$(DEPDIR)/error.Po + -rm -f ./$(DEPDIR)/field.Po + -rm -f ./$(DEPDIR)/help.Po + -rm -f ./$(DEPDIR)/parser.Po + -rm -f ./$(DEPDIR)/pplex.Po + -rm -f ./$(DEPDIR)/ppparse.Po + -rm -f ./$(DEPDIR)/replace.Po + -rm -f ./$(DEPDIR)/reserved.Po + -rm -f ./$(DEPDIR)/scanner.Po + -rm -f ./$(DEPDIR)/tree.Po + -rm -f ./$(DEPDIR)/typeck.Po + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: install-man + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: install-binPROGRAMS + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: install-man1 + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f ./$(DEPDIR)/cobc.Po + -rm -f ./$(DEPDIR)/codegen.Po + -rm -f ./$(DEPDIR)/codeoptim.Po + -rm -f ./$(DEPDIR)/config.Po + -rm -f ./$(DEPDIR)/error.Po + -rm -f ./$(DEPDIR)/field.Po + -rm -f ./$(DEPDIR)/help.Po + -rm -f ./$(DEPDIR)/parser.Po + -rm -f ./$(DEPDIR)/pplex.Po + -rm -f ./$(DEPDIR)/ppparse.Po + -rm -f ./$(DEPDIR)/replace.Po + -rm -f ./$(DEPDIR)/reserved.Po + -rm -f ./$(DEPDIR)/scanner.Po + -rm -f ./$(DEPDIR)/tree.Po + -rm -f ./$(DEPDIR)/typeck.Po + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-binPROGRAMS uninstall-man + +uninstall-man: uninstall-man1 + +.MAKE: all check install install-am install-exec install-strip + +.PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \ + clean-binPROGRAMS clean-generic clean-libtool clean-local \ + cscopelist-am ctags ctags-am distclean distclean-compile \ + distclean-generic distclean-libtool distclean-tags distdir dvi \ + dvi-am html html-am info info-am install install-am \ + install-binPROGRAMS install-data install-data-am install-dvi \ + install-dvi-am install-exec install-exec-am install-html \ + install-html-am install-info install-info-am install-man \ + install-man1 install-pdf install-pdf-am install-ps \ + install-ps-am install-strip installcheck installcheck-am \ + installdirs maintainer-clean maintainer-clean-generic \ + mostlyclean mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am uninstall \ + uninstall-am uninstall-binPROGRAMS uninstall-man \ + uninstall-man1 + +.PRECIOUS: Makefile + + +# Code coverage +# +# Optional: +# - CODE_COVERAGE_DIRECTORY: Top-level directory for code coverage reporting. +# Multiple directories may be specified, separated by whitespace. +# (Default: $(top_builddir)) +# - CODE_COVERAGE_OUTPUT_FILE: Filename and path for the .info file generated +# by lcov for code coverage. (Default: +# $(PACKAGE_NAME)-$(PACKAGE_VERSION)-coverage.info) +# - CODE_COVERAGE_OUTPUT_DIRECTORY: Directory for generated code coverage +# reports to be created. (Default: +# $(PACKAGE_NAME)-$(PACKAGE_VERSION)-coverage) +# - CODE_COVERAGE_BRANCH_COVERAGE: Set to 1 to enforce branch coverage, +# set to 0 to disable it and leave empty to stay with the default. +# (Default: empty) +# - CODE_COVERAGE_LCOV_SHOPTS_DEFAULT: Extra options shared between both lcov +# instances. (Default: based on ) +# - CODE_COVERAGE_LCOV_SHOPTS: Extra options to shared between both lcov +# instances. (Default: ) +# - CODE_COVERAGE_LCOV_OPTIONS_GCOVPATH: --gcov-tool pathtogcov +# - CODE_COVERAGE_LCOV_OPTIONS_DEFAULT: Extra options to pass to the +# collecting lcov instance. (Default: ) +# - CODE_COVERAGE_LCOV_OPTIONS: Extra options to pass to the collecting lcov +# instance. (Default: ) +# - CODE_COVERAGE_LCOV_RMOPTS_DEFAULT: Extra options to pass to the filtering +# lcov instance. (Default: empty) +# - CODE_COVERAGE_LCOV_RMOPTS: Extra options to pass to the filtering lcov +# instance. (Default: ) +# - CODE_COVERAGE_GENHTML_OPTIONS_DEFAULT: Extra options to pass to the +# genhtml instance. (Default: based on ) +# - CODE_COVERAGE_GENHTML_OPTIONS: Extra options to pass to the genhtml +# instance. (Default: ) +# - CODE_COVERAGE_IGNORE_PATTERN: Extra glob pattern of files to ignore +# +# The generated report will be titled using the $(PACKAGE_NAME) and +# $(PACKAGE_VERSION). In order to add the current git hash to the title, +# use the git-version-gen script, available online. +# Optional variables +# run only on top dir +# ifeq ($(abs_builddir), $(abs_top_builddir)) +#CODE_COVERAGE_DIRECTORY ?= $(top_builddir) +#CODE_COVERAGE_OUTPUT_FILE ?= $(PACKAGE_NAME)-$(PACKAGE_VERSION)-coverage.info +#CODE_COVERAGE_OUTPUT_DIRECTORY ?= $(PACKAGE_NAME)-$(PACKAGE_VERSION)-coverage + +#CODE_COVERAGE_BRANCH_COVERAGE ?= +#CODE_COVERAGE_LCOV_SHOPTS_DEFAULT ?= $(if $(CODE_COVERAGE_BRANCH_COVERAGE),--rc lcov_branch_coverage=$(CODE_COVERAGE_BRANCH_COVERAGE)) +#CODE_COVERAGE_LCOV_SHOPTS ?= $(CODE_COVERAGE_LCOV_SHOPTS_DEFAULT) +#CODE_COVERAGE_LCOV_OPTIONS_GCOVPATH ?= --gcov-tool "$(GCOV)" +#CODE_COVERAGE_LCOV_OPTIONS_DEFAULT ?= $(CODE_COVERAGE_LCOV_OPTIONS_GCOVPATH) +#CODE_COVERAGE_LCOV_OPTIONS ?= $(CODE_COVERAGE_LCOV_OPTIONS_DEFAULT) +#CODE_COVERAGE_LCOV_RMOPTS_DEFAULT ?= +#CODE_COVERAGE_LCOV_RMOPTS ?= $(CODE_COVERAGE_LCOV_RMOPTS_DEFAULT) +#CODE_COVERAGE_GENHTML_OPTIONS_DEFAULT ?=$(if $(CODE_COVERAGE_BRANCH_COVERAGE),--rc genhtml_branch_coverage=$(CODE_COVERAGE_BRANCH_COVERAGE)) +#CODE_COVERAGE_GENHTML_OPTIONS ?= $(CODE_COVERAGE_GENHTML_OPTIONS_DEFAULT) +#CODE_COVERAGE_IGNORE_PATTERN ?= + +# Use recursive makes in order to ignore errors during check +#check-code-coverage: +# -$(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -k check +# $(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) code-coverage-capture + +# Capture code coverage data +#code-coverage-capture: code-coverage-capture-hook +# $(code_coverage_v_lcov_cap)$(LCOV) $(code_coverage_quiet) $(addprefix --directory ,$(CODE_COVERAGE_DIRECTORY)) --capture --output-file "$(CODE_COVERAGE_OUTPUT_FILE).tmp" --test-name "$(call code_coverage_sanitize,$(PACKAGE_NAME)-$(PACKAGE_VERSION))" --no-checksum --compat-libtool $(CODE_COVERAGE_LCOV_SHOPTS) $(CODE_COVERAGE_LCOV_OPTIONS) +# $(code_coverage_v_lcov_ign)$(LCOV) $(code_coverage_quiet) $(addprefix --directory ,$(CODE_COVERAGE_DIRECTORY)) --remove "$(CODE_COVERAGE_OUTPUT_FILE).tmp" "/tmp/*" $(CODE_COVERAGE_IGNORE_PATTERN) --output-file "$(CODE_COVERAGE_OUTPUT_FILE)" $(CODE_COVERAGE_LCOV_SHOPTS) $(CODE_COVERAGE_LCOV_RMOPTS) +# -@rm -f "$(CODE_COVERAGE_OUTPUT_FILE).tmp" +# $(code_coverage_v_genhtml)LANG=C $(GENHTML) $(code_coverage_quiet) $(addprefix --prefix ,$(CODE_COVERAGE_DIRECTORY)) --output-directory "$(CODE_COVERAGE_OUTPUT_DIRECTORY)" --title "$(PACKAGE_NAME)-$(PACKAGE_VERSION) Code Coverage" --legend --show-details "$(CODE_COVERAGE_OUTPUT_FILE)" $(CODE_COVERAGE_GENHTML_OPTIONS) +# @echo "file://$(abs_builddir)/$(CODE_COVERAGE_OUTPUT_DIRECTORY)/index.html" + +#code-coverage-clean: +# -$(LCOV) --directory $(top_builddir) -z +# -rm -rf "$(CODE_COVERAGE_OUTPUT_FILE)" "$(CODE_COVERAGE_OUTPUT_FILE).tmp" "$(CODE_COVERAGE_OUTPUT_DIRECTORY)" +# -find . \( -name "*.gcda" -o -name "*.gcno" -o -name "*.gcov" \) -delete + +#code-coverage-dist-clean: +# else # ifneq ($(abs_builddir), $(abs_top_builddir)) +#check-code-coverage: + +#code-coverage-capture: code-coverage-capture-hook + +#code-coverage-clean: + +#code-coverage-dist-clean: +# endif # ifeq ($(abs_builddir), $(abs_top_builddir)) +# Use recursive makes in order to ignore errors during check +check-code-coverage: + @echo "Need to reconfigure with --enable-code-coverage" +# Capture code coverage data +code-coverage-capture: code-coverage-capture-hook + @echo "Need to reconfigure with --enable-code-coverage" + +code-coverage-clean: + +code-coverage-dist-clean: + +# Hook rule executed before code-coverage-capture, overridable by the user +code-coverage-capture-hook: + +.PHONY: check-code-coverage code-coverage-capture code-coverage-dist-clean code-coverage-clean code-coverage-capture-hook + +# Add rules for code-coverage testing, as provided by AX_CODE_COVERAGE + +clean-local: code-coverage-clean +dist-clean-local: code-coverage-dist-clean + +cobc.1: $(HELPSOURCES) | $(COBC) + "$(top_builddir)/pre-inst-env" $(HELP2MAN) --output=$@ $(HELP2MAN_OPTS) $(COBC) +#cobc.1: $(HELPSOURCES) +# "$(top_builddir)/pre-inst-env" $(HELP2MAN) --output=$@ $(HELP2MAN_OPTS) $(COBC) + +.l.c: + LC_CTYPE=C $(LEX) -o$@ $< + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/cobc/codegen.c b/cobc/codegen.c index c2718d26f..41f06631e 100644 --- a/cobc/codegen.c +++ b/cobc/codegen.c @@ -2497,16 +2497,24 @@ output_nonlocal_field_cache (void) /* Strings states */ - - static void -output_strings_states (void) -{ - output_local ("/* States of string statements */\n"); - output_local ("struct inspect_state *inspect_st = NULL;\n"); - output_local ("struct string_state *string_st = NULL;\n"); - output_local ("struct unstring_state *unstring_st = NULL;\n"); - output_newline (); +output_strings_states (struct cb_program *prog) +{ + unsigned int strings_used = + prog->flag_inspect_used || + prog->flag_string_used || + prog->flag_unstring_used; + + // if (strings_used) + output_local ("/* States of string statements */\n"); + // if (prog->flag_inspect_used) + output_local ("struct cob_inspect_state *inspect_st = NULL;\n"); + // if (prog->flag_string_used) + output_local ("struct cob_string_state *string_st = NULL;\n"); + // if (prog->flag_unstring_used) + output_local ("struct cob_unstring_state *unstring_st = NULL;\n"); + // if (strings_used) + output_newline (); } /* Literals, figurative constants and user-defined constants */ @@ -13902,7 +13910,7 @@ codegen_internal (struct cb_program *prog, const int subsequent_call) output_call_parameter_stack_pointers (prog); output_frame_stack (prog); output_dynamic_field_function_id_pointers (); - output_strings_states (); + output_strings_states (prog); if (prog->report_storage) { output_target = prog->local_include->local_fp; diff --git a/cobc/parser.y b/cobc/parser.y index cde461aec..1df383b93 100644 --- a/cobc/parser.y +++ b/cobc/parser.y @@ -14889,7 +14889,6 @@ examine_format_variant: { cb_tree x = $4, replacing_to = $5; cb_tree t, r = cb_build_inspect_region_start (); - cb_tree st = cb_build_direct ("inspect_st", 0); switch (examine_keyword.tallying) { case EXAMINE_TAL_ALL: cb_build_tallying_all (); @@ -14900,7 +14899,11 @@ examine_format_variant: t = cb_build_tallying_value (x, r); break; case EXAMINE_TAL_UNTIL_FIRST: - r = cb_list_add (r, CB_BUILD_FUNCALL_2 ("cob_inspect_before_mt", st, x)); + r = cb_list_add (r, CB_BUILD_FUNCALL_2 ( + "cob_inspect_before_mt", + current_program->inspect_st_ref, + x + )); t = cb_build_tallying_characters (r); break; /* LCOV_EXCL_START */ @@ -14921,7 +14924,11 @@ examine_format_variant: t = cb_build_replacing_leading (x, replacing_to, r); break; case EXAMINE_TAL_UNTIL_FIRST: - r = cb_list_add (r, CB_BUILD_FUNCALL_2 ("cob_inspect_before_mt", st, x)); + r = cb_list_add (r, CB_BUILD_FUNCALL_2 ( + "cob_inspect_before_mt", + current_program->inspect_st_ref, + x + )); t = cb_build_replacing_characters (replacing_to, r); break; } @@ -14933,7 +14940,6 @@ examine_format_variant: { cb_tree from = $3, to = $5; cb_tree t, r = cb_build_inspect_region_start (); - cb_tree st = cb_build_direct ("inspect_st", 0); switch (examine_keyword.replacing) { case EXAMINE_REP_ALL: t = cb_build_replacing_all (from, to, r); @@ -14945,7 +14951,11 @@ examine_format_variant: t = cb_build_replacing_first (from, to, r); break; case EXAMINE_REP_UNTIL_FIRST: - r = cb_list_add (r, CB_BUILD_FUNCALL_2 ("cob_inspect_before_mt", st, from)); + r = cb_list_add (r, CB_BUILD_FUNCALL_2 ( + "cob_inspect_before_mt", + current_program->inspect_st_ref, + from + )); t = cb_build_replacing_characters (to, r); break; /* LCOV_EXCL_START */ @@ -15159,16 +15169,22 @@ inspect_region: inspect_before: BEFORE _initial x { - cb_tree st = cb_build_direct ("inspect_st", 0); - $$ = CB_BUILD_FUNCALL_2 ("cob_inspect_before_mt", st, $3); + $$ = CB_BUILD_FUNCALL_2 ( + "cob_inspect_before_mt", + current_program->inspect_st_ref, + $3 + ); } ; inspect_after: AFTER _initial x { - cb_tree st = cb_build_direct ("inspect_st", 0); - $$ = CB_BUILD_FUNCALL_2 ("cob_inspect_after_mt", st, $3); + $$ = CB_BUILD_FUNCALL_2 ( + "cob_inspect_after_mt", + current_program->inspect_st_ref, + $3 + ); } ; diff --git a/cobc/ppparse.output b/cobc/ppparse.output new file mode 100644 index 000000000..53d4a1c42 --- /dev/null +++ b/cobc/ppparse.output @@ -0,0 +1,3526 @@ +Terminaux inutilisés dans la grammaire + + "word" + + +Grammaire + + 0 $accept: program_structure "end of file" + + 1 program_structure: "CONTROL DIVISION" "." program_with_control_division + 2 | statement_list + + 3 program_with_control_division: statement_list + 4 | control_division_no_replace statement_no_replace statement_list + 5 | control_division_no_replace + 6 | control_division_with_replace "." statement_no_replace_list + + 7 control_division_no_replace: "SUBSTITUTION SECTION" "." + + 8 control_division_with_replace: "SUBSTITUTION SECTION" "." replace_statement + + 9 statement_list: ε + 10 | statement_list statement + + 11 statement_no_replace_list: ε + 12 | statement_no_replace_list statement_no_replace + + 13 statement: statement_no_replace + 14 | replace_statement_with_dot + + 15 statement_no_replace: copy_statement + 16 | directive "end of line" + 17 | listing_statement + 18 | CONTROL_STATEMENT control_options _dot "end of line" + + 19 directive: SOURCE_DIRECTIVE source_directive + 20 | DEFINE_DIRECTIVE define_directive + 21 | COBOL_WORDS_DIRECTIVE cobol_words_directive + 22 | SET_DIRECTIVE set_directive + 23 | REFMOD_DIRECTIVE refmod_directive + 24 | TURN_DIRECTIVE turn_directive + 25 | LISTING_DIRECTIVE listing_directive + 26 | LEAP_SECOND_DIRECTIVE leap_second_directive + + 27 $@1: ε + + 28 directive: IF_DIRECTIVE $@1 if_directive_if + + 29 $@2: ε + + 30 directive: ELIF_DIRECTIVE $@2 if_directive_elif + 31 | ELSE_DIRECTIVE + 32 | ENDIF_DIRECTIVE + + 33 $@3: ε + + 34 directive: CALL_DIRECTIVE $@3 call_directive + + 35 if_directive_if: if_directive + 36 | error + + 37 if_directive_elif: if_directive + 38 | error + + 39 set_directive: set_choice + 40 | set_directive set_choice + + 41 set_choice: CONSTANT "Variable" "Literal" + 42 | "Variable" set_options + 43 | ADDRSV alnum_list + 44 | ADDSYN alnum_equality + 45 | AREACHECK + 46 | ASSIGN unquoted_literal + 47 | BOUND + 48 | CALLFH unquoted_literal + 49 | CALLFH + 50 | CHECKNUM + 51 | COMP1 unquoted_literal + 52 | "DPC-IN-DATA" unquoted_literal + 53 | FOLDCOPYNAME _as unquoted_literal + 54 | MAKESYN alnum_equality + 55 | NOAREACHECK + 56 | NOBOUND + 57 | NOCHECKNUM + 58 | "NODPC-IN-DATA" + 59 | NOFOLDCOPYNAME + 60 | NOODOSLIDE + 61 | NOSPZERO + 62 | NOSSRANGE + 63 | ODOSLIDE + 64 | OVERRIDE alnum_equality_list + 65 | REMOVE alnum_list + 66 | SOURCEFORMAT _as unquoted_literal + 67 | SOURCEFORMAT _as error + 68 | SPZERO + 69 | SSRANGE _literal + + 70 alnum_list: "Literal" + 71 | alnum_list "Literal" + + 72 alnum_equality_list: alnum_equality + 73 | alnum_equality_list alnum_equality + + 74 alnum_equality: "Literal" "=" "Literal" + + 75 alnum_with_list: alnum_with + 76 | alnum_with_list alnum_with + + 77 alnum_with: "Literal" WITH "Literal" + + 78 alnum_by_list: alnum_by + 79 | alnum_by_list alnum_by + + 80 alnum_by: "Literal" BY "Literal" + + 81 set_options: ε + 82 | _as "Literal" + + 83 refmod_directive: _on + 84 | OFF + + 85 source_directive: _format _is "Variable" + 86 | _format _is "Literal" + + 87 _literal: ε + 88 | "Literal" + + 89 define_directive: "Variable" _as "Literal" _override + 90 | "Variable" _as PARAMETER _override + 91 | "Variable" _as OFF + 92 | CONSTANT "Variable" _as "Literal" _override + 93 | variable_or_literal + + 94 cobol_words_directive: EQUATE alnum_with_list + 95 | UNDEFINE alnum_list + 96 | SUBSTITUTE alnum_by_list + 97 | RESERVE alnum_list + + 98 listing_directive: ε + 99 | ON + 100 | OFF + + 101 listing_statement: LISTING_STATEMENT + 102 | TITLE_STATEMENT "Literal" _dot "end of line" + + 103 control_options: control_option + 104 | control_options control_option + + 105 control_option: SOURCE + 106 | NOSOURCE + 107 | LIST + 108 | NOLIST + 109 | MAP + 110 | NOMAP + + 111 _dot: ε + 112 | "." + + 113 leap_second_directive: ε + 114 | ON + 115 | OFF + + 116 turn_directive: ec_list CHECKING on_or_off + + 117 ec_list: "Variable" + 118 | ec_list "Variable" + + 119 on_or_off: on_with_loc + 120 | ON + 121 | OFF + + 122 on_with_loc: ON with_loc + 123 | with_loc + + 124 with_loc: WITH LOCATION + 125 | LOCATION + + 126 call_directive: call_choice + 127 | call_directive call_choice + + 128 call_choice: COBOL + 129 | "EXTERN" + 130 | STDCALL + 131 | STATIC + + 132 if_directive: "Variable" _is _not DEFINED + 133 | "Variable" _is _not SET + 134 | "Variable" _is _not condition_clause object_id + 135 | "Literal" _is _not condition_clause object_id + 136 | garbage + + 137 garbage: variable_or_literal + 138 | garbage variable_or_literal + 139 | garbage error + + 140 variable_or_literal: "Variable" + 141 | "Literal" + + 142 object_id: "Literal" + 143 | "Variable" + + 144 condition_clause: GREATER _than OR EQUAL _to + 145 | GREATER _than + 146 | LESS _than OR EQUAL _to + 147 | LESS _than + 148 | EQUAL _to + 149 | ">=" + 150 | ">" + 151 | "<=" + 152 | "<" + 153 | "=" + 154 | "<>" + + 155 copy_statement: COPY copy_source _copy_in _copy_suppress _copy_replacing "." + 156 | COPY error "." + + 157 copy_source: "Word or Literal" + 158 | "Text-Name" + + 159 _copy_in: ε + 160 | in_or_of copy_source + + 161 in_or_of: IN + 162 | OF + + 163 _copy_suppress: ε + 164 | SUPPRESS _printing + + 165 _copy_replacing: ε + 166 | REPLACING replacing_list + + 167 replace_statement_with_dot: replace_statement "." + 168 | replace_statement error "." + + 169 replace_statement: REPLACE _also replacing_list + 170 | REPLACE _last OFF + + 171 replacing_list: text_src BY text_dst + 172 | lead_trail text_partial_src BY text_partial_dst + 173 | replacing_list text_src BY text_dst + 174 | replacing_list lead_trail text_partial_src BY text_partial_dst + + 175 text_src: "==" token_list "==" + 176 | identifier + + 177 text_dst: "==" "==" + 178 | "==" token_list "==" + 179 | identifier + 180 | IN + 181 | OF + + 182 text_partial_src: "==" "Word or Literal" "==" + 183 | "Word or Literal" + + 184 text_partial_dst: "==" "==" + 185 | "==" "Word or Literal" "==" + 186 | "Word or Literal" + + 187 token_list: "Word or Literal" + 188 | token_list "Word or Literal" + + 189 identifier: "Word or Literal" + 190 | identifier IN "Word or Literal" + 191 | identifier OF "Word or Literal" + 192 | identifier '(' subscripts ')' + + 193 subscripts: "Word or Literal" + 194 | subscripts "Word or Literal" + + 195 lead_trail: LEADING + 196 | TRAILING + + 197 unquoted_literal: "Literal" + + 198 _override: ε + 199 | OVERRIDE + + 200 _not: ε + 201 | NOT + + 202 _also: ε + 203 | ALSO + + 204 _last: ε + 205 | LAST + + 206 _as: ε + 207 | AS + + 208 _format: ε + 209 | FORMAT + + 210 _is: ε + 211 | IS + + 212 _printing: ε + 213 | PRINTING + + 214 _on: ε + 215 | ON + + 216 _than: ε + 217 | THAN + + 218 _to: ε + 219 | TO + + +Terminaux, suivis des règles où ils apparaissent + + "end of file" (0) 0 + '(' (40) 192 + ')' (41) 192 + error (256) 36 38 67 139 156 168 + ALSO (258) 203 + BY (259) 80 171 172 173 174 + COPY (260) 155 156 + "==" (261) 175 177 178 182 184 185 + IN (262) 161 180 190 + LAST (263) 205 + LEADING (264) 195 + OF (265) 162 181 191 + OFF (266) 84 91 100 115 121 170 + PRINTING (267) 213 + REPLACE (268) 169 170 + REPLACING (269) 166 + SUPPRESS (270) 164 + TRAILING (271) 196 + "." (272) 1 6 7 8 112 155 156 167 168 + "word" (273) + LISTING_DIRECTIVE (274) 25 + LISTING_STATEMENT (275) 101 + TITLE_STATEMENT (276) 102 + COBOL_WORDS_DIRECTIVE (277) 21 + EQUATE (278) 94 + UNDEFINE (279) 95 + SUBSTITUTE (280) 96 + RESERVE (281) 97 + CONTROL_STATEMENT (282) 18 + SOURCE (283) 105 + NOSOURCE (284) 106 + LIST (285) 107 + NOLIST (286) 108 + MAP (287) 109 + NOMAP (288) 110 + LEAP_SECOND_DIRECTIVE (289) 26 + "CONTROL DIVISION" (290) 1 + "SUBSTITUTION SECTION" (291) 7 8 + SOURCE_DIRECTIVE (292) 19 + FORMAT (293) 209 + IS (294) 211 + CALL_DIRECTIVE (295) 34 + COBOL (296) 128 + "EXTERN" (297) 129 + STDCALL (298) 130 + STATIC (299) 131 + DEFINE_DIRECTIVE (300) 20 + AS (301) 207 + PARAMETER (302) 90 + OVERRIDE (303) 64 199 + REFMOD_DIRECTIVE (304) 23 + SET_DIRECTIVE (305) 22 + ADDRSV (306) 43 + ADDSYN (307) 44 + AREACHECK (308) 45 + NOAREACHECK (309) 55 + ASSIGN (310) 46 + BOUND (311) 47 + CALLFH (312) 48 49 + CHECKNUM (313) 50 + COMP1 (314) 51 + CONSTANT (315) 41 92 + "DPC-IN-DATA" (316) 52 + FOLDCOPYNAME (317) 53 + MAKESYN (318) 54 + NOBOUND (319) 56 + NOCHECKNUM (320) 57 + "NODPC-IN-DATA" (321) 58 + NOFOLDCOPYNAME (322) 59 + NOODOSLIDE (323) 60 + NOSPZERO (324) 61 + NOSSRANGE (325) 62 + ODOSLIDE (326) 63 + REMOVE (327) 65 + SOURCEFORMAT (328) 66 67 + SPZERO (329) 68 + SSRANGE (330) 69 + IF_DIRECTIVE (331) 28 + ELSE_DIRECTIVE (332) 31 + ENDIF_DIRECTIVE (333) 32 + ELIF_DIRECTIVE (334) 30 + ">=" (335) 149 + "<=" (336) 151 + "<" (337) 152 + ">" (338) 150 + "=" (339) 74 153 + "<>" (340) 154 + NOT (341) 201 + THAN (342) 217 + TO (343) 219 + OR (344) 144 146 + EQUAL (345) 144 146 148 + GREATER (346) 144 145 + LESS (347) 146 147 + SET (348) 133 + DEFINED (349) 132 + TURN_DIRECTIVE (350) 24 + ON (351) 99 114 120 122 215 + CHECKING (352) 116 + WITH (353) 77 124 + LOCATION (354) 124 125 + "end of line" (355) 16 18 102 + "Word or Literal" (356) 157 182 183 185 186 187 188 189 190 191 193 194 + "Text-Name" (357) 158 + "Variable" (358) 41 42 85 89 90 91 92 117 118 132 133 134 140 143 + "Literal" (359) 41 70 71 74 77 80 82 86 88 89 92 102 135 141 142 197 + + +Non-terminaux, suivis des règles où ils apparaissent + + $accept (107) + à gauche: 0 + program_structure (108) + à gauche: 1 2 + à droite: 0 + program_with_control_division (109) + à gauche: 3 4 5 6 + à droite: 1 + control_division_no_replace (110) + à gauche: 7 + à droite: 4 5 + control_division_with_replace (111) + à gauche: 8 + à droite: 6 + statement_list (112) + à gauche: 9 10 + à droite: 2 3 4 10 + statement_no_replace_list (113) + à gauche: 11 12 + à droite: 6 12 + statement (114) + à gauche: 13 14 + à droite: 10 + statement_no_replace (115) + à gauche: 15 16 17 18 + à droite: 4 12 13 + directive (116) + à gauche: 19 20 21 22 23 24 25 26 28 30 31 32 34 + à droite: 16 + $@1 (117) + à gauche: 27 + à droite: 28 + $@2 (118) + à gauche: 29 + à droite: 30 + $@3 (119) + à gauche: 33 + à droite: 34 + if_directive_if (120) + à gauche: 35 36 + à droite: 28 + if_directive_elif (121) + à gauche: 37 38 + à droite: 30 + set_directive (122) + à gauche: 39 40 + à droite: 22 40 + set_choice (123) + à gauche: 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 + à droite: 39 40 + alnum_list (124) + à gauche: 70 71 + à droite: 43 65 71 95 97 + alnum_equality_list (125) + à gauche: 72 73 + à droite: 64 73 + alnum_equality (126) + à gauche: 74 + à droite: 44 54 72 73 + alnum_with_list (127) + à gauche: 75 76 + à droite: 76 94 + alnum_with (128) + à gauche: 77 + à droite: 75 76 + alnum_by_list (129) + à gauche: 78 79 + à droite: 79 96 + alnum_by (130) + à gauche: 80 + à droite: 78 79 + set_options (131) + à gauche: 81 82 + à droite: 42 + refmod_directive (132) + à gauche: 83 84 + à droite: 23 + source_directive (133) + à gauche: 85 86 + à droite: 19 + _literal (134) + à gauche: 87 88 + à droite: 69 + define_directive (135) + à gauche: 89 90 91 92 93 + à droite: 20 + cobol_words_directive (136) + à gauche: 94 95 96 97 + à droite: 21 + listing_directive (137) + à gauche: 98 99 100 + à droite: 25 + listing_statement (138) + à gauche: 101 102 + à droite: 17 + control_options (139) + à gauche: 103 104 + à droite: 18 104 + control_option (140) + à gauche: 105 106 107 108 109 110 + à droite: 103 104 + _dot (141) + à gauche: 111 112 + à droite: 18 102 + leap_second_directive (142) + à gauche: 113 114 115 + à droite: 26 + turn_directive (143) + à gauche: 116 + à droite: 24 + ec_list (144) + à gauche: 117 118 + à droite: 116 118 + on_or_off (145) + à gauche: 119 120 121 + à droite: 116 + on_with_loc (146) + à gauche: 122 123 + à droite: 119 + with_loc (147) + à gauche: 124 125 + à droite: 122 123 + call_directive (148) + à gauche: 126 127 + à droite: 34 127 + call_choice (149) + à gauche: 128 129 130 131 + à droite: 126 127 + if_directive (150) + à gauche: 132 133 134 135 136 + à droite: 35 37 + garbage (151) + à gauche: 137 138 139 + à droite: 136 138 139 + variable_or_literal (152) + à gauche: 140 141 + à droite: 93 137 138 + object_id (153) + à gauche: 142 143 + à droite: 134 135 + condition_clause (154) + à gauche: 144 145 146 147 148 149 150 151 152 153 154 + à droite: 134 135 + copy_statement (155) + à gauche: 155 156 + à droite: 15 + copy_source (156) + à gauche: 157 158 + à droite: 155 160 + _copy_in (157) + à gauche: 159 160 + à droite: 155 + in_or_of (158) + à gauche: 161 162 + à droite: 160 + _copy_suppress (159) + à gauche: 163 164 + à droite: 155 + _copy_replacing (160) + à gauche: 165 166 + à droite: 155 + replace_statement_with_dot (161) + à gauche: 167 168 + à droite: 14 + replace_statement (162) + à gauche: 169 170 + à droite: 8 167 168 + replacing_list (163) + à gauche: 171 172 173 174 + à droite: 166 169 173 174 + text_src

(164) + à gauche: 175 176 + à droite: 171 173 + text_dst (165) + à gauche: 177 178 179 180 181 + à droite: 171 173 + text_partial_src

(166) + à gauche: 182 183 + à droite: 172 174 + text_partial_dst (167) + à gauche: 184 185 186 + à droite: 172 174 + token_list (168) + à gauche: 187 188 + à droite: 175 178 188 + identifier (169) + à gauche: 189 190 191 192 + à droite: 176 179 190 191 192 + subscripts (170) + à gauche: 193 194 + à droite: 192 194 + lead_trail (171) + à gauche: 195 196 + à droite: 172 174 + unquoted_literal (172) + à gauche: 197 + à droite: 46 48 51 52 53 66 + _override (173) + à gauche: 198 199 + à droite: 89 90 92 + _not (174) + à gauche: 200 201 + à droite: 132 133 134 135 + _also (175) + à gauche: 202 203 + à droite: 169 + _last (176) + à gauche: 204 205 + à droite: 170 + _as (177) + à gauche: 206 207 + à droite: 53 66 67 82 89 90 91 92 + _format (178) + à gauche: 208 209 + à droite: 85 86 + _is (179) + à gauche: 210 211 + à droite: 85 86 132 133 134 135 + _printing (180) + à gauche: 212 213 + à droite: 164 + _on (181) + à gauche: 214 215 + à droite: 83 + _than (182) + à gauche: 216 217 + à droite: 144 145 146 147 + _to (183) + à gauche: 218 219 + à droite: 144 146 148 + + +État 0 + + 0 $accept: • program_structure "end of file" + + "CONTROL DIVISION" décalage et aller à l'état 1 + + $défaut réduction par utilisation de la règle 9 (statement_list) + + program_structure aller à l'état 2 + statement_list aller à l'état 3 + + +État 1 + + 1 program_structure: "CONTROL DIVISION" • "." program_with_control_division + + "." décalage et aller à l'état 4 + + +État 2 + + 0 $accept: program_structure • "end of file" + + "end of file" décalage et aller à l'état 5 + + +État 3 + + 2 program_structure: statement_list • + 10 statement_list: statement_list • statement + + COPY décalage et aller à l'état 6 + REPLACE décalage et aller à l'état 7 + LISTING_DIRECTIVE décalage et aller à l'état 8 + LISTING_STATEMENT décalage et aller à l'état 9 + TITLE_STATEMENT décalage et aller à l'état 10 + COBOL_WORDS_DIRECTIVE décalage et aller à l'état 11 + CONTROL_STATEMENT décalage et aller à l'état 12 + LEAP_SECOND_DIRECTIVE décalage et aller à l'état 13 + SOURCE_DIRECTIVE décalage et aller à l'état 14 + CALL_DIRECTIVE décalage et aller à l'état 15 + DEFINE_DIRECTIVE décalage et aller à l'état 16 + REFMOD_DIRECTIVE décalage et aller à l'état 17 + SET_DIRECTIVE décalage et aller à l'état 18 + IF_DIRECTIVE décalage et aller à l'état 19 + ELSE_DIRECTIVE décalage et aller à l'état 20 + ENDIF_DIRECTIVE décalage et aller à l'état 21 + ELIF_DIRECTIVE décalage et aller à l'état 22 + TURN_DIRECTIVE décalage et aller à l'état 23 + + $défaut réduction par utilisation de la règle 2 (program_structure) + + statement aller à l'état 24 + statement_no_replace aller à l'état 25 + directive aller à l'état 26 + listing_statement aller à l'état 27 + copy_statement aller à l'état 28 + replace_statement_with_dot aller à l'état 29 + replace_statement aller à l'état 30 + + +État 4 + + 1 program_structure: "CONTROL DIVISION" "." • program_with_control_division + + "SUBSTITUTION SECTION" décalage et aller à l'état 31 + + $défaut réduction par utilisation de la règle 9 (statement_list) + + program_with_control_division aller à l'état 32 + control_division_no_replace aller à l'état 33 + control_division_with_replace aller à l'état 34 + statement_list aller à l'état 35 + + +État 5 + + 0 $accept: program_structure "end of file" • + + $défaut accepter + + +État 6 + + 155 copy_statement: COPY • copy_source _copy_in _copy_suppress _copy_replacing "." + 156 | COPY • error "." + + error décalage et aller à l'état 36 + "Word or Literal" décalage et aller à l'état 37 + "Text-Name" décalage et aller à l'état 38 + + copy_source aller à l'état 39 + + +État 7 + + 169 replace_statement: REPLACE • _also replacing_list + 170 | REPLACE • _last OFF + + ALSO décalage et aller à l'état 40 + LAST décalage et aller à l'état 41 + + OFF réduction par utilisation de la règle 204 (_last) + $défaut réduction par utilisation de la règle 202 (_also) + + _also aller à l'état 42 + _last aller à l'état 43 + + +État 8 + + 25 directive: LISTING_DIRECTIVE • listing_directive + + OFF décalage et aller à l'état 44 + ON décalage et aller à l'état 45 + + $défaut réduction par utilisation de la règle 98 (listing_directive) + + listing_directive aller à l'état 46 + + +État 9 + + 101 listing_statement: LISTING_STATEMENT • + + $défaut réduction par utilisation de la règle 101 (listing_statement) + + +État 10 + + 102 listing_statement: TITLE_STATEMENT • "Literal" _dot "end of line" + + "Literal" décalage et aller à l'état 47 + + +État 11 + + 21 directive: COBOL_WORDS_DIRECTIVE • cobol_words_directive + + EQUATE décalage et aller à l'état 48 + UNDEFINE décalage et aller à l'état 49 + SUBSTITUTE décalage et aller à l'état 50 + RESERVE décalage et aller à l'état 51 + + cobol_words_directive aller à l'état 52 + + +État 12 + + 18 statement_no_replace: CONTROL_STATEMENT • control_options _dot "end of line" + + SOURCE décalage et aller à l'état 53 + NOSOURCE décalage et aller à l'état 54 + LIST décalage et aller à l'état 55 + NOLIST décalage et aller à l'état 56 + MAP décalage et aller à l'état 57 + NOMAP décalage et aller à l'état 58 + + control_options aller à l'état 59 + control_option aller à l'état 60 + + +État 13 + + 26 directive: LEAP_SECOND_DIRECTIVE • leap_second_directive + + OFF décalage et aller à l'état 61 + ON décalage et aller à l'état 62 + + $défaut réduction par utilisation de la règle 113 (leap_second_directive) + + leap_second_directive aller à l'état 63 + + +État 14 + + 19 directive: SOURCE_DIRECTIVE • source_directive + + FORMAT décalage et aller à l'état 64 + + $défaut réduction par utilisation de la règle 208 (_format) + + source_directive aller à l'état 65 + _format aller à l'état 66 + + +État 15 + + 34 directive: CALL_DIRECTIVE • $@3 call_directive + + $défaut réduction par utilisation de la règle 33 ($@3) + + $@3 aller à l'état 67 + + +État 16 + + 20 directive: DEFINE_DIRECTIVE • define_directive + + CONSTANT décalage et aller à l'état 68 + "Variable" décalage et aller à l'état 69 + "Literal" décalage et aller à l'état 70 + + define_directive aller à l'état 71 + variable_or_literal aller à l'état 72 + + +État 17 + + 23 directive: REFMOD_DIRECTIVE • refmod_directive + + OFF décalage et aller à l'état 73 + ON décalage et aller à l'état 74 + + $défaut réduction par utilisation de la règle 214 (_on) + + refmod_directive aller à l'état 75 + _on aller à l'état 76 + + +État 18 + + 22 directive: SET_DIRECTIVE • set_directive + + OVERRIDE décalage et aller à l'état 77 + ADDRSV décalage et aller à l'état 78 + ADDSYN décalage et aller à l'état 79 + AREACHECK décalage et aller à l'état 80 + NOAREACHECK décalage et aller à l'état 81 + ASSIGN décalage et aller à l'état 82 + BOUND décalage et aller à l'état 83 + CALLFH décalage et aller à l'état 84 + CHECKNUM décalage et aller à l'état 85 + COMP1 décalage et aller à l'état 86 + CONSTANT décalage et aller à l'état 87 + "DPC-IN-DATA" décalage et aller à l'état 88 + FOLDCOPYNAME décalage et aller à l'état 89 + MAKESYN décalage et aller à l'état 90 + NOBOUND décalage et aller à l'état 91 + NOCHECKNUM décalage et aller à l'état 92 + "NODPC-IN-DATA" décalage et aller à l'état 93 + NOFOLDCOPYNAME décalage et aller à l'état 94 + NOODOSLIDE décalage et aller à l'état 95 + NOSPZERO décalage et aller à l'état 96 + NOSSRANGE décalage et aller à l'état 97 + ODOSLIDE décalage et aller à l'état 98 + REMOVE décalage et aller à l'état 99 + SOURCEFORMAT décalage et aller à l'état 100 + SPZERO décalage et aller à l'état 101 + SSRANGE décalage et aller à l'état 102 + "Variable" décalage et aller à l'état 103 + + set_directive aller à l'état 104 + set_choice aller à l'état 105 + + +État 19 + + 28 directive: IF_DIRECTIVE • $@1 if_directive_if + + $défaut réduction par utilisation de la règle 27 ($@1) + + $@1 aller à l'état 106 + + +État 20 + + 31 directive: ELSE_DIRECTIVE • + + $défaut réduction par utilisation de la règle 31 (directive) + + +État 21 + + 32 directive: ENDIF_DIRECTIVE • + + $défaut réduction par utilisation de la règle 32 (directive) + + +État 22 + + 30 directive: ELIF_DIRECTIVE • $@2 if_directive_elif + + $défaut réduction par utilisation de la règle 29 ($@2) + + $@2 aller à l'état 107 + + +État 23 + + 24 directive: TURN_DIRECTIVE • turn_directive + + "Variable" décalage et aller à l'état 108 + + turn_directive aller à l'état 109 + ec_list aller à l'état 110 + + +État 24 + + 10 statement_list: statement_list statement • + + $défaut réduction par utilisation de la règle 10 (statement_list) + + +État 25 + + 13 statement: statement_no_replace • + + $défaut réduction par utilisation de la règle 13 (statement) + + +État 26 + + 16 statement_no_replace: directive • "end of line" + + "end of line" décalage et aller à l'état 111 + + +État 27 + + 17 statement_no_replace: listing_statement • + + $défaut réduction par utilisation de la règle 17 (statement_no_replace) + + +État 28 + + 15 statement_no_replace: copy_statement • + + $défaut réduction par utilisation de la règle 15 (statement_no_replace) + + +État 29 + + 14 statement: replace_statement_with_dot • + + $défaut réduction par utilisation de la règle 14 (statement) + + +État 30 + + 167 replace_statement_with_dot: replace_statement • "." + 168 | replace_statement • error "." + + error décalage et aller à l'état 112 + "." décalage et aller à l'état 113 + + +État 31 + + 7 control_division_no_replace: "SUBSTITUTION SECTION" • "." + 8 control_division_with_replace: "SUBSTITUTION SECTION" • "." replace_statement + + "." décalage et aller à l'état 114 + + +État 32 + + 1 program_structure: "CONTROL DIVISION" "." program_with_control_division • + + $défaut réduction par utilisation de la règle 1 (program_structure) + + +État 33 + + 4 program_with_control_division: control_division_no_replace • statement_no_replace statement_list + 5 | control_division_no_replace • + + COPY décalage et aller à l'état 6 + LISTING_DIRECTIVE décalage et aller à l'état 8 + LISTING_STATEMENT décalage et aller à l'état 9 + TITLE_STATEMENT décalage et aller à l'état 10 + COBOL_WORDS_DIRECTIVE décalage et aller à l'état 11 + CONTROL_STATEMENT décalage et aller à l'état 12 + LEAP_SECOND_DIRECTIVE décalage et aller à l'état 13 + SOURCE_DIRECTIVE décalage et aller à l'état 14 + CALL_DIRECTIVE décalage et aller à l'état 15 + DEFINE_DIRECTIVE décalage et aller à l'état 16 + REFMOD_DIRECTIVE décalage et aller à l'état 17 + SET_DIRECTIVE décalage et aller à l'état 18 + IF_DIRECTIVE décalage et aller à l'état 19 + ELSE_DIRECTIVE décalage et aller à l'état 20 + ENDIF_DIRECTIVE décalage et aller à l'état 21 + ELIF_DIRECTIVE décalage et aller à l'état 22 + TURN_DIRECTIVE décalage et aller à l'état 23 + + $défaut réduction par utilisation de la règle 5 (program_with_control_division) + + statement_no_replace aller à l'état 115 + directive aller à l'état 26 + listing_statement aller à l'état 27 + copy_statement aller à l'état 28 + + +État 34 + + 6 program_with_control_division: control_division_with_replace • "." statement_no_replace_list + + "." décalage et aller à l'état 116 + + +État 35 + + 3 program_with_control_division: statement_list • + 10 statement_list: statement_list • statement + + COPY décalage et aller à l'état 6 + REPLACE décalage et aller à l'état 7 + LISTING_DIRECTIVE décalage et aller à l'état 8 + LISTING_STATEMENT décalage et aller à l'état 9 + TITLE_STATEMENT décalage et aller à l'état 10 + COBOL_WORDS_DIRECTIVE décalage et aller à l'état 11 + CONTROL_STATEMENT décalage et aller à l'état 12 + LEAP_SECOND_DIRECTIVE décalage et aller à l'état 13 + SOURCE_DIRECTIVE décalage et aller à l'état 14 + CALL_DIRECTIVE décalage et aller à l'état 15 + DEFINE_DIRECTIVE décalage et aller à l'état 16 + REFMOD_DIRECTIVE décalage et aller à l'état 17 + SET_DIRECTIVE décalage et aller à l'état 18 + IF_DIRECTIVE décalage et aller à l'état 19 + ELSE_DIRECTIVE décalage et aller à l'état 20 + ENDIF_DIRECTIVE décalage et aller à l'état 21 + ELIF_DIRECTIVE décalage et aller à l'état 22 + TURN_DIRECTIVE décalage et aller à l'état 23 + + $défaut réduction par utilisation de la règle 3 (program_with_control_division) + + statement aller à l'état 24 + statement_no_replace aller à l'état 25 + directive aller à l'état 26 + listing_statement aller à l'état 27 + copy_statement aller à l'état 28 + replace_statement_with_dot aller à l'état 29 + replace_statement aller à l'état 30 + + +État 36 + + 156 copy_statement: COPY error • "." + + "." décalage et aller à l'état 117 + + +État 37 + + 157 copy_source: "Word or Literal" • + + $défaut réduction par utilisation de la règle 157 (copy_source) + + +État 38 + + 158 copy_source: "Text-Name" • + + $défaut réduction par utilisation de la règle 158 (copy_source) + + +État 39 + + 155 copy_statement: COPY copy_source • _copy_in _copy_suppress _copy_replacing "." + + IN décalage et aller à l'état 118 + OF décalage et aller à l'état 119 + + $défaut réduction par utilisation de la règle 159 (_copy_in) + + _copy_in aller à l'état 120 + in_or_of aller à l'état 121 + + +État 40 + + 203 _also: ALSO • + + $défaut réduction par utilisation de la règle 203 (_also) + + +État 41 + + 205 _last: LAST • + + $défaut réduction par utilisation de la règle 205 (_last) + + +État 42 + + 169 replace_statement: REPLACE _also • replacing_list + + "==" décalage et aller à l'état 122 + LEADING décalage et aller à l'état 123 + TRAILING décalage et aller à l'état 124 + "Word or Literal" décalage et aller à l'état 125 + + replacing_list aller à l'état 126 + text_src aller à l'état 127 + identifier aller à l'état 128 + lead_trail aller à l'état 129 + + +État 43 + + 170 replace_statement: REPLACE _last • OFF + + OFF décalage et aller à l'état 130 + + +État 44 + + 100 listing_directive: OFF • + + $défaut réduction par utilisation de la règle 100 (listing_directive) + + +État 45 + + 99 listing_directive: ON • + + $défaut réduction par utilisation de la règle 99 (listing_directive) + + +État 46 + + 25 directive: LISTING_DIRECTIVE listing_directive • + + $défaut réduction par utilisation de la règle 25 (directive) + + +État 47 + + 102 listing_statement: TITLE_STATEMENT "Literal" • _dot "end of line" + + "." décalage et aller à l'état 131 + + $défaut réduction par utilisation de la règle 111 (_dot) + + _dot aller à l'état 132 + + +État 48 + + 94 cobol_words_directive: EQUATE • alnum_with_list + + "Literal" décalage et aller à l'état 133 + + alnum_with_list aller à l'état 134 + alnum_with aller à l'état 135 + + +État 49 + + 95 cobol_words_directive: UNDEFINE • alnum_list + + "Literal" décalage et aller à l'état 136 + + alnum_list aller à l'état 137 + + +État 50 + + 96 cobol_words_directive: SUBSTITUTE • alnum_by_list + + "Literal" décalage et aller à l'état 138 + + alnum_by_list aller à l'état 139 + alnum_by aller à l'état 140 + + +État 51 + + 97 cobol_words_directive: RESERVE • alnum_list + + "Literal" décalage et aller à l'état 136 + + alnum_list aller à l'état 141 + + +État 52 + + 21 directive: COBOL_WORDS_DIRECTIVE cobol_words_directive • + + $défaut réduction par utilisation de la règle 21 (directive) + + +État 53 + + 105 control_option: SOURCE • + + $défaut réduction par utilisation de la règle 105 (control_option) + + +État 54 + + 106 control_option: NOSOURCE • + + $défaut réduction par utilisation de la règle 106 (control_option) + + +État 55 + + 107 control_option: LIST • + + $défaut réduction par utilisation de la règle 107 (control_option) + + +État 56 + + 108 control_option: NOLIST • + + $défaut réduction par utilisation de la règle 108 (control_option) + + +État 57 + + 109 control_option: MAP • + + $défaut réduction par utilisation de la règle 109 (control_option) + + +État 58 + + 110 control_option: NOMAP • + + $défaut réduction par utilisation de la règle 110 (control_option) + + +État 59 + + 18 statement_no_replace: CONTROL_STATEMENT control_options • _dot "end of line" + 104 control_options: control_options • control_option + + "." décalage et aller à l'état 131 + SOURCE décalage et aller à l'état 53 + NOSOURCE décalage et aller à l'état 54 + LIST décalage et aller à l'état 55 + NOLIST décalage et aller à l'état 56 + MAP décalage et aller à l'état 57 + NOMAP décalage et aller à l'état 58 + + $défaut réduction par utilisation de la règle 111 (_dot) + + control_option aller à l'état 142 + _dot aller à l'état 143 + + +État 60 + + 103 control_options: control_option • + + $défaut réduction par utilisation de la règle 103 (control_options) + + +État 61 + + 115 leap_second_directive: OFF • + + $défaut réduction par utilisation de la règle 115 (leap_second_directive) + + +État 62 + + 114 leap_second_directive: ON • + + $défaut réduction par utilisation de la règle 114 (leap_second_directive) + + +État 63 + + 26 directive: LEAP_SECOND_DIRECTIVE leap_second_directive • + + $défaut réduction par utilisation de la règle 26 (directive) + + +État 64 + + 209 _format: FORMAT • + + $défaut réduction par utilisation de la règle 209 (_format) + + +État 65 + + 19 directive: SOURCE_DIRECTIVE source_directive • + + $défaut réduction par utilisation de la règle 19 (directive) + + +État 66 + + 85 source_directive: _format • _is "Variable" + 86 | _format • _is "Literal" + + IS décalage et aller à l'état 144 + + $défaut réduction par utilisation de la règle 210 (_is) + + _is aller à l'état 145 + + +État 67 + + 34 directive: CALL_DIRECTIVE $@3 • call_directive + + COBOL décalage et aller à l'état 146 + "EXTERN" décalage et aller à l'état 147 + STDCALL décalage et aller à l'état 148 + STATIC décalage et aller à l'état 149 + + call_directive aller à l'état 150 + call_choice aller à l'état 151 + + +État 68 + + 92 define_directive: CONSTANT • "Variable" _as "Literal" _override + + "Variable" décalage et aller à l'état 152 + + +État 69 + + 89 define_directive: "Variable" • _as "Literal" _override + 90 | "Variable" • _as PARAMETER _override + 91 | "Variable" • _as OFF + 140 variable_or_literal: "Variable" • + + AS décalage et aller à l'état 153 + + "end of line" réduction par utilisation de la règle 140 (variable_or_literal) + $défaut réduction par utilisation de la règle 206 (_as) + + _as aller à l'état 154 + + +État 70 + + 141 variable_or_literal: "Literal" • + + $défaut réduction par utilisation de la règle 141 (variable_or_literal) + + +État 71 + + 20 directive: DEFINE_DIRECTIVE define_directive • + + $défaut réduction par utilisation de la règle 20 (directive) + + +État 72 + + 93 define_directive: variable_or_literal • + + $défaut réduction par utilisation de la règle 93 (define_directive) + + +État 73 + + 84 refmod_directive: OFF • + + $défaut réduction par utilisation de la règle 84 (refmod_directive) + + +État 74 + + 215 _on: ON • + + $défaut réduction par utilisation de la règle 215 (_on) + + +État 75 + + 23 directive: REFMOD_DIRECTIVE refmod_directive • + + $défaut réduction par utilisation de la règle 23 (directive) + + +État 76 + + 83 refmod_directive: _on • + + $défaut réduction par utilisation de la règle 83 (refmod_directive) + + +État 77 + + 64 set_choice: OVERRIDE • alnum_equality_list + + "Literal" décalage et aller à l'état 155 + + alnum_equality_list aller à l'état 156 + alnum_equality aller à l'état 157 + + +État 78 + + 43 set_choice: ADDRSV • alnum_list + + "Literal" décalage et aller à l'état 136 + + alnum_list aller à l'état 158 + + +État 79 + + 44 set_choice: ADDSYN • alnum_equality + + "Literal" décalage et aller à l'état 155 + + alnum_equality aller à l'état 159 + + +État 80 + + 45 set_choice: AREACHECK • + + $défaut réduction par utilisation de la règle 45 (set_choice) + + +État 81 + + 55 set_choice: NOAREACHECK • + + $défaut réduction par utilisation de la règle 55 (set_choice) + + +État 82 + + 46 set_choice: ASSIGN • unquoted_literal + + "Literal" décalage et aller à l'état 160 + + unquoted_literal aller à l'état 161 + + +État 83 + + 47 set_choice: BOUND • + + $défaut réduction par utilisation de la règle 47 (set_choice) + + +État 84 + + 48 set_choice: CALLFH • unquoted_literal + 49 | CALLFH • + + "Literal" décalage et aller à l'état 160 + + $défaut réduction par utilisation de la règle 49 (set_choice) + + unquoted_literal aller à l'état 162 + + +État 85 + + 50 set_choice: CHECKNUM • + + $défaut réduction par utilisation de la règle 50 (set_choice) + + +État 86 + + 51 set_choice: COMP1 • unquoted_literal + + "Literal" décalage et aller à l'état 160 + + unquoted_literal aller à l'état 163 + + +État 87 + + 41 set_choice: CONSTANT • "Variable" "Literal" + + "Variable" décalage et aller à l'état 164 + + +État 88 + + 52 set_choice: "DPC-IN-DATA" • unquoted_literal + + "Literal" décalage et aller à l'état 160 + + unquoted_literal aller à l'état 165 + + +État 89 + + 53 set_choice: FOLDCOPYNAME • _as unquoted_literal + + AS décalage et aller à l'état 153 + + $défaut réduction par utilisation de la règle 206 (_as) + + _as aller à l'état 166 + + +État 90 + + 54 set_choice: MAKESYN • alnum_equality + + "Literal" décalage et aller à l'état 155 + + alnum_equality aller à l'état 167 + + +État 91 + + 56 set_choice: NOBOUND • + + $défaut réduction par utilisation de la règle 56 (set_choice) + + +État 92 + + 57 set_choice: NOCHECKNUM • + + $défaut réduction par utilisation de la règle 57 (set_choice) + + +État 93 + + 58 set_choice: "NODPC-IN-DATA" • + + $défaut réduction par utilisation de la règle 58 (set_choice) + + +État 94 + + 59 set_choice: NOFOLDCOPYNAME • + + $défaut réduction par utilisation de la règle 59 (set_choice) + + +État 95 + + 60 set_choice: NOODOSLIDE • + + $défaut réduction par utilisation de la règle 60 (set_choice) + + +État 96 + + 61 set_choice: NOSPZERO • + + $défaut réduction par utilisation de la règle 61 (set_choice) + + +État 97 + + 62 set_choice: NOSSRANGE • + + $défaut réduction par utilisation de la règle 62 (set_choice) + + +État 98 + + 63 set_choice: ODOSLIDE • + + $défaut réduction par utilisation de la règle 63 (set_choice) + + +État 99 + + 65 set_choice: REMOVE • alnum_list + + "Literal" décalage et aller à l'état 136 + + alnum_list aller à l'état 168 + + +État 100 + + 66 set_choice: SOURCEFORMAT • _as unquoted_literal + 67 | SOURCEFORMAT • _as error + + AS décalage et aller à l'état 153 + + $défaut réduction par utilisation de la règle 206 (_as) + + _as aller à l'état 169 + + +État 101 + + 68 set_choice: SPZERO • + + $défaut réduction par utilisation de la règle 68 (set_choice) + + +État 102 + + 69 set_choice: SSRANGE • _literal + + "Literal" décalage et aller à l'état 170 + + $défaut réduction par utilisation de la règle 87 (_literal) + + _literal aller à l'état 171 + + +État 103 + + 42 set_choice: "Variable" • set_options + + AS décalage et aller à l'état 153 + + "Literal" réduction par utilisation de la règle 206 (_as) + $défaut réduction par utilisation de la règle 81 (set_options) + + set_options aller à l'état 172 + _as aller à l'état 173 + + +État 104 + + 22 directive: SET_DIRECTIVE set_directive • + 40 set_directive: set_directive • set_choice + + OVERRIDE décalage et aller à l'état 77 + ADDRSV décalage et aller à l'état 78 + ADDSYN décalage et aller à l'état 79 + AREACHECK décalage et aller à l'état 80 + NOAREACHECK décalage et aller à l'état 81 + ASSIGN décalage et aller à l'état 82 + BOUND décalage et aller à l'état 83 + CALLFH décalage et aller à l'état 84 + CHECKNUM décalage et aller à l'état 85 + COMP1 décalage et aller à l'état 86 + CONSTANT décalage et aller à l'état 87 + "DPC-IN-DATA" décalage et aller à l'état 88 + FOLDCOPYNAME décalage et aller à l'état 89 + MAKESYN décalage et aller à l'état 90 + NOBOUND décalage et aller à l'état 91 + NOCHECKNUM décalage et aller à l'état 92 + "NODPC-IN-DATA" décalage et aller à l'état 93 + NOFOLDCOPYNAME décalage et aller à l'état 94 + NOODOSLIDE décalage et aller à l'état 95 + NOSPZERO décalage et aller à l'état 96 + NOSSRANGE décalage et aller à l'état 97 + ODOSLIDE décalage et aller à l'état 98 + REMOVE décalage et aller à l'état 99 + SOURCEFORMAT décalage et aller à l'état 100 + SPZERO décalage et aller à l'état 101 + SSRANGE décalage et aller à l'état 102 + "Variable" décalage et aller à l'état 103 + + $défaut réduction par utilisation de la règle 22 (directive) + + set_choice aller à l'état 174 + + +État 105 + + 39 set_directive: set_choice • + + $défaut réduction par utilisation de la règle 39 (set_directive) + + +État 106 + + 28 directive: IF_DIRECTIVE $@1 • if_directive_if + + error décalage et aller à l'état 175 + "Variable" décalage et aller à l'état 176 + "Literal" décalage et aller à l'état 177 + + if_directive_if aller à l'état 178 + if_directive aller à l'état 179 + garbage aller à l'état 180 + variable_or_literal aller à l'état 181 + + +État 107 + + 30 directive: ELIF_DIRECTIVE $@2 • if_directive_elif + + error décalage et aller à l'état 182 + "Variable" décalage et aller à l'état 176 + "Literal" décalage et aller à l'état 177 + + if_directive_elif aller à l'état 183 + if_directive aller à l'état 184 + garbage aller à l'état 180 + variable_or_literal aller à l'état 181 + + +État 108 + + 117 ec_list: "Variable" • + + $défaut réduction par utilisation de la règle 117 (ec_list) + + +État 109 + + 24 directive: TURN_DIRECTIVE turn_directive • + + $défaut réduction par utilisation de la règle 24 (directive) + + +État 110 + + 116 turn_directive: ec_list • CHECKING on_or_off + 118 ec_list: ec_list • "Variable" + + CHECKING décalage et aller à l'état 185 + "Variable" décalage et aller à l'état 186 + + +État 111 + + 16 statement_no_replace: directive "end of line" • + + $défaut réduction par utilisation de la règle 16 (statement_no_replace) + + +État 112 + + 168 replace_statement_with_dot: replace_statement error • "." + + "." décalage et aller à l'état 187 + + +État 113 + + 167 replace_statement_with_dot: replace_statement "." • + + $défaut réduction par utilisation de la règle 167 (replace_statement_with_dot) + + +État 114 + + 7 control_division_no_replace: "SUBSTITUTION SECTION" "." • + 8 control_division_with_replace: "SUBSTITUTION SECTION" "." • replace_statement + + REPLACE décalage et aller à l'état 7 + + $défaut réduction par utilisation de la règle 7 (control_division_no_replace) + + replace_statement aller à l'état 188 + + +État 115 + + 4 program_with_control_division: control_division_no_replace statement_no_replace • statement_list + + $défaut réduction par utilisation de la règle 9 (statement_list) + + statement_list aller à l'état 189 + + +État 116 + + 6 program_with_control_division: control_division_with_replace "." • statement_no_replace_list + + $défaut réduction par utilisation de la règle 11 (statement_no_replace_list) + + statement_no_replace_list aller à l'état 190 + + +État 117 + + 156 copy_statement: COPY error "." • + + $défaut réduction par utilisation de la règle 156 (copy_statement) + + +État 118 + + 161 in_or_of: IN • + + $défaut réduction par utilisation de la règle 161 (in_or_of) + + +État 119 + + 162 in_or_of: OF • + + $défaut réduction par utilisation de la règle 162 (in_or_of) + + +État 120 + + 155 copy_statement: COPY copy_source _copy_in • _copy_suppress _copy_replacing "." + + SUPPRESS décalage et aller à l'état 191 + + $défaut réduction par utilisation de la règle 163 (_copy_suppress) + + _copy_suppress aller à l'état 192 + + +État 121 + + 160 _copy_in: in_or_of • copy_source + + "Word or Literal" décalage et aller à l'état 37 + "Text-Name" décalage et aller à l'état 38 + + copy_source aller à l'état 193 + + +État 122 + + 175 text_src: "==" • token_list "==" + + "Word or Literal" décalage et aller à l'état 194 + + token_list aller à l'état 195 + + +État 123 + + 195 lead_trail: LEADING • + + $défaut réduction par utilisation de la règle 195 (lead_trail) + + +État 124 + + 196 lead_trail: TRAILING • + + $défaut réduction par utilisation de la règle 196 (lead_trail) + + +État 125 + + 189 identifier: "Word or Literal" • + + $défaut réduction par utilisation de la règle 189 (identifier) + + +État 126 + + 169 replace_statement: REPLACE _also replacing_list • + 173 replacing_list: replacing_list • text_src BY text_dst + 174 | replacing_list • lead_trail text_partial_src BY text_partial_dst + + "==" décalage et aller à l'état 122 + LEADING décalage et aller à l'état 123 + TRAILING décalage et aller à l'état 124 + "Word or Literal" décalage et aller à l'état 125 + + $défaut réduction par utilisation de la règle 169 (replace_statement) + + text_src aller à l'état 196 + identifier aller à l'état 128 + lead_trail aller à l'état 197 + + +État 127 + + 171 replacing_list: text_src • BY text_dst + + BY décalage et aller à l'état 198 + + +État 128 + + 176 text_src: identifier • + 190 identifier: identifier • IN "Word or Literal" + 191 | identifier • OF "Word or Literal" + 192 | identifier • '(' subscripts ')' + + IN décalage et aller à l'état 199 + OF décalage et aller à l'état 200 + '(' décalage et aller à l'état 201 + + $défaut réduction par utilisation de la règle 176 (text_src) + + +État 129 + + 172 replacing_list: lead_trail • text_partial_src BY text_partial_dst + + "==" décalage et aller à l'état 202 + "Word or Literal" décalage et aller à l'état 203 + + text_partial_src aller à l'état 204 + + +État 130 + + 170 replace_statement: REPLACE _last OFF • + + $défaut réduction par utilisation de la règle 170 (replace_statement) + + +État 131 + + 112 _dot: "." • + + $défaut réduction par utilisation de la règle 112 (_dot) + + +État 132 + + 102 listing_statement: TITLE_STATEMENT "Literal" _dot • "end of line" + + "end of line" décalage et aller à l'état 205 + + +État 133 + + 77 alnum_with: "Literal" • WITH "Literal" + + WITH décalage et aller à l'état 206 + + +État 134 + + 76 alnum_with_list: alnum_with_list • alnum_with + 94 cobol_words_directive: EQUATE alnum_with_list • + + "Literal" décalage et aller à l'état 133 + + $défaut réduction par utilisation de la règle 94 (cobol_words_directive) + + alnum_with aller à l'état 207 + + +État 135 + + 75 alnum_with_list: alnum_with • + + $défaut réduction par utilisation de la règle 75 (alnum_with_list) + + +État 136 + + 70 alnum_list: "Literal" • + + $défaut réduction par utilisation de la règle 70 (alnum_list) + + +État 137 + + 71 alnum_list: alnum_list • "Literal" + 95 cobol_words_directive: UNDEFINE alnum_list • + + "Literal" décalage et aller à l'état 208 + + $défaut réduction par utilisation de la règle 95 (cobol_words_directive) + + +État 138 + + 80 alnum_by: "Literal" • BY "Literal" + + BY décalage et aller à l'état 209 + + +État 139 + + 79 alnum_by_list: alnum_by_list • alnum_by + 96 cobol_words_directive: SUBSTITUTE alnum_by_list • + + "Literal" décalage et aller à l'état 138 + + $défaut réduction par utilisation de la règle 96 (cobol_words_directive) + + alnum_by aller à l'état 210 + + +État 140 + + 78 alnum_by_list: alnum_by • + + $défaut réduction par utilisation de la règle 78 (alnum_by_list) + + +État 141 + + 71 alnum_list: alnum_list • "Literal" + 97 cobol_words_directive: RESERVE alnum_list • + + "Literal" décalage et aller à l'état 208 + + $défaut réduction par utilisation de la règle 97 (cobol_words_directive) + + +État 142 + + 104 control_options: control_options control_option • + + $défaut réduction par utilisation de la règle 104 (control_options) + + +État 143 + + 18 statement_no_replace: CONTROL_STATEMENT control_options _dot • "end of line" + + "end of line" décalage et aller à l'état 211 + + +État 144 + + 211 _is: IS • + + $défaut réduction par utilisation de la règle 211 (_is) + + +État 145 + + 85 source_directive: _format _is • "Variable" + 86 | _format _is • "Literal" + + "Variable" décalage et aller à l'état 212 + "Literal" décalage et aller à l'état 213 + + +État 146 + + 128 call_choice: COBOL • + + $défaut réduction par utilisation de la règle 128 (call_choice) + + +État 147 + + 129 call_choice: "EXTERN" • + + $défaut réduction par utilisation de la règle 129 (call_choice) + + +État 148 + + 130 call_choice: STDCALL • + + $défaut réduction par utilisation de la règle 130 (call_choice) + + +État 149 + + 131 call_choice: STATIC • + + $défaut réduction par utilisation de la règle 131 (call_choice) + + +État 150 + + 34 directive: CALL_DIRECTIVE $@3 call_directive • + 127 call_directive: call_directive • call_choice + + COBOL décalage et aller à l'état 146 + "EXTERN" décalage et aller à l'état 147 + STDCALL décalage et aller à l'état 148 + STATIC décalage et aller à l'état 149 + + $défaut réduction par utilisation de la règle 34 (directive) + + call_choice aller à l'état 214 + + +État 151 + + 126 call_directive: call_choice • + + $défaut réduction par utilisation de la règle 126 (call_directive) + + +État 152 + + 92 define_directive: CONSTANT "Variable" • _as "Literal" _override + + AS décalage et aller à l'état 153 + + $défaut réduction par utilisation de la règle 206 (_as) + + _as aller à l'état 215 + + +État 153 + + 207 _as: AS • + + $défaut réduction par utilisation de la règle 207 (_as) + + +État 154 + + 89 define_directive: "Variable" _as • "Literal" _override + 90 | "Variable" _as • PARAMETER _override + 91 | "Variable" _as • OFF + + OFF décalage et aller à l'état 216 + PARAMETER décalage et aller à l'état 217 + "Literal" décalage et aller à l'état 218 + + +État 155 + + 74 alnum_equality: "Literal" • "=" "Literal" + + "=" décalage et aller à l'état 219 + + +État 156 + + 64 set_choice: OVERRIDE alnum_equality_list • + 73 alnum_equality_list: alnum_equality_list • alnum_equality + + "Literal" décalage et aller à l'état 155 + + $défaut réduction par utilisation de la règle 64 (set_choice) + + alnum_equality aller à l'état 220 + + +État 157 + + 72 alnum_equality_list: alnum_equality • + + $défaut réduction par utilisation de la règle 72 (alnum_equality_list) + + +État 158 + + 43 set_choice: ADDRSV alnum_list • + 71 alnum_list: alnum_list • "Literal" + + "Literal" décalage et aller à l'état 208 + + $défaut réduction par utilisation de la règle 43 (set_choice) + + +État 159 + + 44 set_choice: ADDSYN alnum_equality • + + $défaut réduction par utilisation de la règle 44 (set_choice) + + +État 160 + + 197 unquoted_literal: "Literal" • + + $défaut réduction par utilisation de la règle 197 (unquoted_literal) + + +État 161 + + 46 set_choice: ASSIGN unquoted_literal • + + $défaut réduction par utilisation de la règle 46 (set_choice) + + +État 162 + + 48 set_choice: CALLFH unquoted_literal • + + $défaut réduction par utilisation de la règle 48 (set_choice) + + +État 163 + + 51 set_choice: COMP1 unquoted_literal • + + $défaut réduction par utilisation de la règle 51 (set_choice) + + +État 164 + + 41 set_choice: CONSTANT "Variable" • "Literal" + + "Literal" décalage et aller à l'état 221 + + +État 165 + + 52 set_choice: "DPC-IN-DATA" unquoted_literal • + + $défaut réduction par utilisation de la règle 52 (set_choice) + + +État 166 + + 53 set_choice: FOLDCOPYNAME _as • unquoted_literal + + "Literal" décalage et aller à l'état 160 + + unquoted_literal aller à l'état 222 + + +État 167 + + 54 set_choice: MAKESYN alnum_equality • + + $défaut réduction par utilisation de la règle 54 (set_choice) + + +État 168 + + 65 set_choice: REMOVE alnum_list • + 71 alnum_list: alnum_list • "Literal" + + "Literal" décalage et aller à l'état 208 + + $défaut réduction par utilisation de la règle 65 (set_choice) + + +État 169 + + 66 set_choice: SOURCEFORMAT _as • unquoted_literal + 67 | SOURCEFORMAT _as • error + + error décalage et aller à l'état 223 + "Literal" décalage et aller à l'état 160 + + unquoted_literal aller à l'état 224 + + +État 170 + + 88 _literal: "Literal" • + + $défaut réduction par utilisation de la règle 88 (_literal) + + +État 171 + + 69 set_choice: SSRANGE _literal • + + $défaut réduction par utilisation de la règle 69 (set_choice) + + +État 172 + + 42 set_choice: "Variable" set_options • + + $défaut réduction par utilisation de la règle 42 (set_choice) + + +État 173 + + 82 set_options: _as • "Literal" + + "Literal" décalage et aller à l'état 225 + + +État 174 + + 40 set_directive: set_directive set_choice • + + $défaut réduction par utilisation de la règle 40 (set_directive) + + +État 175 + + 36 if_directive_if: error • + + $défaut réduction par utilisation de la règle 36 (if_directive_if) + + +État 176 + + 132 if_directive: "Variable" • _is _not DEFINED + 133 | "Variable" • _is _not SET + 134 | "Variable" • _is _not condition_clause object_id + 140 variable_or_literal: "Variable" • + + IS décalage et aller à l'état 144 + + error réduction par utilisation de la règle 140 (variable_or_literal) + "end of line" réduction par utilisation de la règle 140 (variable_or_literal) + "Variable" réduction par utilisation de la règle 140 (variable_or_literal) + "Literal" réduction par utilisation de la règle 140 (variable_or_literal) + $défaut réduction par utilisation de la règle 210 (_is) + + _is aller à l'état 226 + + +État 177 + + 135 if_directive: "Literal" • _is _not condition_clause object_id + 141 variable_or_literal: "Literal" • + + IS décalage et aller à l'état 144 + + error réduction par utilisation de la règle 141 (variable_or_literal) + "end of line" réduction par utilisation de la règle 141 (variable_or_literal) + "Variable" réduction par utilisation de la règle 141 (variable_or_literal) + "Literal" réduction par utilisation de la règle 141 (variable_or_literal) + $défaut réduction par utilisation de la règle 210 (_is) + + _is aller à l'état 227 + + +État 178 + + 28 directive: IF_DIRECTIVE $@1 if_directive_if • + + $défaut réduction par utilisation de la règle 28 (directive) + + +État 179 + + 35 if_directive_if: if_directive • + + $défaut réduction par utilisation de la règle 35 (if_directive_if) + + +État 180 + + 136 if_directive: garbage • + 138 garbage: garbage • variable_or_literal + 139 | garbage • error + + error décalage et aller à l'état 228 + "Variable" décalage et aller à l'état 229 + "Literal" décalage et aller à l'état 70 + + "end of line" réduction par utilisation de la règle 136 (if_directive) + + variable_or_literal aller à l'état 230 + + +État 181 + + 137 garbage: variable_or_literal • + + $défaut réduction par utilisation de la règle 137 (garbage) + + +État 182 + + 38 if_directive_elif: error • + + $défaut réduction par utilisation de la règle 38 (if_directive_elif) + + +État 183 + + 30 directive: ELIF_DIRECTIVE $@2 if_directive_elif • + + $défaut réduction par utilisation de la règle 30 (directive) + + +État 184 + + 37 if_directive_elif: if_directive • + + $défaut réduction par utilisation de la règle 37 (if_directive_elif) + + +État 185 + + 116 turn_directive: ec_list CHECKING • on_or_off + + OFF décalage et aller à l'état 231 + ON décalage et aller à l'état 232 + WITH décalage et aller à l'état 233 + LOCATION décalage et aller à l'état 234 + + on_or_off aller à l'état 235 + on_with_loc aller à l'état 236 + with_loc aller à l'état 237 + + +État 186 + + 118 ec_list: ec_list "Variable" • + + $défaut réduction par utilisation de la règle 118 (ec_list) + + +État 187 + + 168 replace_statement_with_dot: replace_statement error "." • + + $défaut réduction par utilisation de la règle 168 (replace_statement_with_dot) + + +État 188 + + 8 control_division_with_replace: "SUBSTITUTION SECTION" "." replace_statement • + + $défaut réduction par utilisation de la règle 8 (control_division_with_replace) + + +État 189 + + 4 program_with_control_division: control_division_no_replace statement_no_replace statement_list • + 10 statement_list: statement_list • statement + + COPY décalage et aller à l'état 6 + REPLACE décalage et aller à l'état 7 + LISTING_DIRECTIVE décalage et aller à l'état 8 + LISTING_STATEMENT décalage et aller à l'état 9 + TITLE_STATEMENT décalage et aller à l'état 10 + COBOL_WORDS_DIRECTIVE décalage et aller à l'état 11 + CONTROL_STATEMENT décalage et aller à l'état 12 + LEAP_SECOND_DIRECTIVE décalage et aller à l'état 13 + SOURCE_DIRECTIVE décalage et aller à l'état 14 + CALL_DIRECTIVE décalage et aller à l'état 15 + DEFINE_DIRECTIVE décalage et aller à l'état 16 + REFMOD_DIRECTIVE décalage et aller à l'état 17 + SET_DIRECTIVE décalage et aller à l'état 18 + IF_DIRECTIVE décalage et aller à l'état 19 + ELSE_DIRECTIVE décalage et aller à l'état 20 + ENDIF_DIRECTIVE décalage et aller à l'état 21 + ELIF_DIRECTIVE décalage et aller à l'état 22 + TURN_DIRECTIVE décalage et aller à l'état 23 + + $défaut réduction par utilisation de la règle 4 (program_with_control_division) + + statement aller à l'état 24 + statement_no_replace aller à l'état 25 + directive aller à l'état 26 + listing_statement aller à l'état 27 + copy_statement aller à l'état 28 + replace_statement_with_dot aller à l'état 29 + replace_statement aller à l'état 30 + + +État 190 + + 6 program_with_control_division: control_division_with_replace "." statement_no_replace_list • + 12 statement_no_replace_list: statement_no_replace_list • statement_no_replace + + COPY décalage et aller à l'état 6 + LISTING_DIRECTIVE décalage et aller à l'état 8 + LISTING_STATEMENT décalage et aller à l'état 9 + TITLE_STATEMENT décalage et aller à l'état 10 + COBOL_WORDS_DIRECTIVE décalage et aller à l'état 11 + CONTROL_STATEMENT décalage et aller à l'état 12 + LEAP_SECOND_DIRECTIVE décalage et aller à l'état 13 + SOURCE_DIRECTIVE décalage et aller à l'état 14 + CALL_DIRECTIVE décalage et aller à l'état 15 + DEFINE_DIRECTIVE décalage et aller à l'état 16 + REFMOD_DIRECTIVE décalage et aller à l'état 17 + SET_DIRECTIVE décalage et aller à l'état 18 + IF_DIRECTIVE décalage et aller à l'état 19 + ELSE_DIRECTIVE décalage et aller à l'état 20 + ENDIF_DIRECTIVE décalage et aller à l'état 21 + ELIF_DIRECTIVE décalage et aller à l'état 22 + TURN_DIRECTIVE décalage et aller à l'état 23 + + $défaut réduction par utilisation de la règle 6 (program_with_control_division) + + statement_no_replace aller à l'état 238 + directive aller à l'état 26 + listing_statement aller à l'état 27 + copy_statement aller à l'état 28 + + +État 191 + + 164 _copy_suppress: SUPPRESS • _printing + + PRINTING décalage et aller à l'état 239 + + $défaut réduction par utilisation de la règle 212 (_printing) + + _printing aller à l'état 240 + + +État 192 + + 155 copy_statement: COPY copy_source _copy_in _copy_suppress • _copy_replacing "." + + REPLACING décalage et aller à l'état 241 + + $défaut réduction par utilisation de la règle 165 (_copy_replacing) + + _copy_replacing aller à l'état 242 + + +État 193 + + 160 _copy_in: in_or_of copy_source • + + $défaut réduction par utilisation de la règle 160 (_copy_in) + + +État 194 + + 187 token_list: "Word or Literal" • + + $défaut réduction par utilisation de la règle 187 (token_list) + + +État 195 + + 175 text_src: "==" token_list • "==" + 188 token_list: token_list • "Word or Literal" + + "==" décalage et aller à l'état 243 + "Word or Literal" décalage et aller à l'état 244 + + +État 196 + + 173 replacing_list: replacing_list text_src • BY text_dst + + BY décalage et aller à l'état 245 + + +État 197 + + 174 replacing_list: replacing_list lead_trail • text_partial_src BY text_partial_dst + + "==" décalage et aller à l'état 202 + "Word or Literal" décalage et aller à l'état 203 + + text_partial_src aller à l'état 246 + + +État 198 + + 171 replacing_list: text_src BY • text_dst + + "==" décalage et aller à l'état 247 + IN décalage et aller à l'état 248 + OF décalage et aller à l'état 249 + "Word or Literal" décalage et aller à l'état 125 + + text_dst aller à l'état 250 + identifier aller à l'état 251 + + +État 199 + + 190 identifier: identifier IN • "Word or Literal" + + "Word or Literal" décalage et aller à l'état 252 + + +État 200 + + 191 identifier: identifier OF • "Word or Literal" + + "Word or Literal" décalage et aller à l'état 253 + + +État 201 + + 192 identifier: identifier '(' • subscripts ')' + + "Word or Literal" décalage et aller à l'état 254 + + subscripts aller à l'état 255 + + +État 202 + + 182 text_partial_src: "==" • "Word or Literal" "==" + + "Word or Literal" décalage et aller à l'état 256 + + +État 203 + + 183 text_partial_src: "Word or Literal" • + + $défaut réduction par utilisation de la règle 183 (text_partial_src) + + +État 204 + + 172 replacing_list: lead_trail text_partial_src • BY text_partial_dst + + BY décalage et aller à l'état 257 + + +État 205 + + 102 listing_statement: TITLE_STATEMENT "Literal" _dot "end of line" • + + $défaut réduction par utilisation de la règle 102 (listing_statement) + + +État 206 + + 77 alnum_with: "Literal" WITH • "Literal" + + "Literal" décalage et aller à l'état 258 + + +État 207 + + 76 alnum_with_list: alnum_with_list alnum_with • + + $défaut réduction par utilisation de la règle 76 (alnum_with_list) + + +État 208 + + 71 alnum_list: alnum_list "Literal" • + + $défaut réduction par utilisation de la règle 71 (alnum_list) + + +État 209 + + 80 alnum_by: "Literal" BY • "Literal" + + "Literal" décalage et aller à l'état 259 + + +État 210 + + 79 alnum_by_list: alnum_by_list alnum_by • + + $défaut réduction par utilisation de la règle 79 (alnum_by_list) + + +État 211 + + 18 statement_no_replace: CONTROL_STATEMENT control_options _dot "end of line" • + + $défaut réduction par utilisation de la règle 18 (statement_no_replace) + + +État 212 + + 85 source_directive: _format _is "Variable" • + + $défaut réduction par utilisation de la règle 85 (source_directive) + + +État 213 + + 86 source_directive: _format _is "Literal" • + + $défaut réduction par utilisation de la règle 86 (source_directive) + + +État 214 + + 127 call_directive: call_directive call_choice • + + $défaut réduction par utilisation de la règle 127 (call_directive) + + +État 215 + + 92 define_directive: CONSTANT "Variable" _as • "Literal" _override + + "Literal" décalage et aller à l'état 260 + + +État 216 + + 91 define_directive: "Variable" _as OFF • + + $défaut réduction par utilisation de la règle 91 (define_directive) + + +État 217 + + 90 define_directive: "Variable" _as PARAMETER • _override + + OVERRIDE décalage et aller à l'état 261 + + $défaut réduction par utilisation de la règle 198 (_override) + + _override aller à l'état 262 + + +État 218 + + 89 define_directive: "Variable" _as "Literal" • _override + + OVERRIDE décalage et aller à l'état 261 + + $défaut réduction par utilisation de la règle 198 (_override) + + _override aller à l'état 263 + + +État 219 + + 74 alnum_equality: "Literal" "=" • "Literal" + + "Literal" décalage et aller à l'état 264 + + +État 220 + + 73 alnum_equality_list: alnum_equality_list alnum_equality • + + $défaut réduction par utilisation de la règle 73 (alnum_equality_list) + + +État 221 + + 41 set_choice: CONSTANT "Variable" "Literal" • + + $défaut réduction par utilisation de la règle 41 (set_choice) + + +État 222 + + 53 set_choice: FOLDCOPYNAME _as unquoted_literal • + + $défaut réduction par utilisation de la règle 53 (set_choice) + + +État 223 + + 67 set_choice: SOURCEFORMAT _as error • + + $défaut réduction par utilisation de la règle 67 (set_choice) + + +État 224 + + 66 set_choice: SOURCEFORMAT _as unquoted_literal • + + $défaut réduction par utilisation de la règle 66 (set_choice) + + +État 225 + + 82 set_options: _as "Literal" • + + $défaut réduction par utilisation de la règle 82 (set_options) + + +État 226 + + 132 if_directive: "Variable" _is • _not DEFINED + 133 | "Variable" _is • _not SET + 134 | "Variable" _is • _not condition_clause object_id + + NOT décalage et aller à l'état 265 + + $défaut réduction par utilisation de la règle 200 (_not) + + _not aller à l'état 266 + + +État 227 + + 135 if_directive: "Literal" _is • _not condition_clause object_id + + NOT décalage et aller à l'état 265 + + $défaut réduction par utilisation de la règle 200 (_not) + + _not aller à l'état 267 + + +État 228 + + 139 garbage: garbage error • + + $défaut réduction par utilisation de la règle 139 (garbage) + + +État 229 + + 140 variable_or_literal: "Variable" • + + $défaut réduction par utilisation de la règle 140 (variable_or_literal) + + +État 230 + + 138 garbage: garbage variable_or_literal • + + $défaut réduction par utilisation de la règle 138 (garbage) + + +État 231 + + 121 on_or_off: OFF • + + $défaut réduction par utilisation de la règle 121 (on_or_off) + + +État 232 + + 120 on_or_off: ON • + 122 on_with_loc: ON • with_loc + + WITH décalage et aller à l'état 233 + LOCATION décalage et aller à l'état 234 + + $défaut réduction par utilisation de la règle 120 (on_or_off) + + with_loc aller à l'état 268 + + +État 233 + + 124 with_loc: WITH • LOCATION + + LOCATION décalage et aller à l'état 269 + + +État 234 + + 125 with_loc: LOCATION • + + $défaut réduction par utilisation de la règle 125 (with_loc) + + +État 235 + + 116 turn_directive: ec_list CHECKING on_or_off • + + $défaut réduction par utilisation de la règle 116 (turn_directive) + + +État 236 + + 119 on_or_off: on_with_loc • + + $défaut réduction par utilisation de la règle 119 (on_or_off) + + +État 237 + + 123 on_with_loc: with_loc • + + $défaut réduction par utilisation de la règle 123 (on_with_loc) + + +État 238 + + 12 statement_no_replace_list: statement_no_replace_list statement_no_replace • + + $défaut réduction par utilisation de la règle 12 (statement_no_replace_list) + + +État 239 + + 213 _printing: PRINTING • + + $défaut réduction par utilisation de la règle 213 (_printing) + + +État 240 + + 164 _copy_suppress: SUPPRESS _printing • + + $défaut réduction par utilisation de la règle 164 (_copy_suppress) + + +État 241 + + 166 _copy_replacing: REPLACING • replacing_list + + "==" décalage et aller à l'état 122 + LEADING décalage et aller à l'état 123 + TRAILING décalage et aller à l'état 124 + "Word or Literal" décalage et aller à l'état 125 + + replacing_list aller à l'état 270 + text_src aller à l'état 127 + identifier aller à l'état 128 + lead_trail aller à l'état 129 + + +État 242 + + 155 copy_statement: COPY copy_source _copy_in _copy_suppress _copy_replacing • "." + + "." décalage et aller à l'état 271 + + +État 243 + + 175 text_src: "==" token_list "==" • + + $défaut réduction par utilisation de la règle 175 (text_src) + + +État 244 + + 188 token_list: token_list "Word or Literal" • + + $défaut réduction par utilisation de la règle 188 (token_list) + + +État 245 + + 173 replacing_list: replacing_list text_src BY • text_dst + + "==" décalage et aller à l'état 247 + IN décalage et aller à l'état 248 + OF décalage et aller à l'état 249 + "Word or Literal" décalage et aller à l'état 125 + + text_dst aller à l'état 272 + identifier aller à l'état 251 + + +État 246 + + 174 replacing_list: replacing_list lead_trail text_partial_src • BY text_partial_dst + + BY décalage et aller à l'état 273 + + +État 247 + + 177 text_dst: "==" • "==" + 178 | "==" • token_list "==" + + "==" décalage et aller à l'état 274 + "Word or Literal" décalage et aller à l'état 194 + + token_list aller à l'état 275 + + +État 248 + + 180 text_dst: IN • + + $défaut réduction par utilisation de la règle 180 (text_dst) + + +État 249 + + 181 text_dst: OF • + + $défaut réduction par utilisation de la règle 181 (text_dst) + + +État 250 + + 171 replacing_list: text_src BY text_dst • + + $défaut réduction par utilisation de la règle 171 (replacing_list) + + +État 251 + + 179 text_dst: identifier • + 190 identifier: identifier • IN "Word or Literal" + 191 | identifier • OF "Word or Literal" + 192 | identifier • '(' subscripts ')' + + IN décalage et aller à l'état 199 + OF décalage et aller à l'état 200 + '(' décalage et aller à l'état 201 + + $défaut réduction par utilisation de la règle 179 (text_dst) + + +État 252 + + 190 identifier: identifier IN "Word or Literal" • + + $défaut réduction par utilisation de la règle 190 (identifier) + + +État 253 + + 191 identifier: identifier OF "Word or Literal" • + + $défaut réduction par utilisation de la règle 191 (identifier) + + +État 254 + + 193 subscripts: "Word or Literal" • + + $défaut réduction par utilisation de la règle 193 (subscripts) + + +État 255 + + 192 identifier: identifier '(' subscripts • ')' + 194 subscripts: subscripts • "Word or Literal" + + "Word or Literal" décalage et aller à l'état 276 + ')' décalage et aller à l'état 277 + + +État 256 + + 182 text_partial_src: "==" "Word or Literal" • "==" + + "==" décalage et aller à l'état 278 + + +État 257 + + 172 replacing_list: lead_trail text_partial_src BY • text_partial_dst + + "==" décalage et aller à l'état 279 + "Word or Literal" décalage et aller à l'état 280 + + text_partial_dst aller à l'état 281 + + +État 258 + + 77 alnum_with: "Literal" WITH "Literal" • + + $défaut réduction par utilisation de la règle 77 (alnum_with) + + +État 259 + + 80 alnum_by: "Literal" BY "Literal" • + + $défaut réduction par utilisation de la règle 80 (alnum_by) + + +État 260 + + 92 define_directive: CONSTANT "Variable" _as "Literal" • _override + + OVERRIDE décalage et aller à l'état 261 + + $défaut réduction par utilisation de la règle 198 (_override) + + _override aller à l'état 282 + + +État 261 + + 199 _override: OVERRIDE • + + $défaut réduction par utilisation de la règle 199 (_override) + + +État 262 + + 90 define_directive: "Variable" _as PARAMETER _override • + + $défaut réduction par utilisation de la règle 90 (define_directive) + + +État 263 + + 89 define_directive: "Variable" _as "Literal" _override • + + $défaut réduction par utilisation de la règle 89 (define_directive) + + +État 264 + + 74 alnum_equality: "Literal" "=" "Literal" • + + $défaut réduction par utilisation de la règle 74 (alnum_equality) + + +État 265 + + 201 _not: NOT • + + $défaut réduction par utilisation de la règle 201 (_not) + + +État 266 + + 132 if_directive: "Variable" _is _not • DEFINED + 133 | "Variable" _is _not • SET + 134 | "Variable" _is _not • condition_clause object_id + + ">=" décalage et aller à l'état 283 + "<=" décalage et aller à l'état 284 + "<" décalage et aller à l'état 285 + ">" décalage et aller à l'état 286 + "=" décalage et aller à l'état 287 + "<>" décalage et aller à l'état 288 + EQUAL décalage et aller à l'état 289 + GREATER décalage et aller à l'état 290 + LESS décalage et aller à l'état 291 + SET décalage et aller à l'état 292 + DEFINED décalage et aller à l'état 293 + + condition_clause aller à l'état 294 + + +État 267 + + 135 if_directive: "Literal" _is _not • condition_clause object_id + + ">=" décalage et aller à l'état 283 + "<=" décalage et aller à l'état 284 + "<" décalage et aller à l'état 285 + ">" décalage et aller à l'état 286 + "=" décalage et aller à l'état 287 + "<>" décalage et aller à l'état 288 + EQUAL décalage et aller à l'état 289 + GREATER décalage et aller à l'état 290 + LESS décalage et aller à l'état 291 + + condition_clause aller à l'état 295 + + +État 268 + + 122 on_with_loc: ON with_loc • + + $défaut réduction par utilisation de la règle 122 (on_with_loc) + + +État 269 + + 124 with_loc: WITH LOCATION • + + $défaut réduction par utilisation de la règle 124 (with_loc) + + +État 270 + + 166 _copy_replacing: REPLACING replacing_list • + 173 replacing_list: replacing_list • text_src BY text_dst + 174 | replacing_list • lead_trail text_partial_src BY text_partial_dst + + "==" décalage et aller à l'état 122 + LEADING décalage et aller à l'état 123 + TRAILING décalage et aller à l'état 124 + "Word or Literal" décalage et aller à l'état 125 + + $défaut réduction par utilisation de la règle 166 (_copy_replacing) + + text_src aller à l'état 196 + identifier aller à l'état 128 + lead_trail aller à l'état 197 + + +État 271 + + 155 copy_statement: COPY copy_source _copy_in _copy_suppress _copy_replacing "." • + + $défaut réduction par utilisation de la règle 155 (copy_statement) + + +État 272 + + 173 replacing_list: replacing_list text_src BY text_dst • + + $défaut réduction par utilisation de la règle 173 (replacing_list) + + +État 273 + + 174 replacing_list: replacing_list lead_trail text_partial_src BY • text_partial_dst + + "==" décalage et aller à l'état 279 + "Word or Literal" décalage et aller à l'état 280 + + text_partial_dst aller à l'état 296 + + +État 274 + + 177 text_dst: "==" "==" • + + $défaut réduction par utilisation de la règle 177 (text_dst) + + +État 275 + + 178 text_dst: "==" token_list • "==" + 188 token_list: token_list • "Word or Literal" + + "==" décalage et aller à l'état 297 + "Word or Literal" décalage et aller à l'état 244 + + +État 276 + + 194 subscripts: subscripts "Word or Literal" • + + $défaut réduction par utilisation de la règle 194 (subscripts) + + +État 277 + + 192 identifier: identifier '(' subscripts ')' • + + $défaut réduction par utilisation de la règle 192 (identifier) + + +État 278 + + 182 text_partial_src: "==" "Word or Literal" "==" • + + $défaut réduction par utilisation de la règle 182 (text_partial_src) + + +État 279 + + 184 text_partial_dst: "==" • "==" + 185 | "==" • "Word or Literal" "==" + + "==" décalage et aller à l'état 298 + "Word or Literal" décalage et aller à l'état 299 + + +État 280 + + 186 text_partial_dst: "Word or Literal" • + + $défaut réduction par utilisation de la règle 186 (text_partial_dst) + + +État 281 + + 172 replacing_list: lead_trail text_partial_src BY text_partial_dst • + + $défaut réduction par utilisation de la règle 172 (replacing_list) + + +État 282 + + 92 define_directive: CONSTANT "Variable" _as "Literal" _override • + + $défaut réduction par utilisation de la règle 92 (define_directive) + + +État 283 + + 149 condition_clause: ">=" • + + $défaut réduction par utilisation de la règle 149 (condition_clause) + + +État 284 + + 151 condition_clause: "<=" • + + $défaut réduction par utilisation de la règle 151 (condition_clause) + + +État 285 + + 152 condition_clause: "<" • + + $défaut réduction par utilisation de la règle 152 (condition_clause) + + +État 286 + + 150 condition_clause: ">" • + + $défaut réduction par utilisation de la règle 150 (condition_clause) + + +État 287 + + 153 condition_clause: "=" • + + $défaut réduction par utilisation de la règle 153 (condition_clause) + + +État 288 + + 154 condition_clause: "<>" • + + $défaut réduction par utilisation de la règle 154 (condition_clause) + + +État 289 + + 148 condition_clause: EQUAL • _to + + TO décalage et aller à l'état 300 + + $défaut réduction par utilisation de la règle 218 (_to) + + _to aller à l'état 301 + + +État 290 + + 144 condition_clause: GREATER • _than OR EQUAL _to + 145 | GREATER • _than + + THAN décalage et aller à l'état 302 + + $défaut réduction par utilisation de la règle 216 (_than) + + _than aller à l'état 303 + + +État 291 + + 146 condition_clause: LESS • _than OR EQUAL _to + 147 | LESS • _than + + THAN décalage et aller à l'état 302 + + $défaut réduction par utilisation de la règle 216 (_than) + + _than aller à l'état 304 + + +État 292 + + 133 if_directive: "Variable" _is _not SET • + + $défaut réduction par utilisation de la règle 133 (if_directive) + + +État 293 + + 132 if_directive: "Variable" _is _not DEFINED • + + $défaut réduction par utilisation de la règle 132 (if_directive) + + +État 294 + + 134 if_directive: "Variable" _is _not condition_clause • object_id + + "Variable" décalage et aller à l'état 305 + "Literal" décalage et aller à l'état 306 + + object_id aller à l'état 307 + + +État 295 + + 135 if_directive: "Literal" _is _not condition_clause • object_id + + "Variable" décalage et aller à l'état 305 + "Literal" décalage et aller à l'état 306 + + object_id aller à l'état 308 + + +État 296 + + 174 replacing_list: replacing_list lead_trail text_partial_src BY text_partial_dst • + + $défaut réduction par utilisation de la règle 174 (replacing_list) + + +État 297 + + 178 text_dst: "==" token_list "==" • + + $défaut réduction par utilisation de la règle 178 (text_dst) + + +État 298 + + 184 text_partial_dst: "==" "==" • + + $défaut réduction par utilisation de la règle 184 (text_partial_dst) + + +État 299 + + 185 text_partial_dst: "==" "Word or Literal" • "==" + + "==" décalage et aller à l'état 309 + + +État 300 + + 219 _to: TO • + + $défaut réduction par utilisation de la règle 219 (_to) + + +État 301 + + 148 condition_clause: EQUAL _to • + + $défaut réduction par utilisation de la règle 148 (condition_clause) + + +État 302 + + 217 _than: THAN • + + $défaut réduction par utilisation de la règle 217 (_than) + + +État 303 + + 144 condition_clause: GREATER _than • OR EQUAL _to + 145 | GREATER _than • + + OR décalage et aller à l'état 310 + + $défaut réduction par utilisation de la règle 145 (condition_clause) + + +État 304 + + 146 condition_clause: LESS _than • OR EQUAL _to + 147 | LESS _than • + + OR décalage et aller à l'état 311 + + $défaut réduction par utilisation de la règle 147 (condition_clause) + + +État 305 + + 143 object_id: "Variable" • + + $défaut réduction par utilisation de la règle 143 (object_id) + + +État 306 + + 142 object_id: "Literal" • + + $défaut réduction par utilisation de la règle 142 (object_id) + + +État 307 + + 134 if_directive: "Variable" _is _not condition_clause object_id • + + $défaut réduction par utilisation de la règle 134 (if_directive) + + +État 308 + + 135 if_directive: "Literal" _is _not condition_clause object_id • + + $défaut réduction par utilisation de la règle 135 (if_directive) + + +État 309 + + 185 text_partial_dst: "==" "Word or Literal" "==" • + + $défaut réduction par utilisation de la règle 185 (text_partial_dst) + + +État 310 + + 144 condition_clause: GREATER _than OR • EQUAL _to + + EQUAL décalage et aller à l'état 312 + + +État 311 + + 146 condition_clause: LESS _than OR • EQUAL _to + + EQUAL décalage et aller à l'état 313 + + +État 312 + + 144 condition_clause: GREATER _than OR EQUAL • _to + + TO décalage et aller à l'état 300 + + $défaut réduction par utilisation de la règle 218 (_to) + + _to aller à l'état 314 + + +État 313 + + 146 condition_clause: LESS _than OR EQUAL • _to + + TO décalage et aller à l'état 300 + + $défaut réduction par utilisation de la règle 218 (_to) + + _to aller à l'état 315 + + +État 314 + + 144 condition_clause: GREATER _than OR EQUAL _to • + + $défaut réduction par utilisation de la règle 144 (condition_clause) + + +État 315 + + 146 condition_clause: LESS _than OR EQUAL _to • + + $défaut réduction par utilisation de la règle 146 (condition_clause) diff --git a/cobc/tree.c b/cobc/tree.c index 0e945aeaf..d4353446a 100644 --- a/cobc/tree.c +++ b/cobc/tree.c @@ -2243,6 +2243,15 @@ cb_build_program (struct cb_program *last_program, const int nest_level) p->flag_recursive = 1; } } + + /* state structure for strings */ + p->inspect_st_ref = cb_build_direct ("inspect_st", 0); + p->string_st_ref = cb_build_direct ("string_st", 0); + p->unstring_st_ref = cb_build_direct ("unstring_st", 0); + p->flag_inspect_used = 0; + p->flag_string_used = 0; + p->flag_unstring_used = 0; + return p; } diff --git a/cobc/tree.h b/cobc/tree.h index a9d668772..e163f459b 100644 --- a/cobc/tree.h +++ b/cobc/tree.h @@ -1888,6 +1888,9 @@ struct cb_program { const char *extfh; /* CALLFH for this program */ int last_source_line; /* Line of (implicit) END PROGRAM/FUNCTION */ + cb_tree inspect_st_ref; + cb_tree string_st_ref; + cb_tree unstring_st_ref; /* Internal variables */ int loop_counter; /* Loop counters */ @@ -1928,6 +1931,9 @@ struct cb_program { unsigned int flag_void : 1; /* void return for subprogram */ unsigned int flag_decimal_comp : 1; /* program group has decimal computations */ unsigned int flag_prototype : 1; /* Is a prototype */ + unsigned int flag_inspect_used : 1; + unsigned int flag_string_used : 1; + unsigned int flag_unstring_used : 1; }; #define CB_PROGRAM(x) (CB_TREE_CAST (CB_TAG_PROGRAM, struct cb_program, x)) diff --git a/cobc/typeck.c b/cobc/typeck.c index 3ec484eb3..b2d8a2783 100644 --- a/cobc/typeck.c +++ b/cobc/typeck.c @@ -10331,7 +10331,6 @@ void cb_emit_inspect (cb_tree var, cb_tree body, const enum cb_inspect_clause clause) { cb_tree st = cb_build_direct ("inspect_st", 0); - cb_tree pst = cb_build_direct ("&inspect_st", 0); switch (CB_TREE_TAG (var)) { case CB_TAG_REFERENCE: @@ -10362,11 +10361,21 @@ cb_emit_inspect (cb_tree var, cb_tree body, const enum cb_inspect_clause clause) { const cb_tree replacing_flag = clause == REPLACING_CLAUSE ? cb_int1 : cb_int0; if (clause == CONVERTING_CLAUSE || clause == TRANSFORM_STATEMENT) { - cb_emit (CB_BUILD_FUNCALL_2 ("cob_inspect_init_converting_mt", pst, var)); + cb_emit (CB_BUILD_FUNCALL_2 ( + "cob_inspect_init_converting_mt", + cb_build_direct ("&inspect_st", 0), + var + )); cb_emit_list (body); /* no finish here */ } else { - cb_emit (CB_BUILD_FUNCALL_3 ("cob_inspect_init_mt", pst, var, replacing_flag)); + current_program->flag_inspect_used = 1; + cb_emit (CB_BUILD_FUNCALL_3 ( + "cob_inspect_init_mt", + cb_build_direct ("&inspect_st", 0), + var, + replacing_flag + )); cb_emit_list (body); cb_emit (CB_BUILD_FUNCALL_1 ("cob_inspect_finish_mt", st)); } @@ -14402,7 +14411,6 @@ cb_emit_string (cb_tree items, cb_tree into, cb_tree pointer) cb_tree end; cb_tree dlm; cb_tree st = cb_build_direct ("string_st", 0); - cb_tree pst = cb_build_direct ("&string_st", 0); int nat,nfld; struct cb_field *f; @@ -14416,7 +14424,12 @@ cb_emit_string (cb_tree items, cb_tree into, cb_tree pointer) } start = items; - cb_emit (CB_BUILD_FUNCALL_3 ("cob_string_init_mt", pst, into, pointer)); + current_program->flag_string_used = 1; + cb_emit (CB_BUILD_FUNCALL_3 ( + "cob_string_init_mt", + cb_build_direct ("&string_st", 0), + into, pointer + )); while (start) { /* Find next DELIMITED item */ for (end = start; end; end = CB_CHAIN (end)) { @@ -14491,7 +14504,6 @@ cb_emit_unstring (cb_tree name, cb_tree delimited, cb_tree into, cb_tree pointer, cb_tree tallying) { cb_tree st = cb_build_direct ("unstring_st", 0); - cb_tree pst = cb_build_direct ("&unstring_st", 0); if (cb_validate_one (name) || cb_validate_one (tallying) @@ -14503,8 +14515,14 @@ cb_emit_unstring (cb_tree name, cb_tree delimited, cb_tree into, validate_pointer_clause (pointer, name); } - cb_emit (CB_BUILD_FUNCALL_4 ("cob_unstring_init_mt", pst, name, pointer, - cb_int ((int)cb_list_length (delimited)))); + current_program->flag_unstring_used = 1; + cb_emit (CB_BUILD_FUNCALL_4 ( + "cob_unstring_init_mt", + cb_build_direct ("&unstring_st", 0), + name, + pointer, + cb_int ((int)cb_list_length (delimited)) + )); cb_emit_list (delimited); cb_emit_list (into); if (tallying) { diff --git a/libcob/ChangeLog b/libcob/ChangeLog index 014a3159b..29eaad729 100644 --- a/libcob/ChangeLog +++ b/libcob/ChangeLog @@ -2,13 +2,11 @@ 2024-02-26 Boris Eng * coblocal.h (cob_exit_strings_mt): add multithreaded version of - cob_exit_strings - - * common.h: add signature and structures for multithreaded strings - functions - - * strings.c: add multithreaded version (with 'mt' suffix) for all - functions related to the INSPECT, STRING and UNSTRING statements + cob_exit_strings + * common.h (cob_inspect_state, cob_string_state, cob_unstring_state), + strings.c: moved static variables to structures + * strings.c, common.h: add thread-safe variant for all functions related to + strings 2023-12-14 David Declerck diff --git a/libcob/Makefile b/libcob/Makefile new file mode 100644 index 000000000..460a43571 --- /dev/null +++ b/libcob/Makefile @@ -0,0 +1,1005 @@ +# Makefile.in generated by automake 1.16.5 from Makefile.am. +# libcob/Makefile. Generated from Makefile.in by configure. + +# Copyright (C) 1994-2021 Free Software Foundation, Inc. + +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + + + +# +# Makefile gnucobol/libcob +# +# Copyright (C) 2003-2012, 2014, 2017-2020, 2022-2023 Free Software Foundation, Inc. +# Written by Keisuke Nishida, Roger While, Simon Sobisch +# +# This file is part of GnuCOBOL. +# +# The GnuCOBOL compiler is free software: you can redistribute it +# and/or modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# GnuCOBOL is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GnuCOBOL. If not, see . + +# aminclude_static.am generated automatically by Autoconf +# from AX_AM_MACROS_STATIC on Thu Feb 1 13:31:38 CET 2024 + + + +am__is_gnu_make = { \ + if test -z '$(MAKELEVEL)'; then \ + false; \ + elif test -n '$(MAKE_HOST)'; then \ + true; \ + elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ + true; \ + else \ + false; \ + fi; \ +} +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) +pkgdatadir = $(datadir)/gnucobol +pkglibdir = $(libdir)/gnucobol +pkglibexecdir = $(libexecdir)/gnucobol +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = x86_64-pc-linux-gnu +host_triplet = x86_64-pc-linux-gnu +subdir = libcob +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/ax_ac_append_to_file.m4 \ + $(top_srcdir)/m4/ax_ac_define_resolved.m4 \ + $(top_srcdir)/m4/ax_ac_print_to_file.m4 \ + $(top_srcdir)/m4/ax_add_am_macro_static.m4 \ + $(top_srcdir)/m4/ax_am_macros_static.m4 \ + $(top_srcdir)/m4/ax_check_define.m4 \ + $(top_srcdir)/m4/ax_check_gnu_make.m4 \ + $(top_srcdir)/m4/ax_code_coverage.m4 \ + $(top_srcdir)/m4/ax_file_escapes.m4 \ + $(top_srcdir)/m4/ax_prog_bison.m4 \ + $(top_srcdir)/m4/ax_prog_flex.m4 $(top_srcdir)/m4/codeset.m4 \ + $(top_srcdir)/m4/gettext.m4 $(top_srcdir)/m4/iconv.m4 \ + $(top_srcdir)/m4/intlmacosx.m4 $(top_srcdir)/m4/lib-ld.m4 \ + $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \ + $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ + $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ + $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/nls.m4 \ + $(top_srcdir)/m4/pkg.m4 $(top_srcdir)/m4/po.m4 \ + $(top_srcdir)/m4/progtest.m4 $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(pkginclude_HEADERS) \ + $(am__DIST_COMMON) +mkinstalldirs = $(SHELL) $(top_srcdir)/build_aux/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__uninstall_files_from_dir = { \ + test -z "$$files" \ + || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ + || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ + $(am__cd) "$$dir" && rm -f $$files; }; \ + } +am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(pkgincludedir)" +LTLIBRARIES = $(lib_LTLIBRARIES) +am__DEPENDENCIES_1 = +libcob_la_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +am_libcob_la_OBJECTS = common.lo move.lo numeric.lo strings.lo \ + fileio.lo call.lo intrinsic.lo termio.lo screenio.lo \ + reportio.lo cobgetopt.lo mlio.lo cconv.lo +#nodist_libcob_la_OBJECTS = cJSON.lo +libcob_la_OBJECTS = $(am_libcob_la_OBJECTS) \ + $(nodist_libcob_la_OBJECTS) +AM_V_lt = $(am__v_lt_$(V)) +am__v_lt_ = $(am__v_lt_$(AM_DEFAULT_VERBOSITY)) +am__v_lt_0 = --silent +am__v_lt_1 = +libcob_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(libcob_la_LDFLAGS) $(LDFLAGS) -o $@ +AM_V_P = $(am__v_P_$(V)) +am__v_P_ = $(am__v_P_$(AM_DEFAULT_VERBOSITY)) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_$(V)) +am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY)) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_$(V)) +am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY)) +am__v_at_0 = @ +am__v_at_1 = +DEFAULT_INCLUDES = -I. -I$(top_builddir) +depcomp = $(SHELL) $(top_srcdir)/build_aux/depcomp +am__maybe_remake_depfiles = depfiles +am__depfiles_remade = ./$(DEPDIR)/cJSON.Plo ./$(DEPDIR)/call.Plo \ + ./$(DEPDIR)/cconv.Plo ./$(DEPDIR)/cobgetopt.Plo \ + ./$(DEPDIR)/common.Plo ./$(DEPDIR)/fileio.Plo \ + ./$(DEPDIR)/intrinsic.Plo ./$(DEPDIR)/mlio.Plo \ + ./$(DEPDIR)/move.Plo ./$(DEPDIR)/numeric.Plo \ + ./$(DEPDIR)/reportio.Plo ./$(DEPDIR)/screenio.Plo \ + ./$(DEPDIR)/strings.Plo ./$(DEPDIR)/termio.Plo +am__mv = mv -f +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CFLAGS) $(CFLAGS) +AM_V_CC = $(am__v_CC_$(V)) +am__v_CC_ = $(am__v_CC_$(AM_DEFAULT_VERBOSITY)) +am__v_CC_0 = @echo " CC " $@; +am__v_CC_1 = +CCLD = $(CC) +LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +AM_V_CCLD = $(am__v_CCLD_$(V)) +am__v_CCLD_ = $(am__v_CCLD_$(AM_DEFAULT_VERBOSITY)) +am__v_CCLD_0 = @echo " CCLD " $@; +am__v_CCLD_1 = +SOURCES = $(libcob_la_SOURCES) $(nodist_libcob_la_SOURCES) +DIST_SOURCES = $(libcob_la_SOURCES) +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +HEADERS = $(pkginclude_HEADERS) +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) +# Read a list of newline-separated strings from the standard input, +# and print each of them once, without duplicates. Input order is +# *not* preserved. +am__uniquify_input = $(AWK) '\ + BEGIN { nonempty = 0; } \ + { items[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in items) print i; }; } \ +' +# Make sure the list of sources is unique. This is necessary because, +# e.g., the same source file might be shared among _SOURCES variables +# for different programs/libraries. +am__define_uniq_tagged_files = \ + list='$(am__tagged_files)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | $(am__uniquify_input)` +am__DIST_COMMON = $(srcdir)/Makefile.in \ + $(top_srcdir)/aminclude_static.am \ + $(top_srcdir)/build_aux/depcomp \ + $(top_srcdir)/build_aux/mkinstalldirs ChangeLog +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +pkgincludedir = $(includedir)/libcob +ACLOCAL = ${SHELL} '/home/engboris/gnucobol/build_aux/missing' aclocal-1.16 +AMTAR = $${TAR-tar} +AM_DEFAULT_VERBOSITY = 1 +AR = ar +AS = as +AUTOCONF = ${SHELL} '/home/engboris/gnucobol/build_aux/missing' autoconf +AUTOHEADER = ${SHELL} '/home/engboris/gnucobol/build_aux/missing' autoheader +AUTOMAKE = ${SHELL} '/home/engboris/gnucobol/build_aux/missing' automake-1.16 +AWK = mawk +BDB_CFLAGS = +BDB_LIBS = +CC = gcc +CCDEPMODE = depmode=gcc3 +CFLAGS = -O0 -ggdb3 -fasynchronous-unwind-tables -pipe -fsigned-char -Wall -Wwrite-strings -Wmissing-prototypes -Wno-format-y2k +CJSON_CFLAGS = +CJSON_LIBS = -lcjson +COBC_CPPFLAGS = +COB_BIGENDIAN = no +COB_CC = gcc +COB_CFLAGS = -pipe -I/usr/local/gnucobol/include -Wno-unused -fsigned-char -Wno-pointer-sign +COB_CONFIG_DIR = ${datarootdir}/gnucobol/config +COB_COPY_DIR = ${datarootdir}/gnucobol/copy +COB_ENABLE_DEBUG = yes +COB_EXE_EXT = +COB_FIX_LIBTOOL = +COB_HAS_64_BIT_POINTER = yes +COB_HAS_CURSES = yes +COB_HAS_ISAM = db +COB_HAS_JSON = no +COB_HAS_XML2 = yes +COB_LDFLAGS = +COB_LIBRARY_PATH = ${exec_prefix}/lib/gnucobol +COB_LIBS = -L${exec_prefix}/lib -lcob +COB_MODULE_EXT = so +COB_OBJECT_EXT = o +COB_PATCH_LEVEL = 0 +CODE_COVERAGE_CFLAGS = +CODE_COVERAGE_CPPFLAGS = +CODE_COVERAGE_CXXFLAGS = +CODE_COVERAGE_ENABLED = no +CODE_COVERAGE_LIBS = +CPP = +CPPFLAGS = +CSCOPE = cscope +CTAGS = ctags +CURSES_LIBS = -lncursesw +CYGPATH_W = echo +DEFS = -DHAVE_CONFIG_H +DEPDIR = .deps +DIFF_FLAGS = --strip-trailing-cr +DLLTOOL = false +DSYMUTIL = +DUMPBIN = +ECHO_C = +ECHO_N = -n +ECHO_T = +EGREP = /usr/bin/grep -E +ETAGS = etags +EXEEXT = +FGREP = /usr/bin/grep -F +GCOV = +GENHTML = +GETTEXT_MACRO_VERSION = 0.20 +GMP_CFLAGS = +GMP_LIBS = -lgmp +GMSGFMT = : +GMSGFMT_015 = : +GREP = /usr/bin/grep +HELP2MAN = ${SHELL} '/home/engboris/gnucobol/build_aux/missing' help2man +INSTALL = /usr/bin/install -c +INSTALL_DATA = ${INSTALL} -m 644 +INSTALL_PROGRAM = ${INSTALL} +INSTALL_SCRIPT = ${INSTALL} +INSTALL_STRIP_PROGRAM = $(install_sh) -c -s +INTLLIBS = +INTL_MACOSX_LIBS = +JSON_C_CFLAGS = +JSON_C_LIBS = -ljson-c +LCOV = +LD = /usr/bin/ld -m elf_x86_64 +LDFLAGS = -Wl,-z,relro,-z,now,-O1 +LEX = ${SHELL} '/home/engboris/gnucobol/build_aux/missing' flex +LEXLIB = +LEX_OUTPUT_ROOT = +LIBCOB_CPPFLAGS = -I/usr/include/libxml2 +LIBCOB_LIBS = -lgmp -lxml2 -lncursesw -ldb-5.3 +LIBICONV = -liconv +LIBINTL = +LIBOBJS = +LIBS = +LIBTOOL = $(SHELL) $(top_builddir)/libtool +LIPO = +LN_S = ln -s +LTLIBICONV = -liconv +LTLIBINTL = +LTLIBOBJS = +LT_SYS_LIBRARY_PATH = +MAKE = make +MAKEINFO = ${SHELL} '/home/engboris/gnucobol/build_aux/missing' makeinfo +MANIFEST_TOOL = : +MKDIR_P = /usr/bin/mkdir -p +MPIR_CFLAGS = +MPIR_LIBS = +MSGFMT = : +MSGMERGE = : +MSGMERGE_FOR_MSGFMT_OPTION = --no-location --quiet +NM = /usr/bin/nm -B +NMEDIT = +OBJDUMP = objdump +OBJEXT = o +OTOOL = +OTOOL64 = +PACKAGE = gnucobol +PACKAGE_BUGREPORT = bug-gnucobol@gnu.org +PACKAGE_NAME = GnuCOBOL +PACKAGE_STRING = GnuCOBOL 3.3-dev +PACKAGE_TARNAME = gnucobol +PACKAGE_URL = https://www.gnu.org/software/gnucobol/ +PACKAGE_VERSION = 3.3-dev +PATH_SEPARATOR = : +PERL = perl +PKG_CONFIG = /usr/bin/pkg-config +PKG_CONFIG_LIBDIR = +PKG_CONFIG_PATH = +POSUB = po +PROGRAMS_LIBS = +QUOTE_INCLUDE_FLAG = +RANLIB = ranlib +RC = +SED = /usr/bin/sed +SET_MAKE = +SHELL = /bin/bash +STRIP = strip +USE_NLS = yes +VERSION = 3.3-dev +XGETTEXT = : +XGETTEXT_015 = : +XGETTEXT_EXTRA_OPTIONS = +XML2_CFLAGS = -I/usr/include/libxml2 +XML2_CONFIG = +XML2_LIBS = -lxml2 +YACC = yacc +YFLAGS = +abs_builddir = /home/engboris/gnucobol/libcob +abs_srcdir = /home/engboris/gnucobol/libcob +abs_top_builddir = /home/engboris/gnucobol +abs_top_srcdir = /home/engboris/gnucobol +ac_ct_AR = ar +ac_ct_CC = gcc +ac_ct_DUMPBIN = +am__include = include +am__leading_dot = . +am__quote = +am__tar = $${TAR-tar} chof - "$$tardir" +am__untar = $${TAR-tar} xf - +bindir = ${exec_prefix}/bin +build = x86_64-pc-linux-gnu +build_alias = +build_cpu = x86_64 +build_os = linux-gnu +build_vendor = pc +builddir = . +configured_make = make +datadir = ${datarootdir} +datarootdir = ${prefix}/share +docdir = ${datarootdir}/doc/${PACKAGE_TARNAME} +dvidir = ${docdir} +exec_prefix = ${prefix} +host = x86_64-pc-linux-gnu +host_alias = +host_cpu = x86_64 +host_os = linux-gnu +host_vendor = pc +htmldir = ${docdir} +ifGNUmake = +ifnGNUmake = +includedir = ${prefix}/include +infodir = ${datarootdir}/info +install_sh = ${SHELL} /home/engboris/gnucobol/build_aux/install-sh +libdir = ${exec_prefix}/lib +libexecdir = ${exec_prefix}/libexec +localedir = ${datarootdir}/locale +localstatedir = ${prefix}/var +mandir = ${datarootdir}/man +mkdir_p = $(MKDIR_P) +oldincludedir = /usr/include +pdfdir = ${docdir} +prefix = /usr/local/gnucobol +program_transform_name = s,x,x, +psdir = ${docdir} +runstatedir = ${localstatedir}/run +sbindir = ${exec_prefix}/sbin +sharedstatedir = ${prefix}/com +srcdir = . +sysconfdir = ${prefix}/etc +target_alias = +top_build_prefix = ../ +top_builddir = .. +top_srcdir = .. +lib_LTLIBRARIES = libcob.la +libcob_la_SOURCES = common.c move.c numeric.c strings.c \ + fileio.c call.c intrinsic.c termio.c screenio.c reportio.c cobgetopt.c \ + mlio.c coblocal.h cconv.c system.def + +#nodist_libcob_la_SOURCES = cJSON.c +#DISTCLEANFILES = cJSON.c cJSON.h + +#ToDo Man Page +#dist_man_MANS = libcob.3 +#COBCRUN = cobcrun$(EXEEXT) +AM_CPPFLAGS = -I$(top_srcdir) -I$(top_builddir)/lib -I$(top_srcdir)/lib \ + $(LIBCOB_CPPFLAGS) -DLOCALEDIR=\"$(localedir)\" + +AM_CFLAGS = $(CODE_COVERAGE_CFLAGS) +# note: currently misses libsupport... +libcob_la_LIBADD = $(LIBCOB_LIBS) $(CODE_COVERAGE_LIBS) +libcob_la_LDFLAGS = $(COB_FIX_LIBTOOL) -version-info 6:0:2 -no-undefined +AM_LDFLAGS = $(COB_FIX_LIB) +pkginclude_HEADERS = common.h version.h cobgetopt.h \ + exception.def exception-io.def statement.def + +#GITIGNOREFILES := $(GITIGNOREFILES) $(CODE_COVERAGE_OUTPUT_FILE) $(CODE_COVERAGE_OUTPUT_DIRECTORY) +#code_coverage_v_lcov_cap = $(code_coverage_v_lcov_cap_$(V)) +#code_coverage_v_lcov_cap_ = $(code_coverage_v_lcov_cap_$(AM_DEFAULT_VERBOSITY)) +#code_coverage_v_lcov_cap_0 = @echo " LCOV --capture" $(CODE_COVERAGE_OUTPUT_FILE); +#code_coverage_v_lcov_ign = $(code_coverage_v_lcov_ign_$(V)) +#code_coverage_v_lcov_ign_ = $(code_coverage_v_lcov_ign_$(AM_DEFAULT_VERBOSITY)) +#code_coverage_v_lcov_ign_0 = @echo " LCOV --remove /tmp/*" $(CODE_COVERAGE_IGNORE_PATTERN); +#code_coverage_v_genhtml = $(code_coverage_v_genhtml_$(V)) +#code_coverage_v_genhtml_ = $(code_coverage_v_genhtml_$(AM_DEFAULT_VERBOSITY)) +#code_coverage_v_genhtml_0 = @echo " GEN " "$(CODE_COVERAGE_OUTPUT_DIRECTORY)"; +#code_coverage_quiet = $(code_coverage_quiet_$(V)) +#code_coverage_quiet_ = $(code_coverage_quiet_$(AM_DEFAULT_VERBOSITY)) +#code_coverage_quiet_0 = --quiet + +# sanitizes the test-name: replaces with underscores: dashes and dots +#code_coverage_sanitize = $(subst -,_,$(subst .,_,$(1))) +#AM_DISTCHECK_CONFIGURE_FLAGS := $(AM_DISTCHECK_CONFIGURE_FLAGS) --disable-code-coverage +CODE_COVERAGE_BRANCH_COVERAGE = 1 +CODE_COVERAGE_LCOV_OPTIONS = --no-external +all: all-am + +.SUFFIXES: +.SUFFIXES: .c .lo .o .obj +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/aminclude_static.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu libcob/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu libcob/Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ + esac; +$(top_srcdir)/aminclude_static.am $(am__empty): + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +install-libLTLIBRARIES: $(lib_LTLIBRARIES) + @$(NORMAL_INSTALL) + @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ + list2=; for p in $$list; do \ + if test -f $$p; then \ + list2="$$list2 $$p"; \ + else :; fi; \ + done; \ + test -z "$$list2" || { \ + echo " $(MKDIR_P) '$(DESTDIR)$(libdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(libdir)" || exit 1; \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \ + } + +uninstall-libLTLIBRARIES: + @$(NORMAL_UNINSTALL) + @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ + for p in $$list; do \ + $(am__strip_dir) \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \ + done + +clean-libLTLIBRARIES: + -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) + @list='$(lib_LTLIBRARIES)'; \ + locs=`for p in $$list; do echo $$p; done | \ + sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ + sort -u`; \ + test -z "$$locs" || { \ + echo rm -f $${locs}; \ + rm -f $${locs}; \ + } + +libcob.la: $(libcob_la_OBJECTS) $(libcob_la_DEPENDENCIES) $(EXTRA_libcob_la_DEPENDENCIES) + $(AM_V_CCLD)$(libcob_la_LINK) -rpath $(libdir) $(libcob_la_OBJECTS) $(libcob_la_LIBADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +include ./$(DEPDIR)/cJSON.Plo # am--include-marker +include ./$(DEPDIR)/call.Plo # am--include-marker +include ./$(DEPDIR)/cconv.Plo # am--include-marker +include ./$(DEPDIR)/cobgetopt.Plo # am--include-marker +include ./$(DEPDIR)/common.Plo # am--include-marker +include ./$(DEPDIR)/fileio.Plo # am--include-marker +include ./$(DEPDIR)/intrinsic.Plo # am--include-marker +include ./$(DEPDIR)/mlio.Plo # am--include-marker +include ./$(DEPDIR)/move.Plo # am--include-marker +include ./$(DEPDIR)/numeric.Plo # am--include-marker +include ./$(DEPDIR)/reportio.Plo # am--include-marker +include ./$(DEPDIR)/screenio.Plo # am--include-marker +include ./$(DEPDIR)/strings.Plo # am--include-marker +include ./$(DEPDIR)/termio.Plo # am--include-marker + +$(am__depfiles_remade): + @$(MKDIR_P) $(@D) + @echo '# dummy' >$@-t && $(am__mv) $@-t $@ + +am--depfiles: $(am__depfiles_remade) + +.c.o: + $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< + $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +# $(AM_V_CC)source='$<' object='$@' libtool=no \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(AM_V_CC_no)$(COMPILE) -c -o $@ $< + +.c.obj: + $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` + $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +# $(AM_V_CC)source='$<' object='$@' libtool=no \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(AM_V_CC_no)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +.c.lo: + $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< + $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +# $(AM_V_CC)source='$<' object='$@' libtool=yes \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(AM_V_CC_no)$(LTCOMPILE) -c -o $@ $< + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs +install-pkgincludeHEADERS: $(pkginclude_HEADERS) + @$(NORMAL_INSTALL) + @list='$(pkginclude_HEADERS)'; test -n "$(pkgincludedir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(pkgincludedir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(pkgincludedir)" || exit 1; \ + fi; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(pkgincludedir)'"; \ + $(INSTALL_HEADER) $$files "$(DESTDIR)$(pkgincludedir)" || exit $$?; \ + done + +uninstall-pkgincludeHEADERS: + @$(NORMAL_UNINSTALL) + @list='$(pkginclude_HEADERS)'; test -n "$(pkgincludedir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + dir='$(DESTDIR)$(pkgincludedir)'; $(am__uninstall_files_from_dir) + +ID: $(am__tagged_files) + $(am__define_uniq_tagged_files); mkid -fID $$unique +tags: tags-am +TAGS: tags + +tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + set x; \ + here=`pwd`; \ + $(am__define_uniq_tagged_files); \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: ctags-am + +CTAGS: ctags +ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + $(am__define_uniq_tagged_files); \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" +cscopelist: cscopelist-am + +cscopelist-am: $(am__tagged_files) + list='$(am__tagged_files)'; \ + case "$(srcdir)" in \ + [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ + *) sdir=$(subdir)/$(srcdir) ;; \ + esac; \ + for i in $$list; do \ + if test -f "$$i"; then \ + echo "$(subdir)/$$i"; \ + else \ + echo "$$sdir/$$i"; \ + fi; \ + done >> $(top_builddir)/cscope.files + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags +distdir: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) distdir-am + +distdir-am: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(LTLIBRARIES) $(HEADERS) +installdirs: + for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(pkgincludedir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libLTLIBRARIES clean-libtool clean-local \ + mostlyclean-am + +distclean: distclean-am + -rm -f ./$(DEPDIR)/cJSON.Plo + -rm -f ./$(DEPDIR)/call.Plo + -rm -f ./$(DEPDIR)/cconv.Plo + -rm -f ./$(DEPDIR)/cobgetopt.Plo + -rm -f ./$(DEPDIR)/common.Plo + -rm -f ./$(DEPDIR)/fileio.Plo + -rm -f ./$(DEPDIR)/intrinsic.Plo + -rm -f ./$(DEPDIR)/mlio.Plo + -rm -f ./$(DEPDIR)/move.Plo + -rm -f ./$(DEPDIR)/numeric.Plo + -rm -f ./$(DEPDIR)/reportio.Plo + -rm -f ./$(DEPDIR)/screenio.Plo + -rm -f ./$(DEPDIR)/strings.Plo + -rm -f ./$(DEPDIR)/termio.Plo + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: install-pkgincludeHEADERS + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: install-libLTLIBRARIES + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f ./$(DEPDIR)/cJSON.Plo + -rm -f ./$(DEPDIR)/call.Plo + -rm -f ./$(DEPDIR)/cconv.Plo + -rm -f ./$(DEPDIR)/cobgetopt.Plo + -rm -f ./$(DEPDIR)/common.Plo + -rm -f ./$(DEPDIR)/fileio.Plo + -rm -f ./$(DEPDIR)/intrinsic.Plo + -rm -f ./$(DEPDIR)/mlio.Plo + -rm -f ./$(DEPDIR)/move.Plo + -rm -f ./$(DEPDIR)/numeric.Plo + -rm -f ./$(DEPDIR)/reportio.Plo + -rm -f ./$(DEPDIR)/screenio.Plo + -rm -f ./$(DEPDIR)/strings.Plo + -rm -f ./$(DEPDIR)/termio.Plo + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-libLTLIBRARIES uninstall-pkgincludeHEADERS + +.MAKE: install-am install-strip + +.PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \ + clean-generic clean-libLTLIBRARIES clean-libtool clean-local \ + cscopelist-am ctags ctags-am distclean distclean-compile \ + distclean-generic distclean-libtool distclean-tags distdir dvi \ + dvi-am html html-am info info-am install install-am \ + install-data install-data-am install-dvi install-dvi-am \ + install-exec install-exec-am install-html install-html-am \ + install-info install-info-am install-libLTLIBRARIES \ + install-man install-pdf install-pdf-am \ + install-pkgincludeHEADERS install-ps install-ps-am \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ + pdf pdf-am ps ps-am tags tags-am uninstall uninstall-am \ + uninstall-libLTLIBRARIES uninstall-pkgincludeHEADERS + +.PRECIOUS: Makefile + + +# Code coverage +# +# Optional: +# - CODE_COVERAGE_DIRECTORY: Top-level directory for code coverage reporting. +# Multiple directories may be specified, separated by whitespace. +# (Default: $(top_builddir)) +# - CODE_COVERAGE_OUTPUT_FILE: Filename and path for the .info file generated +# by lcov for code coverage. (Default: +# $(PACKAGE_NAME)-$(PACKAGE_VERSION)-coverage.info) +# - CODE_COVERAGE_OUTPUT_DIRECTORY: Directory for generated code coverage +# reports to be created. (Default: +# $(PACKAGE_NAME)-$(PACKAGE_VERSION)-coverage) +# - CODE_COVERAGE_BRANCH_COVERAGE: Set to 1 to enforce branch coverage, +# set to 0 to disable it and leave empty to stay with the default. +# (Default: empty) +# - CODE_COVERAGE_LCOV_SHOPTS_DEFAULT: Extra options shared between both lcov +# instances. (Default: based on ) +# - CODE_COVERAGE_LCOV_SHOPTS: Extra options to shared between both lcov +# instances. (Default: ) +# - CODE_COVERAGE_LCOV_OPTIONS_GCOVPATH: --gcov-tool pathtogcov +# - CODE_COVERAGE_LCOV_OPTIONS_DEFAULT: Extra options to pass to the +# collecting lcov instance. (Default: ) +# - CODE_COVERAGE_LCOV_OPTIONS: Extra options to pass to the collecting lcov +# instance. (Default: ) +# - CODE_COVERAGE_LCOV_RMOPTS_DEFAULT: Extra options to pass to the filtering +# lcov instance. (Default: empty) +# - CODE_COVERAGE_LCOV_RMOPTS: Extra options to pass to the filtering lcov +# instance. (Default: ) +# - CODE_COVERAGE_GENHTML_OPTIONS_DEFAULT: Extra options to pass to the +# genhtml instance. (Default: based on ) +# - CODE_COVERAGE_GENHTML_OPTIONS: Extra options to pass to the genhtml +# instance. (Default: ) +# - CODE_COVERAGE_IGNORE_PATTERN: Extra glob pattern of files to ignore +# +# The generated report will be titled using the $(PACKAGE_NAME) and +# $(PACKAGE_VERSION). In order to add the current git hash to the title, +# use the git-version-gen script, available online. +# Optional variables +# run only on top dir +# ifeq ($(abs_builddir), $(abs_top_builddir)) +#CODE_COVERAGE_DIRECTORY ?= $(top_builddir) +#CODE_COVERAGE_OUTPUT_FILE ?= $(PACKAGE_NAME)-$(PACKAGE_VERSION)-coverage.info +#CODE_COVERAGE_OUTPUT_DIRECTORY ?= $(PACKAGE_NAME)-$(PACKAGE_VERSION)-coverage + +#CODE_COVERAGE_BRANCH_COVERAGE ?= +#CODE_COVERAGE_LCOV_SHOPTS_DEFAULT ?= $(if $(CODE_COVERAGE_BRANCH_COVERAGE),--rc lcov_branch_coverage=$(CODE_COVERAGE_BRANCH_COVERAGE)) +#CODE_COVERAGE_LCOV_SHOPTS ?= $(CODE_COVERAGE_LCOV_SHOPTS_DEFAULT) +#CODE_COVERAGE_LCOV_OPTIONS_GCOVPATH ?= --gcov-tool "$(GCOV)" +#CODE_COVERAGE_LCOV_OPTIONS_DEFAULT ?= $(CODE_COVERAGE_LCOV_OPTIONS_GCOVPATH) +#CODE_COVERAGE_LCOV_OPTIONS ?= $(CODE_COVERAGE_LCOV_OPTIONS_DEFAULT) +#CODE_COVERAGE_LCOV_RMOPTS_DEFAULT ?= +#CODE_COVERAGE_LCOV_RMOPTS ?= $(CODE_COVERAGE_LCOV_RMOPTS_DEFAULT) +#CODE_COVERAGE_GENHTML_OPTIONS_DEFAULT ?=$(if $(CODE_COVERAGE_BRANCH_COVERAGE),--rc genhtml_branch_coverage=$(CODE_COVERAGE_BRANCH_COVERAGE)) +#CODE_COVERAGE_GENHTML_OPTIONS ?= $(CODE_COVERAGE_GENHTML_OPTIONS_DEFAULT) +#CODE_COVERAGE_IGNORE_PATTERN ?= + +# Use recursive makes in order to ignore errors during check +#check-code-coverage: +# -$(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -k check +# $(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) code-coverage-capture + +# Capture code coverage data +#code-coverage-capture: code-coverage-capture-hook +# $(code_coverage_v_lcov_cap)$(LCOV) $(code_coverage_quiet) $(addprefix --directory ,$(CODE_COVERAGE_DIRECTORY)) --capture --output-file "$(CODE_COVERAGE_OUTPUT_FILE).tmp" --test-name "$(call code_coverage_sanitize,$(PACKAGE_NAME)-$(PACKAGE_VERSION))" --no-checksum --compat-libtool $(CODE_COVERAGE_LCOV_SHOPTS) $(CODE_COVERAGE_LCOV_OPTIONS) +# $(code_coverage_v_lcov_ign)$(LCOV) $(code_coverage_quiet) $(addprefix --directory ,$(CODE_COVERAGE_DIRECTORY)) --remove "$(CODE_COVERAGE_OUTPUT_FILE).tmp" "/tmp/*" $(CODE_COVERAGE_IGNORE_PATTERN) --output-file "$(CODE_COVERAGE_OUTPUT_FILE)" $(CODE_COVERAGE_LCOV_SHOPTS) $(CODE_COVERAGE_LCOV_RMOPTS) +# -@rm -f "$(CODE_COVERAGE_OUTPUT_FILE).tmp" +# $(code_coverage_v_genhtml)LANG=C $(GENHTML) $(code_coverage_quiet) $(addprefix --prefix ,$(CODE_COVERAGE_DIRECTORY)) --output-directory "$(CODE_COVERAGE_OUTPUT_DIRECTORY)" --title "$(PACKAGE_NAME)-$(PACKAGE_VERSION) Code Coverage" --legend --show-details "$(CODE_COVERAGE_OUTPUT_FILE)" $(CODE_COVERAGE_GENHTML_OPTIONS) +# @echo "file://$(abs_builddir)/$(CODE_COVERAGE_OUTPUT_DIRECTORY)/index.html" + +#code-coverage-clean: +# -$(LCOV) --directory $(top_builddir) -z +# -rm -rf "$(CODE_COVERAGE_OUTPUT_FILE)" "$(CODE_COVERAGE_OUTPUT_FILE).tmp" "$(CODE_COVERAGE_OUTPUT_DIRECTORY)" +# -find . \( -name "*.gcda" -o -name "*.gcno" -o -name "*.gcov" \) -delete + +#code-coverage-dist-clean: +# else # ifneq ($(abs_builddir), $(abs_top_builddir)) +#check-code-coverage: + +#code-coverage-capture: code-coverage-capture-hook + +#code-coverage-clean: + +#code-coverage-dist-clean: +# endif # ifeq ($(abs_builddir), $(abs_top_builddir)) +# Use recursive makes in order to ignore errors during check +check-code-coverage: + @echo "Need to reconfigure with --enable-code-coverage" +# Capture code coverage data +code-coverage-capture: code-coverage-capture-hook + @echo "Need to reconfigure with --enable-code-coverage" + +code-coverage-clean: + +code-coverage-dist-clean: + +# Hook rule executed before code-coverage-capture, overridable by the user +code-coverage-capture-hook: + +.PHONY: check-code-coverage code-coverage-capture code-coverage-dist-clean code-coverage-clean code-coverage-capture-hook + +# Add rules for code-coverage testing, as provided by AX_CODE_COVERAGE + +clean-local: code-coverage-clean +dist-clean-local: code-coverage-dist-clean + +#HELPSOURCES = $(top_srcdir)/bin/cobcrun.c $(top_srcdir)/configure.ac +#HELP2MAN_OPTS = --info-page=$(PACKAGE) -specialflag +#if MAKE_HAS_PREREQ_ONLY +#libcob.3: $(HELPSOURCES) | $(COBCRUN) +# "$(top_builddir)/pre-inst-env" $(HELP2MAN) --output=$@ $(HELP2MAN_OPTS) $(COBCRUN) +#else +#libcob.3: $(HELPSOURCES) +# "$(top_builddir)/pre-inst-env" $(HELP2MAN) --output=$@ $(HELP2MAN_OPTS) $(COBCRUN) +#endif + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/libcob/coblocal.h b/libcob/coblocal.h index 0ecd6279d..31a742d78 100644 --- a/libcob/coblocal.h +++ b/libcob/coblocal.h @@ -324,7 +324,6 @@ typedef struct __cob_settings { unsigned int cob_exit_wait; /* wait on program exit if no ACCEPT came after last DISPLAY */ const char *cob_exit_msg; /* message for cob_exit_wait */ - /* reportio.c */ unsigned int cob_col_just_lrc; /* Justify data in column LEFT/RIGHT/CENTER */ @@ -457,9 +456,6 @@ COB_HIDDEN void cob_exit_intrinsic (void); COB_HIDDEN void cob_exit_strings (void); COB_HIDDEN void cob_exit_mlio (void); -COB_HIDDEN void cob_exit_strings_mt -(struct inspect_state *, struct unstring_state *); /* multi-thread version */ - COB_HIDDEN FILE *cob_create_tmpfile (const char *); COB_HIDDEN int cob_check_numval_f (const cob_field *); @@ -492,6 +488,10 @@ COB_HIDDEN const char *cob_get_last_exception_name (void); COB_HIDDEN void cob_parameter_check (const char *, const int); COB_HIDDEN char* cob_get_strerror (void); +/* string.c */ +COB_HIDDEN void cob_str_memcpy (cob_field*, unsigned char*, const int size); +COB_HIDDEN void alloc_figurative (const cob_field*, const cob_field*); + enum cob_case_modifier { CCM_NONE, CCM_LOWER, diff --git a/libcob/common.h b/libcob/common.h index 357ce718d..7c6b60416 100644 --- a/libcob/common.h +++ b/libcob/common.h @@ -1249,26 +1249,26 @@ typedef struct __cob_screen { } cob_screen; /* String structure */ -struct inspect_state { +struct cob_inspect_state { cob_field *var; unsigned char *data; unsigned char *start; unsigned char *end; unsigned char *mark; /* buffer to marker only: 0/1 */ size_t mark_size; /* size of internal marker elements, increased up to - the maximum needed (biggest target field size) */ + the maximum needed (biggest target field size) */ size_t mark_min; /* min. position of the marker set by the last initialize */ size_t mark_max; /* max. position of the marker set by the last initialize */ unsigned char *repdata; /* contains data for REPLACING which is applied at end */ size_t repdata_size; /* size of internal repdata buffer, increased up to - the maximum needed (biggest target field size) */ + the maximum needed (biggest target field size) */ size_t size; cob_u32_t replacing; /* marker about current operation being INSPECT REPLACING */ int sign; cob_field var_copy; }; -struct string_state { +struct cob_string_state { cob_field *dst; cob_field *ptr; cob_field *dlm; @@ -1278,19 +1278,19 @@ struct string_state { int offset; }; -struct unstring_state { +struct cob_unstring_state { struct dlm_struct *dlm_list; - cob_field *src; - cob_field *ptr; - size_t dlm_list_size; /* size of internal delimiter elements, increased up to - the maximum needed (amount of DELIMITED BY), - actual size of dlm_list is calculated by - dlm_list_size * sizeof(dlm_struct) */ - cob_field src_copy; - cob_field ptr_copy; - int offset; - int count; - int ndlms; + cob_field *src; + cob_field *ptr; + size_t dlm_list_size; /* size of internal delimiter elements, increased up to + the maximum needed (amount of DELIMITED BY), + actual size of dlm_list is calculated by + dlm_list_size * sizeof(dlm_struct) */ + cob_field src_copy; + cob_field ptr_copy; + int offset; + int count; + int ndlms; }; /* Module structure */ @@ -1986,6 +1986,35 @@ COB_EXPIMP int cob_bcd_cmp_zero (cob_field *); /*******************************/ /* Functions in strings.c */ +/* Thread-safe inspect */ +void cob_inspect_init_mt (struct cob_inspect_state **, cob_field *, const cob_u32_t); +void cob_inspect_init_converting_mt (struct cob_inspect_state **, cob_field *); +COB_EXPIMP void cob_inspect_start_mt (struct cob_inspect_state *); +COB_EXPIMP void cob_inspect_before_mt (struct cob_inspect_state *, const cob_field *); +COB_EXPIMP void cob_inspect_after_mt (struct cob_inspect_state *, const cob_field *); +COB_EXPIMP void cob_inspect_characters_mt (struct cob_inspect_state *, cob_field *); +COB_EXPIMP void cob_inspect_all_mt (struct cob_inspect_state *, cob_field *, cob_field *); +COB_EXPIMP void cob_inspect_leading_mt (struct cob_inspect_state *, cob_field *, cob_field *); +COB_EXPIMP void cob_inspect_first_mt (struct cob_inspect_state *, cob_field *, cob_field *); +COB_EXPIMP void cob_inspect_trailing_mt (struct cob_inspect_state *, cob_field *, cob_field *); +COB_EXPIMP void cob_inspect_converting_mt (struct cob_inspect_state *, const cob_field *, const cob_field *); +COB_EXPIMP void cob_inspect_translating_mt (struct cob_inspect_state *, const unsigned char *); +COB_EXPIMP void cob_inspect_finish_mt (struct cob_inspect_state *); + +/* Thread-safe string */ +void cob_string_init_mt (struct cob_string_state **, cob_field *, cob_field *); +COB_EXPIMP void cob_string_delimited_mt (struct cob_string_state *, cob_field *); +COB_EXPIMP void cob_string_append_mt (struct cob_string_state *, cob_field *); +COB_EXPIMP void cob_string_finish_mt (struct cob_string_state *); + +/* Thread-safe unstring */ +void cob_unstring_init_mt (struct cob_unstring_state **, cob_field *, cob_field *, const size_t); +COB_EXPIMP void cob_unstring_delimited_mt (struct cob_unstring_state *, cob_field *, const cob_u32_t); +COB_EXPIMP void cob_unstring_into_mt (struct cob_unstring_state *, cob_field *, cob_field *, cob_field *); +COB_EXPIMP void cob_unstring_tallying_mt (struct cob_unstring_state *, cob_field *); +COB_EXPIMP void cob_unstring_finish_mt (struct cob_unstring_state *); + +/* Compat-only functions for old programs */ COB_EXPIMP void cob_inspect_init (cob_field *, const cob_u32_t); COB_EXPIMP void cob_inspect_init_converting (cob_field *); COB_EXPIMP void cob_inspect_start (void); @@ -2017,34 +2046,6 @@ COB_EXPIMP const char *COB_SPACES_ALPHABETIC; /* PIC X/A/U SPACES */ COB_EXPIMP const char *COB_ZEROES_ALPHABETIC; /* PIC X/A/U ZEROES */ #define COB_ZEROES_ALPHABETIC_BYTE_LENGTH 256 -/* Multithread inspect */ -void cob_inspect_init_mt (struct inspect_state **, cob_field *, const cob_u32_t); -void cob_inspect_init_converting_mt (struct inspect_state **, cob_field *); -COB_EXPIMP void cob_inspect_start_mt (struct inspect_state *); -COB_EXPIMP void cob_inspect_before_mt (struct inspect_state *, const cob_field *); -COB_EXPIMP void cob_inspect_after_mt (struct inspect_state *, const cob_field *); -COB_EXPIMP void cob_inspect_characters_mt (struct inspect_state *, cob_field *); -COB_EXPIMP void cob_inspect_all_mt (struct inspect_state *, cob_field *, cob_field *); -COB_EXPIMP void cob_inspect_leading_mt (struct inspect_state *, cob_field *, cob_field *); -COB_EXPIMP void cob_inspect_first_mt (struct inspect_state *, cob_field *, cob_field *); -COB_EXPIMP void cob_inspect_trailing_mt (struct inspect_state *, cob_field *, cob_field *); -COB_EXPIMP void cob_inspect_converting_mt (struct inspect_state *, const cob_field *, const cob_field *); -COB_EXPIMP void cob_inspect_translating_mt (struct inspect_state *, const unsigned char *); -COB_EXPIMP void cob_inspect_finish_mt (struct inspect_state *); - -/* Multithread string */ -void cob_string_init_mt (struct string_state **, cob_field *, cob_field *); -COB_EXPIMP void cob_string_delimited_mt (struct string_state *, cob_field *); -COB_EXPIMP void cob_string_append_mt (struct string_state *, cob_field *); -COB_EXPIMP void cob_string_finish_mt (struct string_state *); - -/* Multithread unstring */ -void cob_unstring_init_mt (struct unstring_state **, cob_field *, cob_field *, const size_t); -COB_EXPIMP void cob_unstring_delimited_mt (struct unstring_state *, cob_field *, const cob_u32_t); -COB_EXPIMP void cob_unstring_into_mt (struct unstring_state *, cob_field *, cob_field *, cob_field *); -COB_EXPIMP void cob_unstring_tallying_mt (struct unstring_state *, cob_field *); -COB_EXPIMP void cob_unstring_finish_mt (struct unstring_state *); - /*******************************/ /* Functions in move.c */ /*******************************/ diff --git a/libcob/strings.c b/libcob/strings.c index 9d4433a0b..266876ab7 100644 --- a/libcob/strings.c +++ b/libcob/strings.c @@ -51,17 +51,20 @@ struct dlm_struct { static cob_global *cobglobptr = NULL; static const cob_field_attr const_alpha_attr = - {COB_TYPE_ALPHANUMERIC, 0, 0, 0, NULL}; + {COB_TYPE_ALPHANUMERIC, 0, 0, 0, NULL}; static const cob_field_attr const_strall_attr = - {COB_TYPE_ALPHANUMERIC_ALL, 0, 0, 0, NULL}; + {COB_TYPE_ALPHANUMERIC_ALL, 0, 0, 0, NULL}; /* Static structures for backward compatibility */ -static struct inspect_state share_inspect_state; -static struct string_state share_string_state; -static struct unstring_state share_unstring_state; -static struct inspect_state *pshare_inspect_state = &share_inspect_state; -static struct string_state *pshare_string_state = &share_string_state; -static struct unstring_state *pshare_unstring_state = &share_unstring_state; +static struct cob_inspect_state share_inspect_state; +static struct cob_string_state share_string_state; +static struct cob_unstring_state share_unstring_state; +static struct cob_inspect_state *pshare_inspect_state = + &share_inspect_state; +static struct cob_string_state *pshare_string_state = + &share_string_state; +static struct cob_unstring_state *pshare_unstring_state = + &share_unstring_state; unsigned char *figurative_ptr; size_t figurative_size; @@ -82,7 +85,7 @@ cob_str_memcpy (cob_field *dst, unsigned char *src, const int size) } void -alloc_figurative (struct inspect_state *st, const cob_field *f1, const cob_field *f2) +alloc_figurative (const cob_field *f1, const cob_field *f2) { const size_t size2 = f2->size; @@ -139,7 +142,7 @@ alloc_figurative (struct inspect_state *st, const cob_field *f1, const cob_field changed to correctly handle multiple replacements with BEFORE/AFTER clauses */ COB_INLINE COB_A_INLINE void -setup_repdata (struct inspect_state *st) +setup_repdata (struct cob_inspect_state *st) { /* implementation note: A version that memcpy'd the complete data to repdata @@ -167,8 +170,8 @@ setup_repdata (struct inspect_state *st) } } -COB_INLINE COB_A_INLINE unsigned char * -inspect_find_data (struct inspect_state *st, const cob_field *str) +static COB_INLINE COB_A_INLINE unsigned char * +inspect_find_data (struct cob_inspect_state *st, const cob_field *str) { const unsigned char *data = str->data; const size_t len = str->size; @@ -189,9 +192,9 @@ inspect_find_data (struct inspect_state *st, const cob_field *str) return NULL; } -COB_INLINE COB_A_INLINE void +static COB_INLINE COB_A_INLINE void set_inspect_mark ( - struct inspect_state *st, + struct cob_inspect_state *st, const size_t pos, const size_t length ) @@ -208,8 +211,8 @@ set_inspect_mark ( } /* check for an area in the marker to be non-zero */ -COB_INLINE COB_A_INLINE int -is_marked (struct inspect_state *st, size_t pos, size_t length) +static COB_INLINE COB_A_INLINE int +is_marked (struct cob_inspect_state *st, size_t pos, size_t length) { /* no need to check further if there's no mark or no possible overlap ... */ if (st->mark[st->mark_min] == 0 @@ -236,9 +239,9 @@ is_marked (struct inspect_state *st, size_t pos, size_t length) return 0; } -void +static void inspect_common_no_replace ( - struct inspect_state *st, + struct cob_inspect_state *st, cob_field *f1, cob_field *f2, const enum inspect_type type, @@ -319,9 +322,9 @@ inspect_common_no_replace ( } } -COB_INLINE COB_A_INLINE int +static COB_INLINE COB_A_INLINE int do_mark ( - struct inspect_state *st, + struct cob_inspect_state *st, const size_t pos, const size_t length, unsigned char *replace_data @@ -343,9 +346,9 @@ do_mark ( return 1; } -void +static void inspect_common_replacing ( - struct inspect_state *st, + struct cob_inspect_state *st, cob_field *f1, cob_field *f2, const enum inspect_type type, @@ -403,9 +406,9 @@ inspect_common_replacing ( } } -void +static void inspect_common ( - struct inspect_state *st, + struct cob_inspect_state *st, cob_field *f1, cob_field *f2, const enum inspect_type type @@ -439,7 +442,7 @@ inspect_common ( } else { if (f1->size != f2->size) { if (COB_FIELD_TYPE (f1) == COB_TYPE_ALPHANUMERIC_ALL) { - alloc_figurative (st, f1, f2); + alloc_figurative (f1, f2); f1 = &alpha_fld; } else { cob_set_exception (COB_EC_RANGE_INSPECT_SIZE); @@ -467,15 +470,15 @@ inspect_common ( cob_inspect_leading/cob_inspect_trailing/cob_inspect_first one-time cob_inspect_finish (copying the REPLACING characters back) */ -COB_INLINE COB_A_INLINE void -cob_inspect_init_common_mt (struct inspect_state **pst, cob_field *var) +static COB_INLINE COB_A_INLINE void +cob_inspect_init_common_mt (struct cob_inspect_state **pst, cob_field *var) { if (*pst == NULL) { - *pst = malloc (sizeof(struct inspect_state)); + *pst = malloc (sizeof(struct cob_inspect_state)); (*pst)->mark = NULL; (*pst)->repdata = NULL; } - struct inspect_state *st = *pst; + struct cob_inspect_state *st = *pst; if (COB_FIELD_HAVE_SIGN (var) && !COB_FIELD_SIGN_SEPARATE(var)) { /* it is allowed to TRANSFORM / INSPECT a numeric display signed element; @@ -497,10 +500,10 @@ cob_inspect_init_common_mt (struct inspect_state **pst, cob_field *var) cobglobptr->cob_exception_code = 0; } void -cob_inspect_init_mt (struct inspect_state **pst, cob_field *var, const cob_u32_t replacing) +cob_inspect_init_mt (struct cob_inspect_state **pst, cob_field *var, const cob_u32_t replacing) { cob_inspect_init_common_mt (pst, var); - struct inspect_state *st = *pst; + struct cob_inspect_state *st = *pst; st->replacing = replacing; if (st->size > st->mark_size) { @@ -538,10 +541,10 @@ cob_inspect_init (cob_field *var, const cob_u32_t replacing) one-time cob_inspect_converting/cob_inspect_translating (actual converstion) */ void -cob_inspect_init_converting_mt (struct inspect_state **pst, cob_field *var) +cob_inspect_init_converting_mt (struct cob_inspect_state **pst, cob_field *var) { cob_inspect_init_common_mt (pst, var); - struct inspect_state *st = *pst; + struct cob_inspect_state *st = *pst; st->replacing = 0; /* only set for pre 3.2 compat because of cob_inspect_finish */ } void @@ -551,7 +554,7 @@ cob_inspect_init_converting (cob_field *var) } void -cob_inspect_start_mt (struct inspect_state *st) +cob_inspect_start_mt (struct cob_inspect_state *st) { st->start = st->data; st->end = st->data + st->size; @@ -563,7 +566,7 @@ cob_inspect_start (void) } void -cob_inspect_before_mt (struct inspect_state *st, const cob_field *str) +cob_inspect_before_mt (struct cob_inspect_state *st, const cob_field *str) { unsigned char *data_pos = inspect_find_data (st, str); if (data_pos) @@ -576,7 +579,7 @@ cob_inspect_before (const cob_field *str) } void -cob_inspect_after_mt (struct inspect_state *st, const cob_field *str) +cob_inspect_after_mt (struct cob_inspect_state *st, const cob_field *str) { unsigned char *data_pos = inspect_find_data (st, str); if (data_pos) @@ -591,7 +594,7 @@ cob_inspect_after (const cob_field *str) } void -cob_inspect_characters_mt (struct inspect_state *st, cob_field *f1) +cob_inspect_characters_mt (struct cob_inspect_state *st, cob_field *f1) { const size_t pos = st->start - st->data; const size_t len = st->end - st->start; @@ -653,7 +656,7 @@ cob_inspect_characters (cob_field *f1) } void -cob_inspect_all_mt (struct inspect_state *st, cob_field *f1, cob_field *f2) +cob_inspect_all_mt (struct cob_inspect_state *st, cob_field *f1, cob_field *f2) { inspect_common (st, f1, f2, INSPECT_ALL); } @@ -664,7 +667,7 @@ cob_inspect_all (cob_field *f1, cob_field *f2) } void -cob_inspect_leading_mt (struct inspect_state *st, cob_field *f1, cob_field *f2) +cob_inspect_leading_mt (struct cob_inspect_state *st, cob_field *f1, cob_field *f2) { inspect_common (st, f1, f2, INSPECT_LEADING); } @@ -675,7 +678,7 @@ cob_inspect_leading (cob_field *f1, cob_field *f2) } void -cob_inspect_first_mt (struct inspect_state *st, cob_field *f1, cob_field *f2) +cob_inspect_first_mt (struct cob_inspect_state *st, cob_field *f1, cob_field *f2) { inspect_common (st, f1, f2, INSPECT_FIRST); } @@ -686,7 +689,7 @@ cob_inspect_first (cob_field *f1, cob_field *f2) } void -cob_inspect_trailing_mt (struct inspect_state *st, cob_field *f1, cob_field *f2) +cob_inspect_trailing_mt (struct cob_inspect_state *st, cob_field *f1, cob_field *f2) { inspect_common (st, f1, f2, INSPECT_TRAILING); } @@ -698,7 +701,7 @@ cob_inspect_trailing (cob_field *f1, cob_field *f2) void cob_inspect_converting_mt ( - struct inspect_state *st, + struct cob_inspect_state *st, const cob_field *f1, const cob_field *f2 ) @@ -719,7 +722,7 @@ cob_inspect_converting_mt ( } if (f1->size != f2->size) { if (COB_FIELD_TYPE (f2) == COB_TYPE_ALPHANUMERIC_ALL) { - alloc_figurative (st, f2, f1); + alloc_figurative (f2, f1); f2 = &alpha_fld; } else { cob_set_exception (COB_EC_RANGE_INSPECT_SIZE); @@ -814,7 +817,7 @@ cob_inspect_converting (const cob_field *f1, const cob_field *f2) /* note: currently not used by cobc (disabled unfinished prototype) */ void -cob_inspect_translating_mt (struct inspect_state *st, const unsigned char *conv_table) +cob_inspect_translating_mt (struct cob_inspect_state *st, const unsigned char *conv_table) { const size_t len = st->end - st->start; @@ -846,7 +849,7 @@ cob_inspect_translating (const unsigned char* conv_table) } void -cob_inspect_finish_mt (struct inspect_state *st) +cob_inspect_finish_mt (struct cob_inspect_state *st) { /* Note: this is not called any more for TRANSFORM/INSPECT CONVERTING since GnuCOBOL 3.2 codegen (only for "old modules")! */ @@ -891,11 +894,11 @@ cob_inspect_finish (void) one-time cob_string_finish (setting the string pointer) */ void -cob_string_init_mt (struct string_state **pst, cob_field *dst, cob_field *ptr) +cob_string_init_mt (struct cob_string_state **pst, cob_field *dst, cob_field *ptr) { if (*pst == NULL) - *pst = malloc (sizeof(struct string_state)); - struct string_state *st = *pst; + *pst = malloc (sizeof(struct cob_string_state)); + struct cob_string_state *st = *pst; st->dst_copy = *dst; st->dst = &st->dst_copy; @@ -922,7 +925,7 @@ cob_string_init (cob_field *dst, cob_field *ptr) } void -cob_string_delimited_mt (struct string_state *st, cob_field *dlm) +cob_string_delimited_mt (struct cob_string_state *st, cob_field *dlm) { if (dlm) { st->dlm_copy = *dlm; @@ -938,7 +941,7 @@ cob_string_delimited (cob_field *dlm) } void -cob_string_append_mt (struct string_state *st, cob_field *src) +cob_string_append_mt (struct cob_string_state *st, cob_field *src) { size_t src_size; int i; @@ -980,7 +983,7 @@ cob_string_append (cob_field *src) } void -cob_string_finish_mt (struct string_state *st) +cob_string_finish_mt (struct cob_string_state *st) { if (st->ptr) { cob_set_int (st->ptr, st->offset + 1); @@ -1006,17 +1009,17 @@ cob_string_finish (void) void cob_unstring_init_mt ( - struct unstring_state **pst, + struct cob_unstring_state **pst, cob_field *src, cob_field *ptr, const size_t num_dlm ) { if (*pst == NULL) { - *pst = malloc (sizeof(struct unstring_state)); + *pst = malloc (sizeof(struct cob_unstring_state)); (*pst)->dlm_list = NULL; } - struct unstring_state *st = *pst; + struct cob_unstring_state *st = *pst; st->src_copy = *src; st->src = &st->src_copy; @@ -1061,7 +1064,7 @@ cob_unstring_init ( } void -cob_unstring_delimited_mt (struct unstring_state *st, cob_field *dlm, const cob_u32_t all) +cob_unstring_delimited_mt (struct cob_unstring_state *st, cob_field *dlm, const cob_u32_t all) { st->dlm_list[st->ndlms].uns_dlm = *dlm; st->dlm_list[st->ndlms].uns_all = all; @@ -1075,7 +1078,7 @@ cob_unstring_delimited (cob_field *dlm, const cob_u32_t all) void cob_unstring_into_mt ( - struct unstring_state *st, + struct cob_unstring_state *st, cob_field *dst, cob_field *dlm, cob_field *cnt @@ -1223,7 +1226,7 @@ cob_unstring_into ( } void -cob_unstring_tallying_mt (struct unstring_state *st, cob_field *f) +cob_unstring_tallying_mt (struct cob_unstring_state *st, cob_field *f) { cob_add_int (f, st->count, 0); } @@ -1234,7 +1237,7 @@ cob_unstring_tallying (cob_field *f) } void -cob_unstring_finish_mt (struct unstring_state *st) +cob_unstring_finish_mt (struct cob_unstring_state *st) { if (st->offset < (int)st->src->size) { /* overflow from any iteration -> overflow exception */ @@ -1254,8 +1257,11 @@ cob_unstring_finish (void) /* Initialization/Termination */ void -cob_exit_strings_mt (struct inspect_state *sti, struct unstring_state *stu) +cob_exit_strings () { + struct cob_inspect_state *sti = &share_inspect_state; + struct cob_unstring_state *stu = &share_unstring_state; + if (sti->mark) { cob_free (sti->mark); sti->mark = NULL; @@ -1279,14 +1285,9 @@ cob_exit_strings_mt (struct inspect_state *sti, struct unstring_state *stu) } figurative_size = 0; } -void -cob_exit_strings (void) -{ - cob_exit_strings_mt (&share_inspect_state, &share_unstring_state); -} void -cob_init_strings_mt (struct inspect_state *st, cob_global *lptr) +cob_init_strings (cob_global *lptr) { cobglobptr = lptr; @@ -1301,8 +1302,3 @@ cob_init_strings_mt (struct inspect_state *st, cob_global *lptr) str_cob_low.data = (cob_u8_ptr)"\0"; str_cob_low.attr = &const_strall_attr; } -void -cob_init_strings (cob_global *lptr) -{ - cob_init_strings_mt (&share_inspect_state, lptr); -} diff --git a/tests/ChangeLog b/tests/ChangeLog index 1ab1637f8..d64a60242 100644 --- a/tests/ChangeLog +++ b/tests/ChangeLog @@ -2,8 +2,8 @@ 2024-02-26 Boris Eng * testsuite.at: added a new test suite to test the backward compatibility - of strings functions (INSPECT, STRING, UNSTRING) for versions of compilers - not using multithreaded functions for strings + of strings functions (INSPECT, STRING, UNSTRING) for versions of compilers + not using thread-safe functions for strings 2023-07-10 Simon Sobisch diff --git a/tests/Makefile.am b/tests/Makefile.am index c4acdbff9..1f6027245 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -64,7 +64,8 @@ testsuite_sources = \ testsuite.src/data_packed.at \ testsuite.src/data_pointer.at \ testsuite.src/numeric-dump.cob \ - testsuite.src/numeric-display.cob + testsuite.src/numeric-display.cob \ + testsuite.src/backcomp.at testsuite_manual_sources = \ testsuite.src/run_manual_screen.at diff --git a/tests/testsuite.at b/tests/testsuite.at index 07381d0fc..a40cc5e67 100644 --- a/tests/testsuite.at +++ b/tests/testsuite.at @@ -82,6 +82,6 @@ m4_include([data_display.at]) # USAGE DISPLAY m4_include([data_packed.at]) # USAGE PACKED-DECIMAL m4_include([data_pointer.at]) # USAGE POINTER -## Test for backward compatibility of libcob -AT_BANNER([Backward compatibility of libcob]) -m4_include([backcomp_strings.at]) # INSPECT, STRING, UNSTRING +## Test for backward compatibility +AT_BANNER([Backward compatibility]) +m4_include([backcomp.at]) diff --git a/tests/testsuite.src/backcomp_strings.at b/tests/testsuite.src/backcomp_strings.at deleted file mode 100644 index 78bbbfeff..000000000 --- a/tests/testsuite.src/backcomp_strings.at +++ /dev/null @@ -1,10029 +0,0 @@ -AT_SETUP([INSPECT REPLACING LEADING ZEROS BY SPACES]) -AT_KEYWORDS([runmisc]) - -AT_DATA([prog.c], [[ -/* Generated by cobc 3.3-dev.0 */ -/* Generated from prog.cob */ -/* Generated at févr. 23 2024 16:25:59 */ -/* GnuCOBOL build date Feb 21 2024 15:41:43 */ -/* GnuCOBOL package date Feb 01 2024 13:58:21 UTC */ -/* Compile command cobc -Cx prog.cob */ - -#include /* for memcpy, memcmp and friends */ -#define COB_KEYWORD_INLINE __inline -#include - -#define COB_SOURCE_FILE "prog.cob" -#define COB_PACKAGE_VERSION "3.3-dev" -#define COB_PATCH_LEVEL 0 -#define COB_MODULE_FORMATTED_DATE "févr. 23 2024 16:25:59" -#define COB_MODULE_DATE 20240223 -#define COB_MODULE_TIME 162559 - -/* Global variables */ -#include "prog.c.h" - -/* Function prototypes */ - -static int prog (); -static int prog_ (const int); -static void prog_module_init (cob_module *module); - -/* Main function */ -int -main (int argc, char **argv) -{ - cob_init (argc, argv); - cob_stop_run (prog ()); -} - -/* Functions */ - -static void gc_module_so_init () __attribute__ ((constructor)); -static void gc_module_so_init () -{ - cob_check_version (COB_SOURCE_FILE, COB_PACKAGE_VERSION, COB_PATCH_LEVEL); -} - -/* PROGRAM-ID 'prog' */ - -/* ENTRY 'prog' */ - -static int -prog () -{ - return prog_ (0); -} - -static int -prog_ (const int entry) -{ - /* Program local variables */ - #include "prog.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; - - /* 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: 7 : Entry prog : prog.cob */ - l_2:; - - /* Line: 7 : INSPECT : prog.cob */ - cob_inspect_init (&f_17, 1); - cob_inspect_start (); - cob_inspect_leading (&cob_all_space, &cob_all_zero); - cob_inspect_finish (); - - /* Line: 8 : IF : prog.cob */ - if (((int)memcmp (b_17, (cob_u8_ptr)" 1", 4) != 0)) - { - - /* Line: 9 : DISPLAY : prog.cob */ - cob_display (0, 1, 3, &c_1, &f_17, &c_2); - } - - /* Line: 10 : STOP RUN : prog.cob */ - cob_stop_run (b_2); - - /* 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_module_path = cob_glob_ptr->cob_main_argv0; - - prog_module_init (module); - - module->collating_sequence = NULL; - module->crt_status = NULL; - module->cursor_pos = NULL; - module->xml_code = NULL; - module->xml_event = NULL; - module->xml_information = NULL; - module->xml_namespace = NULL; - module->xml_namespace_prefix = NULL; - module->xml_nnamespace = NULL; - module->xml_nnamespace_prefix = NULL; - module->xml_ntext = NULL; - module->xml_text = NULL; - module->json_code = NULL; - module->json_status = NULL; - - /* Initialize cancel callback */ - cob_set_cancel (module); - - /* Initialize WORKING-STORAGE */ - /* initialize field RETURN-CODE */ - b_2 = 0; - - /* initialize field X */ - memcpy (b_17, "0001", 4); - - - 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 'prog' */ - -/* Initialize module structure for prog */ -static void prog_module_init (cob_module *module) -{ - module->module_name = "prog"; - module->module_formatted_date = COB_MODULE_FORMATTED_DATE; - module->module_source = COB_SOURCE_FILE; - module->gc_version = COB_PACKAGE_VERSION; - module->module_entry.funcptr = (void *(*)())prog; - module->module_cancel.funcptr = (void *(*)())prog_; - 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->xml_mode = 1; - module->module_stmt = 0; - module->module_sources = NULL; -} - -/* End functions */ - - -]]) - -AT_DATA([prog.c.h], [[ -/* Generated by cobc 3.3-dev.0 */ -/* Generated from prog.cob */ -/* Generated at févr. 23 2024 16:25:59 */ -/* GnuCOBOL build date Feb 21 2024 15:41:43 */ -/* GnuCOBOL package date Feb 01 2024 13:58:21 UTC */ -/* Compile command cobc -Cx prog.cob */ - - -/* Module path */ -static const char *cob_module_path = NULL; - -/* Number of call parameters */ -static int cob_call_params = 0; - -/* Attributes */ - -static const cob_field_attr a_1 = {0x21, 0, 0, 0x0000, NULL}; -static const cob_field_attr a_2 = {0x21, 0, 0, 0x1000, NULL}; - -static const cob_field_attr cob_all_attr = {0x22, 0, 0, 0, NULL}; - - -/* Constants */ -static const cob_field c_1 = {25, (cob_u8_ptr)"Should be ' 1' but is '", &a_2}; -static const cob_field c_2 = {1, (cob_u8_ptr)"'", &a_2}; - -static cob_field cob_all_space = {1, (cob_u8_ptr)" ", &cob_all_attr}; -static cob_field cob_all_zero = {1, (cob_u8_ptr)"0", &cob_all_attr}; - - -]]) - -AT_DATA([prog.c.l.h], [[ -/* Generated by cobc 3.3-dev.0 */ -/* Generated from prog.cob */ -/* Generated at févr. 23 2024 16:25:59 */ -/* GnuCOBOL build date Feb 21 2024 15:41:43 */ -/* GnuCOBOL package date Feb 01 2024 13:58:21 UTC */ -/* Compile command cobc -Cx prog.cob */ - -/* Program local variables for 'prog' */ - -/* Module initialization indicator */ -static unsigned int initialized = 0; - -/* Module structure pointer */ -static cob_module *module = NULL; - -/* Global variable pointer */ -cob_global *cob_glob_ptr; - - -/* LINKAGE SECTION (Items not referenced by USING clause) */ -static unsigned char *b_9 = NULL; /* XML-NAMESPACE */ -static unsigned char *b_10 = NULL; /* XML-NAMESPACE-PREFIX */ -static unsigned char *b_11 = NULL; /* XML-NNAMESPACE */ -static unsigned char *b_12 = NULL; /* XML-NNAMESPACE-PREFIX */ -static unsigned char *b_13 = NULL; /* XML-NTEXT */ -static unsigned char *b_14 = NULL; /* XML-TEXT */ - - -/* Call parameters */ -cob_field *cob_procedure_params[1]; - -/* Perform frame stack */ -struct cob_frame *frame_ptr; -struct cob_frame frame_stack[255]; - - -/* Data storage */ -static int b_2; /* RETURN-CODE */ -static cob_u8_t b_17[4] __attribute__((aligned)); /* X */ - -/* End of local data storage */ - - -/* Fields (local) */ -static cob_field f_17 = {4, b_17, &a_1}; /* X */ - -/* End of fields */ - - -]]) - -AT_CHECK([$COMPILE prog.c], [0], [], []) -AT_CHECK([$COBCRUN_DIRECT ./prog], [0], [], []) - -AT_CLEANUP - -AT_SETUP([INSPECT: no repeat conversion]) -AT_KEYWORDS([runmisc INSPECT]) - -AT_DATA([prog.c], [[ -/* Generated by cobc 3.3-dev.0 */ -/* Generated from prog.cob */ -/* Generated at févr. 23 2024 16:34:28 */ -/* GnuCOBOL build date Feb 21 2024 15:41:43 */ -/* GnuCOBOL package date Feb 01 2024 13:58:21 UTC */ -/* Compile command cobc -Cx prog.cob */ - -#include /* for memcpy, memcmp and friends */ -#define COB_KEYWORD_INLINE __inline -#include - -#define COB_SOURCE_FILE "prog.cob" -#define COB_PACKAGE_VERSION "3.3-dev" -#define COB_PATCH_LEVEL 0 -#define COB_MODULE_FORMATTED_DATE "févr. 23 2024 16:34:28" -#define COB_MODULE_DATE 20240223 -#define COB_MODULE_TIME 163428 - -/* Global variables */ -#include "prog.c.h" - -/* Function prototypes */ - -static int prog (); -static int prog_ (const int); -static void prog_module_init (cob_module *module); - -/* Main function */ -int -main (int argc, char **argv) -{ - cob_init (argc, argv); - cob_stop_run (prog ()); -} - -/* Functions */ - -static void gc_module_so_init () __attribute__ ((constructor)); -static void gc_module_so_init () -{ - cob_check_version (COB_SOURCE_FILE, COB_PACKAGE_VERSION, COB_PATCH_LEVEL); -} - -/* PROGRAM-ID 'prog' */ - -/* ENTRY 'prog' */ - -static int -prog () -{ - return prog_ (0); -} - -static int -prog_ (const int entry) -{ - /* Program local variables */ - #include "prog.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; - - /* 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: 8 : Entry prog : prog.cob */ - l_2:; - - /* Line: 8 : INSPECT : prog.cob */ - cob_inspect_init_converting (&f_17); - cob_inspect_start (); - cob_inspect_converting ((cob_field *)&c_1, (cob_field *)&c_2); - - /* Line: 9 : IF : prog.cob */ - if (((int)memcmp (b_17, (cob_u8_ptr)"CDB", 3) != 0)) - { - - /* Line: 10 : DISPLAY : prog.cob */ - cob_display (0, 1, 2, &c_3, &f_17); - } - - /* Line: 11 : INSPECT : prog.cob */ - cob_inspect_init_converting (&f_18); - cob_inspect_start (); - cob_inspect_converting ((cob_field *)&c_1, (cob_field *)&c_2); - - /* Line: 12 : IF : prog.cob */ - if (((int)memcmp (b_18, (cob_u8_ptr)" CDB", 6) != 0)) - { - - /* Line: 13 : DISPLAY : prog.cob */ - cob_display (0, 1, 2, &c_4, &f_18); - } - - /* Line: 14 : STOP RUN : prog.cob */ - cob_stop_run (b_2); - - /* 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_module_path = cob_glob_ptr->cob_main_argv0; - - prog_module_init (module); - - module->collating_sequence = NULL; - module->crt_status = NULL; - module->cursor_pos = NULL; - module->xml_code = NULL; - module->xml_event = NULL; - module->xml_information = NULL; - module->xml_namespace = NULL; - module->xml_namespace_prefix = NULL; - module->xml_nnamespace = NULL; - module->xml_nnamespace_prefix = NULL; - module->xml_ntext = NULL; - module->xml_text = NULL; - module->json_code = NULL; - module->json_status = NULL; - - /* Initialize cancel callback */ - cob_set_cancel (module); - - /* Initialize WORKING-STORAGE */ - /* initialize field RETURN-CODE */ - b_2 = 0; - - /* initialize field X */ - memcpy (b_17, "BCA", 3); - - /* initialize field Y */ - memcpy (b_18, " BCA", 6); - - - 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 'prog' */ - -/* Initialize module structure for prog */ -static void prog_module_init (cob_module *module) -{ - module->module_name = "prog"; - module->module_formatted_date = COB_MODULE_FORMATTED_DATE; - module->module_source = COB_SOURCE_FILE; - module->gc_version = COB_PACKAGE_VERSION; - module->module_entry.funcptr = (void *(*)())prog; - module->module_cancel.funcptr = (void *(*)())prog_; - 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->xml_mode = 1; - module->module_stmt = 0; - module->module_sources = NULL; -} - -/* End functions */ - - -]]) - -AT_DATA([prog.c.h], [[ -/* Generated by cobc 3.3-dev.0 */ -/* Generated from prog.cob */ -/* Generated at févr. 23 2024 16:34:28 */ -/* GnuCOBOL build date Feb 21 2024 15:41:43 */ -/* GnuCOBOL package date Feb 01 2024 13:58:21 UTC */ -/* Compile command cobc -Cx prog.cob */ - - -/* Module path */ -static const char *cob_module_path = NULL; - -/* Number of call parameters */ -static int cob_call_params = 0; - -/* Attributes */ - -static const cob_field_attr a_1 = {0x21, 0, 0, 0x0000, NULL}; -static const cob_field_attr a_2 = {0x21, 0, 0, 0x1000, NULL}; - - -/* Constants */ -static const cob_field c_1 = {3, (cob_u8_ptr)"ABC", &a_2}; -static const cob_field c_2 = {3, (cob_u8_ptr)"BCD", &a_2}; -static const cob_field c_3 = {3, (cob_u8_ptr)"X: ", &a_2}; -static const cob_field c_4 = {3, (cob_u8_ptr)"Y: ", &a_2}; - - -]]) - -AT_DATA([prog.c.l.h], [[ -/* Generated by cobc 3.3-dev.0 */ -/* Generated from prog.cob */ -/* Generated at févr. 23 2024 16:34:28 */ -/* GnuCOBOL build date Feb 21 2024 15:41:43 */ -/* GnuCOBOL package date Feb 01 2024 13:58:21 UTC */ -/* Compile command cobc -Cx prog.cob */ - -/* Program local variables for 'prog' */ - -/* Module initialization indicator */ -static unsigned int initialized = 0; - -/* Module structure pointer */ -static cob_module *module = NULL; - -/* Global variable pointer */ -cob_global *cob_glob_ptr; - - -/* LINKAGE SECTION (Items not referenced by USING clause) */ -static unsigned char *b_9 = NULL; /* XML-NAMESPACE */ -static unsigned char *b_10 = NULL; /* XML-NAMESPACE-PREFIX */ -static unsigned char *b_11 = NULL; /* XML-NNAMESPACE */ -static unsigned char *b_12 = NULL; /* XML-NNAMESPACE-PREFIX */ -static unsigned char *b_13 = NULL; /* XML-NTEXT */ -static unsigned char *b_14 = NULL; /* XML-TEXT */ - - -/* Call parameters */ -cob_field *cob_procedure_params[1]; - -/* Perform frame stack */ -struct cob_frame *frame_ptr; -struct cob_frame frame_stack[255]; - - -/* Data storage */ -static int b_2; /* RETURN-CODE */ -static cob_u8_t b_17[3] __attribute__((aligned)); /* X */ -static cob_u8_t b_18[6] __attribute__((aligned)); /* Y */ - -/* End of local data storage */ - - -/* Fields (local) */ -static cob_field f_17 = {3, b_17, &a_1}; /* X */ -static cob_field f_18 = {6, b_18, &a_1}; /* Y */ - -/* End of fields */ - - -]]) - -AT_CHECK([$COMPILE prog.c], [0], [], []) -AT_CHECK([$COBCRUN_DIRECT ./prog], [0], [], []) - -AT_CLEANUP - - -AT_SETUP([TRANSFORM statement]) -AT_KEYWORDS([runmisc CONVERTING ALPHABET]) - -AT_DATA([prog.c], [[ -/* Generated by cobc 3.3-dev.0 */ -/* Generated from prog.cob */ -/* Generated at févr. 23 2024 16:35:38 */ -/* GnuCOBOL build date Feb 21 2024 15:41:43 */ -/* GnuCOBOL package date Feb 01 2024 13:58:21 UTC */ -/* Compile command cobc -Cx prog.cob */ - -#include /* for memcpy, memcmp and friends */ -#define COB_KEYWORD_INLINE __inline -#include - -#define COB_SOURCE_FILE "prog.cob" -#define COB_PACKAGE_VERSION "3.3-dev" -#define COB_PATCH_LEVEL 0 -#define COB_MODULE_FORMATTED_DATE "févr. 23 2024 16:35:38" -#define COB_MODULE_DATE 20240223 -#define COB_MODULE_TIME 163538 - -/* Global variables */ -#include "prog.c.h" - -/* Function prototypes */ - -static int prog (); -static int prog_ (const int); -static void prog_module_init (cob_module *module); - -/* Main function */ -int -main (int argc, char **argv) -{ - cob_init (argc, argv); - cob_stop_run (prog ()); -} - -/* Functions */ - -static void gc_module_so_init () __attribute__ ((constructor)); -static void gc_module_so_init () -{ - cob_check_version (COB_SOURCE_FILE, COB_PACKAGE_VERSION, COB_PATCH_LEVEL); -} - -/* PROGRAM-ID 'prog' */ - -/* ENTRY 'prog' */ - -static int -prog () -{ - return prog_ (0); -} - -static int -prog_ (const int entry) -{ - /* Program local variables */ - #include "prog.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; - - /* 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: 15 : Entry prog : prog.cob */ - l_2:; - - /* Line: 15 : TRANSFORM : prog.cob */ - cob_inspect_init_converting (&f_17); - cob_inspect_start (); - cob_inspect_converting ((cob_field *)&c_1, (cob_field *)&c_2); - - /* Line: 16 : IF : prog.cob */ - if (((int)cob_cmp (&f_17, (cob_field *)&c_3) != 0)) - { - - /* Line: 17 : DISPLAY : prog.cob */ - cob_display (0, 1, 2, &c_4, &f_17); - } - - /* Line: 19 : TRANSFORM : prog.cob */ - cob_inspect_init_converting (&f_17); - cob_inspect_start (); - cob_inspect_converting (&f_native, &f_ascii_ebcdic); - - /* Line: 21 : STOP RUN : prog.cob */ - cob_stop_run (b_2); - - /* 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_module_path = cob_glob_ptr->cob_main_argv0; - - prog_module_init (module); - - module->collating_sequence = NULL; - module->crt_status = NULL; - module->cursor_pos = NULL; - module->xml_code = NULL; - module->xml_event = NULL; - module->xml_information = NULL; - module->xml_namespace = NULL; - module->xml_namespace_prefix = NULL; - module->xml_nnamespace = NULL; - module->xml_nnamespace_prefix = NULL; - module->xml_ntext = NULL; - module->xml_text = NULL; - module->json_code = NULL; - module->json_status = NULL; - - /* Initialize cancel callback */ - cob_set_cancel (module); - - /* Initialize WORKING-STORAGE */ - /* initialize field RETURN-CODE */ - b_2 = 0; - - /* initialize field X */ - memcpy (b_17, "BCA", 3); - - - 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 'prog' */ - -/* Initialize module structure for prog */ -static void prog_module_init (cob_module *module) -{ - module->module_name = "prog"; - module->module_formatted_date = COB_MODULE_FORMATTED_DATE; - module->module_source = COB_SOURCE_FILE; - module->gc_version = COB_PACKAGE_VERSION; - module->module_entry.funcptr = (void *(*)())prog; - module->module_cancel.funcptr = (void *(*)())prog_; - 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->xml_mode = 1; - module->module_stmt = 0; - module->module_sources = NULL; -} - -/* End functions */ - - -]]) - -AT_DATA([prog.c.h], [[ -/* Generated by cobc 3.3-dev.0 */ -/* Generated from prog.cob */ -/* Generated at févr. 23 2024 16:35:38 */ -/* GnuCOBOL build date Feb 21 2024 15:41:43 */ -/* GnuCOBOL package date Feb 01 2024 13:58:21 UTC */ -/* Compile command cobc -Cx prog.cob */ - - -/* Module path */ -static const char *cob_module_path = NULL; - -/* Number of call parameters */ -static int cob_call_params = 0; - -/* Attributes */ - -static const cob_field_attr a_1 = {0x21, 0, 0, 0x0000, NULL}; -static const cob_field_attr a_2 = {0x21, 0, 0, 0x1000, NULL}; - - -/* Constants */ -static const cob_field c_1 = {3, (cob_u8_ptr)"ABC", &a_2}; -static const cob_field c_2 = {3, (cob_u8_ptr)"BCD", &a_2}; -static const cob_field c_3 = {3, (cob_u8_ptr)"CDB", &a_2}; -static const cob_field c_4 = {3, (cob_u8_ptr)"X: ", &a_2}; - - -/* NATIVE table */ -static const unsigned char cob_native[256] = { - 0000, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, - 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, - 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, - 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, - 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, - 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, - 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, - 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, - 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, - 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, - 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, - 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, - 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, - 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, - 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, - 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, - 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, - 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, - 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, - 0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f, - 0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, - 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, - 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, - 0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf, - 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, - 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, - 0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, - 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf, - 0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, - 0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef, - 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, - 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff, -}; -static cob_field f_native = { 256, (cob_u8_ptr)cob_native, &a_1 }; - - -/* ASCII to EBCDIC table */ -static const unsigned char cob_ascii_ebcdic[256] = { - 0000, 0x01, 0x02, 0x03, 0x37, 0x2d, 0x2e, 0x2f, - 0x16, 0x05, 0x25, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, - 0x10, 0x11, 0x12, 0x13, 0x3c, 0x3d, 0x32, 0x26, - 0x18, 0x19, 0x3f, 0x27, 0x1c, 0x1d, 0x1e, 0x1f, - 0x40, 0x5a, 0x7f, 0x7b, 0x5b, 0x6c, 0x50, 0x7d, - 0x4d, 0x5d, 0x5c, 0x4e, 0x6b, 0x60, 0x4b, 0x61, - 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, - 0xf8, 0xf9, 0x7a, 0x5e, 0x4c, 0x7e, 0x6e, 0x6f, - 0x7c, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, - 0xc8, 0xc9, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, - 0xd7, 0xd8, 0xd9, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, - 0xe7, 0xe8, 0xe9, 0xad, 0xe0, 0xbd, 0x5f, 0x6d, - 0x79, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, - 0x88, 0x89, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, - 0x97, 0x98, 0x99, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, - 0xa7, 0xa8, 0xa9, 0xc0, 0x6a, 0xd0, 0xa1, 0x07, - 0x68, 0xdc, 0x51, 0x42, 0x43, 0x44, 0x47, 0x48, - 0x52, 0x53, 0x54, 0x57, 0x56, 0x58, 0x63, 0x67, - 0x71, 0x9c, 0x9e, 0xcb, 0xcc, 0xcd, 0xdb, 0xdd, - 0xdf, 0xec, 0xfc, 0xb0, 0xb1, 0xb2, 0x3e, 0xb4, - 0x45, 0x55, 0xce, 0xde, 0x49, 0x69, 0x9a, 0x9b, - 0xab, 0x9f, 0xba, 0xb8, 0xb7, 0xaa, 0x8a, 0x8b, - 0xb6, 0xb5, 0x62, 0x4f, 0x64, 0x65, 0x66, 0x20, - 0x21, 0x22, 0x70, 0x23, 0x72, 0x73, 0x74, 0xbe, - 0x76, 0x77, 0x78, 0x80, 0x24, 0x15, 0x8c, 0x8d, - 0x8e, 0x41, 0x06, 0x17, 0x28, 0x29, 0x9d, 0x2a, - 0x2b, 0x2c, 0x09, 0x0a, 0xac, 0x4a, 0xae, 0xaf, - 0x1b, 0x30, 0x31, 0xfa, 0x1a, 0x33, 0x34, 0x35, - 0x36, 0x59, 0x08, 0x38, 0xbc, 0x39, 0xa0, 0xbf, - 0xca, 0x3a, 0xfe, 0x3b, 0x04, 0xcf, 0xda, 0x14, - 0xe1, 0x8f, 0x46, 0x75, 0xfd, 0xeb, 0xee, 0xed, - 0x90, 0xef, 0xb3, 0xfb, 0xb9, 0xea, 0xbb, 0xff, -}; -static cob_field f_ascii_ebcdic = { 256, (cob_u8_ptr)cob_ascii_ebcdic, &a_1 }; - - -]]) - -AT_DATA([prog.c.l.h], [[ -/* Generated by cobc 3.3-dev.0 */ -/* Generated from prog.cob */ -/* Generated at févr. 23 2024 16:35:38 */ -/* GnuCOBOL build date Feb 21 2024 15:41:43 */ -/* GnuCOBOL package date Feb 01 2024 13:58:21 UTC */ -/* Compile command cobc -Cx prog.cob */ - -/* Program local variables for 'prog' */ - -/* Module initialization indicator */ -static unsigned int initialized = 0; - -/* Module structure pointer */ -static cob_module *module = NULL; - -/* Global variable pointer */ -cob_global *cob_glob_ptr; - - -/* LINKAGE SECTION (Items not referenced by USING clause) */ -static unsigned char *b_9 = NULL; /* XML-NAMESPACE */ -static unsigned char *b_10 = NULL; /* XML-NAMESPACE-PREFIX */ -static unsigned char *b_11 = NULL; /* XML-NNAMESPACE */ -static unsigned char *b_12 = NULL; /* XML-NNAMESPACE-PREFIX */ -static unsigned char *b_13 = NULL; /* XML-NTEXT */ -static unsigned char *b_14 = NULL; /* XML-TEXT */ - - -/* Call parameters */ -cob_field *cob_procedure_params[1]; - -/* Perform frame stack */ -struct cob_frame *frame_ptr; -struct cob_frame frame_stack[255]; - - -/* Data storage */ -static int b_2; /* RETURN-CODE */ -static cob_u8_t b_17[3] __attribute__((aligned)); /* X */ - -/* End of local data storage */ - - -/* Fields (local) */ -static cob_field f_17 = {3, b_17, &a_1}; /* X */ - -/* End of fields */ - - -]]) - -AT_CHECK([$COMPILE prog.c], [0], [], []) -AT_CHECK([$COBCRUN_DIRECT ./prog], [0], [], []) - -AT_CLEANUP - - -AT_SETUP([INSPECT CONVERTING alphabet]) -AT_KEYWORDS([runmisc ASCII EBCDIC]) - -AT_DATA([prog.c], [[ -/* Generated by cobc 3.3-dev.0 */ -/* Generated from prog.cob */ -/* Generated at févr. 23 2024 16:36:57 */ -/* GnuCOBOL build date Feb 21 2024 15:41:43 */ -/* GnuCOBOL package date Feb 01 2024 13:58:21 UTC */ -/* Compile command cobc -Cx prog.cob */ - -#include /* for memcpy, memcmp and friends */ -#define COB_KEYWORD_INLINE __inline -#include - -#define COB_SOURCE_FILE "prog.cob" -#define COB_PACKAGE_VERSION "3.3-dev" -#define COB_PATCH_LEVEL 0 -#define COB_MODULE_FORMATTED_DATE "févr. 23 2024 16:36:57" -#define COB_MODULE_DATE 20240223 -#define COB_MODULE_TIME 163657 - -/* Global variables */ -#include "prog.c.h" - -/* Function prototypes */ - -static int charset (); -static int charset_ (const int); -static void charset_module_init (cob_module *module); - -/* Main function */ -int -main (int argc, char **argv) -{ - cob_init (argc, argv); - cob_stop_run (charset ()); -} - -/* Functions */ - -static void gc_module_so_init () __attribute__ ((constructor)); -static void gc_module_so_init () -{ - cob_check_version (COB_SOURCE_FILE, COB_PACKAGE_VERSION, COB_PATCH_LEVEL); -} - -/* PROGRAM-ID 'charset' */ - -/* ENTRY 'charset' */ - -static int -charset () -{ - return charset_ (0); -} - -static int -charset_ (const int entry) -{ - /* Program local variables */ - #include "prog.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; - - /* 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: 16 : Entry charset : prog.cob */ - l_2:; - - /* Line: 16 : Paragraph sample-main : prog.cob */ - - /* Line: 18 : INSPECT : prog.cob */ - cob_inspect_init_converting (&f_17); - cob_inspect_start (); - cob_inspect_converting (&f_ascii_ebcdic, &f_native); - - /* Line: 19 : DISPLAY : prog.cob */ - cob_display (0, 0, 3, &c_1, &f_17, &c_2); - - /* Line: 21 : GOBACK : prog.cob */ - goto exit_program; - - /* Program exit */ - - exit_program: - - /* 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_module_path = cob_glob_ptr->cob_main_argv0; - - charset_module_init (module); - - module->collating_sequence = NULL; - module->crt_status = NULL; - module->cursor_pos = NULL; - module->xml_code = NULL; - module->xml_event = NULL; - module->xml_information = NULL; - module->xml_namespace = NULL; - module->xml_namespace_prefix = NULL; - module->xml_nnamespace = NULL; - module->xml_nnamespace_prefix = NULL; - module->xml_ntext = NULL; - module->xml_text = NULL; - module->json_code = NULL; - module->json_status = NULL; - - /* Initialize cancel callback */ - cob_set_cancel (module); - - /* Initialize WORKING-STORAGE */ - /* initialize field RETURN-CODE */ - b_2 = 0; - - /* initialize field TESTHEX */ - memcpy (b_17, "\301{\326\362\360\361\370@jZ", 10); - - - 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 'charset' */ - -/* Initialize module structure for charset */ -static void charset_module_init (cob_module *module) -{ - module->module_name = "charset"; - module->module_formatted_date = COB_MODULE_FORMATTED_DATE; - module->module_source = COB_SOURCE_FILE; - module->gc_version = COB_PACKAGE_VERSION; - module->module_entry.funcptr = (void *(*)())charset; - module->module_cancel.funcptr = (void *(*)())charset_; - 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->xml_mode = 1; - module->module_stmt = 0; - module->module_sources = NULL; -} - -/* End functions */ - - -]]) - -AT_DATA([prog.c.h], [[ -/* Generated by cobc 3.3-dev.0 */ -/* Generated from prog.cob */ -/* Generated at févr. 23 2024 16:36:57 */ -/* GnuCOBOL build date Feb 21 2024 15:41:43 */ -/* GnuCOBOL package date Feb 01 2024 13:58:21 UTC */ -/* Compile command cobc -Cx prog.cob */ - - -/* Module path */ -static const char *cob_module_path = NULL; - -/* Number of call parameters */ -static int cob_call_params = 0; - -/* Attributes */ - -static const cob_field_attr a_1 = {0x21, 0, 0, 0x0000, NULL}; -static const cob_field_attr a_2 = {0x21, 0, 0, 0x1000, NULL}; - - -/* Constants */ -static const cob_field c_1 = {12, (cob_u8_ptr)"Converted: \"", &a_2}; -static const cob_field c_2 = {1, (cob_u8_ptr)"\"", &a_2}; - - -/* NATIVE table */ -static const unsigned char cob_native[256] = { - 0000, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, - 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, - 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, - 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, - 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, - 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, - 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, - 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, - 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, - 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, - 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, - 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, - 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, - 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, - 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, - 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, - 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, - 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, - 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, - 0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f, - 0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, - 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, - 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, - 0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf, - 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, - 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, - 0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, - 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf, - 0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, - 0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef, - 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, - 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff, -}; -static cob_field f_native = { 256, (cob_u8_ptr)cob_native, &a_1 }; - - -/* ASCII to EBCDIC table */ -static const unsigned char cob_ascii_ebcdic[256] = { - 0000, 0x01, 0x02, 0x03, 0x37, 0x2d, 0x2e, 0x2f, - 0x16, 0x05, 0x25, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, - 0x10, 0x11, 0x12, 0x13, 0x3c, 0x3d, 0x32, 0x26, - 0x18, 0x19, 0x3f, 0x27, 0x1c, 0x1d, 0x1e, 0x1f, - 0x40, 0x5a, 0x7f, 0x7b, 0x5b, 0x6c, 0x50, 0x7d, - 0x4d, 0x5d, 0x5c, 0x4e, 0x6b, 0x60, 0x4b, 0x61, - 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, - 0xf8, 0xf9, 0x7a, 0x5e, 0x4c, 0x7e, 0x6e, 0x6f, - 0x7c, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, - 0xc8, 0xc9, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, - 0xd7, 0xd8, 0xd9, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, - 0xe7, 0xe8, 0xe9, 0xad, 0xe0, 0xbd, 0x5f, 0x6d, - 0x79, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, - 0x88, 0x89, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, - 0x97, 0x98, 0x99, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, - 0xa7, 0xa8, 0xa9, 0xc0, 0x6a, 0xd0, 0xa1, 0x07, - 0x68, 0xdc, 0x51, 0x42, 0x43, 0x44, 0x47, 0x48, - 0x52, 0x53, 0x54, 0x57, 0x56, 0x58, 0x63, 0x67, - 0x71, 0x9c, 0x9e, 0xcb, 0xcc, 0xcd, 0xdb, 0xdd, - 0xdf, 0xec, 0xfc, 0xb0, 0xb1, 0xb2, 0x3e, 0xb4, - 0x45, 0x55, 0xce, 0xde, 0x49, 0x69, 0x9a, 0x9b, - 0xab, 0x9f, 0xba, 0xb8, 0xb7, 0xaa, 0x8a, 0x8b, - 0xb6, 0xb5, 0x62, 0x4f, 0x64, 0x65, 0x66, 0x20, - 0x21, 0x22, 0x70, 0x23, 0x72, 0x73, 0x74, 0xbe, - 0x76, 0x77, 0x78, 0x80, 0x24, 0x15, 0x8c, 0x8d, - 0x8e, 0x41, 0x06, 0x17, 0x28, 0x29, 0x9d, 0x2a, - 0x2b, 0x2c, 0x09, 0x0a, 0xac, 0x4a, 0xae, 0xaf, - 0x1b, 0x30, 0x31, 0xfa, 0x1a, 0x33, 0x34, 0x35, - 0x36, 0x59, 0x08, 0x38, 0xbc, 0x39, 0xa0, 0xbf, - 0xca, 0x3a, 0xfe, 0x3b, 0x04, 0xcf, 0xda, 0x14, - 0xe1, 0x8f, 0x46, 0x75, 0xfd, 0xeb, 0xee, 0xed, - 0x90, 0xef, 0xb3, 0xfb, 0xb9, 0xea, 0xbb, 0xff, -}; -static cob_field f_ascii_ebcdic = { 256, (cob_u8_ptr)cob_ascii_ebcdic, &a_1 }; - - -]]) - -AT_DATA([prog.c.l.h], [[ -/* Generated by cobc 3.3-dev.0 */ -/* Generated from prog.cob */ -/* Generated at févr. 23 2024 16:36:57 */ -/* GnuCOBOL build date Feb 21 2024 15:41:43 */ -/* GnuCOBOL package date Feb 01 2024 13:58:21 UTC */ -/* Compile command cobc -Cx prog.cob */ - -/* Program local variables for 'charset' */ - -/* Module initialization indicator */ -static unsigned int initialized = 0; - -/* Module structure pointer */ -static cob_module *module = NULL; - -/* Global variable pointer */ -cob_global *cob_glob_ptr; - - -/* LINKAGE SECTION (Items not referenced by USING clause) */ -static unsigned char *b_9 = NULL; /* XML-NAMESPACE */ -static unsigned char *b_10 = NULL; /* XML-NAMESPACE-PREFIX */ -static unsigned char *b_11 = NULL; /* XML-NNAMESPACE */ -static unsigned char *b_12 = NULL; /* XML-NNAMESPACE-PREFIX */ -static unsigned char *b_13 = NULL; /* XML-NTEXT */ -static unsigned char *b_14 = NULL; /* XML-TEXT */ - - -/* Call parameters */ -cob_field *cob_procedure_params[1]; - -/* Perform frame stack */ -struct cob_frame *frame_ptr; -struct cob_frame frame_stack[255]; - - -/* Data storage */ -static int b_2; /* RETURN-CODE */ -static cob_u8_t b_17[10] __attribute__((aligned)); /* TESTHEX */ - -/* End of local data storage */ - - -/* Fields (local) */ -static cob_field f_17 = {10, b_17, &a_1}; /* TESTHEX */ - -/* End of fields */ - - -]]) - -AT_CHECK([$COMPILE prog.c], [0], [], []) -AT_CHECK([$COBCRUN_DIRECT ./prog], [0], -[Converted: "A#O2018 |!"], []) - -AT_DATA([prog.c], [[ -/* Generated by cobc 3.3-dev.0 */ -/* Generated from prog.cob */ -/* Generated at févr. 23 2024 17:38:45 */ -/* GnuCOBOL build date Feb 21 2024 15:41:43 */ -/* GnuCOBOL package date Feb 01 2024 13:58:21 UTC */ -/* Compile command cobc -Cx -febcdic-table=ebcdic500_ascii7bit prog.cob */ - -#include /* for memcpy, memcmp and friends */ -#define COB_KEYWORD_INLINE __inline -#include - -#define COB_SOURCE_FILE "prog.cob" -#define COB_PACKAGE_VERSION "3.3-dev" -#define COB_PATCH_LEVEL 0 -#define COB_MODULE_FORMATTED_DATE "févr. 23 2024 17:38:45" -#define COB_MODULE_DATE 20240223 -#define COB_MODULE_TIME 173845 - -/* Global variables */ -#include "prog.c.h" - -/* Function prototypes */ - -static int charset (); -static int charset_ (const int); -static void charset_module_init (cob_module *module); - -/* Main function */ -int -main (int argc, char **argv) -{ - cob_init (argc, argv); - cob_stop_run (charset ()); -} - -/* Functions */ - -static void gc_module_so_init () __attribute__ ((constructor)); -static void gc_module_so_init () -{ - cob_check_version (COB_SOURCE_FILE, COB_PACKAGE_VERSION, COB_PATCH_LEVEL); -} - -/* PROGRAM-ID 'charset' */ - -/* ENTRY 'charset' */ - -static int -charset () -{ - return charset_ (0); -} - -static int -charset_ (const int entry) -{ - /* Program local variables */ - #include "prog.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; - - /* 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: 16 : Entry charset : prog.cob */ - l_2:; - - /* Line: 16 : Paragraph sample-main : prog.cob */ - - /* Line: 18 : INSPECT : prog.cob */ - cob_inspect_init_converting (&f_17); - cob_inspect_start (); - cob_inspect_converting (&f_ascii_ebcdic, &f_native); - - /* Line: 19 : DISPLAY : prog.cob */ - cob_display (0, 0, 3, &c_1, &f_17, &c_2); - - /* Line: 21 : GOBACK : prog.cob */ - goto exit_program; - - /* Program exit */ - - exit_program: - - /* 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_module_path = cob_glob_ptr->cob_main_argv0; - - charset_module_init (module); - - module->collating_sequence = NULL; - module->crt_status = NULL; - module->cursor_pos = NULL; - module->xml_code = NULL; - module->xml_event = NULL; - module->xml_information = NULL; - module->xml_namespace = NULL; - module->xml_namespace_prefix = NULL; - module->xml_nnamespace = NULL; - module->xml_nnamespace_prefix = NULL; - module->xml_ntext = NULL; - module->xml_text = NULL; - module->json_code = NULL; - module->json_status = NULL; - - /* Initialize cancel callback */ - cob_set_cancel (module); - - /* Initialize WORKING-STORAGE */ - /* initialize field RETURN-CODE */ - b_2 = 0; - - /* initialize field TESTHEX */ - memcpy (b_17, "\301{\326\362\360\361\370@jZ", 10); - - - 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 'charset' */ - -/* Initialize module structure for charset */ -static void charset_module_init (cob_module *module) -{ - module->module_name = "charset"; - module->module_formatted_date = COB_MODULE_FORMATTED_DATE; - module->module_source = COB_SOURCE_FILE; - module->gc_version = COB_PACKAGE_VERSION; - module->module_entry.funcptr = (void *(*)())charset; - module->module_cancel.funcptr = (void *(*)())charset_; - 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->xml_mode = 1; - module->module_stmt = 0; - module->module_sources = NULL; -} - -/* End functions */ - - -]]) - -AT_DATA([prog.c.h], [[ -/* Generated by cobc 3.3-dev.0 */ -/* Generated from prog.cob */ -/* Generated at févr. 23 2024 17:38:45 */ -/* GnuCOBOL build date Feb 21 2024 15:41:43 */ -/* GnuCOBOL package date Feb 01 2024 13:58:21 UTC */ -/* Compile command cobc -Cx -febcdic-table=ebcdic500_ascii7bit prog.cob */ - - -/* Module path */ -static const char *cob_module_path = NULL; - -/* Number of call parameters */ -static int cob_call_params = 0; - -/* Attributes */ - -static const cob_field_attr a_1 = {0x21, 0, 0, 0x0000, NULL}; -static const cob_field_attr a_2 = {0x21, 0, 0, 0x1000, NULL}; - - -/* Constants */ -static const cob_field c_1 = {12, (cob_u8_ptr)"Converted: \"", &a_2}; -static const cob_field c_2 = {1, (cob_u8_ptr)"\"", &a_2}; - - -/* NATIVE table */ -static const unsigned char cob_native[256] = { - 0000, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, - 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, - 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, - 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, - 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, - 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, - 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, - 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, - 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, - 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, - 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, - 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, - 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, - 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, - 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, - 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, - 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, - 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, - 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, - 0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f, - 0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, - 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, - 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, - 0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf, - 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, - 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, - 0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, - 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf, - 0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, - 0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef, - 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, - 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff, -}; -static cob_field f_native = { 256, (cob_u8_ptr)cob_native, &a_1 }; - - -/* ASCII to EBCDIC table */ -static const unsigned char cob_ascii_ebcdic[256] = { - 0000, 0x01, 0x02, 0x03, 0x37, 0x2d, 0x2e, 0x2f, - 0x16, 0x05, 0x25, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, - 0x10, 0x11, 0x12, 0x13, 0x3c, 0x3d, 0x32, 0x26, - 0x18, 0x19, 0x3f, 0x27, 0x1c, 0x1d, 0x1e, 0x1f, - 0x40, 0x4f, 0x7f, 0x7b, 0x5b, 0x6c, 0x50, 0x7d, - 0x4d, 0x5d, 0x5c, 0x4e, 0x6b, 0x60, 0x4b, 0x61, - 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, - 0xf8, 0xf9, 0x7a, 0x5e, 0x4c, 0x7e, 0x6e, 0x6f, - 0x7c, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, - 0xc8, 0xc9, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, - 0xd7, 0xd8, 0xd9, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, - 0xe7, 0xe8, 0xe9, 0x4a, 0xe0, 0x5a, 0x5f, 0x6d, - 0x79, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, - 0x88, 0x89, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, - 0x97, 0x98, 0x99, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, - 0xa7, 0xa8, 0xa9, 0xc0, 0x6a, 0xd0, 0xa1, 0x07, - 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, - 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, - 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, - 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, - 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, - 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, - 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, - 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, - 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, - 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, - 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, - 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, - 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, - 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, - 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, - 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, -}; -static cob_field f_ascii_ebcdic = { 256, (cob_u8_ptr)cob_ascii_ebcdic, &a_1 }; - - -]]) - -AT_DATA([prog.c.l.h], [[ -/* Generated by cobc 3.3-dev.0 */ -/* Generated from prog.cob */ -/* Generated at févr. 23 2024 17:38:45 */ -/* GnuCOBOL build date Feb 21 2024 15:41:43 */ -/* GnuCOBOL package date Feb 01 2024 13:58:21 UTC */ -/* Compile command cobc -Cx -febcdic-table=ebcdic500_ascii7bit prog.cob */ - -/* Program local variables for 'charset' */ - -/* Module initialization indicator */ -static unsigned int initialized = 0; - -/* Module structure pointer */ -static cob_module *module = NULL; - -/* Global variable pointer */ -cob_global *cob_glob_ptr; - - -/* LINKAGE SECTION (Items not referenced by USING clause) */ -static unsigned char *b_9 = NULL; /* XML-NAMESPACE */ -static unsigned char *b_10 = NULL; /* XML-NAMESPACE-PREFIX */ -static unsigned char *b_11 = NULL; /* XML-NNAMESPACE */ -static unsigned char *b_12 = NULL; /* XML-NNAMESPACE-PREFIX */ -static unsigned char *b_13 = NULL; /* XML-NTEXT */ -static unsigned char *b_14 = NULL; /* XML-TEXT */ - - -/* Call parameters */ -cob_field *cob_procedure_params[1]; - -/* Perform frame stack */ -struct cob_frame *frame_ptr; -struct cob_frame frame_stack[255]; - - -/* Data storage */ -static int b_2; /* RETURN-CODE */ -static cob_u8_t b_17[10] __attribute__((aligned)); /* TESTHEX */ - -/* End of local data storage */ - - -/* Fields (local) */ -static cob_field f_17 = {10, b_17, &a_1}; /* TESTHEX */ - -/* End of fields */ - - -]]) - - -# For characters above IBM (with irregularities) and GCOS should match: -AT_CHECK([$COMPILE prog.c -febcdic-table=ebcdic500_ascii7bit -o prog-ibm], [0], [], []) -AT_CHECK([$COBCRUN_DIRECT ./prog-ibm], [0], -[Converted: "A#O2018 |@:>@"], []) # prefix is actually "|]" (escaped for m4 preproc) - -AT_DATA([prog.c], [[ -/* Generated by cobc 3.3-dev.0 */ -/* Generated from prog.cob */ -/* Generated at févr. 23 2024 17:41:58 */ -/* GnuCOBOL build date Feb 21 2024 15:41:43 */ -/* GnuCOBOL package date Feb 01 2024 13:58:21 UTC */ -/* Compile command cobc -Cx -febcdic-table=ebcdic500_ascii8bit prog.cob */ - -#include /* for memcpy, memcmp and friends */ -#define COB_KEYWORD_INLINE __inline -#include - -#define COB_SOURCE_FILE "prog.cob" -#define COB_PACKAGE_VERSION "3.3-dev" -#define COB_PATCH_LEVEL 0 -#define COB_MODULE_FORMATTED_DATE "févr. 23 2024 17:41:58" -#define COB_MODULE_DATE 20240223 -#define COB_MODULE_TIME 174158 - -/* Global variables */ -#include "prog.c.h" - -/* Function prototypes */ - -static int charset (); -static int charset_ (const int); -static void charset_module_init (cob_module *module); - -/* Main function */ -int -main (int argc, char **argv) -{ - cob_init (argc, argv); - cob_stop_run (charset ()); -} - -/* Functions */ - -static void gc_module_so_init () __attribute__ ((constructor)); -static void gc_module_so_init () -{ - cob_check_version (COB_SOURCE_FILE, COB_PACKAGE_VERSION, COB_PATCH_LEVEL); -} - -/* PROGRAM-ID 'charset' */ - -/* ENTRY 'charset' */ - -static int -charset () -{ - return charset_ (0); -} - -static int -charset_ (const int entry) -{ - /* Program local variables */ - #include "prog.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; - - /* 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: 16 : Entry charset : prog.cob */ - l_2:; - - /* Line: 16 : Paragraph sample-main : prog.cob */ - - /* Line: 18 : INSPECT : prog.cob */ - cob_inspect_init_converting (&f_17); - cob_inspect_start (); - cob_inspect_converting (&f_ascii_ebcdic, &f_native); - - /* Line: 19 : DISPLAY : prog.cob */ - cob_display (0, 0, 3, &c_1, &f_17, &c_2); - - /* Line: 21 : GOBACK : prog.cob */ - goto exit_program; - - /* Program exit */ - - exit_program: - - /* 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_module_path = cob_glob_ptr->cob_main_argv0; - - charset_module_init (module); - - module->collating_sequence = NULL; - module->crt_status = NULL; - module->cursor_pos = NULL; - module->xml_code = NULL; - module->xml_event = NULL; - module->xml_information = NULL; - module->xml_namespace = NULL; - module->xml_namespace_prefix = NULL; - module->xml_nnamespace = NULL; - module->xml_nnamespace_prefix = NULL; - module->xml_ntext = NULL; - module->xml_text = NULL; - module->json_code = NULL; - module->json_status = NULL; - - /* Initialize cancel callback */ - cob_set_cancel (module); - - /* Initialize WORKING-STORAGE */ - /* initialize field RETURN-CODE */ - b_2 = 0; - - /* initialize field TESTHEX */ - memcpy (b_17, "\301{\326\362\360\361\370@jZ", 10); - - - 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 'charset' */ - -/* Initialize module structure for charset */ -static void charset_module_init (cob_module *module) -{ - module->module_name = "charset"; - module->module_formatted_date = COB_MODULE_FORMATTED_DATE; - module->module_source = COB_SOURCE_FILE; - module->gc_version = COB_PACKAGE_VERSION; - module->module_entry.funcptr = (void *(*)())charset; - module->module_cancel.funcptr = (void *(*)())charset_; - 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->xml_mode = 1; - module->module_stmt = 0; - module->module_sources = NULL; -} - -/* End functions */ - - -]]) - -AT_DATA([prog.c.h], [[ -/* Generated by cobc 3.3-dev.0 */ -/* Generated from prog.cob */ -/* Generated at févr. 23 2024 17:41:58 */ -/* GnuCOBOL build date Feb 21 2024 15:41:43 */ -/* GnuCOBOL package date Feb 01 2024 13:58:21 UTC */ -/* Compile command cobc -Cx -febcdic-table=ebcdic500_ascii8bit prog.cob */ - - -/* Module path */ -static const char *cob_module_path = NULL; - -/* Number of call parameters */ -static int cob_call_params = 0; - -/* Attributes */ - -static const cob_field_attr a_1 = {0x21, 0, 0, 0x0000, NULL}; -static const cob_field_attr a_2 = {0x21, 0, 0, 0x1000, NULL}; - - -/* Constants */ -static const cob_field c_1 = {12, (cob_u8_ptr)"Converted: \"", &a_2}; -static const cob_field c_2 = {1, (cob_u8_ptr)"\"", &a_2}; - - -/* NATIVE table */ -static const unsigned char cob_native[256] = { - 0000, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, - 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, - 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, - 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, - 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, - 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, - 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, - 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, - 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, - 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, - 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, - 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, - 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, - 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, - 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, - 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, - 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, - 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, - 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, - 0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f, - 0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, - 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, - 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, - 0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf, - 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, - 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, - 0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, - 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf, - 0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, - 0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef, - 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, - 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff, -}; -static cob_field f_native = { 256, (cob_u8_ptr)cob_native, &a_1 }; - - -/* ASCII to EBCDIC table */ -static const unsigned char cob_ascii_ebcdic[256] = { - 0000, 0x01, 0x02, 0x03, 0x37, 0x2d, 0x2e, 0x2f, - 0x16, 0x05, 0x25, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, - 0x10, 0x11, 0x12, 0x13, 0x3c, 0x3d, 0x32, 0x26, - 0x18, 0x19, 0x3f, 0x27, 0x1c, 0x1d, 0x1e, 0x1f, - 0x40, 0x4f, 0x7f, 0x7b, 0x5b, 0x6c, 0x50, 0x7d, - 0x4d, 0x5d, 0x5c, 0x4e, 0x6b, 0x60, 0x4b, 0x61, - 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, - 0xf8, 0xf9, 0x7a, 0x5e, 0x4c, 0x7e, 0x6e, 0x6f, - 0x7c, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, - 0xc8, 0xc9, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, - 0xd7, 0xd8, 0xd9, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, - 0xe7, 0xe8, 0xe9, 0x4a, 0xe0, 0x5a, 0x5f, 0x6d, - 0x79, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, - 0x88, 0x89, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, - 0x97, 0x98, 0x99, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, - 0xa7, 0xa8, 0xa9, 0xc0, 0x6a, 0xd0, 0xa1, 0x07, - 0x20, 0x21, 0x22, 0x23, 0x24, 0x15, 0x06, 0x17, - 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x09, 0x0a, 0x1b, - 0x30, 0x31, 0x1a, 0x33, 0x34, 0x35, 0x36, 0x08, - 0x38, 0x39, 0x3a, 0x3b, 0x04, 0x14, 0x3e, 0xe1, - 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, - 0x49, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, - 0x58, 0x59, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, - 0x68, 0x69, 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, - 0x76, 0x77, 0x78, 0x80, 0x8a, 0x8b, 0x8c, 0x8d, - 0x8e, 0x8f, 0x90, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, - 0x9f, 0xa0, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, - 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, - 0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf, - 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, 0xda, 0xdb, - 0xdc, 0xdd, 0xde, 0xdf, 0xea, 0xeb, 0xec, 0xed, - 0xee, 0xef, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff, -}; -static cob_field f_ascii_ebcdic = { 256, (cob_u8_ptr)cob_ascii_ebcdic, &a_1 }; - - -]]) - -AT_DATA([prog.c.l.h], [[ -/* Generated by cobc 3.3-dev.0 */ -/* Generated from prog.cob */ -/* Generated at févr. 23 2024 17:41:58 */ -/* GnuCOBOL build date Feb 21 2024 15:41:43 */ -/* GnuCOBOL package date Feb 01 2024 13:58:21 UTC */ -/* Compile command cobc -Cx -febcdic-table=ebcdic500_ascii8bit prog.cob */ - -/* Program local variables for 'charset' */ - -/* Module initialization indicator */ -static unsigned int initialized = 0; - -/* Module structure pointer */ -static cob_module *module = NULL; - -/* Global variable pointer */ -cob_global *cob_glob_ptr; - - -/* LINKAGE SECTION (Items not referenced by USING clause) */ -static unsigned char *b_9 = NULL; /* XML-NAMESPACE */ -static unsigned char *b_10 = NULL; /* XML-NAMESPACE-PREFIX */ -static unsigned char *b_11 = NULL; /* XML-NNAMESPACE */ -static unsigned char *b_12 = NULL; /* XML-NNAMESPACE-PREFIX */ -static unsigned char *b_13 = NULL; /* XML-NTEXT */ -static unsigned char *b_14 = NULL; /* XML-TEXT */ - - -/* Call parameters */ -cob_field *cob_procedure_params[1]; - -/* Perform frame stack */ -struct cob_frame *frame_ptr; -struct cob_frame frame_stack[255]; - - -/* Data storage */ -static int b_2; /* RETURN-CODE */ -static cob_u8_t b_17[10] __attribute__((aligned)); /* TESTHEX */ - -/* End of local data storage */ - - -/* Fields (local) */ -static cob_field f_17 = {10, b_17, &a_1}; /* TESTHEX */ - -/* End of fields */ - - -]]) - - -AT_CHECK([$COMPILE prog.c -febcdic-table=ebcdic500_ascii8bit -o prog-gcos], [0], [], []) -AT_CHECK([$COBCRUN_DIRECT ./prog-gcos], [0], -[Converted: "A#O2018 |@:>@"], []) # prefix is actually "|]" (escaped for m4 preproc) - -# FIXME: This really does not convert to anything close to ASCII; -# what's this table supposed to encode? -# AT_CHECK([$COMPILE prog.c -febcdic-table=RESTRICTED-GC -o prog-rgc], [0], [], []) -# AT_CHECK([$COBCRUN_DIRECT ./prog-rgc], [0], []) - -AT_CLEANUP - - -AT_SETUP([INSPECT CONVERTING TO figurative constant]) -AT_KEYWORDS([runmisc]) - -AT_DATA([prog.c], [[ -/* Generated by cobc 3.3-dev.0 */ -/* Generated from prog.cob */ -/* Generated at févr. 23 2024 16:53:28 */ -/* GnuCOBOL build date Feb 21 2024 15:41:43 */ -/* GnuCOBOL package date Feb 01 2024 13:58:21 UTC */ -/* Compile command cobc -Cx prog.cob */ - -#include /* for memcpy, memcmp and friends */ -#define COB_KEYWORD_INLINE __inline -#include - -#define COB_SOURCE_FILE "prog.cob" -#define COB_PACKAGE_VERSION "3.3-dev" -#define COB_PATCH_LEVEL 0 -#define COB_MODULE_FORMATTED_DATE "févr. 23 2024 16:53:28" -#define COB_MODULE_DATE 20240223 -#define COB_MODULE_TIME 165328 - -/* Global variables */ -#include "prog.c.h" - -/* Function prototypes */ - -static int prog (); -static int prog_ (const int); -static void prog_module_init (cob_module *module); - -/* Main function */ -int -main (int argc, char **argv) -{ - cob_init (argc, argv); - cob_stop_run (prog ()); -} - -/* Functions */ - -static void gc_module_so_init () __attribute__ ((constructor)); -static void gc_module_so_init () -{ - cob_check_version (COB_SOURCE_FILE, COB_PACKAGE_VERSION, COB_PATCH_LEVEL); -} - -/* PROGRAM-ID 'prog' */ - -/* ENTRY 'prog' */ - -static int -prog () -{ - return prog_ (0); -} - -static int -prog_ (const int entry) -{ - /* Program local variables */ - #include "prog.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; - - /* 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: 7 : Entry prog : prog.cob */ - l_2:; - - /* Line: 7 : INSPECT : prog.cob */ - cob_inspect_init_converting (&f_17); - cob_inspect_start (); - cob_inspect_converting ((cob_field *)&c_1, &cob_all_space); - - /* Line: 8 : IF : prog.cob */ - if (((int)memcmp (b_17, COB_SPACES_ALPHABETIC, 3) != 0)) - { - - /* Line: 9 : DISPLAY : prog.cob */ - cob_display (0, 1, 1, &f_17); - } - - /* Line: 10 : STOP RUN : prog.cob */ - cob_stop_run (b_2); - - /* 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_module_path = cob_glob_ptr->cob_main_argv0; - - prog_module_init (module); - - module->collating_sequence = NULL; - module->crt_status = NULL; - module->cursor_pos = NULL; - module->xml_code = NULL; - module->xml_event = NULL; - module->xml_information = NULL; - module->xml_namespace = NULL; - module->xml_namespace_prefix = NULL; - module->xml_nnamespace = NULL; - module->xml_nnamespace_prefix = NULL; - module->xml_ntext = NULL; - module->xml_text = NULL; - module->json_code = NULL; - module->json_status = NULL; - - /* Initialize cancel callback */ - cob_set_cancel (module); - - /* Initialize WORKING-STORAGE */ - /* initialize field RETURN-CODE */ - b_2 = 0; - - /* initialize field X */ - memcpy (b_17, "BCA", 3); - - - 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 'prog' */ - -/* Initialize module structure for prog */ -static void prog_module_init (cob_module *module) -{ - module->module_name = "prog"; - module->module_formatted_date = COB_MODULE_FORMATTED_DATE; - module->module_source = COB_SOURCE_FILE; - module->gc_version = COB_PACKAGE_VERSION; - module->module_entry.funcptr = (void *(*)())prog; - module->module_cancel.funcptr = (void *(*)())prog_; - 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->xml_mode = 1; - module->module_stmt = 0; - module->module_sources = NULL; -} - -/* End functions */ - - -]]) - -AT_DATA([prog.c.h], [[ -/* Generated by cobc 3.3-dev.0 */ -/* Generated from prog.cob */ -/* Generated at févr. 23 2024 16:53:28 */ -/* GnuCOBOL build date Feb 21 2024 15:41:43 */ -/* GnuCOBOL package date Feb 01 2024 13:58:21 UTC */ -/* Compile command cobc -Cx prog.cob */ - - -/* Module path */ -static const char *cob_module_path = NULL; - -/* Number of call parameters */ -static int cob_call_params = 0; - -/* Attributes */ - -static const cob_field_attr a_1 = {0x21, 0, 0, 0x0000, NULL}; -static const cob_field_attr a_2 = {0x21, 0, 0, 0x1000, NULL}; - -static const cob_field_attr cob_all_attr = {0x22, 0, 0, 0, NULL}; - - -/* Constants */ -static const cob_field c_1 = {3, (cob_u8_ptr)"ABC", &a_2}; - -static cob_field cob_all_space = {1, (cob_u8_ptr)" ", &cob_all_attr}; - - -]]) - -AT_DATA([prog.c.l.h], [[ -/* Generated by cobc 3.3-dev.0 */ -/* Generated from prog.cob */ -/* Generated at févr. 23 2024 16:53:28 */ -/* GnuCOBOL build date Feb 21 2024 15:41:43 */ -/* GnuCOBOL package date Feb 01 2024 13:58:21 UTC */ -/* Compile command cobc -Cx prog.cob */ - -/* Program local variables for 'prog' */ - -/* Module initialization indicator */ -static unsigned int initialized = 0; - -/* Module structure pointer */ -static cob_module *module = NULL; - -/* Global variable pointer */ -cob_global *cob_glob_ptr; - - -/* LINKAGE SECTION (Items not referenced by USING clause) */ -static unsigned char *b_9 = NULL; /* XML-NAMESPACE */ -static unsigned char *b_10 = NULL; /* XML-NAMESPACE-PREFIX */ -static unsigned char *b_11 = NULL; /* XML-NNAMESPACE */ -static unsigned char *b_12 = NULL; /* XML-NNAMESPACE-PREFIX */ -static unsigned char *b_13 = NULL; /* XML-NTEXT */ -static unsigned char *b_14 = NULL; /* XML-TEXT */ - - -/* Call parameters */ -cob_field *cob_procedure_params[1]; - -/* Perform frame stack */ -struct cob_frame *frame_ptr; -struct cob_frame frame_stack[255]; - - -/* Data storage */ -static int b_2; /* RETURN-CODE */ -static cob_u8_t b_17[3] __attribute__((aligned)); /* X */ - -/* End of local data storage */ - - -/* Fields (local) */ -static cob_field f_17 = {3, b_17, &a_1}; /* X */ - -/* End of fields */ - - -]]) - -AT_CHECK([$COMPILE prog.c], [0], [], []) -AT_CHECK([$COBCRUN_DIRECT ./prog], [0], [], []) - -AT_CLEANUP - - -AT_SETUP([INSPECT CONVERTING NULL]) -AT_KEYWORDS([runmisc]) - -AT_DATA([prog.c], [[ -/* Generated by cobc 3.3-dev.0 */ -/* Generated from prog.cob */ -/* Generated at févr. 23 2024 16:54:04 */ -/* GnuCOBOL build date Feb 21 2024 15:41:43 */ -/* GnuCOBOL package date Feb 01 2024 13:58:21 UTC */ -/* Compile command cobc -Cx prog.cob */ - -#include /* for memcpy, memcmp and friends */ -#define COB_KEYWORD_INLINE __inline -#include - -#define COB_SOURCE_FILE "prog.cob" -#define COB_PACKAGE_VERSION "3.3-dev" -#define COB_PATCH_LEVEL 0 -#define COB_MODULE_FORMATTED_DATE "févr. 23 2024 16:54:04" -#define COB_MODULE_DATE 20240223 -#define COB_MODULE_TIME 165404 - -/* Global variables */ -#include "prog.c.h" - -/* Function prototypes */ - -static int prog (); -static int prog_ (const int); -static void prog_module_init (cob_module *module); - -/* Main function */ -int -main (int argc, char **argv) -{ - cob_init (argc, argv); - cob_stop_run (prog ()); -} - -/* Functions */ - -static void gc_module_so_init () __attribute__ ((constructor)); -static void gc_module_so_init () -{ - cob_check_version (COB_SOURCE_FILE, COB_PACKAGE_VERSION, COB_PATCH_LEVEL); -} - -/* PROGRAM-ID 'prog' */ - -/* ENTRY 'prog' */ - -static int -prog () -{ - return prog_ (0); -} - -static int -prog_ (const int entry) -{ - /* Program local variables */ - #include "prog.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; - - /* 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: 7 : Entry prog : prog.cob */ - l_2:; - - /* Line: 7 : INSPECT : prog.cob */ - cob_inspect_init_converting (&f_17); - cob_inspect_start (); - cob_inspect_converting (0, (cob_field *)&c_1); - - /* Line: 8 : IF : prog.cob */ - if (((int)memcmp (b_17, (cob_u8_ptr)"AAA", 3) != 0)) - { - - /* Line: 9 : DISPLAY : prog.cob */ - cob_display (0, 1, 1, &f_17); - } - - /* Line: 10 : STOP RUN : prog.cob */ - cob_stop_run (b_2); - - /* 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_module_path = cob_glob_ptr->cob_main_argv0; - - prog_module_init (module); - - module->collating_sequence = NULL; - module->crt_status = NULL; - module->cursor_pos = NULL; - module->xml_code = NULL; - module->xml_event = NULL; - module->xml_information = NULL; - module->xml_namespace = NULL; - module->xml_namespace_prefix = NULL; - module->xml_nnamespace = NULL; - module->xml_nnamespace_prefix = NULL; - module->xml_ntext = NULL; - module->xml_text = NULL; - module->json_code = NULL; - module->json_status = NULL; - - /* Initialize cancel callback */ - cob_set_cancel (module); - - /* Initialize WORKING-STORAGE */ - /* initialize field RETURN-CODE */ - b_2 = 0; - - /* initialize field X */ - memset (b_17, 0, 3); - - - 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 'prog' */ - -/* Initialize module structure for prog */ -static void prog_module_init (cob_module *module) -{ - module->module_name = "prog"; - module->module_formatted_date = COB_MODULE_FORMATTED_DATE; - module->module_source = COB_SOURCE_FILE; - module->gc_version = COB_PACKAGE_VERSION; - module->module_entry.funcptr = (void *(*)())prog; - module->module_cancel.funcptr = (void *(*)())prog_; - 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->xml_mode = 1; - module->module_stmt = 0; - module->module_sources = NULL; -} - -/* End functions */ - - -]]) - -AT_DATA([prog.c.h], [[ -/* Generated by cobc 3.3-dev.0 */ -/* Generated from prog.cob */ -/* Generated at févr. 23 2024 16:54:04 */ -/* GnuCOBOL build date Feb 21 2024 15:41:43 */ -/* GnuCOBOL package date Feb 01 2024 13:58:21 UTC */ -/* Compile command cobc -Cx prog.cob */ - - -/* Module path */ -static const char *cob_module_path = NULL; - -/* Number of call parameters */ -static int cob_call_params = 0; - -/* Attributes */ - -static const cob_field_attr a_1 = {0x21, 0, 0, 0x0000, NULL}; -static const cob_field_attr a_2 = {0x21, 0, 0, 0x1000, NULL}; - - -/* Constants */ -static const cob_field c_1 = {1, (cob_u8_ptr)"A", &a_2}; - - -]]) - -AT_DATA([prog.c.l.h], [[ -/* Generated by cobc 3.3-dev.0 */ -/* Generated from prog.cob */ -/* Generated at févr. 23 2024 16:54:04 */ -/* GnuCOBOL build date Feb 21 2024 15:41:43 */ -/* GnuCOBOL package date Feb 01 2024 13:58:21 UTC */ -/* Compile command cobc -Cx prog.cob */ - -/* Program local variables for 'prog' */ - -/* Module initialization indicator */ -static unsigned int initialized = 0; - -/* Module structure pointer */ -static cob_module *module = NULL; - -/* Global variable pointer */ -cob_global *cob_glob_ptr; - - -/* LINKAGE SECTION (Items not referenced by USING clause) */ -static unsigned char *b_9 = NULL; /* XML-NAMESPACE */ -static unsigned char *b_10 = NULL; /* XML-NAMESPACE-PREFIX */ -static unsigned char *b_11 = NULL; /* XML-NNAMESPACE */ -static unsigned char *b_12 = NULL; /* XML-NNAMESPACE-PREFIX */ -static unsigned char *b_13 = NULL; /* XML-NTEXT */ -static unsigned char *b_14 = NULL; /* XML-TEXT */ - - -/* Call parameters */ -cob_field *cob_procedure_params[1]; - -/* Perform frame stack */ -struct cob_frame *frame_ptr; -struct cob_frame frame_stack[255]; - - -/* Data storage */ -static int b_2; /* RETURN-CODE */ -static cob_u8_t b_17[3] __attribute__((aligned)); /* X */ - -/* End of local data storage */ - - -/* Fields (local) */ -static cob_field f_17 = {3, b_17, &a_1}; /* X */ - -/* End of fields */ - - -]]) - -AT_CHECK([$COMPILE prog.c], [0], [], []) -AT_CHECK([$COBCRUN_DIRECT ./prog], [0], [], []) - -AT_CLEANUP - - -AT_SETUP([INSPECT CONVERTING TO NULL]) -AT_KEYWORDS([runmisc]) - -AT_DATA([prog.c], [[ -/* Generated by cobc 3.3-dev.0 */ -/* Generated from prog.cob */ -/* Generated at févr. 23 2024 16:54:24 */ -/* GnuCOBOL build date Feb 21 2024 15:41:43 */ -/* GnuCOBOL package date Feb 01 2024 13:58:21 UTC */ -/* Compile command cobc -Cx prog.cob */ - -#include /* for memcpy, memcmp and friends */ -#define COB_KEYWORD_INLINE __inline -#include - -#define COB_SOURCE_FILE "prog.cob" -#define COB_PACKAGE_VERSION "3.3-dev" -#define COB_PATCH_LEVEL 0 -#define COB_MODULE_FORMATTED_DATE "févr. 23 2024 16:54:24" -#define COB_MODULE_DATE 20240223 -#define COB_MODULE_TIME 165424 - -/* Global variables */ -#include "prog.c.h" - -/* Function prototypes */ - -static int prog (); -static int prog_ (const int); -static void prog_module_init (cob_module *module); - -/* Main function */ -int -main (int argc, char **argv) -{ - cob_init (argc, argv); - cob_stop_run (prog ()); -} - -/* Functions */ - -static void gc_module_so_init () __attribute__ ((constructor)); -static void gc_module_so_init () -{ - cob_check_version (COB_SOURCE_FILE, COB_PACKAGE_VERSION, COB_PATCH_LEVEL); -} - -/* PROGRAM-ID 'prog' */ - -/* ENTRY 'prog' */ - -static int -prog () -{ - return prog_ (0); -} - -static int -prog_ (const int entry) -{ - /* Program local variables */ - #include "prog.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; - - /* 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: 7 : Entry prog : prog.cob */ - l_2:; - - /* Line: 7 : INSPECT : prog.cob */ - cob_inspect_init_converting (&f_17); - cob_inspect_start (); - cob_inspect_converting ((cob_field *)&c_1, 0); - - /* Line: 8 : IF : prog.cob */ - if (((int)cob_cmp (&f_17, &cob_all_low) != 0)) - { - - /* Line: 9 : DISPLAY : prog.cob */ - cob_display (0, 1, 1, &c_2); - } - - /* Line: 10 : STOP RUN : prog.cob */ - cob_stop_run (b_2); - - /* 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_module_path = cob_glob_ptr->cob_main_argv0; - - prog_module_init (module); - - module->collating_sequence = NULL; - module->crt_status = NULL; - module->cursor_pos = NULL; - module->xml_code = NULL; - module->xml_event = NULL; - module->xml_information = NULL; - module->xml_namespace = NULL; - module->xml_namespace_prefix = NULL; - module->xml_nnamespace = NULL; - module->xml_nnamespace_prefix = NULL; - module->xml_ntext = NULL; - module->xml_text = NULL; - module->json_code = NULL; - module->json_status = NULL; - - /* Initialize cancel callback */ - cob_set_cancel (module); - - /* Initialize WORKING-STORAGE */ - /* initialize field RETURN-CODE */ - b_2 = 0; - - /* initialize field X */ - memcpy (b_17, "AAA", 3); - - - 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 'prog' */ - -/* Initialize module structure for prog */ -static void prog_module_init (cob_module *module) -{ - module->module_name = "prog"; - module->module_formatted_date = COB_MODULE_FORMATTED_DATE; - module->module_source = COB_SOURCE_FILE; - module->gc_version = COB_PACKAGE_VERSION; - module->module_entry.funcptr = (void *(*)())prog; - module->module_cancel.funcptr = (void *(*)())prog_; - 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->xml_mode = 1; - module->module_stmt = 0; - module->module_sources = NULL; -} - -/* End functions */ - - -]]) - -AT_DATA([prog.c.h], [[ -/* Generated by cobc 3.3-dev.0 */ -/* Generated from prog.cob */ -/* Generated at févr. 23 2024 16:54:24 */ -/* GnuCOBOL build date Feb 21 2024 15:41:43 */ -/* GnuCOBOL package date Feb 01 2024 13:58:21 UTC */ -/* Compile command cobc -Cx prog.cob */ - - -/* Module path */ -static const char *cob_module_path = NULL; - -/* Number of call parameters */ -static int cob_call_params = 0; - -/* Attributes */ - -static const cob_field_attr a_1 = {0x21, 0, 0, 0x0000, NULL}; -static const cob_field_attr a_2 = {0x21, 0, 0, 0x1000, NULL}; - -static const cob_field_attr cob_all_attr = {0x22, 0, 0, 0, NULL}; - - -/* Constants */ -static const cob_field c_1 = {1, (cob_u8_ptr)"A", &a_2}; -static const cob_field c_2 = {2, (cob_u8_ptr)"NG", &a_2}; - -static cob_field cob_all_low = {1, (cob_u8_ptr)"\0", &cob_all_attr}; - - -]]) - -AT_DATA([prog.c.l.h], [[ -/* Generated by cobc 3.3-dev.0 */ -/* Generated from prog.cob */ -/* Generated at févr. 23 2024 16:54:24 */ -/* GnuCOBOL build date Feb 21 2024 15:41:43 */ -/* GnuCOBOL package date Feb 01 2024 13:58:21 UTC */ -/* Compile command cobc -Cx prog.cob */ - -/* Program local variables for 'prog' */ - -/* Module initialization indicator */ -static unsigned int initialized = 0; - -/* Module structure pointer */ -static cob_module *module = NULL; - -/* Global variable pointer */ -cob_global *cob_glob_ptr; - - -/* LINKAGE SECTION (Items not referenced by USING clause) */ -static unsigned char *b_9 = NULL; /* XML-NAMESPACE */ -static unsigned char *b_10 = NULL; /* XML-NAMESPACE-PREFIX */ -static unsigned char *b_11 = NULL; /* XML-NNAMESPACE */ -static unsigned char *b_12 = NULL; /* XML-NNAMESPACE-PREFIX */ -static unsigned char *b_13 = NULL; /* XML-NTEXT */ -static unsigned char *b_14 = NULL; /* XML-TEXT */ - - -/* Call parameters */ -cob_field *cob_procedure_params[1]; - -/* Perform frame stack */ -struct cob_frame *frame_ptr; -struct cob_frame frame_stack[255]; - - -/* Data storage */ -static int b_2; /* RETURN-CODE */ -static cob_u8_t b_17[3] __attribute__((aligned)); /* X */ - -/* End of local data storage */ - - -/* Fields (local) */ -static cob_field f_17 = {3, b_17, &a_1}; /* X */ - -/* End of fields */ - - -]]) - -AT_CHECK([$COMPILE prog.c], [0], [], []) -AT_CHECK([$COBCRUN_DIRECT ./prog], [0], [], []) - -AT_CLEANUP - - -AT_SETUP([INSPECT CONVERTING complex]) -AT_KEYWORDS([runmisc]) - -AT_DATA([prog.c], [[ -/* Generated by cobc 3.3-dev.0 */ -/* Generated from prog.cob */ -/* Generated at févr. 23 2024 16:54:50 */ -/* GnuCOBOL build date Feb 21 2024 15:41:43 */ -/* GnuCOBOL package date Feb 01 2024 13:58:21 UTC */ -/* Compile command cobc -Cx prog.cob */ - -#include /* for memcpy, memcmp and friends */ -#define COB_KEYWORD_INLINE __inline -#include - -#define COB_SOURCE_FILE "prog.cob" -#define COB_PACKAGE_VERSION "3.3-dev" -#define COB_PATCH_LEVEL 0 -#define COB_MODULE_FORMATTED_DATE "févr. 23 2024 16:54:50" -#define COB_MODULE_DATE 20240223 -#define COB_MODULE_TIME 165450 - -/* Global variables */ -#include "prog.c.h" - -/* Function prototypes */ - -static int prog (); -static int prog_ (const int); -static void prog_module_init (cob_module *module); - -/* Main function */ -int -main (int argc, char **argv) -{ - cob_init (argc, argv); - cob_stop_run (prog ()); -} - -/* Functions */ - -static void gc_module_so_init () __attribute__ ((constructor)); -static void gc_module_so_init () -{ - cob_check_version (COB_SOURCE_FILE, COB_PACKAGE_VERSION, COB_PATCH_LEVEL); -} - -/* PROGRAM-ID 'prog' */ - -/* ENTRY 'prog' */ - -static int -prog () -{ - return prog_ (0); -} - -static int -prog_ (const int entry) -{ - /* Program local variables */ - #include "prog.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; - - /* 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: 7 : Entry prog : prog.cob */ - l_2:; - - /* Line: 7 : INSPECT : prog.cob */ - cob_inspect_init_converting (&f_17); - cob_inspect_start (); - cob_inspect_converting ((cob_field *)&c_1, (cob_field *)&c_2); - - /* Line: 8 : IF : prog.cob */ - if (((int)memcmp (b_17, (cob_u8_ptr)"Z0ZYYXDXXEXX", 12) != 0)) - { - - /* Line: 9 : DISPLAY : prog.cob */ - cob_display (0, 1, 2, &c_3, &f_17); - - /* Line: 10 : MOVE : prog.cob */ - memcpy (b_17, "Z0ZYYXDXXEXX", 12); - } - - /* Line: 12 : INSPECT : prog.cob */ - cob_inspect_init_converting (&f_17); - cob_inspect_start (); - cob_inspect_before ((cob_field *)&c_4); - cob_inspect_after ((cob_field *)&c_5); - cob_inspect_converting ((cob_field *)&c_6, &cob_all_space); - - /* Line: 14 : IF : prog.cob */ - if (((int)memcmp (b_17, (cob_u8_ptr)"Z0ZYYXD EXX", 12) != 0)) - { - - /* Line: 15 : DISPLAY : prog.cob */ - cob_display (0, 1, 2, &c_7, &f_17); - - /* Line: 16 : MOVE : prog.cob */ - memcpy (b_17, "Z0ZYYXD EXX", 12); - } - - /* Line: 18 : STOP RUN : prog.cob */ - cob_stop_run (b_2); - - /* 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_module_path = cob_glob_ptr->cob_main_argv0; - - prog_module_init (module); - - module->collating_sequence = NULL; - module->crt_status = NULL; - module->cursor_pos = NULL; - module->xml_code = NULL; - module->xml_event = NULL; - module->xml_information = NULL; - module->xml_namespace = NULL; - module->xml_namespace_prefix = NULL; - module->xml_nnamespace = NULL; - module->xml_nnamespace_prefix = NULL; - module->xml_ntext = NULL; - module->xml_text = NULL; - module->json_code = NULL; - module->json_status = NULL; - - /* Initialize cancel callback */ - cob_set_cancel (module); - - /* Initialize WORKING-STORAGE */ - /* initialize field RETURN-CODE */ - b_2 = 0; - - /* initialize field X */ - memcpy (b_17, "AZABBCDCCECC", 12); - - - 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 'prog' */ - -/* Initialize module structure for prog */ -static void prog_module_init (cob_module *module) -{ - module->module_name = "prog"; - module->module_formatted_date = COB_MODULE_FORMATTED_DATE; - module->module_source = COB_SOURCE_FILE; - module->gc_version = COB_PACKAGE_VERSION; - module->module_entry.funcptr = (void *(*)())prog; - module->module_cancel.funcptr = (void *(*)())prog_; - 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->xml_mode = 1; - module->module_stmt = 0; - module->module_sources = NULL; -} - -/* End functions */ - - -]]) - -AT_DATA([prog.c.h], [[ -/* Generated by cobc 3.3-dev.0 */ -/* Generated from prog.cob */ -/* Generated at févr. 23 2024 16:54:50 */ -/* GnuCOBOL build date Feb 21 2024 15:41:43 */ -/* GnuCOBOL package date Feb 01 2024 13:58:21 UTC */ -/* Compile command cobc -Cx prog.cob */ - - -/* Module path */ -static const char *cob_module_path = NULL; - -/* Number of call parameters */ -static int cob_call_params = 0; - -/* Attributes */ - -static const cob_field_attr a_1 = {0x21, 0, 0, 0x0000, NULL}; -static const cob_field_attr a_2 = {0x21, 0, 0, 0x1000, NULL}; - -static const cob_field_attr cob_all_attr = {0x22, 0, 0, 0, NULL}; - - -/* Constants */ -static const cob_field c_1 = {4, (cob_u8_ptr)"ABZC", &a_2}; -static const cob_field c_2 = {4, (cob_u8_ptr)"ZY0X", &a_2}; -static const cob_field c_3 = {4, (cob_u8_ptr)"1 - ", &a_2}; -static const cob_field c_4 = {1, (cob_u8_ptr)"E", &a_2}; -static const cob_field c_5 = {1, (cob_u8_ptr)"D", &a_2}; -static const cob_field c_6 = {2, (cob_u8_ptr)"XD", &a_2}; -static const cob_field c_7 = {4, (cob_u8_ptr)"2 - ", &a_2}; - -static cob_field cob_all_space = {1, (cob_u8_ptr)" ", &cob_all_attr}; - - -]]) - -AT_DATA([prog.c.l.h], [[ -/* Generated by cobc 3.3-dev.0 */ -/* Generated from prog.cob */ -/* Generated at févr. 23 2024 16:54:50 */ -/* GnuCOBOL build date Feb 21 2024 15:41:43 */ -/* GnuCOBOL package date Feb 01 2024 13:58:21 UTC */ -/* Compile command cobc -Cx prog.cob */ - -/* Program local variables for 'prog' */ - -/* Module initialization indicator */ -static unsigned int initialized = 0; - -/* Module structure pointer */ -static cob_module *module = NULL; - -/* Global variable pointer */ -cob_global *cob_glob_ptr; - - -/* LINKAGE SECTION (Items not referenced by USING clause) */ -static unsigned char *b_9 = NULL; /* XML-NAMESPACE */ -static unsigned char *b_10 = NULL; /* XML-NAMESPACE-PREFIX */ -static unsigned char *b_11 = NULL; /* XML-NNAMESPACE */ -static unsigned char *b_12 = NULL; /* XML-NNAMESPACE-PREFIX */ -static unsigned char *b_13 = NULL; /* XML-NTEXT */ -static unsigned char *b_14 = NULL; /* XML-TEXT */ - - -/* Call parameters */ -cob_field *cob_procedure_params[1]; - -/* Perform frame stack */ -struct cob_frame *frame_ptr; -struct cob_frame frame_stack[255]; - - -/* Data storage */ -static int b_2; /* RETURN-CODE */ -static cob_u8_t b_17[12] __attribute__((aligned)); /* X */ - -/* End of local data storage */ - - -/* Fields (local) */ -static cob_field f_17 = {12, b_17, &a_1}; /* X */ - -/* End of fields */ - - -]]) - -AT_CHECK([$COMPILE prog.c], [0], [], []) -AT_CHECK([$COBCRUN_DIRECT ./prog], [0], [], []) -AT_CLEANUP - - -AT_SETUP([INSPECT numeric signed]) -AT_KEYWORDS([runmisc]) - -AT_DATA([prog.c], [[ -/* Generated by cobc 3.3-dev.0 */ -/* Generated from prog.cob */ -/* Generated at févr. 23 2024 16:55:19 */ -/* GnuCOBOL build date Feb 21 2024 15:41:43 */ -/* GnuCOBOL package date Feb 01 2024 13:58:21 UTC */ -/* Compile command cobc -Cx prog.cob */ - -#include /* for memcpy, memcmp and friends */ -#define COB_KEYWORD_INLINE __inline -#include - -#define COB_SOURCE_FILE "prog.cob" -#define COB_PACKAGE_VERSION "3.3-dev" -#define COB_PATCH_LEVEL 0 -#define COB_MODULE_FORMATTED_DATE "févr. 23 2024 16:55:19" -#define COB_MODULE_DATE 20240223 -#define COB_MODULE_TIME 165519 - -/* Global variables */ -#include "prog.c.h" - -/* Function prototypes */ - -static int prog (); -static int prog_ (const int); -static void prog_module_init (cob_module *module); - -/* Main function */ -int -main (int argc, char **argv) -{ - cob_init (argc, argv); - cob_stop_run (prog ()); -} - -/* Functions */ - -static void gc_module_so_init () __attribute__ ((constructor)); -static void gc_module_so_init () -{ - cob_check_version (COB_SOURCE_FILE, COB_PACKAGE_VERSION, COB_PATCH_LEVEL); -} - -/* PROGRAM-ID 'prog' */ - -/* ENTRY 'prog' */ - -static int -prog () -{ - return prog_ (0); -} - -static int -prog_ (const int entry) -{ - /* Program local variables */ - #include "prog.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; - - /* 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: 15 : Entry prog : prog.cob */ - l_2:; - - /* Line: 15 : MOVE : prog.cob */ - (*(int *)(b_25)) = 0; - - /* Line: 16 : INSPECT : prog.cob */ - cob_inspect_init (&f_17, 0); - cob_inspect_start (); - cob_inspect_all (&f_25, (cob_field *)&c_1); - cob_inspect_finish (); - - /* Line: 17 : IF : prog.cob */ - if (((int)cob_cmp_s32 (b_25, COB_S64_C(2)) != 0)) - { - - /* Line: 18 : DISPLAY : prog.cob */ - cob_display (0, 1, 2, &c_2, &f_25); - } - - /* Line: 19 : MOVE : prog.cob */ - (*(int *)(b_25)) = 0; - - /* Line: 20 : INSPECT : prog.cob */ - cob_inspect_init (&f_18, 0); - cob_inspect_start (); - cob_inspect_all (&f_25, (cob_field *)&c_1); - cob_inspect_finish (); - - /* Line: 21 : IF : prog.cob */ - if (((int)cob_cmp_s32 (b_25, COB_S64_C(2)) != 0)) - { - - /* Line: 22 : DISPLAY : prog.cob */ - cob_display (0, 1, 2, &c_3, &f_25); - } - - /* Line: 23 : MOVE : prog.cob */ - (*(int *)(b_25)) = 0; - - /* Line: 24 : INSPECT : prog.cob */ - cob_inspect_init (&f_19, 0); - cob_inspect_start (); - cob_inspect_all (&f_25, (cob_field *)&c_1); - cob_inspect_finish (); - - /* Line: 25 : IF : prog.cob */ - if (((int)cob_cmp_s32 (b_25, COB_S64_C(2)) != 0)) - { - - /* Line: 26 : DISPLAY : prog.cob */ - cob_display (0, 1, 2, &c_4, &f_25); - } - - /* Line: 27 : MOVE : prog.cob */ - (*(int *)(b_25)) = 0; - - /* Line: 28 : INSPECT : prog.cob */ - cob_inspect_init (&f_20, 0); - cob_inspect_start (); - cob_inspect_all (&f_25, (cob_field *)&c_1); - cob_inspect_finish (); - - /* Line: 29 : IF : prog.cob */ - if (((int)cob_cmp_s32 (b_25, COB_S64_C(2)) != 0)) - { - - /* Line: 30 : DISPLAY : prog.cob */ - cob_display (0, 1, 2, &c_5, &f_25); - } - - /* Line: 31 : MOVE : prog.cob */ - (*(int *)(b_25)) = 0; - - /* Line: 32 : INSPECT : prog.cob */ - cob_inspect_init (&f_21, 0); - cob_inspect_start (); - cob_inspect_all (&f_25, (cob_field *)&c_1); - cob_inspect_finish (); - - /* Line: 33 : IF : prog.cob */ - if (((int)cob_cmp_s32 (b_25, COB_S64_C(2)) != 0)) - { - - /* Line: 34 : DISPLAY : prog.cob */ - cob_display (0, 1, 2, &c_6, &f_25); - } - - /* Line: 35 : MOVE : prog.cob */ - (*(int *)(b_25)) = 0; - - /* Line: 36 : INSPECT : prog.cob */ - cob_inspect_init (&f_22, 0); - cob_inspect_start (); - cob_inspect_all (&f_25, (cob_field *)&c_1); - cob_inspect_finish (); - - /* Line: 37 : IF : prog.cob */ - if (((int)cob_cmp_s32 (b_25, COB_S64_C(2)) != 0)) - { - - /* Line: 38 : DISPLAY : prog.cob */ - cob_display (0, 1, 2, &c_7, &f_25); - } - - /* Line: 39 : MOVE : prog.cob */ - (*(int *)(b_25)) = 0; - - /* Line: 40 : INSPECT : prog.cob */ - cob_inspect_init (&f_23, 0); - cob_inspect_start (); - cob_inspect_all (&f_25, (cob_field *)&c_1); - cob_inspect_finish (); - - /* Line: 41 : IF : prog.cob */ - if (((int)cob_cmp_s32 (b_25, COB_S64_C(2)) != 0)) - { - - /* Line: 42 : DISPLAY : prog.cob */ - cob_display (0, 1, 2, &c_8, &f_25); - } - - /* Line: 43 : MOVE : prog.cob */ - (*(int *)(b_25)) = 0; - - /* Line: 44 : INSPECT : prog.cob */ - cob_inspect_init (&f_24, 0); - cob_inspect_start (); - cob_inspect_all (&f_25, (cob_field *)&c_1); - cob_inspect_finish (); - - /* Line: 45 : IF : prog.cob */ - if (((int)cob_cmp_s32 (b_25, COB_S64_C(2)) != 0)) - { - - /* Line: 46 : DISPLAY : prog.cob */ - cob_display (0, 1, 2, &c_9, &f_25); - } - - /* Line: 48 : INSPECT : prog.cob */ - cob_inspect_init_converting (&f_17); - cob_inspect_start (); - cob_inspect_converting ((cob_field *)&c_10, (cob_field *)&c_11); - - /* Line: 49 : IF : prog.cob */ - if (((int)cob_cmp_llint (&f_17, COB_S64_C(-22)) != 0)) - { - - /* Line: 50 : DISPLAY : prog.cob */ - cob_display (0, 1, 2, &c_12, &f_17); - - /* Line: 51 : MOVE : prog.cob */ - cob_move ((cob_field *)&c_13, &f_17); - } - - /* Line: 52 : INSPECT : prog.cob */ - cob_inspect_init_converting (&f_18); - cob_inspect_start (); - cob_inspect_converting ((cob_field *)&c_10, (cob_field *)&c_11); - - /* Line: 53 : IF : prog.cob */ - if (((int)cob_cmp_llint (&f_18, COB_S64_C(22)) != 0)) - { - - /* Line: 54 : DISPLAY : prog.cob */ - cob_display (0, 1, 2, &c_14, &f_18); - - /* Line: 55 : MOVE : prog.cob */ - cob_move ((cob_field *)&c_15, &f_18); - } - - /* Line: 56 : INSPECT : prog.cob */ - cob_inspect_init_converting (&f_19); - cob_inspect_start (); - cob_inspect_converting ((cob_field *)&c_10, (cob_field *)&c_11); - - /* Line: 57 : IF : prog.cob */ - if (((int)cob_cmp_llint (&f_19, COB_S64_C(-22)) != 0)) - { - - /* Line: 58 : DISPLAY : prog.cob */ - cob_display (0, 1, 2, &c_16, &f_19); - - /* Line: 59 : MOVE : prog.cob */ - cob_move ((cob_field *)&c_13, &f_19); - } - - /* Line: 60 : INSPECT : prog.cob */ - cob_inspect_init_converting (&f_20); - cob_inspect_start (); - cob_inspect_converting ((cob_field *)&c_10, (cob_field *)&c_11); - - /* Line: 61 : IF : prog.cob */ - if (((int)cob_cmp_llint (&f_20, COB_S64_C(22)) != 0)) - { - - /* Line: 62 : DISPLAY : prog.cob */ - cob_display (0, 1, 2, &c_17, &f_20); - - /* Line: 63 : MOVE : prog.cob */ - cob_move ((cob_field *)&c_15, &f_20); - } - - /* Line: 64 : INSPECT : prog.cob */ - cob_inspect_init_converting (&f_21); - cob_inspect_start (); - cob_inspect_converting ((cob_field *)&c_10, (cob_field *)&c_11); - - /* Line: 65 : IF : prog.cob */ - if (((int)cob_cmp_numdisp (b_21, 2, COB_S64_C(-22), 1) != 0)) - { - - /* Line: 66 : DISPLAY : prog.cob */ - cob_display (0, 1, 2, &c_18, &f_21); - - /* Line: 67 : MOVE : prog.cob */ - memcpy (b_21, "2r", 2); - } - - /* Line: 68 : INSPECT : prog.cob */ - cob_inspect_init_converting (&f_22); - cob_inspect_start (); - cob_inspect_converting ((cob_field *)&c_10, (cob_field *)&c_11); - - /* Line: 69 : IF : prog.cob */ - if (((int)cob_cmp_numdisp (b_22, 2, COB_S64_C(22), 1) != 0)) - { - - /* Line: 70 : DISPLAY : prog.cob */ - cob_display (0, 1, 2, &c_19, &f_22); - - /* Line: 71 : MOVE : prog.cob */ - memset (b_22, 50, 2); - } - - /* Line: 72 : INSPECT : prog.cob */ - cob_inspect_init_converting (&f_23); - cob_inspect_start (); - cob_inspect_converting ((cob_field *)&c_10, (cob_field *)&c_11); - - /* Line: 73 : IF : prog.cob */ - if (((int)cob_cmp_numdisp (b_23, 2, COB_S64_C(-22), 1) != 0)) - { - - /* Line: 74 : DISPLAY : prog.cob */ - cob_display (0, 1, 2, &c_20, &f_23); - - /* Line: 75 : MOVE : prog.cob */ - memcpy (b_23, "2r", 2); - } - - /* Line: 76 : INSPECT : prog.cob */ - cob_inspect_init_converting (&f_24); - cob_inspect_start (); - cob_inspect_converting ((cob_field *)&c_10, (cob_field *)&c_11); - - /* Line: 77 : IF : prog.cob */ - if (((int)cob_cmp_numdisp (b_24, 2, COB_S64_C(22), 1) != 0)) - { - - /* Line: 78 : DISPLAY : prog.cob */ - cob_display (0, 1, 2, &c_21, &f_24); - - /* Line: 79 : MOVE : prog.cob */ - memset (b_24, 50, 2); - } - - /* Line: 81 : INSPECT : prog.cob */ - cob_inspect_init (&f_17, 1); - cob_inspect_start (); - cob_inspect_all ((cob_field *)&c_22, (cob_field *)&c_1); - cob_inspect_start (); - cob_inspect_all ((cob_field *)&c_23, (cob_field *)&c_22); - cob_inspect_start (); - cob_inspect_all ((cob_field *)&c_24, (cob_field *)&c_23); - cob_inspect_finish (); - - /* Line: 84 : IF : prog.cob */ - if (((int)cob_cmp_llint (&f_17, COB_S64_C(-33)) != 0)) - { - - /* Line: 85 : DISPLAY : prog.cob */ - cob_display (0, 1, 2, &c_25, &f_17); - - /* Line: 86 : MOVE : prog.cob */ - cob_move ((cob_field *)&c_26, &f_17); - } - - /* Line: 87 : INSPECT : prog.cob */ - cob_inspect_init (&f_18, 1); - cob_inspect_start (); - cob_inspect_all ((cob_field *)&c_22, (cob_field *)&c_1); - cob_inspect_start (); - cob_inspect_all ((cob_field *)&c_23, (cob_field *)&c_22); - cob_inspect_start (); - cob_inspect_all ((cob_field *)&c_24, (cob_field *)&c_23); - cob_inspect_finish (); - - /* Line: 90 : IF : prog.cob */ - if (((int)cob_cmp_llint (&f_18, COB_S64_C(33)) != 0)) - { - - /* Line: 91 : DISPLAY : prog.cob */ - cob_display (0, 1, 2, &c_27, &f_18); - - /* Line: 92 : MOVE : prog.cob */ - cob_move ((cob_field *)&c_28, &f_18); - } - - /* Line: 93 : INSPECT : prog.cob */ - cob_inspect_init (&f_19, 1); - cob_inspect_start (); - cob_inspect_all ((cob_field *)&c_22, (cob_field *)&c_1); - cob_inspect_start (); - cob_inspect_all ((cob_field *)&c_23, (cob_field *)&c_22); - cob_inspect_start (); - cob_inspect_all ((cob_field *)&c_24, (cob_field *)&c_23); - cob_inspect_finish (); - - /* Line: 96 : IF : prog.cob */ - if (((int)cob_cmp_llint (&f_19, COB_S64_C(-33)) != 0)) - { - - /* Line: 97 : DISPLAY : prog.cob */ - cob_display (0, 1, 2, &c_29, &f_19); - - /* Line: 98 : MOVE : prog.cob */ - cob_move ((cob_field *)&c_26, &f_19); - } - - /* Line: 99 : INSPECT : prog.cob */ - cob_inspect_init (&f_20, 1); - cob_inspect_start (); - cob_inspect_all ((cob_field *)&c_22, (cob_field *)&c_1); - cob_inspect_start (); - cob_inspect_all ((cob_field *)&c_23, (cob_field *)&c_22); - cob_inspect_start (); - cob_inspect_all ((cob_field *)&c_24, (cob_field *)&c_23); - cob_inspect_finish (); - - /* Line: 102 : IF : prog.cob */ - if (((int)cob_cmp_llint (&f_20, COB_S64_C(33)) != 0)) - { - - /* Line: 103 : DISPLAY : prog.cob */ - cob_display (0, 1, 2, &c_30, &f_20); - - /* Line: 104 : MOVE : prog.cob */ - cob_move ((cob_field *)&c_28, &f_20); - } - - /* Line: 105 : INSPECT : prog.cob */ - cob_inspect_init (&f_21, 1); - cob_inspect_start (); - cob_inspect_all ((cob_field *)&c_22, (cob_field *)&c_1); - cob_inspect_start (); - cob_inspect_all ((cob_field *)&c_23, (cob_field *)&c_22); - cob_inspect_start (); - cob_inspect_all ((cob_field *)&c_24, (cob_field *)&c_23); - cob_inspect_finish (); - - /* Line: 108 : IF : prog.cob */ - if (((int)cob_cmp_numdisp (b_21, 2, COB_S64_C(-33), 1) != 0)) - { - - /* Line: 109 : DISPLAY : prog.cob */ - cob_display (0, 1, 2, &c_31, &f_21); - - /* Line: 110 : MOVE : prog.cob */ - memcpy (b_21, "3s", 2); - } - - /* Line: 111 : INSPECT : prog.cob */ - cob_inspect_init (&f_22, 1); - cob_inspect_start (); - cob_inspect_all ((cob_field *)&c_22, (cob_field *)&c_1); - cob_inspect_start (); - cob_inspect_all ((cob_field *)&c_23, (cob_field *)&c_22); - cob_inspect_start (); - cob_inspect_all ((cob_field *)&c_24, (cob_field *)&c_23); - cob_inspect_finish (); - - /* Line: 114 : IF : prog.cob */ - if (((int)cob_cmp_numdisp (b_22, 2, COB_S64_C(33), 1) != 0)) - { - - /* Line: 115 : DISPLAY : prog.cob */ - cob_display (0, 1, 2, &c_32, &f_22); - - /* Line: 116 : MOVE : prog.cob */ - memset (b_22, 51, 2); - } - - /* Line: 117 : INSPECT : prog.cob */ - cob_inspect_init (&f_23, 1); - cob_inspect_start (); - cob_inspect_all ((cob_field *)&c_22, (cob_field *)&c_1); - cob_inspect_start (); - cob_inspect_all ((cob_field *)&c_23, (cob_field *)&c_22); - cob_inspect_start (); - cob_inspect_all ((cob_field *)&c_24, (cob_field *)&c_23); - cob_inspect_finish (); - - /* Line: 120 : IF : prog.cob */ - if (((int)cob_cmp_numdisp (b_23, 2, COB_S64_C(-33), 1) != 0)) - { - - /* Line: 121 : DISPLAY : prog.cob */ - cob_display (0, 1, 2, &c_33, &f_23); - - /* Line: 122 : MOVE : prog.cob */ - memcpy (b_23, "3s", 2); - } - - /* Line: 123 : INSPECT : prog.cob */ - cob_inspect_init (&f_24, 1); - cob_inspect_start (); - cob_inspect_all ((cob_field *)&c_22, (cob_field *)&c_1); - cob_inspect_start (); - cob_inspect_all ((cob_field *)&c_23, (cob_field *)&c_22); - cob_inspect_start (); - cob_inspect_all ((cob_field *)&c_24, (cob_field *)&c_23); - cob_inspect_finish (); - - /* Line: 126 : IF : prog.cob */ - if (((int)cob_cmp_numdisp (b_24, 2, COB_S64_C(33), 1) != 0)) - { - - /* Line: 127 : DISPLAY : prog.cob */ - cob_display (0, 1, 2, &c_34, &f_24); - - /* Line: 128 : MOVE : prog.cob */ - memset (b_24, 51, 2); - } - - /* Line: 130 : STOP RUN : prog.cob */ - cob_stop_run (b_2); - - /* 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_module_path = cob_glob_ptr->cob_main_argv0; - - prog_module_init (module); - - module->collating_sequence = NULL; - module->crt_status = NULL; - module->cursor_pos = NULL; - module->xml_code = NULL; - module->xml_event = NULL; - module->xml_information = NULL; - module->xml_namespace = NULL; - module->xml_namespace_prefix = NULL; - module->xml_nnamespace = NULL; - module->xml_nnamespace_prefix = NULL; - module->xml_ntext = NULL; - module->xml_text = NULL; - module->json_code = NULL; - module->json_status = NULL; - - /* Initialize cancel callback */ - cob_set_cancel (module); - - /* Initialize WORKING-STORAGE */ - /* initialize field RETURN-CODE */ - b_2 = 0; - - /* initialize field SEPARATE1 */ - cob_move ((cob_field *)&c_35, &f_17); - - /* initialize field SEPARATE2 */ - cob_move ((cob_field *)&c_36, &f_18); - - /* initialize field TSEPARATE1 */ - cob_move ((cob_field *)&c_35, &f_19); - - /* initialize field TSEPARATE2 */ - cob_move ((cob_field *)&c_36, &f_20); - - /* initialize field NSEPARATE1 */ - memcpy (b_21, "1q", 2); - - /* initialize field NSEPARATE2 */ - memset (b_22, 49, 2); - - /* initialize field TRAILING1 */ - memcpy (b_23, "1q", 2); - - /* initialize field TRAILING2 */ - memset (b_24, 49, 2); - - /* initialize field CNT */ - memset (b_25, 0x0, 4); - - - 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 'prog' */ - -/* Initialize module structure for prog */ -static void prog_module_init (cob_module *module) -{ - module->module_name = "prog"; - module->module_formatted_date = COB_MODULE_FORMATTED_DATE; - module->module_source = COB_SOURCE_FILE; - module->gc_version = COB_PACKAGE_VERSION; - module->module_entry.funcptr = (void *(*)())prog; - module->module_cancel.funcptr = (void *(*)())prog_; - 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->xml_mode = 1; - module->module_stmt = 0; - module->module_sources = NULL; -} - -/* End functions */ - - -]]) - -AT_DATA([prog.c.h], [[ -/* Generated by cobc 3.3-dev.0 */ -/* Generated from prog.cob */ -/* Generated at févr. 23 2024 16:55:19 */ -/* GnuCOBOL build date Feb 21 2024 15:41:43 */ -/* GnuCOBOL package date Feb 01 2024 13:58:21 UTC */ -/* Compile command cobc -Cx prog.cob */ - - -/* Module path */ -static const char *cob_module_path = NULL; - -/* Number of call parameters */ -static int cob_call_params = 0; - -/* Attributes */ - -static const cob_field_attr a_1 = {0x10, 2, 0, 0x0007, NULL}; -static const cob_field_attr a_2 = {0x11, 9, 0, 0x0041, NULL}; -static const cob_field_attr a_3 = {0x21, 0, 0, 0x1000, NULL}; -static const cob_field_attr a_4 = {0x10, 2, 0, 0x0003, NULL}; -static const cob_field_attr a_5 = {0x10, 2, 0, 0x0001, NULL}; - - -/* Constants */ -static const cob_field c_1 = {1, (cob_u8_ptr)"1", &a_3}; -static const cob_field c_2 = {5, (cob_u8_ptr)"T1 - ", &a_3}; -static const cob_field c_3 = {5, (cob_u8_ptr)"T2 - ", &a_3}; -static const cob_field c_4 = {5, (cob_u8_ptr)"T3 - ", &a_3}; -static const cob_field c_5 = {5, (cob_u8_ptr)"T4 - ", &a_3}; -static const cob_field c_6 = {5, (cob_u8_ptr)"T5 - ", &a_3}; -static const cob_field c_7 = {5, (cob_u8_ptr)"T6 - ", &a_3}; -static const cob_field c_8 = {5, (cob_u8_ptr)"T7 - ", &a_3}; -static const cob_field c_9 = {5, (cob_u8_ptr)"T8 - ", &a_3}; -static const cob_field c_10 = {3, (cob_u8_ptr)"123", &a_3}; -static const cob_field c_11 = {3, (cob_u8_ptr)"234", &a_3}; -static const cob_field c_12 = {5, (cob_u8_ptr)"C1 - ", &a_3}; -static const cob_field c_13 = {3, (cob_u8_ptr)"-22", &a_1}; -static const cob_field c_14 = {5, (cob_u8_ptr)"C2 - ", &a_3}; -static const cob_field c_15 = {3, (cob_u8_ptr)"+22", &a_1}; -static const cob_field c_16 = {5, (cob_u8_ptr)"C3 - ", &a_3}; -static const cob_field c_17 = {5, (cob_u8_ptr)"C4 - ", &a_3}; -static const cob_field c_18 = {5, (cob_u8_ptr)"C5 - ", &a_3}; -static const cob_field c_19 = {5, (cob_u8_ptr)"C6 - ", &a_3}; -static const cob_field c_20 = {5, (cob_u8_ptr)"C7 - ", &a_3}; -static const cob_field c_21 = {5, (cob_u8_ptr)"C8 - ", &a_3}; -static const cob_field c_22 = {1, (cob_u8_ptr)"2", &a_3}; -static const cob_field c_23 = {1, (cob_u8_ptr)"3", &a_3}; -static const cob_field c_24 = {1, (cob_u8_ptr)"4", &a_3}; -static const cob_field c_25 = {5, (cob_u8_ptr)"R1 - ", &a_3}; -static const cob_field c_26 = {3, (cob_u8_ptr)"-33", &a_1}; -static const cob_field c_27 = {5, (cob_u8_ptr)"R2 - ", &a_3}; -static const cob_field c_28 = {3, (cob_u8_ptr)"+33", &a_1}; -static const cob_field c_29 = {5, (cob_u8_ptr)"R3 - ", &a_3}; -static const cob_field c_30 = {5, (cob_u8_ptr)"R4 - ", &a_3}; -static const cob_field c_31 = {5, (cob_u8_ptr)"R5 - ", &a_3}; -static const cob_field c_32 = {5, (cob_u8_ptr)"R6 - ", &a_3}; -static const cob_field c_33 = {5, (cob_u8_ptr)"R7 - ", &a_3}; -static const cob_field c_34 = {5, (cob_u8_ptr)"R8 - ", &a_3}; -static const cob_field c_35 = {3, (cob_u8_ptr)"-11", &a_1}; -static const cob_field c_36 = {3, (cob_u8_ptr)"+11", &a_1}; - - -static COB_INLINE COB_A_INLINE int -cob_cmp_s32 (const void *p, const cob_s64_t n) -{ - int val; - void *x; - x = &val; - optim_memcpy (x, p, 4); - return (val < n) ? -1 : (val > n); -} - - -]]) - -AT_DATA([prog.c.l.h], [[ -/* Generated by cobc 3.3-dev.0 */ -/* Generated from prog.cob */ -/* Generated at févr. 23 2024 16:55:19 */ -/* GnuCOBOL build date Feb 21 2024 15:41:43 */ -/* GnuCOBOL package date Feb 01 2024 13:58:21 UTC */ -/* Compile command cobc -Cx prog.cob */ - -/* Program local variables for 'prog' */ - -/* Module initialization indicator */ -static unsigned int initialized = 0; - -/* Module structure pointer */ -static cob_module *module = NULL; - -/* Global variable pointer */ -cob_global *cob_glob_ptr; - - -/* LINKAGE SECTION (Items not referenced by USING clause) */ -static unsigned char *b_9 = NULL; /* XML-NAMESPACE */ -static unsigned char *b_10 = NULL; /* XML-NAMESPACE-PREFIX */ -static unsigned char *b_11 = NULL; /* XML-NNAMESPACE */ -static unsigned char *b_12 = NULL; /* XML-NNAMESPACE-PREFIX */ -static unsigned char *b_13 = NULL; /* XML-NTEXT */ -static unsigned char *b_14 = NULL; /* XML-TEXT */ - - -/* Call parameters */ -cob_field *cob_procedure_params[1]; - -/* Perform frame stack */ -struct cob_frame *frame_ptr; -struct cob_frame frame_stack[255]; - - -/* Data storage */ -static int b_2; /* RETURN-CODE */ -static cob_u8_t b_17[3] __attribute__((aligned)); /* SEPARATE1 */ -static cob_u8_t b_18[3] __attribute__((aligned)); /* SEPARATE2 */ -static cob_u8_t b_19[3] __attribute__((aligned)); /* TSEPARATE1 */ -static cob_u8_t b_20[3] __attribute__((aligned)); /* TSEPARATE2 */ -static cob_u8_t b_21[2] __attribute__((aligned)); /* NSEPARATE1 */ -static cob_u8_t b_22[2] __attribute__((aligned)); /* NSEPARATE2 */ -static cob_u8_t b_23[2] __attribute__((aligned)); /* TRAILING1 */ -static cob_u8_t b_24[2] __attribute__((aligned)); /* TRAILING2 */ -static cob_u8_t b_25[4] __attribute__((aligned)); /* CNT */ - -/* End of local data storage */ - - -/* Fields (local) */ -static cob_field f_17 = {3, b_17, &a_1}; /* SEPARATE1 */ -static cob_field f_18 = {3, b_18, &a_1}; /* SEPARATE2 */ -static cob_field f_19 = {3, b_19, &a_4}; /* TSEPARATE1 */ -static cob_field f_20 = {3, b_20, &a_4}; /* TSEPARATE2 */ -static cob_field f_21 = {2, b_21, &a_5}; /* NSEPARATE1 */ -static cob_field f_22 = {2, b_22, &a_5}; /* NSEPARATE2 */ -static cob_field f_23 = {2, b_23, &a_5}; /* TRAILING1 */ -static cob_field f_24 = {2, b_24, &a_5}; /* TRAILING2 */ -static cob_field f_25 = {4, b_25, &a_2}; /* CNT */ - -/* End of fields */ - - -]]) - -AT_CHECK([$COMPILE prog.c], [0], [], []) -AT_CHECK([$COBCRUN_DIRECT ./prog], [0], [], []) -AT_CLEANUP - - -AT_SETUP([INSPECT TALLYING BEFORE]) -AT_KEYWORDS([runmisc]) - -AT_DATA([prog.c], [[ -/* Generated by cobc 3.3-dev.0 */ -/* Generated from prog.cob */ -/* Generated at févr. 23 2024 16:56:39 */ -/* GnuCOBOL build date Feb 21 2024 15:41:43 */ -/* GnuCOBOL package date Feb 01 2024 13:58:21 UTC */ -/* Compile command cobc -Cx prog.cob */ - -#include /* for memcpy, memcmp and friends */ -#define COB_KEYWORD_INLINE __inline -#include - -#define COB_SOURCE_FILE "prog.cob" -#define COB_PACKAGE_VERSION "3.3-dev" -#define COB_PATCH_LEVEL 0 -#define COB_MODULE_FORMATTED_DATE "févr. 23 2024 16:56:39" -#define COB_MODULE_DATE 20240223 -#define COB_MODULE_TIME 165639 - -/* Global variables */ -#include "prog.c.h" - -/* Function prototypes */ - -static int prog (); -static int prog_ (const int); -static void prog_module_init (cob_module *module); - -/* Main function */ -int -main (int argc, char **argv) -{ - cob_init (argc, argv); - cob_stop_run (prog ()); -} - -/* Functions */ - -static void gc_module_so_init () __attribute__ ((constructor)); -static void gc_module_so_init () -{ - cob_check_version (COB_SOURCE_FILE, COB_PACKAGE_VERSION, COB_PATCH_LEVEL); -} - -/* PROGRAM-ID 'prog' */ - -/* ENTRY 'prog' */ - -static int -prog () -{ - return prog_ (0); -} - -static int -prog_ (const int entry) -{ - /* Program local variables */ - #include "prog.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; - - /* 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: 8 : Entry prog : prog.cob */ - l_2:; - - /* Line: 8 : MOVE : prog.cob */ - memset (b_18, 48, 3); - - /* Line: 9 : INSPECT : prog.cob */ - cob_inspect_init (&f_17, 0); - cob_inspect_start (); - cob_inspect_before ((cob_field *)&c_1); - cob_inspect_characters (&f_18); - cob_inspect_finish (); - - /* Line: 11 : IF : prog.cob */ - if (((int)cob_cmp_numdisp (b_18, 3, COB_S64_C(3), 0) != 0)) - { - - /* Line: 12 : DISPLAY : prog.cob */ - cob_display (0, 1, 2, &c_2, &f_18); - } - - /* Line: 14 : MOVE : prog.cob */ - memset (b_18, 48, 3); - - /* Line: 15 : MOVE : prog.cob */ - memcpy (b_17, " ABC", 4); - - /* Line: 16 : INSPECT : prog.cob */ - cob_inspect_init (&f_17, 0); - cob_inspect_start (); - cob_inspect_before ((cob_field *)&c_1); - cob_inspect_characters (&f_18); - cob_inspect_finish (); - - /* Line: 18 : IF : prog.cob */ - if (((int)cob_numeric_display_cmp_zero (&f_18) != 0)) - { - - /* Line: 19 : DISPLAY : prog.cob */ - cob_display (0, 1, 2, &c_3, &f_18); - } - - /* Line: 21 : STOP RUN : prog.cob */ - cob_stop_run (b_2); - - /* 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_module_path = cob_glob_ptr->cob_main_argv0; - - prog_module_init (module); - - module->collating_sequence = NULL; - module->crt_status = NULL; - module->cursor_pos = NULL; - module->xml_code = NULL; - module->xml_event = NULL; - module->xml_information = NULL; - module->xml_namespace = NULL; - module->xml_namespace_prefix = NULL; - module->xml_nnamespace = NULL; - module->xml_nnamespace_prefix = NULL; - module->xml_ntext = NULL; - module->xml_text = NULL; - module->json_code = NULL; - module->json_status = NULL; - - /* Initialize cancel callback */ - cob_set_cancel (module); - - /* Initialize WORKING-STORAGE */ - /* initialize field RETURN-CODE */ - b_2 = 0; - - /* initialize field X */ - memcpy (b_17, "ABC ", 4); - - /* initialize field TAL */ - memset (b_18, 48, 3); - - - 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 'prog' */ - -/* Initialize module structure for prog */ -static void prog_module_init (cob_module *module) -{ - module->module_name = "prog"; - module->module_formatted_date = COB_MODULE_FORMATTED_DATE; - module->module_source = COB_SOURCE_FILE; - module->gc_version = COB_PACKAGE_VERSION; - module->module_entry.funcptr = (void *(*)())prog; - module->module_cancel.funcptr = (void *(*)())prog_; - 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->xml_mode = 1; - module->module_stmt = 0; - module->module_sources = NULL; -} - -/* End functions */ - - -]]) - -AT_DATA([prog.c.h], [[ -/* Generated by cobc 3.3-dev.0 */ -/* Generated from prog.cob */ -/* Generated at févr. 23 2024 16:56:39 */ -/* GnuCOBOL build date Feb 21 2024 15:41:43 */ -/* GnuCOBOL package date Feb 01 2024 13:58:21 UTC */ -/* Compile command cobc -Cx prog.cob */ - - -/* Module path */ -static const char *cob_module_path = NULL; - -/* Number of call parameters */ -static int cob_call_params = 0; - -/* Attributes */ - -static const cob_field_attr a_1 = {0x21, 0, 0, 0x0000, NULL}; -static const cob_field_attr a_2 = {0x21, 0, 0, 0x1000, NULL}; -static const cob_field_attr a_3 = {0x10, 3, 0, 0x0000, NULL}; - - -/* Constants */ -static const cob_field c_1 = {1, (cob_u8_ptr)" ", &a_2}; -static const cob_field c_2 = {22, (cob_u8_ptr)"1: should be 3 but is ", &a_2}; -static const cob_field c_3 = {22, (cob_u8_ptr)"2: should be 0 but is ", &a_2}; - - -]]) - -AT_DATA([prog.c.l.h], [[ -/* Generated by cobc 3.3-dev.0 */ -/* Generated from prog.cob */ -/* Generated at févr. 23 2024 16:56:39 */ -/* GnuCOBOL build date Feb 21 2024 15:41:43 */ -/* GnuCOBOL package date Feb 01 2024 13:58:21 UTC */ -/* Compile command cobc -Cx prog.cob */ - -/* Program local variables for 'prog' */ - -/* Module initialization indicator */ -static unsigned int initialized = 0; - -/* Module structure pointer */ -static cob_module *module = NULL; - -/* Global variable pointer */ -cob_global *cob_glob_ptr; - - -/* LINKAGE SECTION (Items not referenced by USING clause) */ -static unsigned char *b_9 = NULL; /* XML-NAMESPACE */ -static unsigned char *b_10 = NULL; /* XML-NAMESPACE-PREFIX */ -static unsigned char *b_11 = NULL; /* XML-NNAMESPACE */ -static unsigned char *b_12 = NULL; /* XML-NNAMESPACE-PREFIX */ -static unsigned char *b_13 = NULL; /* XML-NTEXT */ -static unsigned char *b_14 = NULL; /* XML-TEXT */ - - -/* Call parameters */ -cob_field *cob_procedure_params[1]; - -/* Perform frame stack */ -struct cob_frame *frame_ptr; -struct cob_frame frame_stack[255]; - - -/* Data storage */ -static int b_2; /* RETURN-CODE */ -static cob_u8_t b_17[4] __attribute__((aligned)); /* X */ -static cob_u8_t b_18[3] __attribute__((aligned)); /* TAL */ - -/* End of local data storage */ - - -/* Fields (local) */ -static cob_field f_17 = {4, b_17, &a_1}; /* X */ -static cob_field f_18 = {3, b_18, &a_3}; /* TAL */ - -/* End of fields */ - - -]]) - - -AT_CHECK([$COMPILE prog.c], [0], [], []) -AT_CHECK([$COBCRUN_DIRECT ./prog], [0], [], []) - -AT_CLEANUP - - -AT_SETUP([INSPECT TALLYING AFTER]) -AT_KEYWORDS([runmisc]) - -AT_DATA([prog.c], [[ -/* Generated by cobc 3.3-dev.0 */ -/* Generated from prog.cob */ -/* Generated at févr. 23 2024 16:57:16 */ -/* GnuCOBOL build date Feb 21 2024 15:41:43 */ -/* GnuCOBOL package date Feb 01 2024 13:58:21 UTC */ -/* Compile command cobc -Cx prog.cob */ - -#include /* for memcpy, memcmp and friends */ -#define COB_KEYWORD_INLINE __inline -#include - -#define COB_SOURCE_FILE "prog.cob" -#define COB_PACKAGE_VERSION "3.3-dev" -#define COB_PATCH_LEVEL 0 -#define COB_MODULE_FORMATTED_DATE "févr. 23 2024 16:57:16" -#define COB_MODULE_DATE 20240223 -#define COB_MODULE_TIME 165716 - -/* Global variables */ -#include "prog.c.h" - -/* Function prototypes */ - -static int prog (); -static int prog_ (const int); -static void prog_module_init (cob_module *module); - -/* Main function */ -int -main (int argc, char **argv) -{ - cob_init (argc, argv); - cob_stop_run (prog ()); -} - -/* Functions */ - -static void gc_module_so_init () __attribute__ ((constructor)); -static void gc_module_so_init () -{ - cob_check_version (COB_SOURCE_FILE, COB_PACKAGE_VERSION, COB_PATCH_LEVEL); -} - -/* PROGRAM-ID 'prog' */ - -/* ENTRY 'prog' */ - -static int -prog () -{ - return prog_ (0); -} - -static int -prog_ (const int entry) -{ - /* Program local variables */ - #include "prog.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; - - /* 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: 8 : Entry prog : prog.cob */ - l_2:; - - /* Line: 8 : MOVE : prog.cob */ - memset (b_18, 48, 3); - - /* Line: 9 : INSPECT : prog.cob */ - cob_inspect_init (&f_17, 0); - cob_inspect_start (); - cob_inspect_after ((cob_field *)&c_1); - cob_inspect_characters (&f_18); - cob_inspect_finish (); - - /* Line: 11 : IF : prog.cob */ - if (((int)cob_numeric_display_cmp_zero (&f_18) != 0)) - { - - /* Line: 12 : DISPLAY : prog.cob */ - cob_display (0, 1, 1, &f_18); - } - - /* Line: 14 : MOVE : prog.cob */ - memset (b_18, 48, 3); - - /* Line: 15 : MOVE : prog.cob */ - memcpy (b_17, " ABC", 4); - - /* Line: 16 : INSPECT : prog.cob */ - cob_inspect_init (&f_17, 0); - cob_inspect_start (); - cob_inspect_after ((cob_field *)&c_1); - cob_inspect_characters (&f_18); - cob_inspect_finish (); - - /* Line: 18 : IF : prog.cob */ - if (((int)cob_cmp_numdisp (b_18, 3, COB_S64_C(3), 0) != 0)) - { - - /* Line: 19 : DISPLAY : prog.cob */ - cob_display (0, 1, 1, &f_18); - } - - /* Line: 21 : STOP RUN : prog.cob */ - cob_stop_run (b_2); - - /* 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_module_path = cob_glob_ptr->cob_main_argv0; - - prog_module_init (module); - - module->collating_sequence = NULL; - module->crt_status = NULL; - module->cursor_pos = NULL; - module->xml_code = NULL; - module->xml_event = NULL; - module->xml_information = NULL; - module->xml_namespace = NULL; - module->xml_namespace_prefix = NULL; - module->xml_nnamespace = NULL; - module->xml_nnamespace_prefix = NULL; - module->xml_ntext = NULL; - module->xml_text = NULL; - module->json_code = NULL; - module->json_status = NULL; - - /* Initialize cancel callback */ - cob_set_cancel (module); - - /* Initialize WORKING-STORAGE */ - /* initialize field RETURN-CODE */ - b_2 = 0; - - /* initialize field X */ - memcpy (b_17, "ABC ", 4); - - /* initialize field TAL */ - memset (b_18, 48, 3); - - - 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 'prog' */ - -/* Initialize module structure for prog */ -static void prog_module_init (cob_module *module) -{ - module->module_name = "prog"; - module->module_formatted_date = COB_MODULE_FORMATTED_DATE; - module->module_source = COB_SOURCE_FILE; - module->gc_version = COB_PACKAGE_VERSION; - module->module_entry.funcptr = (void *(*)())prog; - module->module_cancel.funcptr = (void *(*)())prog_; - 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->xml_mode = 1; - module->module_stmt = 0; - module->module_sources = NULL; -} - -/* End functions */ - - -]]) - -AT_DATA([prog.c.h], [[ -/* Generated by cobc 3.3-dev.0 */ -/* Generated from prog.cob */ -/* Generated at févr. 23 2024 16:57:16 */ -/* GnuCOBOL build date Feb 21 2024 15:41:43 */ -/* GnuCOBOL package date Feb 01 2024 13:58:21 UTC */ -/* Compile command cobc -Cx prog.cob */ - - -/* Module path */ -static const char *cob_module_path = NULL; - -/* Number of call parameters */ -static int cob_call_params = 0; - -/* Attributes */ - -static const cob_field_attr a_1 = {0x21, 0, 0, 0x0000, NULL}; -static const cob_field_attr a_2 = {0x21, 0, 0, 0x1000, NULL}; -static const cob_field_attr a_3 = {0x10, 3, 0, 0x0000, NULL}; - - -/* Constants */ -static const cob_field c_1 = {1, (cob_u8_ptr)" ", &a_2}; - - -]]) - -AT_DATA([prog.c.l.h], [[ -/* Generated by cobc 3.3-dev.0 */ -/* Generated from prog.cob */ -/* Generated at févr. 23 2024 16:57:16 */ -/* GnuCOBOL build date Feb 21 2024 15:41:43 */ -/* GnuCOBOL package date Feb 01 2024 13:58:21 UTC */ -/* Compile command cobc -Cx prog.cob */ - -/* Program local variables for 'prog' */ - -/* Module initialization indicator */ -static unsigned int initialized = 0; - -/* Module structure pointer */ -static cob_module *module = NULL; - -/* Global variable pointer */ -cob_global *cob_glob_ptr; - - -/* LINKAGE SECTION (Items not referenced by USING clause) */ -static unsigned char *b_9 = NULL; /* XML-NAMESPACE */ -static unsigned char *b_10 = NULL; /* XML-NAMESPACE-PREFIX */ -static unsigned char *b_11 = NULL; /* XML-NNAMESPACE */ -static unsigned char *b_12 = NULL; /* XML-NNAMESPACE-PREFIX */ -static unsigned char *b_13 = NULL; /* XML-NTEXT */ -static unsigned char *b_14 = NULL; /* XML-TEXT */ - - -/* Call parameters */ -cob_field *cob_procedure_params[1]; - -/* Perform frame stack */ -struct cob_frame *frame_ptr; -struct cob_frame frame_stack[255]; - - -/* Data storage */ -static int b_2; /* RETURN-CODE */ -static cob_u8_t b_17[4] __attribute__((aligned)); /* X */ -static cob_u8_t b_18[3] __attribute__((aligned)); /* TAL */ - -/* End of local data storage */ - - -/* Fields (local) */ -static cob_field f_17 = {4, b_17, &a_1}; /* X */ -static cob_field f_18 = {3, b_18, &a_3}; /* TAL */ - -/* End of fields */ - - -]]) - - -AT_CHECK([$COMPILE prog.c], [0], [], []) -AT_CHECK([$COBCRUN_DIRECT ./prog], [0], [], []) - -AT_CLEANUP - - -AT_SETUP([INSPECT TALLYING BEFORE and AFTER]) -AT_KEYWORDS([runmisc]) - -AT_DATA([prog.c], [[ -/* Generated by cobc 3.3-dev.0 */ -/* Generated from prog.cob */ -/* Generated at févr. 23 2024 16:57:35 */ -/* GnuCOBOL build date Feb 21 2024 15:41:43 */ -/* GnuCOBOL package date Feb 01 2024 13:58:21 UTC */ -/* Compile command cobc -Cx prog.cob */ - -#include /* for memcpy, memcmp and friends */ -#define COB_KEYWORD_INLINE __inline -#include - -#define COB_SOURCE_FILE "prog.cob" -#define COB_PACKAGE_VERSION "3.3-dev" -#define COB_PATCH_LEVEL 0 -#define COB_MODULE_FORMATTED_DATE "févr. 23 2024 16:57:35" -#define COB_MODULE_DATE 20240223 -#define COB_MODULE_TIME 165735 - -/* Global variables */ -#include "prog.c.h" - -/* Function prototypes */ - -static int prog (); -static int prog_ (const int); -static void prog_module_init (cob_module *module); - -/* Main function */ -int -main (int argc, char **argv) -{ - cob_init (argc, argv); - cob_stop_run (prog ()); -} - -/* Functions */ - -static void gc_module_so_init () __attribute__ ((constructor)); -static void gc_module_so_init () -{ - cob_check_version (COB_SOURCE_FILE, COB_PACKAGE_VERSION, COB_PATCH_LEVEL); -} - -/* PROGRAM-ID 'prog' */ - -/* ENTRY 'prog' */ - -static int -prog () -{ - return prog_ (0); -} - -static int -prog_ (const int entry) -{ - /* Program local variables */ - #include "prog.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; - - /* 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: 9 : Entry prog : prog.cob */ - l_2:; - - /* Line: 9 : MOVE : prog.cob */ - memset (b_18, 48, 3); - - /* Line: 10 : INSPECT : prog.cob */ - cob_inspect_init (&f_17, 0); - cob_inspect_start (); - cob_inspect_before ((cob_field *)&c_1); - cob_inspect_after ((cob_field *)&c_1); - cob_inspect_characters (&f_18); - cob_inspect_finish (); - - /* Line: 13 : IF : prog.cob */ - if (((int)cob_numeric_display_cmp_zero (&f_18) != 0)) - { - - /* Line: 14 : DISPLAY : prog.cob */ - cob_display (0, 1, 2, &c_2, &f_18); - } - - /* Line: 17 : MOVE : prog.cob */ - memset (b_18, 48, 3); - - /* Line: 18 : INSPECT : prog.cob */ - cob_inspect_init (&f_19, 0); - cob_inspect_start (); - cob_inspect_after ((cob_field *)&c_3); - cob_inspect_before ((cob_field *)&c_4); - cob_inspect_characters (&f_18); - cob_inspect_finish (); - - /* Line: 21 : IF : prog.cob */ - if (((int)cob_numeric_display_cmp_zero (&f_18) != 0)) - { - - /* Line: 22 : DISPLAY : prog.cob */ - cob_display (0, 1, 2, &c_5, &f_18); - } - - /* Line: 24 : STOP RUN : prog.cob */ - cob_stop_run (b_2); - - /* 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_module_path = cob_glob_ptr->cob_main_argv0; - - prog_module_init (module); - - module->collating_sequence = NULL; - module->crt_status = NULL; - module->cursor_pos = NULL; - module->xml_code = NULL; - module->xml_event = NULL; - module->xml_information = NULL; - module->xml_namespace = NULL; - module->xml_namespace_prefix = NULL; - module->xml_nnamespace = NULL; - module->xml_nnamespace_prefix = NULL; - module->xml_ntext = NULL; - module->xml_text = NULL; - module->json_code = NULL; - module->json_status = NULL; - - /* Initialize cancel callback */ - cob_set_cancel (module); - - /* Initialize WORKING-STORAGE */ - /* initialize field RETURN-CODE */ - b_2 = 0; - - /* initialize field X */ - memcpy (b_17, "ABC ", 4); - - /* initialize field TAL */ - memset (b_18, 48, 3); - - /* initialize field MSG */ - memset (b_19, 32, 256); - - - 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 'prog' */ - -/* Initialize module structure for prog */ -static void prog_module_init (cob_module *module) -{ - module->module_name = "prog"; - module->module_formatted_date = COB_MODULE_FORMATTED_DATE; - module->module_source = COB_SOURCE_FILE; - module->gc_version = COB_PACKAGE_VERSION; - module->module_entry.funcptr = (void *(*)())prog; - module->module_cancel.funcptr = (void *(*)())prog_; - 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->xml_mode = 1; - module->module_stmt = 0; - module->module_sources = NULL; -} - -/* End functions */ - - -]]) - -AT_DATA([prog.c.h], [[ -/* Generated by cobc 3.3-dev.0 */ -/* Generated from prog.cob */ -/* Generated at févr. 23 2024 16:57:35 */ -/* GnuCOBOL build date Feb 21 2024 15:41:43 */ -/* GnuCOBOL package date Feb 01 2024 13:58:21 UTC */ -/* Compile command cobc -Cx prog.cob */ - - -/* Module path */ -static const char *cob_module_path = NULL; - -/* Number of call parameters */ -static int cob_call_params = 0; - -/* Attributes */ - -static const cob_field_attr a_1 = {0x21, 0, 0, 0x0000, NULL}; -static const cob_field_attr a_2 = {0x21, 0, 0, 0x1000, NULL}; -static const cob_field_attr a_3 = {0x10, 3, 0, 0x0000, NULL}; - - -/* Constants */ -static const cob_field c_1 = {1, (cob_u8_ptr)" ", &a_2}; -static const cob_field c_2 = {22, (cob_u8_ptr)"1: should be 0 but is ", &a_2}; -static const cob_field c_3 = {1, (cob_u8_ptr)"<", &a_2}; -static const cob_field c_4 = {2, (cob_u8_ptr)" /* for memcpy, memcmp and friends */ -#define COB_KEYWORD_INLINE __inline -#include - -#define COB_SOURCE_FILE "prog.cob" -#define COB_PACKAGE_VERSION "3.3-dev" -#define COB_PATCH_LEVEL 0 -#define COB_MODULE_FORMATTED_DATE "févr. 23 2024 16:58:36" -#define COB_MODULE_DATE 20240223 -#define COB_MODULE_TIME 165836 - -/* Global variables */ -#include "prog.c.h" - -/* Function prototypes */ - -static int prog (); -static int prog_ (const int); -static void prog_module_init (cob_module *module); - -/* Main function */ -int -main (int argc, char **argv) -{ - cob_init (argc, argv); - cob_stop_run (prog ()); -} - -/* Functions */ - -static void gc_module_so_init () __attribute__ ((constructor)); -static void gc_module_so_init () -{ - cob_check_version (COB_SOURCE_FILE, COB_PACKAGE_VERSION, COB_PATCH_LEVEL); -} - -/* PROGRAM-ID 'prog' */ - -/* ENTRY 'prog' */ - -static int -prog () -{ - return prog_ (0); -} - -static int -prog_ (const int entry) -{ - /* Program local variables */ - #include "prog.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; - - /* 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: 11 : Entry prog : prog.cob */ - l_2:; - - /* Line: 11 : INSPECT : prog.cob */ - cob_inspect_init (&f_17, 0); - cob_inspect_start (); - cob_inspect_before ((cob_field *)&c_1); - cob_inspect_characters (&f_19); - cob_inspect_start (); - cob_inspect_after ((cob_field *)&c_2); - cob_inspect_characters (&f_20); - cob_inspect_finish (); - cob_inspect_init (&f_17, 1); - cob_inspect_start (); - cob_inspect_after ((cob_field *)&c_3); - cob_inspect_before ((cob_field *)&c_4); - cob_inspect_characters ((cob_field *)&c_5); - cob_inspect_start (); - cob_inspect_after ((cob_field *)&c_6); - cob_inspect_before ((cob_field *)&c_7); - cob_inspect_characters ((cob_field *)&c_8); - cob_inspect_finish (); - - /* Line: 18 : IF : prog.cob */ - if (((int)memcmp (b_17, (cob_u8_ptr)"A22222111111111122222222YZ", 26) != 0)) - { - - /* Line: 19 : DISPLAY : prog.cob */ - cob_display (0, 1, 5, &c_9, &f_17, &c_10, &c_11, &c_12); - } - - /* Line: 20 : IF : prog.cob */ - if (((int)cob_cmpswp_u16 (b_19, COB_S64_C(107)) != 0)) - { - - /* Line: 21 : DISPLAY : prog.cob */ - cob_display (0, 1, 3, &c_9, &f_19, &c_13); - } - - /* Line: 22 : IF : prog.cob */ - if (((int)cob_cmpswp_u16 (b_20, COB_S64_C(19)) != 0)) - { - - /* Line: 23 : DISPLAY : prog.cob */ - cob_display (0, 1, 3, &c_9, &f_20, &c_14); - } - - /* Line: 25 : GOBACK : prog.cob */ - goto exit_program; - - /* Program exit */ - - exit_program: - - /* 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_module_path = cob_glob_ptr->cob_main_argv0; - - prog_module_init (module); - - module->collating_sequence = NULL; - module->crt_status = NULL; - module->cursor_pos = NULL; - module->xml_code = NULL; - module->xml_event = NULL; - module->xml_information = NULL; - module->xml_namespace = NULL; - module->xml_namespace_prefix = NULL; - module->xml_nnamespace = NULL; - module->xml_nnamespace_prefix = NULL; - module->xml_ntext = NULL; - module->xml_text = NULL; - module->json_code = NULL; - module->json_status = NULL; - - /* Initialize cancel callback */ - cob_set_cancel (module); - - /* Initialize WORKING-STORAGE */ - /* initialize field RETURN-CODE */ - b_2 = 0; - - /* initialize field INSP-STRING */ - memcpy (b_17, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", 26); - - /* initialize field RES-IDX */ - cob_move ((cob_field *)&c_15, &f_19); - - /* initialize field RES-IDX-1 */ - memset (b_20, 0, 2); - - - 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 'prog' */ - -/* Initialize module structure for prog */ -static void prog_module_init (cob_module *module) -{ - module->module_name = "prog"; - module->module_formatted_date = COB_MODULE_FORMATTED_DATE; - module->module_source = COB_SOURCE_FILE; - module->gc_version = COB_PACKAGE_VERSION; - module->module_entry.funcptr = (void *(*)())prog; - module->module_cancel.funcptr = (void *(*)())prog_; - 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->xml_mode = 1; - module->module_stmt = 0; - module->module_sources = NULL; -} - -/* End functions */ - - -]]) - -AT_DATA([prog.c.h], [[ -/* Generated by cobc 3.3-dev.0 */ -/* Generated from prog.cob */ -/* Generated at févr. 23 2024 16:58:36 */ -/* GnuCOBOL build date Feb 21 2024 15:41:43 */ -/* GnuCOBOL package date Feb 01 2024 13:58:21 UTC */ -/* Compile command cobc -Cx prog.cob */ - - -/* Module path */ -static const char *cob_module_path = NULL; - -/* Number of call parameters */ -static int cob_call_params = 0; - -/* Attributes */ - -static const cob_field_attr a_1 = {0x21, 0, 0, 0x0000, NULL}; -static const cob_field_attr a_2 = {0x21, 0, 0, 0x1000, NULL}; -static const cob_field_attr a_3 = {0x11, 4, 0, 0x0820, NULL}; -static const cob_field_attr a_4 = {0x10, 3, 0, 0x1000, NULL}; - - -/* Constants */ -static const cob_field c_1 = {1, (cob_u8_ptr)"H", &a_2}; -static const cob_field c_2 = {1, (cob_u8_ptr)"B", &a_2}; -static const cob_field c_3 = {1, (cob_u8_ptr)"F", &a_2}; -static const cob_field c_4 = {1, (cob_u8_ptr)"Q", &a_2}; -static const cob_field c_5 = {1, (cob_u8_ptr)"1", &a_2}; -static const cob_field c_6 = {1, (cob_u8_ptr)"A", &a_2}; -static const cob_field c_7 = {1, (cob_u8_ptr)"Y", &a_2}; -static const cob_field c_8 = {1, (cob_u8_ptr)"2", &a_2}; -static const cob_field c_9 = {8, (cob_u8_ptr)"Failed <", &a_2}; -static const cob_field c_10 = {6, (cob_u8_ptr)"> != <", &a_2}; -static const cob_field c_11 = {26, (cob_u8_ptr)"A22222111111111122222222YZ", &a_2}; -static const cob_field c_12 = {1, (cob_u8_ptr)">", &a_2}; -static const cob_field c_13 = {10, (cob_u8_ptr)"> != <107>", &a_2}; -static const cob_field c_14 = {9, (cob_u8_ptr)"> != <19>", &a_2}; -static const cob_field c_15 = {3, (cob_u8_ptr)"100", &a_4}; - - -static COB_INLINE COB_A_INLINE int -cob_cmpswp_u16 (const void *p, const cob_s64_t n) -{ - void *x; - unsigned short val; - if (unlikely(n < 0)) { - return 1; - } - x = &val; - optim_memcpy (x, p, 2); - val = COB_BSWAP_16 (val); - return (val < n) ? -1 : (val > n); -} - - -]]) - -AT_DATA([prog.c.l.h], [[ -/* Generated by cobc 3.3-dev.0 */ -/* Generated from prog.cob */ -/* Generated at févr. 23 2024 16:58:36 */ -/* GnuCOBOL build date Feb 21 2024 15:41:43 */ -/* GnuCOBOL package date Feb 01 2024 13:58:21 UTC */ -/* Compile command cobc -Cx prog.cob */ - -/* Program local variables for 'prog' */ - -/* Module initialization indicator */ -static unsigned int initialized = 0; - -/* Module structure pointer */ -static cob_module *module = NULL; - -/* Global variable pointer */ -cob_global *cob_glob_ptr; - - -/* LINKAGE SECTION (Items not referenced by USING clause) */ -static unsigned char *b_9 = NULL; /* XML-NAMESPACE */ -static unsigned char *b_10 = NULL; /* XML-NAMESPACE-PREFIX */ -static unsigned char *b_11 = NULL; /* XML-NNAMESPACE */ -static unsigned char *b_12 = NULL; /* XML-NNAMESPACE-PREFIX */ -static unsigned char *b_13 = NULL; /* XML-NTEXT */ -static unsigned char *b_14 = NULL; /* XML-TEXT */ - - -/* Call parameters */ -cob_field *cob_procedure_params[1]; - -/* Perform frame stack */ -struct cob_frame *frame_ptr; -struct cob_frame frame_stack[255]; - - -/* Data storage */ -static int b_2; /* RETURN-CODE */ -static cob_u8_t b_17[26] __attribute__((aligned)); /* INSP-STRING */ -static cob_u8_t b_19[2] __attribute__((aligned)); /* RES-IDX */ -static cob_u8_t b_20[2] __attribute__((aligned)); /* RES-IDX-1 */ - -/* End of local data storage */ - - -/* Fields (local) */ -static cob_field f_17 = {26, b_17, &a_1}; /* INSP-STRING */ -static cob_field f_19 = {2, b_19, &a_3}; /* RES-IDX */ -static cob_field f_20 = {2, b_20, &a_3}; /* RES-IDX-1 */ - -/* End of fields */ - - -]]) - - -AT_CHECK([$COMPILE prog.c], [0], [], []) -AT_CHECK([$COBCRUN_DIRECT ./prog], [0], [], []) - -AT_CLEANUP - - -AT_SETUP([INSPECT REPLACING figurative constant]) -AT_KEYWORDS([runmisc]) - -AT_DATA([prog.c], [[ -/* Generated by cobc 3.3-dev.0 */ -/* Generated from prog.cob */ -/* Generated at févr. 23 2024 16:58:54 */ -/* GnuCOBOL build date Feb 21 2024 15:41:43 */ -/* GnuCOBOL package date Feb 01 2024 13:58:21 UTC */ -/* Compile command cobc -Cx prog.cob */ - -#include /* for memcpy, memcmp and friends */ -#define COB_KEYWORD_INLINE __inline -#include - -#define COB_SOURCE_FILE "prog.cob" -#define COB_PACKAGE_VERSION "3.3-dev" -#define COB_PATCH_LEVEL 0 -#define COB_MODULE_FORMATTED_DATE "févr. 23 2024 16:58:54" -#define COB_MODULE_DATE 20240223 -#define COB_MODULE_TIME 165854 - -/* Global variables */ -#include "prog.c.h" - -/* Function prototypes */ - -static int prog (); -static int prog_ (const int); -static void prog_module_init (cob_module *module); - -/* Main function */ -int -main (int argc, char **argv) -{ - cob_init (argc, argv); - cob_stop_run (prog ()); -} - -/* Functions */ - -static void gc_module_so_init () __attribute__ ((constructor)); -static void gc_module_so_init () -{ - cob_check_version (COB_SOURCE_FILE, COB_PACKAGE_VERSION, COB_PATCH_LEVEL); -} - -/* PROGRAM-ID 'prog' */ - -/* ENTRY 'prog' */ - -static int -prog () -{ - return prog_ (0); -} - -static int -prog_ (const int entry) -{ - /* Program local variables */ - #include "prog.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; - - /* 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: 7 : Entry prog : prog.cob */ - l_2:; - - /* Line: 7 : INSPECT : prog.cob */ - cob_inspect_init (&f_17, 1); - cob_inspect_start (); - cob_inspect_all (&cob_all_space, (cob_field *)&c_1); - cob_inspect_finish (); - - /* Line: 8 : IF : prog.cob */ - if (((int)memcmp (b_17, (cob_u8_ptr)" A", 3) != 0)) - { - - /* Line: 9 : DISPLAY : prog.cob */ - cob_display (0, 1, 1, &f_17); - } - - /* Line: 10 : STOP RUN : prog.cob */ - cob_stop_run (b_2); - - /* 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_module_path = cob_glob_ptr->cob_main_argv0; - - prog_module_init (module); - - module->collating_sequence = NULL; - module->crt_status = NULL; - module->cursor_pos = NULL; - module->xml_code = NULL; - module->xml_event = NULL; - module->xml_information = NULL; - module->xml_namespace = NULL; - module->xml_namespace_prefix = NULL; - module->xml_nnamespace = NULL; - module->xml_nnamespace_prefix = NULL; - module->xml_ntext = NULL; - module->xml_text = NULL; - module->json_code = NULL; - module->json_status = NULL; - - /* Initialize cancel callback */ - cob_set_cancel (module); - - /* Initialize WORKING-STORAGE */ - /* initialize field RETURN-CODE */ - b_2 = 0; - - /* initialize field X */ - memcpy (b_17, "BCA", 3); - - - 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 'prog' */ - -/* Initialize module structure for prog */ -static void prog_module_init (cob_module *module) -{ - module->module_name = "prog"; - module->module_formatted_date = COB_MODULE_FORMATTED_DATE; - module->module_source = COB_SOURCE_FILE; - module->gc_version = COB_PACKAGE_VERSION; - module->module_entry.funcptr = (void *(*)())prog; - module->module_cancel.funcptr = (void *(*)())prog_; - 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->xml_mode = 1; - module->module_stmt = 0; - module->module_sources = NULL; -} - -/* End functions */ - - -]]) - -AT_DATA([prog.c.h], [[ -/* Generated by cobc 3.3-dev.0 */ -/* Generated from prog.cob */ -/* Generated at févr. 23 2024 16:58:54 */ -/* GnuCOBOL build date Feb 21 2024 15:41:43 */ -/* GnuCOBOL package date Feb 01 2024 13:58:21 UTC */ -/* Compile command cobc -Cx prog.cob */ - - -/* Module path */ -static const char *cob_module_path = NULL; - -/* Number of call parameters */ -static int cob_call_params = 0; - -/* Attributes */ - -static const cob_field_attr a_1 = {0x21, 0, 0, 0x0000, NULL}; -static const cob_field_attr a_2 = {0x21, 0, 0, 0x1000, NULL}; - -static const cob_field_attr cob_all_attr = {0x22, 0, 0, 0, NULL}; - - -/* Constants */ -static const cob_field c_1 = {2, (cob_u8_ptr)"BC", &a_2}; - -static cob_field cob_all_space = {1, (cob_u8_ptr)" ", &cob_all_attr}; - - -]]) - -AT_DATA([prog.c.l.h], [[ -/* Generated by cobc 3.3-dev.0 */ -/* Generated from prog.cob */ -/* Generated at févr. 23 2024 16:58:54 */ -/* GnuCOBOL build date Feb 21 2024 15:41:43 */ -/* GnuCOBOL package date Feb 01 2024 13:58:21 UTC */ -/* Compile command cobc -Cx prog.cob */ - -/* Program local variables for 'prog' */ - -/* Module initialization indicator */ -static unsigned int initialized = 0; - -/* Module structure pointer */ -static cob_module *module = NULL; - -/* Global variable pointer */ -cob_global *cob_glob_ptr; - - -/* LINKAGE SECTION (Items not referenced by USING clause) */ -static unsigned char *b_9 = NULL; /* XML-NAMESPACE */ -static unsigned char *b_10 = NULL; /* XML-NAMESPACE-PREFIX */ -static unsigned char *b_11 = NULL; /* XML-NNAMESPACE */ -static unsigned char *b_12 = NULL; /* XML-NNAMESPACE-PREFIX */ -static unsigned char *b_13 = NULL; /* XML-NTEXT */ -static unsigned char *b_14 = NULL; /* XML-TEXT */ - - -/* Call parameters */ -cob_field *cob_procedure_params[1]; - -/* Perform frame stack */ -struct cob_frame *frame_ptr; -struct cob_frame frame_stack[255]; - - -/* Data storage */ -static int b_2; /* RETURN-CODE */ -static cob_u8_t b_17[3] __attribute__((aligned)); /* X */ - -/* End of local data storage */ - - -/* Fields (local) */ -static cob_field f_17 = {3, b_17, &a_1}; /* X */ - -/* End of fields */ - - -]]) - - -AT_CHECK([$COMPILE prog.c], [0], [], []) -AT_CHECK([$COBCRUN_DIRECT ./prog], [0], [], []) - -AT_CLEANUP - - -AT_SETUP([STRING with subscript reference]) -AT_KEYWORDS([runmisc]) - -AT_DATA([prog.c], [[ -/* Generated by cobc 3.3-dev.0 */ -/* Generated from prog.cob */ -/* Generated at févr. 23 2024 16:59:05 */ -/* GnuCOBOL build date Feb 21 2024 15:41:43 */ -/* GnuCOBOL package date Feb 01 2024 13:58:21 UTC */ -/* Compile command cobc -Cx prog.cob */ - -#include /* for memcpy, memcmp and friends */ -#define COB_KEYWORD_INLINE __inline -#include - -#define COB_SOURCE_FILE "prog.cob" -#define COB_PACKAGE_VERSION "3.3-dev" -#define COB_PATCH_LEVEL 0 -#define COB_MODULE_FORMATTED_DATE "févr. 23 2024 16:59:05" -#define COB_MODULE_DATE 20240223 -#define COB_MODULE_TIME 165905 - -/* Global variables */ -#include "prog.c.h" - -/* Function prototypes */ - -static int prog (); -static int prog_ (const int); -static void prog_module_init (cob_module *module); - -/* Main function */ -int -main (int argc, char **argv) -{ - cob_init (argc, argv); - cob_stop_run (prog ()); -} - -/* Functions */ - -static void gc_module_so_init () __attribute__ ((constructor)); -static void gc_module_so_init () -{ - cob_check_version (COB_SOURCE_FILE, COB_PACKAGE_VERSION, COB_PATCH_LEVEL); -} - -/* PROGRAM-ID 'prog' */ - -/* ENTRY 'prog' */ - -static int -prog () -{ - return prog_ (0); -} - -static int -prog_ (const int entry) -{ - /* Program local variables */ - #include "prog.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; - - /* 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: 8 : Entry prog : prog.cob */ - l_2:; - - /* Line: 8 : MOVE : prog.cob */ - memset (b_17, 32, 9); - - /* Line: 9 : STRING : prog.cob */ - cob_string_init (COB_SET_FLD (f0, 3, b_17 + 3LL * 1LL, &a_1), NULL); - cob_string_delimited (NULL); - cob_string_append ((cob_field *)&c_1); - cob_string_finish (); - - /* Line: 11 : IF : prog.cob */ - if (((int)memcmp (b_17, (cob_u8_ptr)" abc ", 9) != 0)) - { - - /* Line: 12 : DISPLAY : prog.cob */ - cob_display (0, 1, 1, COB_SET_FLD (f0, 3, b_17, &a_1)); - } - - /* Line: 14 : STOP RUN : prog.cob */ - cob_stop_run (b_2); - - /* 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_module_path = cob_glob_ptr->cob_main_argv0; - - prog_module_init (module); - - module->collating_sequence = NULL; - module->crt_status = NULL; - module->cursor_pos = NULL; - module->xml_code = NULL; - module->xml_event = NULL; - module->xml_information = NULL; - module->xml_namespace = NULL; - module->xml_namespace_prefix = NULL; - module->xml_nnamespace = NULL; - module->xml_nnamespace_prefix = NULL; - module->xml_ntext = NULL; - module->xml_text = NULL; - module->json_code = NULL; - module->json_status = NULL; - - /* Initialize cancel callback */ - cob_set_cancel (module); - - /* Initialize WORKING-STORAGE */ - /* initialize field RETURN-CODE */ - b_2 = 0; - - /* initialize field G */ - memset (b_17, (unsigned char)' ', 9); - - - 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 'prog' */ - -/* Initialize module structure for prog */ -static void prog_module_init (cob_module *module) -{ - module->module_name = "prog"; - module->module_formatted_date = COB_MODULE_FORMATTED_DATE; - module->module_source = COB_SOURCE_FILE; - module->gc_version = COB_PACKAGE_VERSION; - module->module_entry.funcptr = (void *(*)())prog; - module->module_cancel.funcptr = (void *(*)())prog_; - 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->xml_mode = 1; - module->module_stmt = 0; - module->module_sources = NULL; -} - -/* End functions */ - - -]]) - -AT_DATA([prog.c.h], [[ -/* Generated by cobc 3.3-dev.0 */ -/* Generated from prog.cob */ -/* Generated at févr. 23 2024 16:59:05 */ -/* GnuCOBOL build date Feb 21 2024 15:41:43 */ -/* GnuCOBOL package date Feb 01 2024 13:58:21 UTC */ -/* Compile command cobc -Cx prog.cob */ - - -/* Module path */ -static const char *cob_module_path = NULL; - -/* Number of call parameters */ -static int cob_call_params = 0; - -/* Attributes */ - -static const cob_field_attr a_1 = {0x21, 0, 0, 0x0000, NULL}; -static const cob_field_attr a_2 = {0x21, 0, 0, 0x1000, NULL}; - - -/* Constants */ -static const cob_field c_1 = {3, (cob_u8_ptr)"abc", &a_2}; - - -]]) - -AT_DATA([prog.c.l.h], [[ -/* Generated by cobc 3.3-dev.0 */ -/* Generated from prog.cob */ -/* Generated at févr. 23 2024 16:59:05 */ -/* GnuCOBOL build date Feb 21 2024 15:41:43 */ -/* GnuCOBOL package date Feb 01 2024 13:58:21 UTC */ -/* Compile command cobc -Cx prog.cob */ - -/* Program local variables for 'prog' */ - -/* Module initialization indicator */ -static unsigned int initialized = 0; - -/* Module structure pointer */ -static cob_module *module = NULL; - -/* Global variable pointer */ -cob_global *cob_glob_ptr; - - -/* LINKAGE SECTION (Items not referenced by USING clause) */ -static unsigned char *b_9 = NULL; /* XML-NAMESPACE */ -static unsigned char *b_10 = NULL; /* XML-NAMESPACE-PREFIX */ -static unsigned char *b_11 = NULL; /* XML-NNAMESPACE */ -static unsigned char *b_12 = NULL; /* XML-NNAMESPACE-PREFIX */ -static unsigned char *b_13 = NULL; /* XML-NTEXT */ -static unsigned char *b_14 = NULL; /* XML-TEXT */ - - -/* Local cob_field items */ -cob_field f0; - - -/* Call parameters */ -cob_field *cob_procedure_params[1]; - -/* Perform frame stack */ -struct cob_frame *frame_ptr; -struct cob_frame frame_stack[255]; - - -/* Data storage */ -static int b_2; /* RETURN-CODE */ -static cob_u8_t b_17[9] __attribute__((aligned)); /* G */ - -/* End of local data storage */ - - -]]) - - -AT_CHECK([$COMPILE prog.c], [0], [], []) -AT_CHECK([$COBCRUN_DIRECT ./prog], [0], [], []) - -AT_CLEANUP - - -AT_SETUP([STRING WITH POINTER ON OVERFLOW with DELIMITER]) -AT_KEYWORDS([runmisc exceptions]) - -AT_DATA([prog.c], [[ -/* Generated by cobc 3.3-dev.0 */ -/* Generated from prog.cob */ -/* Generated at févr. 23 2024 16:59:34 */ -/* GnuCOBOL build date Feb 21 2024 15:41:43 */ -/* GnuCOBOL package date Feb 01 2024 13:58:21 UTC */ -/* Compile command cobc -Cx prog.cob */ - -#include /* for memcpy, memcmp and friends */ -#define COB_KEYWORD_INLINE __inline -#include - -#define COB_SOURCE_FILE "prog.cob" -#define COB_PACKAGE_VERSION "3.3-dev" -#define COB_PATCH_LEVEL 0 -#define COB_MODULE_FORMATTED_DATE "févr. 23 2024 16:59:34" -#define COB_MODULE_DATE 20240223 -#define COB_MODULE_TIME 165934 - -/* Global variables */ -#include "prog.c.h" - -/* Function prototypes */ - -static int StringTest (); -static int StringTest_ (const int); -static void StringTest_module_init (cob_module *module); - -/* Main function */ -int -main (int argc, char **argv) -{ - cob_init (argc, argv); - cob_stop_run (StringTest ()); -} - -/* Functions */ - -static void gc_module_so_init () __attribute__ ((constructor)); -static void gc_module_so_init () -{ - cob_check_version (COB_SOURCE_FILE, COB_PACKAGE_VERSION, COB_PATCH_LEVEL); -} - -/* PROGRAM-ID 'StringTest' */ - -/* ENTRY 'StringTest' */ - -static int -StringTest () -{ - return StringTest_ (0); -} - -static int -StringTest_ (const int entry) -{ - /* Program local variables */ - #include "prog.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; - - /* 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: 21 : Entry StringTest : prog.cob */ - l_2:; - - /* Line: 21 : MOVE : prog.cob */ - memcpy (b_18, "01", 2); - - /* Line: 22 : STRING : prog.cob */ - cob_glob_ptr->cob_exception_code = 0; - cob_string_init (&f_17, &f_18); - cob_string_delimited (NULL); - cob_string_append ((cob_field *)&c_1); - cob_string_append ((cob_field *)&c_2); - cob_string_append ((cob_field *)&c_3); - cob_string_finish (); - if (unlikely ((cob_glob_ptr->cob_exception_code & 0xff00) == 0x0a00)) - { - - /* Line: 26 : DISPLAY : prog.cob */ - cob_display (0, 1, 1, &c_4); - } - - /* Line: 28 : IF : prog.cob */ - if (((int)memcmp (b_17, (cob_u8_ptr)"ABC", 3) != 0)) - { - - /* Line: 29 : DISPLAY : prog.cob */ - cob_display (0, 1, 3, &c_5, &f_17, &c_6); - } - - /* Line: 30 : IF : prog.cob */ - if (((int)cob_cmp_numdisp (b_18, 2, COB_S64_C(4), 0) != 0)) - { - - /* Line: 31 : DISPLAY : prog.cob */ - cob_display (0, 1, 3, &c_7, &f_18, &c_8); - } - - /* Line: 34 : MOVE : prog.cob */ - memset (b_18, 48, 2); - - /* Line: 35 : MOVE : prog.cob */ - memset (b_17, 32, 3); - - /* Line: 36 : STRING : prog.cob */ - cob_glob_ptr->cob_exception_code = 0; - cob_string_init (&f_17, &f_18); - cob_string_delimited (NULL); - cob_string_append ((cob_field *)&c_1); - cob_string_append ((cob_field *)&c_2); - cob_string_append ((cob_field *)&c_3); - cob_string_finish (); - if (!cob_glob_ptr->cob_exception_code) - { - - /* Line: 40 : DISPLAY : prog.cob */ - cob_display (0, 1, 1, &c_9); - } - - /* Line: 42 : IF : prog.cob */ - if (((int)memcmp (b_17, COB_SPACES_ALPHABETIC, 3) != 0)) - { - - /* Line: 43 : DISPLAY : prog.cob */ - cob_display (0, 1, 3, &c_10, &f_17, &c_11); - } - - /* Line: 44 : IF : prog.cob */ - if (((int)cob_numeric_display_cmp_zero (&f_18) != 0)) - { - - /* Line: 45 : DISPLAY : prog.cob */ - cob_display (0, 1, 3, &c_12, &f_18, &c_13); - } - - /* Line: 48 : MOVE : prog.cob */ - memcpy (b_18, "04", 2); - - /* Line: 49 : MOVE : prog.cob */ - memset (b_17, 32, 3); - - /* Line: 50 : STRING : prog.cob */ - cob_glob_ptr->cob_exception_code = 0; - cob_string_init (&f_17, &f_18); - cob_string_delimited (NULL); - cob_string_append ((cob_field *)&c_1); - cob_string_append ((cob_field *)&c_2); - cob_string_append ((cob_field *)&c_3); - cob_string_finish (); - if (!cob_glob_ptr->cob_exception_code) - { - - /* Line: 54 : DISPLAY : prog.cob */ - cob_display (0, 1, 1, &c_14); - } - - /* Line: 56 : IF : prog.cob */ - if (((int)memcmp (b_17, COB_SPACES_ALPHABETIC, 3) != 0)) - { - - /* Line: 57 : DISPLAY : prog.cob */ - cob_display (0, 1, 3, &c_15, &f_17, &c_11); - } - - /* Line: 58 : IF : prog.cob */ - if (((int)cob_cmp_numdisp (b_18, 2, COB_S64_C(4), 0) != 0)) - { - - /* Line: 59 : DISPLAY : prog.cob */ - cob_display (0, 1, 3, &c_16, &f_18, &c_8); - } - - /* Line: 62 : MOVE : prog.cob */ - memcpy (b_18, "01", 2); - - /* Line: 63 : MOVE : prog.cob */ - *(b_19) = 124; - - /* Line: 64 : MOVE : prog.cob */ - memset (b_17, 32, 3); - - /* Line: 65 : STRING : prog.cob */ - cob_string_init (&f_17, &f_18); - cob_string_delimited (&f_19); - cob_string_append ((cob_field *)&c_17); - cob_string_append ((cob_field *)&c_18); - cob_string_append ((cob_field *)&c_19); - cob_string_finish (); - - /* Line: 69 : IF : prog.cob */ - if (((int)memcmp (b_17, (cob_u8_ptr)"1AC", 3) != 0)) - { - - /* Line: 70 : DISPLAY : prog.cob */ - cob_display (0, 1, 3, &c_20, &f_17, &c_21); - } - - /* Line: 72 : GOBACK : prog.cob */ - goto exit_program; - - /* Program exit */ - - exit_program: - - /* 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_module_path = cob_glob_ptr->cob_main_argv0; - - StringTest_module_init (module); - - module->collating_sequence = NULL; - module->crt_status = NULL; - module->cursor_pos = NULL; - module->xml_code = NULL; - module->xml_event = NULL; - module->xml_information = NULL; - module->xml_namespace = NULL; - module->xml_namespace_prefix = NULL; - module->xml_nnamespace = NULL; - module->xml_nnamespace_prefix = NULL; - module->xml_ntext = NULL; - module->xml_text = NULL; - module->json_code = NULL; - module->json_status = NULL; - - /* Initialize cancel callback */ - cob_set_cancel (module); - - /* Initialize WORKING-STORAGE */ - /* initialize field RETURN-CODE */ - b_2 = 0; - - /* initialize field TRGT-STRING */ - memset (b_17, 32, 3); - - /* initialize field STR-POINTER */ - memset (b_18, (unsigned char)'0', 2); - - /* initialize field SRC-DELIM */ - *(cob_u8_ptr)(b_19) = (unsigned char)' '; - - - 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 'StringTest' */ - -/* Initialize module structure for StringTest */ -static void StringTest_module_init (cob_module *module) -{ - module->module_name = "StringTest"; - module->module_formatted_date = COB_MODULE_FORMATTED_DATE; - module->module_source = COB_SOURCE_FILE; - module->gc_version = COB_PACKAGE_VERSION; - module->module_entry.funcptr = (void *(*)())StringTest; - module->module_cancel.funcptr = (void *(*)())StringTest_; - 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->xml_mode = 1; - module->module_stmt = 0; - module->module_sources = NULL; -} - -/* End functions */ - - -]]) - -AT_DATA([prog.c.h], [[ -/* Generated by cobc 3.3-dev.0 */ -/* Generated from prog.cob */ -/* Generated at févr. 23 2024 16:59:34 */ -/* GnuCOBOL build date Feb 21 2024 15:41:43 */ -/* GnuCOBOL package date Feb 01 2024 13:58:21 UTC */ -/* Compile command cobc -Cx prog.cob */ - - -/* Module path */ -static const char *cob_module_path = NULL; - -/* Number of call parameters */ -static int cob_call_params = 0; - -/* Attributes */ - -static const cob_field_attr a_1 = {0x21, 0, 0, 0x0000, NULL}; -static const cob_field_attr a_2 = {0x10, 2, 0, 0x0000, NULL}; -static const cob_field_attr a_3 = {0x21, 0, 0, 0x1000, NULL}; - - -/* Constants */ -static const cob_field c_1 = {1, (cob_u8_ptr)"A", &a_3}; -static const cob_field c_2 = {1, (cob_u8_ptr)"B", &a_3}; -static const cob_field c_3 = {1, (cob_u8_ptr)"C", &a_3}; -static const cob_field c_4 = {27, (cob_u8_ptr)"Case A: Should not overflow", &a_3}; -static const cob_field c_5 = {16, (cob_u8_ptr)"A: TRTG-STRING <", &a_3}; -static const cob_field c_6 = {10, (cob_u8_ptr)"> != ", &a_3}; -static const cob_field c_7 = {16, (cob_u8_ptr)"A: STR-POINTER <", &a_3}; -static const cob_field c_8 = {9, (cob_u8_ptr)"> != <04>", &a_3}; -static const cob_field c_9 = {23, (cob_u8_ptr)"Case B: Should overflow", &a_3}; -static const cob_field c_10 = {16, (cob_u8_ptr)"B: TRTG-STRING <", &a_3}; -static const cob_field c_11 = {11, (cob_u8_ptr)"> != SPACES", &a_3}; -static const cob_field c_12 = {16, (cob_u8_ptr)"B: STR-POINTER <", &a_3}; -static const cob_field c_13 = {9, (cob_u8_ptr)"> != <00>", &a_3}; -static const cob_field c_14 = {23, (cob_u8_ptr)"Case C: Should overflow", &a_3}; -static const cob_field c_15 = {16, (cob_u8_ptr)"C: TRTG-STRING <", &a_3}; -static const cob_field c_16 = {16, (cob_u8_ptr)"C: STR-POINTER <", &a_3}; -static const cob_field c_17 = {3, (cob_u8_ptr)"1|2", &a_3}; -static const cob_field c_18 = {3, (cob_u8_ptr)"A|B", &a_3}; -static const cob_field c_19 = {3, (cob_u8_ptr)"C|D", &a_3}; -static const cob_field c_20 = {16, (cob_u8_ptr)"D: TRGT-STRING <", &a_3}; -static const cob_field c_21 = {10, (cob_u8_ptr)"> != <1AC>", &a_3}; - - -]]) - -AT_DATA([prog.c.l.h], [[ -/* Generated by cobc 3.3-dev.0 */ -/* Generated from prog.cob */ -/* Generated at févr. 23 2024 16:59:34 */ -/* GnuCOBOL build date Feb 21 2024 15:41:43 */ -/* GnuCOBOL package date Feb 01 2024 13:58:21 UTC */ -/* Compile command cobc -Cx prog.cob */ - -/* Program local variables for 'StringTest' */ - -/* Module initialization indicator */ -static unsigned int initialized = 0; - -/* Module structure pointer */ -static cob_module *module = NULL; - -/* Global variable pointer */ -cob_global *cob_glob_ptr; - - -/* LINKAGE SECTION (Items not referenced by USING clause) */ -static unsigned char *b_9 = NULL; /* XML-NAMESPACE */ -static unsigned char *b_10 = NULL; /* XML-NAMESPACE-PREFIX */ -static unsigned char *b_11 = NULL; /* XML-NNAMESPACE */ -static unsigned char *b_12 = NULL; /* XML-NNAMESPACE-PREFIX */ -static unsigned char *b_13 = NULL; /* XML-NTEXT */ -static unsigned char *b_14 = NULL; /* XML-TEXT */ - - -/* Call parameters */ -cob_field *cob_procedure_params[1]; - -/* Perform frame stack */ -struct cob_frame *frame_ptr; -struct cob_frame frame_stack[255]; - - -/* Data storage */ -static int b_2; /* RETURN-CODE */ -static cob_u8_t b_17[3] __attribute__((aligned)); /* TRGT-STRING */ -static cob_u8_t b_18[2] __attribute__((aligned)); /* STR-POINTER */ -static cob_u8_t b_19[1] __attribute__((aligned)); /* SRC-DELIM */ - -/* End of local data storage */ - - -/* Fields (local) */ -static cob_field f_17 = {3, b_17, &a_1}; /* TRGT-STRING */ -static cob_field f_18 = {2, b_18, &a_2}; /* STR-POINTER */ -static cob_field f_19 = {1, b_19, &a_1}; /* SRC-DELIM */ - -/* End of fields */ - - -]]) - - -AT_CHECK([$COMPILE prog.c], [0], [], []) -AT_CHECK([$COBCRUN_DIRECT ./prog], [0], [], []) - -AT_CLEANUP - - -AT_SETUP([STRING / UNSTRING [[NOT]] ON OVERFLOW]) -AT_KEYWORDS([runmisc exceptions]) - -AT_DATA([prog.c], [[ -/* Generated by cobc 3.3-dev.0 */ -/* Generated from prog.cob */ -/* Generated at févr. 23 2024 16:59:56 */ -/* GnuCOBOL build date Feb 21 2024 15:41:43 */ -/* GnuCOBOL package date Feb 01 2024 13:58:21 UTC */ -/* Compile command cobc -Cx prog.cob */ - -#include /* for memcpy, memcmp and friends */ -#define COB_KEYWORD_INLINE __inline -#include - -#define COB_SOURCE_FILE "prog.cob" -#define COB_PACKAGE_VERSION "3.3-dev" -#define COB_PATCH_LEVEL 0 -#define COB_MODULE_FORMATTED_DATE "févr. 23 2024 16:59:56" -#define COB_MODULE_DATE 20240223 -#define COB_MODULE_TIME 165956 - -/* Global variables */ -#include "prog.c.h" - -/* Function prototypes */ - -static int prog (); -static int prog_ (const int); -static void prog_module_init (cob_module *module); - -/* Main function */ -int -main (int argc, char **argv) -{ - cob_init (argc, argv); - cob_stop_run (prog ()); -} - -/* Functions */ - -static void gc_module_so_init () __attribute__ ((constructor)); -static void gc_module_so_init () -{ - cob_check_version (COB_SOURCE_FILE, COB_PACKAGE_VERSION, COB_PATCH_LEVEL); -} - -/* PROGRAM-ID 'prog' */ - -/* ENTRY 'prog' */ - -static int -prog () -{ - return prog_ (0); -} - -static int -prog_ (const int entry) -{ - /* Program local variables */ - #include "prog.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; - - /* 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: 10 : Entry prog : prog.cob */ - l_2:; - - /* Line: 10 : MOVE : prog.cob */ - memset (b_17, 32, 20); - - /* Line: 11 : STRING : prog.cob */ - cob_glob_ptr->cob_exception_code = 0; - cob_string_init (&f_17, NULL); - cob_string_delimited (NULL); - cob_string_append ((cob_field *)&c_1); - cob_string_finish (); - if (unlikely ((cob_glob_ptr->cob_exception_code & 0xff00) == 0x0a00)) - { - - /* Line: 15 : MOVE : prog.cob */ - memset (b_18, 32, 50); - - /* Line: 16 : STRING : prog.cob */ - cob_string_init (&f_18, NULL); - cob_string_delimited (NULL); - cob_string_append ((cob_field *)&c_2); - cob_string_finish (); - - /* Line: 20 : DISPLAY : prog.cob */ - cob_display (1, 1, 1, &f_18); - - /* Line: 22 : DISPLAY : prog.cob */ - cob_display (0, 1, 1, &c_3); - } - else - { - - /* Line: 25 : DISPLAY : prog.cob */ - cob_display (0, 1, 1, &c_4); - } - - /* Line: 28 : IF : prog.cob */ - if (((int)cob_cmp (&f_17, (cob_field *)&c_1) != 0)) - { - - /* Line: 29 : DISPLAY : prog.cob */ - cob_display (0, 1, 3, &c_5, &f_17, &c_6); - } - - /* Line: 33 : MOVE : prog.cob */ - memset (b_17, 32, 20); - - /* Line: 34 : STRING : prog.cob */ - cob_glob_ptr->cob_exception_code = 0; - cob_string_init (&f_17, NULL); - cob_string_delimited (NULL); - cob_string_append ((cob_field *)&c_7); - cob_string_finish (); - if (unlikely ((cob_glob_ptr->cob_exception_code & 0xff00) == 0x0a00)) - { - - /* Line: 38 : DISPLAY : prog.cob */ - cob_display (0, 1, 1, &c_8); - } - else - { - - /* Line: 41 : DISPLAY : prog.cob */ - cob_display (0, 1, 1, &c_9); - - /* Line: 43 : MOVE : prog.cob */ - memset (b_18, 32, 50); - - /* Line: 44 : STRING : prog.cob */ - cob_string_init (&f_18, NULL); - cob_string_delimited (NULL); - cob_string_append ((cob_field *)&c_10); - cob_string_finish (); - - /* Line: 48 : DISPLAY : prog.cob */ - cob_display (1, 1, 1, &f_18); - } - - /* Line: 51 : IF : prog.cob */ - if (((int)memcmp (b_17, (cob_u8_ptr)"data is too big here", 20) != 0)) - { - - /* Line: 52 : DISPLAY : prog.cob */ - cob_display (0, 1, 3, &c_11, &f_17, &c_6); - } - - /* Line: 57 : MOVE : prog.cob */ - memset (b_17, 32, 20); - - /* Line: 58 : UNSTRING : prog.cob */ - cob_glob_ptr->cob_exception_code = 0; - cob_unstring_init ((cob_field *)&c_1, NULL, 0); - cob_unstring_into (&f_17, 0, 0); - cob_unstring_finish (); - if (unlikely ((cob_glob_ptr->cob_exception_code & 0xff00) == 0x0a00)) - { - - /* Line: 61 : MOVE : prog.cob */ - memset (b_18, 32, 50); - - /* Line: 62 : UNSTRING : prog.cob */ - cob_unstring_init ((cob_field *)&c_12, NULL, 0); - cob_unstring_into (&f_18, 0, 0); - cob_unstring_finish (); - - /* Line: 65 : DISPLAY : prog.cob */ - cob_display (1, 1, 1, &f_18); - - /* Line: 67 : DISPLAY : prog.cob */ - cob_display (0, 1, 1, &c_13); - } - else - { - - /* Line: 70 : DISPLAY : prog.cob */ - cob_display (0, 1, 1, &c_14); - } - - /* Line: 73 : IF : prog.cob */ - if (((int)cob_cmp (&f_17, (cob_field *)&c_1) != 0)) - { - - /* Line: 74 : DISPLAY : prog.cob */ - cob_display (0, 1, 3, &c_15, &f_17, &c_6); - } - - /* Line: 78 : MOVE : prog.cob */ - memset (b_17, 32, 20); - - /* Line: 79 : UNSTRING : prog.cob */ - cob_glob_ptr->cob_exception_code = 0; - cob_unstring_init ((cob_field *)&c_7, NULL, 0); - cob_unstring_into (&f_17, 0, 0); - cob_unstring_finish (); - if (unlikely ((cob_glob_ptr->cob_exception_code & 0xff00) == 0x0a00)) - { - - /* Line: 82 : DISPLAY : prog.cob */ - cob_display (0, 1, 1, &c_16); - } - else - { - - /* Line: 85 : DISPLAY : prog.cob */ - cob_display (0, 1, 1, &c_17); - - /* Line: 87 : MOVE : prog.cob */ - memset (b_18, 32, 50); - - /* Line: 88 : STRING : prog.cob */ - cob_string_init (&f_18, NULL); - cob_string_delimited (NULL); - cob_string_append ((cob_field *)&c_10); - cob_string_finish (); - - /* Line: 92 : DISPLAY : prog.cob */ - cob_display (1, 1, 1, &f_18); - } - - /* Line: 95 : IF : prog.cob */ - if (((int)memcmp (b_17, (cob_u8_ptr)"data is too big here", 20) != 0)) - { - - /* Line: 96 : DISPLAY : prog.cob */ - cob_display (0, 1, 3, &c_18, &f_17, &c_6); - } - - /* Line: 100 : STOP RUN : prog.cob */ - cob_stop_run (b_2); - - /* 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_module_path = cob_glob_ptr->cob_main_argv0; - - prog_module_init (module); - - module->collating_sequence = NULL; - module->crt_status = NULL; - module->cursor_pos = NULL; - module->xml_code = NULL; - module->xml_event = NULL; - module->xml_information = NULL; - module->xml_namespace = NULL; - module->xml_namespace_prefix = NULL; - module->xml_nnamespace = NULL; - module->xml_nnamespace_prefix = NULL; - module->xml_ntext = NULL; - module->xml_text = NULL; - module->json_code = NULL; - module->json_status = NULL; - - /* Initialize cancel callback */ - cob_set_cancel (module); - - /* Initialize WORKING-STORAGE */ - /* initialize field RETURN-CODE */ - b_2 = 0; - - /* initialize field simple-str */ - memset (b_17, (unsigned char)' ', 20); - - /* initialize field err-str */ - memset (b_18, (unsigned char)' ', 50); - - - 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 'prog' */ - -/* Initialize module structure for prog */ -static void prog_module_init (cob_module *module) -{ - module->module_name = "prog"; - module->module_formatted_date = COB_MODULE_FORMATTED_DATE; - module->module_source = COB_SOURCE_FILE; - module->gc_version = COB_PACKAGE_VERSION; - module->module_entry.funcptr = (void *(*)())prog; - module->module_cancel.funcptr = (void *(*)())prog_; - 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->xml_mode = 1; - module->module_stmt = 0; - module->module_sources = NULL; -} - -/* End functions */ - - -]]) - -AT_DATA([prog.c.h], [[ -/* Generated by cobc 3.3-dev.0 */ -/* Generated from prog.cob */ -/* Generated at févr. 23 2024 16:59:56 */ -/* GnuCOBOL build date Feb 21 2024 15:41:43 */ -/* GnuCOBOL package date Feb 01 2024 13:58:21 UTC */ -/* Compile command cobc -Cx prog.cob */ - - -/* Module path */ -static const char *cob_module_path = NULL; - -/* Number of call parameters */ -static int cob_call_params = 0; - -/* Attributes */ - -static const cob_field_attr a_1 = {0x21, 0, 0, 0x0000, NULL}; -static const cob_field_attr a_2 = {0x21, 0, 0, 0x1000, NULL}; - - -/* Constants */ -static const cob_field c_1 = {4, (cob_u8_ptr)"data", &a_2}; -static const cob_field c_2 = {15, (cob_u8_ptr)"STRING OVERFLOW", &a_2}; -static const cob_field c_3 = {8, (cob_u8_ptr)"1 failed", &a_2}; -static const cob_field c_4 = {8, (cob_u8_ptr)"1 passed", &a_2}; -static const cob_field c_5 = {19, (cob_u8_ptr)"STRING ERROR (1): \"", &a_2}; -static const cob_field c_6 = {1, (cob_u8_ptr)"\"", &a_2}; -static const cob_field c_7 = {23, (cob_u8_ptr)"data is too big here...", &a_2}; -static const cob_field c_8 = {8, (cob_u8_ptr)"2 passed", &a_2}; -static const cob_field c_9 = {8, (cob_u8_ptr)"2 failed", &a_2}; -static const cob_field c_10 = {16, (cob_u8_ptr)"missing OVERFLOW", &a_2}; -static const cob_field c_11 = {19, (cob_u8_ptr)"STRING ERROR (2): \"", &a_2}; -static const cob_field c_12 = {17, (cob_u8_ptr)"UNSTRING OVERFLOW", &a_2}; -static const cob_field c_13 = {8, (cob_u8_ptr)"3 failed", &a_2}; -static const cob_field c_14 = {8, (cob_u8_ptr)"3 passed", &a_2}; -static const cob_field c_15 = {21, (cob_u8_ptr)"UNSTRING ERROR (1): \"", &a_2}; -static const cob_field c_16 = {8, (cob_u8_ptr)"4 passed", &a_2}; -static const cob_field c_17 = {8, (cob_u8_ptr)"4 failed", &a_2}; -static const cob_field c_18 = {21, (cob_u8_ptr)"UNSTRING ERROR (2): \"", &a_2}; - - -]]) - -AT_DATA([prog.c.l.h], [[ -/* Generated by cobc 3.3-dev.0 */ -/* Generated from prog.cob */ -/* Generated at févr. 23 2024 16:59:56 */ -/* GnuCOBOL build date Feb 21 2024 15:41:43 */ -/* GnuCOBOL package date Feb 01 2024 13:58:21 UTC */ -/* Compile command cobc -Cx prog.cob */ - -/* Program local variables for 'prog' */ - -/* Module initialization indicator */ -static unsigned int initialized = 0; - -/* Module structure pointer */ -static cob_module *module = NULL; - -/* Global variable pointer */ -cob_global *cob_glob_ptr; - - -/* LINKAGE SECTION (Items not referenced by USING clause) */ -static unsigned char *b_9 = NULL; /* XML-NAMESPACE */ -static unsigned char *b_10 = NULL; /* XML-NAMESPACE-PREFIX */ -static unsigned char *b_11 = NULL; /* XML-NNAMESPACE */ -static unsigned char *b_12 = NULL; /* XML-NNAMESPACE-PREFIX */ -static unsigned char *b_13 = NULL; /* XML-NTEXT */ -static unsigned char *b_14 = NULL; /* XML-TEXT */ - - -/* Call parameters */ -cob_field *cob_procedure_params[1]; - -/* Perform frame stack */ -struct cob_frame *frame_ptr; -struct cob_frame frame_stack[255]; - - -/* Data storage */ -static int b_2; /* RETURN-CODE */ -static cob_u8_t b_17[20] __attribute__((aligned)); /* simple-str */ -static cob_u8_t b_18[50] __attribute__((aligned)); /* err-str */ - -/* End of local data storage */ - - -/* Fields (local) */ -static cob_field f_17 = {20, b_17, &a_1}; /* simple-str */ -static cob_field f_18 = {50, b_18, &a_1}; /* err-str */ - -/* End of fields */ - - -]]) - - -AT_CHECK([$COMPILE prog.c], [0], [], []) -AT_CHECK([$COBCRUN_DIRECT ./prog], [0], -[1 passed -2 passed -3 passed -4 passed -], []) - -AT_CLEANUP - - -AT_SETUP([UNSTRING DELIMITED ALL LOW-VALUE]) -AT_KEYWORDS([runmisc]) - -AT_DATA([prog.c], [[ -/* Generated by cobc 3.3-dev.0 */ -/* Generated from prog.cob */ -/* Generated at févr. 23 2024 17:00:15 */ -/* GnuCOBOL build date Feb 21 2024 15:41:43 */ -/* GnuCOBOL package date Feb 01 2024 13:58:21 UTC */ -/* Compile command cobc -Cx prog.cob */ - -#include /* for memcpy, memcmp and friends */ -#define COB_KEYWORD_INLINE __inline -#include - -#define COB_SOURCE_FILE "prog.cob" -#define COB_PACKAGE_VERSION "3.3-dev" -#define COB_PATCH_LEVEL 0 -#define COB_MODULE_FORMATTED_DATE "févr. 23 2024 17:00:15" -#define COB_MODULE_DATE 20240223 -#define COB_MODULE_TIME 170015 - -/* Global variables */ -#include "prog.c.h" - -/* Function prototypes */ - -static int prog (); -static int prog_ (const int); -static void prog_module_init (cob_module *module); - -/* Main function */ -int -main (int argc, char **argv) -{ - cob_init (argc, argv); - cob_stop_run (prog ()); -} - -/* Functions */ - -static void gc_module_so_init () __attribute__ ((constructor)); -static void gc_module_so_init () -{ - cob_check_version (COB_SOURCE_FILE, COB_PACKAGE_VERSION, COB_PATCH_LEVEL); -} - -/* PROGRAM-ID 'prog' */ - -/* ENTRY 'prog' */ - -static int -prog () -{ - return prog_ (0); -} - -static int -prog_ (const int entry) -{ - /* Program local variables */ - #include "prog.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; - - /* 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: 12 : Entry prog : prog.cob */ - l_2:; - - /* Line: 12 : UNSTRING : prog.cob */ - cob_unstring_init (&f_17, NULL, 1); - cob_unstring_delimited (&cob_all_low, 1); - cob_unstring_into (&f_21, 0, 0); - cob_unstring_into (&f_22, 0, 0); - cob_unstring_finish (); - - /* Line: 15 : IF : prog.cob */ - if (((int)memcmp (b_21, (cob_u8_ptr)"ABC", 3) != 0)) - { - - /* Line: 16 : DISPLAY : prog.cob */ - cob_display (0, 1, 1, &f_21); - } - - /* Line: 17 : IF : prog.cob */ - if (((int)memcmp (b_22, (cob_u8_ptr)"DEF", 3) != 0)) - { - - /* Line: 18 : DISPLAY : prog.cob */ - cob_display (0, 1, 1, &f_22); - } - - /* Line: 19 : STOP RUN : prog.cob */ - cob_stop_run (b_2); - - /* 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_module_path = cob_glob_ptr->cob_main_argv0; - - prog_module_init (module); - - module->collating_sequence = NULL; - module->crt_status = NULL; - module->cursor_pos = NULL; - module->xml_code = NULL; - module->xml_event = NULL; - module->xml_information = NULL; - module->xml_namespace = NULL; - module->xml_namespace_prefix = NULL; - module->xml_nnamespace = NULL; - module->xml_nnamespace_prefix = NULL; - module->xml_ntext = NULL; - module->xml_text = NULL; - module->json_code = NULL; - module->json_status = NULL; - - /* Initialize cancel callback */ - cob_set_cancel (module); - - /* Initialize WORKING-STORAGE */ - /* initialize field RETURN-CODE */ - b_2 = 0; - - /* initialize field FILLER 1 */ - memcpy (b_17, "ABC", 3); - /* initialize field FILLER 2 */ - memset (b_17 + 3, 0, 2); - /* initialize field FILLER 3 */ - memcpy (b_17 + 5, "DEF", 3); - - /* initialize field A */ - memset (b_21, (unsigned char)' ', 3); - - /* initialize field B */ - memset (b_22, (unsigned char)' ', 3); - - - 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 'prog' */ - -/* Initialize module structure for prog */ -static void prog_module_init (cob_module *module) -{ - module->module_name = "prog"; - module->module_formatted_date = COB_MODULE_FORMATTED_DATE; - module->module_source = COB_SOURCE_FILE; - module->gc_version = COB_PACKAGE_VERSION; - module->module_entry.funcptr = (void *(*)())prog; - module->module_cancel.funcptr = (void *(*)())prog_; - 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->xml_mode = 1; - module->module_stmt = 0; - module->module_sources = NULL; -} - -/* End functions */ - - -]]) - -AT_DATA([prog.c.h], [[ -/* Generated by cobc 3.3-dev.0 */ -/* Generated from prog.cob */ -/* Generated at févr. 23 2024 17:00:15 */ -/* GnuCOBOL build date Feb 21 2024 15:41:43 */ -/* GnuCOBOL package date Feb 01 2024 13:58:21 UTC */ -/* Compile command cobc -Cx prog.cob */ - - -/* Module path */ -static const char *cob_module_path = NULL; - -/* Number of call parameters */ -static int cob_call_params = 0; - -/* Attributes */ - -static const cob_field_attr a_1 = {0x01, 0, 0, 0x0000, NULL}; -static const cob_field_attr a_2 = {0x21, 0, 0, 0x0000, NULL}; - -static const cob_field_attr cob_all_attr = {0x22, 0, 0, 0, NULL}; - - -/* Constants */ - -static cob_field cob_all_low = {1, (cob_u8_ptr)"\0", &cob_all_attr}; - - -]]) - -AT_DATA([prog.c.l.h], [[ -/* Generated by cobc 3.3-dev.0 */ -/* Generated from prog.cob */ -/* Generated at févr. 23 2024 17:00:15 */ -/* GnuCOBOL build date Feb 21 2024 15:41:43 */ -/* GnuCOBOL package date Feb 01 2024 13:58:21 UTC */ -/* Compile command cobc -Cx prog.cob */ - -/* Program local variables for 'prog' */ - -/* Module initialization indicator */ -static unsigned int initialized = 0; - -/* Module structure pointer */ -static cob_module *module = NULL; - -/* Global variable pointer */ -cob_global *cob_glob_ptr; - - -/* LINKAGE SECTION (Items not referenced by USING clause) */ -static unsigned char *b_9 = NULL; /* XML-NAMESPACE */ -static unsigned char *b_10 = NULL; /* XML-NAMESPACE-PREFIX */ -static unsigned char *b_11 = NULL; /* XML-NNAMESPACE */ -static unsigned char *b_12 = NULL; /* XML-NNAMESPACE-PREFIX */ -static unsigned char *b_13 = NULL; /* XML-NTEXT */ -static unsigned char *b_14 = NULL; /* XML-TEXT */ - - -/* Call parameters */ -cob_field *cob_procedure_params[1]; - -/* Perform frame stack */ -struct cob_frame *frame_ptr; -struct cob_frame frame_stack[255]; - - -/* Data storage */ -static int b_2; /* RETURN-CODE */ -static cob_u8_t b_17[8] __attribute__((aligned)); /* G */ -static cob_u8_t b_21[3] __attribute__((aligned)); /* A */ -static cob_u8_t b_22[3] __attribute__((aligned)); /* B */ - -/* End of local data storage */ - - -/* Fields (local) */ -static cob_field f_17 = {8, b_17, &a_1}; /* G */ -static cob_field f_21 = {3, b_21, &a_2}; /* A */ -static cob_field f_22 = {3, b_22, &a_2}; /* B */ - -/* End of fields */ - - -]]) - - -AT_CHECK([$COMPILE prog.c], [0], [], []) -AT_CHECK([$COBCRUN_DIRECT ./prog], [0], [], []) - -AT_CLEANUP - - -AT_SETUP([UNSTRING DELIMITED ALL SPACE-2]) -AT_KEYWORDS([runmisc]) - -AT_DATA([prog.c], [[ -/* Generated by cobc 3.3-dev.0 */ -/* Generated from prog.cob */ -/* Generated at févr. 23 2024 17:00:29 */ -/* GnuCOBOL build date Feb 21 2024 15:41:43 */ -/* GnuCOBOL package date Feb 01 2024 13:58:21 UTC */ -/* Compile command cobc -Cx prog.cob */ - -#include /* for memcpy, memcmp and friends */ -#define COB_KEYWORD_INLINE __inline -#include - -#define COB_SOURCE_FILE "prog.cob" -#define COB_PACKAGE_VERSION "3.3-dev" -#define COB_PATCH_LEVEL 0 -#define COB_MODULE_FORMATTED_DATE "févr. 23 2024 17:00:29" -#define COB_MODULE_DATE 20240223 -#define COB_MODULE_TIME 170029 - -/* Global variables */ -#include "prog.c.h" - -/* Function prototypes */ - -static int prog (); -static int prog_ (const int); -static void prog_module_init (cob_module *module); - -/* Main function */ -int -main (int argc, char **argv) -{ - cob_init (argc, argv); - cob_stop_run (prog ()); -} - -/* Functions */ - -static void gc_module_so_init () __attribute__ ((constructor)); -static void gc_module_so_init () -{ - cob_check_version (COB_SOURCE_FILE, COB_PACKAGE_VERSION, COB_PATCH_LEVEL); -} - -/* PROGRAM-ID 'prog' */ - -/* ENTRY 'prog' */ - -static int -prog () -{ - return prog_ (0); -} - -static int -prog_ (const int entry) -{ - /* Program local variables */ - #include "prog.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; - - /* 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: 16 : Entry prog : prog.cob */ - l_2:; - - /* Line: 16 : MOVE : prog.cob */ - memcpy (b_25, "01", 2); - - /* Line: 18 : PERFORM : prog.cob */ - /* PERFORM 0001-SUB */ - frame_ptr++; - frame_ptr->perform_through = 5; - frame_ptr->return_address_ptr = &&l_6; - goto l_5; - l_6: - frame_ptr--; - - /* Line: 19 : IF : prog.cob */ - if (((int)memcmp (b_24, COB_SPACES_ALPHABETIC, 15) != 0)) - { - - /* Line: 20 : DISPLAY : prog.cob */ - cob_display (0, 1, 2, &c_1, &f_24); - } - - /* Line: 21 : IF : prog.cob */ - if (((int)cob_cmp_numdisp (b_25, 2, COB_S64_C(5), 0) != 0)) - { - - /* Line: 22 : DISPLAY : prog.cob */ - cob_display (0, 1, 2, &c_2, &f_25); - } - - /* Line: 24 : PERFORM : prog.cob */ - /* PERFORM 0001-SUB */ - frame_ptr++; - frame_ptr->perform_through = 5; - frame_ptr->return_address_ptr = &&l_7; - goto l_5; - l_7: - frame_ptr--; - - /* Line: 25 : IF : prog.cob */ - if (((int)cob_cmp (&f_24, (cob_field *)&c_3) != 0)) - { - - /* Line: 26 : DISPLAY : prog.cob */ - cob_display (0, 1, 2, &c_4, &f_24); - } - - /* Line: 27 : IF : prog.cob */ - if (((int)cob_cmp_numdisp (b_25, 2, COB_S64_C(21), 0) != 0)) - { - - /* Line: 28 : DISPLAY : prog.cob */ - cob_display (0, 1, 2, &c_5, &f_25); - } - - /* Line: 30 : PERFORM : prog.cob */ - /* PERFORM 0001-SUB */ - frame_ptr++; - frame_ptr->perform_through = 5; - frame_ptr->return_address_ptr = &&l_8; - goto l_5; - l_8: - frame_ptr--; - - /* Line: 31 : IF : prog.cob */ - if (((int)cob_cmp (&f_24, (cob_field *)&c_6) != 0)) - { - - /* Line: 32 : DISPLAY : prog.cob */ - cob_display (0, 1, 2, &c_7, &f_24); - } - - /* Line: 33 : IF : prog.cob */ - if (((int)cob_cmp_numdisp (b_25, 2, COB_S64_C(40), 0) != 0)) - { - - /* Line: 34 : DISPLAY : prog.cob */ - cob_display (0, 1, 2, &c_8, &f_25); - } - - /* Line: 35 : STOP RUN : prog.cob */ - cob_stop_run (b_2); - - /* Line: 36 : Paragraph 0001-SUB : prog.cob */ - l_5:; - - /* Line: 37 : UNSTRING : prog.cob */ - cob_unstring_init (&f_17, &f_25, 1); - cob_unstring_delimited (&f_23, 1); - cob_unstring_into (&f_24, 0, 0); - cob_unstring_finish (); - - /* Implicit PERFORM return */ - if (frame_ptr->perform_through == 5) - goto *frame_ptr->return_address_ptr; - - /* 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_module_path = cob_glob_ptr->cob_main_argv0; - - prog_module_init (module); - - module->collating_sequence = NULL; - module->crt_status = NULL; - module->cursor_pos = NULL; - module->xml_code = NULL; - module->xml_event = NULL; - module->xml_information = NULL; - module->xml_namespace = NULL; - module->xml_namespace_prefix = NULL; - module->xml_nnamespace = NULL; - module->xml_nnamespace_prefix = NULL; - module->xml_ntext = NULL; - module->xml_text = NULL; - module->json_code = NULL; - module->json_status = NULL; - - /* Initialize cancel callback */ - cob_set_cancel (module); - - /* Initialize WORKING-STORAGE */ - /* initialize field RETURN-CODE */ - b_2 = 0; - - /* initialize field FILLER 1 */ - memset (b_17, 32, 4); - /* initialize field FILLER 2 */ - memcpy (b_17 + 4, "ABC AND DE", 10); - /* initialize field FILLER 3 */ - memset (b_17 + 14, 32, 7); - /* initialize field FILLER 4 */ - memcpy (b_17 + 21, "FG AND HIJ", 10); - /* initialize field FILLER 5 */ - memset (b_17 + 31, 32, 8); - - /* initialize field SPACE-2 */ - memset (b_23, 32, 2); - - /* initialize field WS-DUMMY */ - memset (b_24, (unsigned char)' ', 15); - - /* initialize field WS-POINTER */ - memset (b_25, (unsigned char)'0', 2); - - - 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 'prog' */ - -/* Initialize module structure for prog */ -static void prog_module_init (cob_module *module) -{ - module->module_name = "prog"; - module->module_formatted_date = COB_MODULE_FORMATTED_DATE; - module->module_source = COB_SOURCE_FILE; - module->gc_version = COB_PACKAGE_VERSION; - module->module_entry.funcptr = (void *(*)())prog; - module->module_cancel.funcptr = (void *(*)())prog_; - 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->xml_mode = 1; - module->module_stmt = 0; - module->module_sources = NULL; -} - -/* End functions */ - - -]]) - -AT_DATA([prog.c.h], [[ -/* Generated by cobc 3.3-dev.0 */ -/* Generated from prog.cob */ -/* Generated at févr. 23 2024 17:00:29 */ -/* GnuCOBOL build date Feb 21 2024 15:41:43 */ -/* GnuCOBOL package date Feb 01 2024 13:58:21 UTC */ -/* Compile command cobc -Cx prog.cob */ - - -/* Module path */ -static const char *cob_module_path = NULL; - -/* Number of call parameters */ -static int cob_call_params = 0; - -/* Attributes */ - -static const cob_field_attr a_1 = {0x21, 0, 0, 0x1000, NULL}; -static const cob_field_attr a_2 = {0x21, 0, 0, 0x0000, NULL}; -static const cob_field_attr a_3 = {0x10, 2, 0, 0x0000, NULL}; -static const cob_field_attr a_4 = {0x01, 0, 0, 0x0000, NULL}; - - -/* Constants */ -static const cob_field c_1 = {21, (cob_u8_ptr)"Expected space - Got ", &a_1}; -static const cob_field c_2 = {17, (cob_u8_ptr)"Expected 5 - Got ", &a_1}; -static const cob_field c_3 = {10, (cob_u8_ptr)"ABC AND DE", &a_1}; -static const cob_field c_4 = {26, (cob_u8_ptr)"Expected ABC AND DE - Got ", &a_1}; -static const cob_field c_5 = {18, (cob_u8_ptr)"Expected 21 - Got ", &a_1}; -static const cob_field c_6 = {11, (cob_u8_ptr)" FG AND HIJ", &a_1}; -static const cob_field c_7 = {27, (cob_u8_ptr)"Expected FG AND HIJ - Got ", &a_1}; -static const cob_field c_8 = {18, (cob_u8_ptr)"Expected 40 - Got ", &a_1}; - - -]]) - -AT_DATA([prog.c.l.h], [[ -/* Generated by cobc 3.3-dev.0 */ -/* Generated from prog.cob */ -/* Generated at févr. 23 2024 17:00:29 */ -/* GnuCOBOL build date Feb 21 2024 15:41:43 */ -/* GnuCOBOL package date Feb 01 2024 13:58:21 UTC */ -/* Compile command cobc -Cx prog.cob */ - -/* Program local variables for 'prog' */ - -/* Module initialization indicator */ -static unsigned int initialized = 0; - -/* Module structure pointer */ -static cob_module *module = NULL; - -/* Global variable pointer */ -cob_global *cob_glob_ptr; - - -/* LINKAGE SECTION (Items not referenced by USING clause) */ -static unsigned char *b_9 = NULL; /* XML-NAMESPACE */ -static unsigned char *b_10 = NULL; /* XML-NAMESPACE-PREFIX */ -static unsigned char *b_11 = NULL; /* XML-NNAMESPACE */ -static unsigned char *b_12 = NULL; /* XML-NNAMESPACE-PREFIX */ -static unsigned char *b_13 = NULL; /* XML-NTEXT */ -static unsigned char *b_14 = NULL; /* XML-TEXT */ - - -/* Call parameters */ -cob_field *cob_procedure_params[1]; - -/* Perform frame stack */ -struct cob_frame *frame_ptr; -struct cob_frame frame_stack[255]; - - -/* Data storage */ -static int b_2; /* RETURN-CODE */ -static cob_u8_t b_17[39] __attribute__((aligned)); /* WS-RECORD */ -static cob_u8_t b_23[2] __attribute__((aligned)); /* SPACE-2 */ -static cob_u8_t b_24[15] __attribute__((aligned)); /* WS-DUMMY */ -static cob_u8_t b_25[2] __attribute__((aligned)); /* WS-POINTER */ - -/* End of local data storage */ - - -/* Fields (local) */ -static cob_field f_17 = {39, b_17, &a_4}; /* WS-RECORD */ -static cob_field f_23 = {2, b_23, &a_2}; /* SPACE-2 */ -static cob_field f_24 = {15, b_24, &a_2}; /* WS-DUMMY */ -static cob_field f_25 = {2, b_25, &a_3}; /* WS-POINTER */ - -/* End of fields */ - - -]]) - - -AT_CHECK([$COMPILE prog.c], [0], [], []) -AT_CHECK([$COBCRUN_DIRECT ./prog], [0], [], []) - -AT_CLEANUP - - -AT_SETUP([UNSTRING DELIMITED POINTER]) -AT_KEYWORDS([runmisc]) - -AT_DATA([prog.c], [[ -/* Generated by cobc 3.3-dev.0 */ -/* Generated from prog.cob */ -/* Generated at févr. 23 2024 17:00:49 */ -/* GnuCOBOL build date Feb 21 2024 15:41:43 */ -/* GnuCOBOL package date Feb 01 2024 13:58:21 UTC */ -/* Compile command cobc -Cx prog.cob */ - -#include /* for memcpy, memcmp and friends */ -#define COB_KEYWORD_INLINE __inline -#include - -#define COB_SOURCE_FILE "prog.cob" -#define COB_PACKAGE_VERSION "3.3-dev" -#define COB_PATCH_LEVEL 0 -#define COB_MODULE_FORMATTED_DATE "févr. 23 2024 17:00:49" -#define COB_MODULE_DATE 20240223 -#define COB_MODULE_TIME 170049 - -/* Global variables */ -#include "prog.c.h" - -/* Function prototypes */ - -static int prog (); -static int prog_ (const int); -static void prog_module_init (cob_module *module); - -/* Main function */ -int -main (int argc, char **argv) -{ - cob_init (argc, argv); - cob_stop_run (prog ()); -} - -/* Functions */ - -static void gc_module_so_init () __attribute__ ((constructor)); -static void gc_module_so_init () -{ - cob_check_version (COB_SOURCE_FILE, COB_PACKAGE_VERSION, COB_PATCH_LEVEL); -} - -/* PROGRAM-ID 'prog' */ - -/* ENTRY 'prog' */ - -static int -prog () -{ - return prog_ (0); -} - -static int -prog_ (const int entry) -{ - /* Program local variables */ - #include "prog.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; - - /* 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: 11 : Entry prog : prog.cob */ - l_2:; - - /* Line: 11 : MOVE : prog.cob */ - memcpy (b_17, " 10 AF-RECORD-TYPE-SEQUENCE-04 PIC 9(05) COMP-3. ", 66); - - /* Line: 14 : MOVE : prog.cob */ - memcpy (b_20, "01", 2); - - /* Line: 15 : PERFORM : prog.cob */ - /* PERFORM 0001-SUB */ - frame_ptr++; - frame_ptr->perform_through = 5; - frame_ptr->return_address_ptr = &&l_6; - goto l_5; - l_6: - frame_ptr--; - - /* Line: 16 : IF : prog.cob */ - if (((int)cob_cmp_numdisp (b_20, 2, COB_S64_C(48), 0) != 0)) - { - - /* Line: 17 : DISPLAY : prog.cob */ - cob_display (0, 1, 2, &c_1, &f_20); - } - - /* Line: 18 : ADD : prog.cob */ - cob_add_int (&f_20, 7, 0); - - /* Line: 20 : PERFORM : prog.cob */ - /* PERFORM 0001-SUB */ - frame_ptr++; - frame_ptr->perform_through = 5; - frame_ptr->return_address_ptr = &&l_7; - goto l_5; - l_7: - frame_ptr--; - - /* Line: 21 : IF : prog.cob */ - if (((int)cob_cmp_numdisp (b_20, 2, COB_S64_C(62), 0) != 0)) - { - - /* Line: 22 : DISPLAY : prog.cob */ - cob_display (0, 1, 2, &c_2, &f_20); - } - - /* Line: 23 : PERFORM : prog.cob */ - /* PERFORM 0001-SUB */ - frame_ptr++; - frame_ptr->perform_through = 5; - frame_ptr->return_address_ptr = &&l_8; - goto l_5; - l_8: - frame_ptr--; - - /* Line: 24 : IF : prog.cob */ - if (((int)cob_cmp_numdisp (b_20, 2, COB_S64_C(63), 0) != 0)) - { - - /* Line: 25 : DISPLAY : prog.cob */ - cob_display (0, 1, 2, &c_3, &f_20); - } - - /* Line: 26 : STOP RUN : prog.cob */ - cob_stop_run (b_2); - - /* Line: 27 : Paragraph 0001-SUB : prog.cob */ - l_5:; - - /* Line: 28 : UNSTRING : prog.cob */ - cob_unstring_init (&f_17, &f_20, 3); - cob_unstring_delimited ((cob_field *)&c_4, 0); - cob_unstring_delimited ((cob_field *)&c_5, 0); - cob_unstring_delimited ((cob_field *)&c_6, 0); - cob_unstring_into (&f_18, &f_19, 0); - cob_unstring_finish (); - - /* Implicit PERFORM return */ - if (frame_ptr->perform_through == 5) - goto *frame_ptr->return_address_ptr; - - /* 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_module_path = cob_glob_ptr->cob_main_argv0; - - prog_module_init (module); - - module->collating_sequence = NULL; - module->crt_status = NULL; - module->cursor_pos = NULL; - module->xml_code = NULL; - module->xml_event = NULL; - module->xml_information = NULL; - module->xml_namespace = NULL; - module->xml_namespace_prefix = NULL; - module->xml_nnamespace = NULL; - module->xml_nnamespace_prefix = NULL; - module->xml_ntext = NULL; - module->xml_text = NULL; - module->json_code = NULL; - module->json_status = NULL; - - /* Initialize cancel callback */ - cob_set_cancel (module); - - /* Initialize WORKING-STORAGE */ - /* initialize field RETURN-CODE */ - b_2 = 0; - - /* initialize field WS-LAY-RECORD */ - memset (b_17, (unsigned char)' ', 66); - - /* initialize field WS-DUMMY */ - memset (b_18, (unsigned char)' ', 50); - - /* initialize field WS-KEYWORD */ - memset (b_19, (unsigned char)' ', 32); - - /* initialize field WS-POINTER */ - memset (b_20, (unsigned char)'0', 2); - - - 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 'prog' */ - -/* Initialize module structure for prog */ -static void prog_module_init (cob_module *module) -{ - module->module_name = "prog"; - module->module_formatted_date = COB_MODULE_FORMATTED_DATE; - module->module_source = COB_SOURCE_FILE; - module->gc_version = COB_PACKAGE_VERSION; - module->module_entry.funcptr = (void *(*)())prog; - module->module_cancel.funcptr = (void *(*)())prog_; - 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->xml_mode = 1; - module->module_stmt = 0; - module->module_sources = NULL; -} - -/* End functions */ - - -]]) - -AT_DATA([prog.c.h], [[ -/* Generated by cobc 3.3-dev.0 */ -/* Generated from prog.cob */ -/* Generated at févr. 23 2024 17:00:49 */ -/* GnuCOBOL build date Feb 21 2024 15:41:43 */ -/* GnuCOBOL package date Feb 01 2024 13:58:21 UTC */ -/* Compile command cobc -Cx prog.cob */ - - -/* Module path */ -static const char *cob_module_path = NULL; - -/* Number of call parameters */ -static int cob_call_params = 0; - -/* Attributes */ - -static const cob_field_attr a_1 = {0x21, 0, 0, 0x1000, NULL}; -static const cob_field_attr a_2 = {0x10, 2, 0, 0x0000, NULL}; -static const cob_field_attr a_3 = {0x21, 0, 0, 0x0000, NULL}; - - -/* Constants */ -static const cob_field c_1 = {18, (cob_u8_ptr)"Expected 48 - Got ", &a_1}; -static const cob_field c_2 = {18, (cob_u8_ptr)"Expected 62 - Got ", &a_1}; -static const cob_field c_3 = {18, (cob_u8_ptr)"Expected 63 - Got ", &a_1}; -static const cob_field c_4 = {5, (cob_u8_ptr)" PIC ", &a_1}; -static const cob_field c_5 = {7, (cob_u8_ptr)" COMP-3", &a_1}; -static const cob_field c_6 = {1, (cob_u8_ptr)".", &a_1}; - - -]]) - -AT_DATA([prog.c.l.h], [[ -/* Generated by cobc 3.3-dev.0 */ -/* Generated from prog.cob */ -/* Generated at févr. 23 2024 17:00:49 */ -/* GnuCOBOL build date Feb 21 2024 15:41:43 */ -/* GnuCOBOL package date Feb 01 2024 13:58:21 UTC */ -/* Compile command cobc -Cx prog.cob */ - -/* Program local variables for 'prog' */ - -/* Module initialization indicator */ -static unsigned int initialized = 0; - -/* Module structure pointer */ -static cob_module *module = NULL; - -/* Global variable pointer */ -cob_global *cob_glob_ptr; - - -/* LINKAGE SECTION (Items not referenced by USING clause) */ -static unsigned char *b_9 = NULL; /* XML-NAMESPACE */ -static unsigned char *b_10 = NULL; /* XML-NAMESPACE-PREFIX */ -static unsigned char *b_11 = NULL; /* XML-NNAMESPACE */ -static unsigned char *b_12 = NULL; /* XML-NNAMESPACE-PREFIX */ -static unsigned char *b_13 = NULL; /* XML-NTEXT */ -static unsigned char *b_14 = NULL; /* XML-TEXT */ - - -/* Call parameters */ -cob_field *cob_procedure_params[1]; - -/* Perform frame stack */ -struct cob_frame *frame_ptr; -struct cob_frame frame_stack[255]; - - -/* Data storage */ -static int b_2; /* RETURN-CODE */ -static cob_u8_t b_17[66] __attribute__((aligned)); /* WS-LAY-RECORD */ -static cob_u8_t b_18[50] __attribute__((aligned)); /* WS-DUMMY */ -static cob_u8_t b_19[32] __attribute__((aligned)); /* WS-KEYWORD */ -static cob_u8_t b_20[2] __attribute__((aligned)); /* WS-POINTER */ - -/* End of local data storage */ - - -/* Fields (local) */ -static cob_field f_17 = {66, b_17, &a_3}; /* WS-LAY-RECORD */ -static cob_field f_18 = {50, b_18, &a_3}; /* WS-DUMMY */ -static cob_field f_19 = {32, b_19, &a_3}; /* WS-KEYWORD */ -static cob_field f_20 = {2, b_20, &a_2}; /* WS-POINTER */ - -/* End of fields */ - - -]]) - - -AT_CHECK([$COMPILE prog.c], [0], [], []) -AT_CHECK([$COBCRUN_DIRECT ./prog], [0], [], []) - -AT_CLEANUP - - -AT_SETUP([UNSTRING DELIMITER IN]) -AT_KEYWORDS([runmisc]) - -AT_DATA([prog.c], [[ -/* Generated by cobc 3.3-dev.0 */ -/* Generated from prog.cob */ -/* Generated at févr. 23 2024 17:01:05 */ -/* GnuCOBOL build date Feb 21 2024 15:41:43 */ -/* GnuCOBOL package date Feb 01 2024 13:58:21 UTC */ -/* Compile command cobc -Cx prog.cob */ - -#include /* for memcpy, memcmp and friends */ -#define COB_KEYWORD_INLINE __inline -#include - -#define COB_SOURCE_FILE "prog.cob" -#define COB_PACKAGE_VERSION "3.3-dev" -#define COB_PATCH_LEVEL 0 -#define COB_MODULE_FORMATTED_DATE "févr. 23 2024 17:01:05" -#define COB_MODULE_DATE 20240223 -#define COB_MODULE_TIME 170105 - -/* Global variables */ -#include "prog.c.h" - -/* Function prototypes */ - -static int prog (); -static int prog_ (const int); -static void prog_module_init (cob_module *module); - -/* Main function */ -int -main (int argc, char **argv) -{ - cob_init (argc, argv); - cob_stop_run (prog ()); -} - -/* Functions */ - -static void gc_module_so_init () __attribute__ ((constructor)); -static void gc_module_so_init () -{ - cob_check_version (COB_SOURCE_FILE, COB_PACKAGE_VERSION, COB_PATCH_LEVEL); -} - -/* PROGRAM-ID 'prog' */ - -/* ENTRY 'prog' */ - -static int -prog () -{ - return prog_ (0); -} - -static int -prog_ (const int entry) -{ - /* Program local variables */ - #include "prog.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; - - /* 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 prog : prog.cob */ - l_2:; - - /* Line: 13 : UNSTRING : prog.cob */ - cob_unstring_init (&f_17, NULL, 2); - cob_unstring_delimited (COB_SET_FLD (f0, 1, b_18, &a_1), 0); - cob_unstring_delimited (COB_SET_FLD (f0, 1, b_18 + 1LL, &a_1), 0); - cob_unstring_into (COB_SET_FLD (f0, 2, b_22, &a_1), COB_SET_FLD (f1, 1, b_21, &a_1), 0); - cob_unstring_into (COB_SET_FLD (f0, 2, b_22 + 2LL * 1LL, &a_1), COB_SET_FLD (f1, 1, b_21 + 1LL, &a_1), 0); - cob_unstring_into (COB_SET_FLD (f0, 2, b_22 + 2LL * 2LL, &a_1), 0, 0); - cob_unstring_finish (); - - /* Line: 18 : IF : prog.cob */ - if (((((((int)memcmp (b_22, (cob_u8_ptr)"WW", 2) != 0) || - ((int)memcmp (b_22 + 2LL * 1LL, (cob_u8_ptr)"DD", 2) != 0)) || - ((int)memcmp (b_22 + 2LL * 2LL, (cob_u8_ptr)"CC", 2) != 0)) || - ((int)(int)(*(b_21) - (unsigned char)'A') != 0)) || - ((int)(int)(*(b_21 + 1LL) - (unsigned char)'B') != 0))) - { - - /* Line: 23 : DISPLAY : prog.cob */ - cob_display (0, 1, 5, COB_SET_FLD (f0, 2, b_22, &a_1), COB_SET_FLD (f1, 2, b_22 + 2LL * 1LL, &a_1), COB_SET_FLD (f2, 2, b_22 + 2LL * 2LL, &a_1), COB_SET_FLD (f3, 1, b_21, &a_1), COB_SET_FLD (f4, 1, b_21 + 1LL, &a_1)); - } - - /* Line: 30 : STOP RUN : prog.cob */ - cob_stop_run (b_2); - - /* 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_module_path = cob_glob_ptr->cob_main_argv0; - - prog_module_init (module); - - module->collating_sequence = NULL; - module->crt_status = NULL; - module->cursor_pos = NULL; - module->xml_code = NULL; - module->xml_event = NULL; - module->xml_information = NULL; - module->xml_namespace = NULL; - module->xml_namespace_prefix = NULL; - module->xml_nnamespace = NULL; - module->xml_nnamespace_prefix = NULL; - module->xml_ntext = NULL; - module->xml_text = NULL; - module->json_code = NULL; - module->json_status = NULL; - - /* Initialize cancel callback */ - cob_set_cancel (module); - - /* Initialize WORKING-STORAGE */ - /* initialize field RETURN-CODE */ - b_2 = 0; - - /* initialize field WK-CMD */ - memcpy (b_17, "WWADDBCC", 8); - - /* initialize field WK-SIGNS */ - memcpy (b_18, "AB", 2); - - - /* initialize field WK-DELIM */ - memset (b_21, (unsigned char)' ', 2); - - /* initialize field WK-DATA */ - memset (b_22, (unsigned char)' ', 3); - - - 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 'prog' */ - -/* Initialize module structure for prog */ -static void prog_module_init (cob_module *module) -{ - module->module_name = "prog"; - module->module_formatted_date = COB_MODULE_FORMATTED_DATE; - module->module_source = COB_SOURCE_FILE; - module->gc_version = COB_PACKAGE_VERSION; - module->module_entry.funcptr = (void *(*)())prog; - module->module_cancel.funcptr = (void *(*)())prog_; - 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->xml_mode = 1; - module->module_stmt = 0; - module->module_sources = NULL; -} - -/* End functions */ - - -]]) - -AT_DATA([prog.c.h], [[ -/* Generated by cobc 3.3-dev.0 */ -/* Generated from prog.cob */ -/* Generated at févr. 23 2024 17:01:05 */ -/* GnuCOBOL build date Feb 21 2024 15:41:43 */ -/* GnuCOBOL package date Feb 01 2024 13:58:21 UTC */ -/* Compile command cobc -Cx prog.cob */ - - -/* Module path */ -static const char *cob_module_path = NULL; - -/* Number of call parameters */ -static int cob_call_params = 0; - -/* Attributes */ - -static const cob_field_attr a_1 = {0x21, 0, 0, 0x0000, NULL}; - - -]]) - -AT_DATA([prog.c.l.h], [[ -/* Generated by cobc 3.3-dev.0 */ -/* Generated from prog.cob */ -/* Generated at févr. 23 2024 17:01:05 */ -/* GnuCOBOL build date Feb 21 2024 15:41:43 */ -/* GnuCOBOL package date Feb 01 2024 13:58:21 UTC */ -/* Compile command cobc -Cx prog.cob */ - -/* Program local variables for 'prog' */ - -/* Module initialization indicator */ -static unsigned int initialized = 0; - -/* Module structure pointer */ -static cob_module *module = NULL; - -/* Global variable pointer */ -cob_global *cob_glob_ptr; - - -/* LINKAGE SECTION (Items not referenced by USING clause) */ -static unsigned char *b_9 = NULL; /* XML-NAMESPACE */ -static unsigned char *b_10 = NULL; /* XML-NAMESPACE-PREFIX */ -static unsigned char *b_11 = NULL; /* XML-NNAMESPACE */ -static unsigned char *b_12 = NULL; /* XML-NNAMESPACE-PREFIX */ -static unsigned char *b_13 = NULL; /* XML-NTEXT */ -static unsigned char *b_14 = NULL; /* XML-TEXT */ - - -/* Local cob_field items */ -cob_field f0; -cob_field f1; -cob_field f2; -cob_field f3; -cob_field f4; - - -/* Call parameters */ -cob_field *cob_procedure_params[1]; - -/* Perform frame stack */ -struct cob_frame *frame_ptr; -struct cob_frame frame_stack[255]; - - -/* Data storage */ -static int b_2; /* RETURN-CODE */ -static cob_u8_t b_17[8] __attribute__((aligned)); /* WK-CMD */ -static cob_u8_t b_18[2] __attribute__((aligned)); /* WK-SIGNS */ -static cob_u8_t b_21[2] __attribute__((aligned)); /* WK-DELIM */ -static cob_u8_t b_22[6] __attribute__((aligned)); /* WK-DATA */ - -/* End of local data storage */ - - -/* Fields (local) */ -static cob_field f_17 = {8, b_17, &a_1}; /* WK-CMD */ - -/* End of fields */ - - -]]) - - -AT_CHECK([$COMPILE -ftop-level-occurs-clause=ok prog.c], [0], [], []) -AT_CHECK([$COBCRUN_DIRECT ./prog], [0], [], []) - -AT_CLEANUP - - -AT_SETUP([UNSTRING combined]) -AT_KEYWORDS([runmisc]) - -AT_DATA([prog.c], [[ -/* Generated by cobc 3.3-dev.0 */ -/* Generated from prog.cob */ -/* Generated at févr. 23 2024 17:01:26 */ -/* GnuCOBOL build date Feb 21 2024 15:41:43 */ -/* GnuCOBOL package date Feb 01 2024 13:58:21 UTC */ -/* Compile command cobc -Cx prog.cob */ - -#include /* for memcpy, memcmp and friends */ -#define COB_KEYWORD_INLINE __inline -#include - -#define COB_SOURCE_FILE "prog.cob" -#define COB_PACKAGE_VERSION "3.3-dev" -#define COB_PATCH_LEVEL 0 -#define COB_MODULE_FORMATTED_DATE "févr. 23 2024 17:01:26" -#define COB_MODULE_DATE 20240223 -#define COB_MODULE_TIME 170126 - -/* Global variables */ -#include "prog.c.h" - -/* Function prototypes */ - -static int UnstringTest (); -static int UnstringTest_ (const int); -static void UnstringTest_module_init (cob_module *module); - -/* Main function */ -int -main (int argc, char **argv) -{ - cob_init (argc, argv); - cob_stop_run (UnstringTest ()); -} - -/* Functions */ - -static void gc_module_so_init () __attribute__ ((constructor)); -static void gc_module_so_init () -{ - cob_check_version (COB_SOURCE_FILE, COB_PACKAGE_VERSION, COB_PATCH_LEVEL); -} - -/* PROGRAM-ID 'UnstringTest' */ - -/* ENTRY 'UnstringTest' */ - -static int -UnstringTest () -{ - return UnstringTest_ (0); -} - -static int -UnstringTest_ (const int entry) -{ - /* Program local variables */ - #include "prog.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; - - /* 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: 26 : Entry UnstringTest : prog.cob */ - l_2:; - - /* Line: 26 : INITIALIZE : prog.cob */ - memset (b_19, (unsigned char)' ', 21); - memset (b_19 + 21, (unsigned char)'0', 2); - memset (b_19 + 23, (unsigned char)' ', 21); - memset (b_19 + 44, (unsigned char)'0', 4); - - /* Line: 27 : MOVE : prog.cob */ - memcpy (b_18, "01", 2); - - /* Line: 29 : UNSTRING : prog.cob */ - cob_glob_ptr->cob_exception_code = 0; - cob_unstring_init (&f_17, &f_18, 1); - cob_unstring_delimited ((cob_field *)&c_1, 0); - cob_unstring_into (&f_20, &f_21, &f_22); - cob_unstring_into (&f_23, &f_24, &f_25); - cob_unstring_tallying (&f_26); - cob_unstring_finish (); - if (unlikely ((cob_glob_ptr->cob_exception_code & 0xff00) == 0x0a00)) - { - - /* Line: 38 : DISPLAY : prog.cob */ - cob_display (0, 1, 1, &c_2); - } - - /* Line: 42 : PERFORM : prog.cob */ - /* PERFORM TEST-CASE-1-RESULT */ - frame_ptr++; - frame_ptr->perform_through = 5; - frame_ptr->return_address_ptr = &&l_7; - goto l_5; - l_7: - frame_ptr--; - - /* Line: 45 : INITIALIZE : prog.cob */ - memset (b_19, (unsigned char)' ', 21); - memset (b_19 + 21, (unsigned char)'0', 2); - memset (b_19 + 23, (unsigned char)' ', 21); - memset (b_19 + 44, (unsigned char)'0', 4); - - /* Line: 46 : MOVE : prog.cob */ - memcpy (b_18, "01", 2); - - /* Line: 48 : UNSTRING : prog.cob */ - cob_glob_ptr->cob_exception_code = 0; - cob_unstring_init (&f_17, &f_18, 2); - cob_unstring_delimited ((cob_field *)&c_1, 0); - cob_unstring_delimited ((cob_field *)&c_3, 1); - cob_unstring_into (&f_20, &f_21, &f_22); - cob_unstring_into (&f_23, &f_24, &f_25); - cob_unstring_tallying (&f_26); - cob_unstring_finish (); - if (!cob_glob_ptr->cob_exception_code) - { - - /* Line: 57 : DISPLAY : prog.cob */ - cob_display (0, 1, 1, &c_4); - } - - /* Line: 61 : PERFORM : prog.cob */ - /* PERFORM TEST-CASE-2-RESULT */ - frame_ptr++; - frame_ptr->perform_through = 6; - frame_ptr->return_address_ptr = &&l_8; - goto l_6; - l_8: - frame_ptr--; - - /* Line: 63 : GOBACK : prog.cob */ - goto exit_program; - - /* Line: 66 : Paragraph TEST-CASE-1-RESULT : prog.cob */ - l_5:; - - /* Line: 68 : IF : prog.cob */ - if (((int)cob_cmp (&f_20, (cob_field *)&c_5) != 0)) - { - - /* Line: 69 : DISPLAY : prog.cob */ - cob_display (0, 1, 3, &c_6, &f_20, &c_7); - } - - /* Line: 70 : IF : prog.cob */ - if (((int)(int)(*(b_19 + 20) - (unsigned char)'|') != 0)) - { - - /* Line: 71 : DISPLAY : prog.cob */ - cob_display (0, 1, 3, &c_8, &f_21, &c_9); - } - - /* Line: 72 : IF : prog.cob */ - if (((int)cob_cmp_numdisp (b_19 + 21, 2, COB_S64_C(4), 0) != 0)) - { - - /* Line: 73 : DISPLAY : prog.cob */ - cob_display (0, 1, 3, &c_10, &f_22, &c_11); - } - - /* Line: 74 : IF : prog.cob */ - if (((int)cob_cmp (&f_23, (cob_field *)&c_12) != 0)) - { - - /* Line: 75 : DISPLAY : prog.cob */ - cob_display (0, 1, 3, &c_13, &f_23, &c_14); - } - - /* Line: 76 : IF : prog.cob */ - if (((int)(int)(*(b_19 + 43) - ' ') != 0)) - { - - /* Line: 77 : DISPLAY : prog.cob */ - cob_display (0, 1, 3, &c_15, &f_24, &c_16); - } - - /* Line: 78 : IF : prog.cob */ - if (((int)cob_cmp_numdisp (b_19 + 44, 2, COB_S64_C(8), 0) != 0)) - { - - /* Line: 79 : DISPLAY : prog.cob */ - cob_display (0, 1, 3, &c_10, &f_25, &c_17); - } - - /* Line: 80 : IF : prog.cob */ - if (((int)cob_cmp_numdisp (b_18, 2, COB_S64_C(14), 0) != 0)) - { - - /* Line: 81 : DISPLAY : prog.cob */ - cob_display (0, 1, 3, &c_18, &f_18, &c_19); - } - - /* Line: 82 : IF : prog.cob */ - if (((int)cob_cmp_numdisp (b_19 + 46, 2, COB_S64_C(2), 0) != 0)) - { - - /* Line: 83 : DISPLAY : prog.cob */ - cob_display (0, 1, 3, &c_20, &f_26, &c_21); - } - - /* Implicit PERFORM return */ - if (frame_ptr->perform_through == 5) - goto *frame_ptr->return_address_ptr; - - /* Line: 85 : Paragraph TEST-CASE-2-RESULT : prog.cob */ - l_6:; - - /* Line: 87 : IF : prog.cob */ - if (((int)cob_cmp (&f_20, (cob_field *)&c_5) != 0)) - { - - /* Line: 88 : DISPLAY : prog.cob */ - cob_display (0, 1, 3, &c_22, &f_20, &c_7); - } - - /* Line: 89 : IF : prog.cob */ - if (((int)(int)(*(b_19 + 20) - (unsigned char)'|') != 0)) - { - - /* Line: 90 : DISPLAY : prog.cob */ - cob_display (0, 1, 3, &c_23, &f_21, &c_9); - } - - /* Line: 91 : IF : prog.cob */ - if (((int)cob_cmp_numdisp (b_19 + 21, 2, COB_S64_C(4), 0) != 0)) - { - - /* Line: 92 : DISPLAY : prog.cob */ - cob_display (0, 1, 3, &c_24, &f_22, &c_11); - } - - /* Line: 93 : IF : prog.cob */ - if (((int)cob_cmp (&f_23, (cob_field *)&c_25) != 0)) - { - - /* Line: 94 : DISPLAY : prog.cob */ - cob_display (0, 1, 3, &c_26, &f_23, &c_27); - } - - /* Line: 95 : IF : prog.cob */ - if (((int)(int)(*(b_19 + 43) - (unsigned char)'-') != 0)) - { - - /* Line: 96 : DISPLAY : prog.cob */ - cob_display (0, 1, 3, &c_28, &f_24, &c_29); - } - - /* Line: 97 : IF : prog.cob */ - if (((int)cob_cmp_numdisp (b_19 + 44, 2, COB_S64_C(3), 0) != 0)) - { - - /* Line: 98 : DISPLAY : prog.cob */ - cob_display (0, 1, 3, &c_24, &f_25, &c_30); - } - - /* Line: 99 : IF : prog.cob */ - if (((int)cob_cmp_numdisp (b_18, 2, COB_S64_C(11), 0) != 0)) - { - - /* Line: 100 : DISPLAY : prog.cob */ - cob_display (0, 1, 3, &c_31, &f_18, &c_32); - } - - /* Line: 101 : IF : prog.cob */ - if (((int)cob_cmp_numdisp (b_19 + 46, 2, COB_S64_C(2), 0) != 0)) - { - - /* Line: 102 : DISPLAY : prog.cob */ - cob_display (0, 1, 3, &c_33, &f_26, &c_21); - } - - /* Implicit PERFORM return */ - if (frame_ptr->perform_through == 6) - goto *frame_ptr->return_address_ptr; - - /* Program exit */ - - exit_program: - - /* 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_module_path = cob_glob_ptr->cob_main_argv0; - - UnstringTest_module_init (module); - - module->collating_sequence = NULL; - module->crt_status = NULL; - module->cursor_pos = NULL; - module->xml_code = NULL; - module->xml_event = NULL; - module->xml_information = NULL; - module->xml_namespace = NULL; - module->xml_namespace_prefix = NULL; - module->xml_nnamespace = NULL; - module->xml_nnamespace_prefix = NULL; - module->xml_ntext = NULL; - module->xml_text = NULL; - module->json_code = NULL; - module->json_status = NULL; - - /* Initialize cancel callback */ - cob_set_cancel (module); - - /* Initialize WORKING-STORAGE */ - /* initialize field RETURN-CODE */ - b_2 = 0; - - /* initialize field INP-STRING */ - memcpy (b_17, "ABC1|DEF--GHI", 13); - - /* initialize field STR-POINTER */ - memset (b_18, (unsigned char)'0', 2); - - /* initialize field RES-TRGT-1 */ - memset (b_19, (unsigned char)' ', 21); - /* initialize field RES-COUNT-1 */ - memset (b_19 + 21, (unsigned char)'0', 2); - /* initialize field RES-TRGT-2 */ - memset (b_19 + 23, (unsigned char)' ', 21); - /* initialize field RES-COUNT-2 */ - memset (b_19 + 44, (unsigned char)'0', 4); - - - 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 'UnstringTest' */ - -/* Initialize module structure for UnstringTest */ -static void UnstringTest_module_init (cob_module *module) -{ - module->module_name = "UnstringTest"; - module->module_formatted_date = COB_MODULE_FORMATTED_DATE; - module->module_source = COB_SOURCE_FILE; - module->gc_version = COB_PACKAGE_VERSION; - module->module_entry.funcptr = (void *(*)())UnstringTest; - module->module_cancel.funcptr = (void *(*)())UnstringTest_; - 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->xml_mode = 1; - module->module_stmt = 0; - module->module_sources = NULL; -} - -/* End functions */ - - -]]) - -AT_DATA([prog.c.h], [[ -/* Generated by cobc 3.3-dev.0 */ -/* Generated from prog.cob */ -/* Generated at févr. 23 2024 17:01:26 */ -/* GnuCOBOL build date Feb 21 2024 15:41:43 */ -/* GnuCOBOL package date Feb 01 2024 13:58:21 UTC */ -/* Compile command cobc -Cx prog.cob */ - - -/* Module path */ -static const char *cob_module_path = NULL; - -/* Number of call parameters */ -static int cob_call_params = 0; - -/* Attributes */ - -static const cob_field_attr a_1 = {0x21, 0, 0, 0x0000, NULL}; -static const cob_field_attr a_2 = {0x10, 2, 0, 0x0000, NULL}; -static const cob_field_attr a_3 = {0x21, 0, 0, 0x1000, NULL}; - - -/* Constants */ -static const cob_field c_1 = {1, (cob_u8_ptr)"|", &a_3}; -static const cob_field c_2 = {44, (cob_u8_ptr)"Unstring tallying case 1 should not OVERFLOW", &a_3}; -static const cob_field c_3 = {1, (cob_u8_ptr)"-", &a_3}; -static const cob_field c_4 = {41, (cob_u8_ptr)"Unstring tallying case 2 should OVERFLOW", &a_3}; -static const cob_field c_5 = {4, (cob_u8_ptr)"ABC1", &a_3}; -static const cob_field c_6 = {15, (cob_u8_ptr)"A: RES-TRGT-1 <", &a_3}; -static const cob_field c_7 = {11, (cob_u8_ptr)"> != ", &a_3}; -static const cob_field c_8 = {16, (cob_u8_ptr)"A: RES-DELIM-1 <", &a_3}; -static const cob_field c_9 = {8, (cob_u8_ptr)"> != <|>", &a_3}; -static const cob_field c_10 = {16, (cob_u8_ptr)"A: RES-COUNT-1 <", &a_3}; -static const cob_field c_11 = {8, (cob_u8_ptr)"> != <4>", &a_3}; -static const cob_field c_12 = {8, (cob_u8_ptr)"DEF--GHI", &a_3}; -static const cob_field c_13 = {15, (cob_u8_ptr)"A: RES-TRGT-2 <", &a_3}; -static const cob_field c_14 = {15, (cob_u8_ptr)"> != ", &a_3}; -static const cob_field c_15 = {15, (cob_u8_ptr)"A: RES-DELIM2 <", &a_3}; -static const cob_field c_16 = {10, (cob_u8_ptr)"> != SPACE", &a_3}; -static const cob_field c_17 = {8, (cob_u8_ptr)"> != <8>", &a_3}; -static const cob_field c_18 = {16, (cob_u8_ptr)"A: STR-POINTER <", &a_3}; -static const cob_field c_19 = {9, (cob_u8_ptr)"> != <14>", &a_3}; -static const cob_field c_20 = {14, (cob_u8_ptr)"A: RES-TALLY <", &a_3}; -static const cob_field c_21 = {8, (cob_u8_ptr)"> != <2>", &a_3}; -static const cob_field c_22 = {15, (cob_u8_ptr)"B: RES-TRGT-1 <", &a_3}; -static const cob_field c_23 = {16, (cob_u8_ptr)"B: RES-DELIM-1 <", &a_3}; -static const cob_field c_24 = {16, (cob_u8_ptr)"B: RES-COUNT-1 <", &a_3}; -static const cob_field c_25 = {3, (cob_u8_ptr)"DEF", &a_3}; -static const cob_field c_26 = {15, (cob_u8_ptr)"B: RES-TRGT-2 <", &a_3}; -static const cob_field c_27 = {10, (cob_u8_ptr)"> != ", &a_3}; -static const cob_field c_28 = {15, (cob_u8_ptr)"B: RES-DELIM2 <", &a_3}; -static const cob_field c_29 = {8, (cob_u8_ptr)"> != <->", &a_3}; -static const cob_field c_30 = {8, (cob_u8_ptr)"> != <3>", &a_3}; -static const cob_field c_31 = {16, (cob_u8_ptr)"B: STR-POINTER <", &a_3}; -static const cob_field c_32 = {9, (cob_u8_ptr)"> != <11>", &a_3}; -static const cob_field c_33 = {14, (cob_u8_ptr)"B: RES-TALLY <", &a_3}; - - -]]) - -AT_DATA([prog.c.l.h], [[ -/* Generated by cobc 3.3-dev.0 */ -/* Generated from prog.cob */ -/* Generated at févr. 23 2024 17:01:26 */ -/* GnuCOBOL build date Feb 21 2024 15:41:43 */ -/* GnuCOBOL package date Feb 01 2024 13:58:21 UTC */ -/* Compile command cobc -Cx prog.cob */ - -/* Program local variables for 'UnstringTest' */ - -/* Module initialization indicator */ -static unsigned int initialized = 0; - -/* Module structure pointer */ -static cob_module *module = NULL; - -/* Global variable pointer */ -cob_global *cob_glob_ptr; - - -/* LINKAGE SECTION (Items not referenced by USING clause) */ -static unsigned char *b_9 = NULL; /* XML-NAMESPACE */ -static unsigned char *b_10 = NULL; /* XML-NAMESPACE-PREFIX */ -static unsigned char *b_11 = NULL; /* XML-NNAMESPACE */ -static unsigned char *b_12 = NULL; /* XML-NNAMESPACE-PREFIX */ -static unsigned char *b_13 = NULL; /* XML-NTEXT */ -static unsigned char *b_14 = NULL; /* XML-TEXT */ - - -/* Call parameters */ -cob_field *cob_procedure_params[1]; - -/* Perform frame stack */ -struct cob_frame *frame_ptr; -struct cob_frame frame_stack[255]; - - -/* Data storage */ -static int b_2; /* RETURN-CODE */ -static cob_u8_t b_17[13] __attribute__((aligned)); /* INP-STRING */ -static cob_u8_t b_18[2] __attribute__((aligned)); /* STR-POINTER */ -static cob_u8_t b_19[48] __attribute__((aligned)); /* RES-DATA */ - -/* End of local data storage */ - - -/* Fields (local) */ -static cob_field f_17 = {13, b_17, &a_1}; /* INP-STRING */ -static cob_field f_18 = {2, b_18, &a_2}; /* STR-POINTER */ -static cob_field f_20 = {20, b_19, &a_1}; /* RES-TRGT-1 */ -static cob_field f_21 = {1, b_19 + 20, &a_1}; /* RES-DELIM-1 */ -static cob_field f_22 = {2, b_19 + 21, &a_2}; /* RES-COUNT-1 */ -static cob_field f_23 = {20, b_19 + 23, &a_1}; /* RES-TRGT-2 */ -static cob_field f_24 = {1, b_19 + 43, &a_1}; /* RES-DELIM-2 */ -static cob_field f_25 = {2, b_19 + 44, &a_2}; /* RES-COUNT-2 */ -static cob_field f_26 = {2, b_19 + 46, &a_2}; /* RES-TALLY */ - -/* End of fields */ - - -]]) - - -AT_CHECK([$COMPILE prog.c], [0], [], []) -AT_CHECK([$COBCRUN_DIRECT ./prog], [0], [], []) - -AT_CLEANUP - - -AT_SETUP([UNSTRING with FUNCTION / literal]) -AT_KEYWORDS([runmisc]) - -AT_DATA([prog.c], [[ -/* Generated by cobc 3.3-dev.0 */ -/* Generated from prog.cob */ -/* Generated at févr. 23 2024 17:01:49 */ -/* GnuCOBOL build date Feb 21 2024 15:41:43 */ -/* GnuCOBOL package date Feb 01 2024 13:58:21 UTC */ -/* Compile command cobc -Cx prog.cob */ - -#include /* for memcpy, memcmp and friends */ -#define COB_KEYWORD_INLINE __inline -#include - -#define COB_SOURCE_FILE "prog.cob" -#define COB_PACKAGE_VERSION "3.3-dev" -#define COB_PATCH_LEVEL 0 -#define COB_MODULE_FORMATTED_DATE "févr. 23 2024 17:01:49" -#define COB_MODULE_DATE 20240223 -#define COB_MODULE_TIME 170149 - -/* Global variables */ -#include "prog.c.h" - -/* Function prototypes */ - -static int prog (); -static int prog_ (const int); -static void prog_module_init (cob_module *module); - -/* Main function */ -int -main (int argc, char **argv) -{ - cob_init (argc, argv); - cob_stop_run (prog ()); -} - -/* Functions */ - -static void gc_module_so_init () __attribute__ ((constructor)); -static void gc_module_so_init () -{ - cob_check_version (COB_SOURCE_FILE, COB_PACKAGE_VERSION, COB_PATCH_LEVEL); -} - -/* PROGRAM-ID 'prog' */ - -/* ENTRY 'prog' */ - -static int -prog () -{ - return prog_ (0); -} - -static int -prog_ (const int entry) -{ - /* Program local variables */ - #include "prog.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; - - /* 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: 9 : Entry prog : prog.cob */ - l_2:; - - /* Line: 9 : MOVE : prog.cob */ - cob_move ((cob_field *)&c_1, &f_18); - - /* Line: 10 : UNSTRING : prog.cob */ - cob_unstring_init (&f_18, NULL, 1); - cob_unstring_delimited ((cob_field *)&c_2, 0); - cob_unstring_into (COB_SET_FLD (f0, 16, b_17 + 479, &a_2), 0, 0); - cob_unstring_into (COB_SET_FLD (f0, 16, b_17 + 479 + 16LL * 1LL, &a_2), 0, 0); - cob_unstring_into (COB_SET_FLD (f0, 16, b_17 + 479 + 16LL * 2LL, &a_2), 0, 0); - cob_unstring_into (COB_SET_FLD (f0, 16, b_17 + 479 + 16LL * 3LL, &a_2), 0, 0); - cob_unstring_finish (); - - /* Line: 12 : DISPLAY : prog.cob */ - cob_display (0, 1, 3, &c_3, COB_SET_FLD (f0, 16, b_17 + 479, &a_2), &c_4); - - /* Line: 13 : DISPLAY : prog.cob */ - cob_display (0, 1, 3, &c_5, COB_SET_FLD (f0, 16, b_17 + 479 + 16LL * 1LL, &a_2), &c_4); - - /* Line: 14 : DISPLAY : prog.cob */ - cob_display (0, 1, 3, &c_6, COB_SET_FLD (f0, 16, b_17 + 479 + 16LL * 2LL, &a_2), &c_4); - - /* Line: 15 : DISPLAY : prog.cob */ - cob_display (0, 1, 3, &c_7, COB_SET_FLD (f0, 16, b_17 + 479 + 16LL * 3LL, &a_2), &c_4); - - /* Line: 16 : UNSTRING : prog.cob */ - cob_unstring_init (cob_intr_upper_case (0, 0, &f_18), NULL, 1); - cob_unstring_delimited ((cob_field *)&c_2, 0); - cob_unstring_into (COB_SET_FLD (f0, 16, b_17 + 479, &a_2), 0, 0); - cob_unstring_into (COB_SET_FLD (f0, 16, b_17 + 479 + 16LL * 1LL, &a_2), 0, 0); - cob_unstring_into (COB_SET_FLD (f0, 16, b_17 + 479 + 16LL * 2LL, &a_2), 0, 0); - cob_unstring_into (COB_SET_FLD (f0, 16, b_17 + 479 + 16LL * 3LL, &a_2), 0, 0); - cob_unstring_finish (); - - /* Line: 18 : DISPLAY : prog.cob */ - cob_display (0, 1, 1, &c_8); - - /* Line: 19 : DISPLAY : prog.cob */ - cob_display (0, 1, 3, &c_3, COB_SET_FLD (f0, 16, b_17 + 479, &a_2), &c_4); - - /* Line: 20 : DISPLAY : prog.cob */ - cob_display (0, 1, 3, &c_5, COB_SET_FLD (f0, 16, b_17 + 479 + 16LL * 1LL, &a_2), &c_4); - - /* Line: 21 : DISPLAY : prog.cob */ - cob_display (0, 1, 3, &c_6, COB_SET_FLD (f0, 16, b_17 + 479 + 16LL * 2LL, &a_2), &c_4); - - /* Line: 22 : DISPLAY : prog.cob */ - cob_display (0, 1, 3, &c_7, COB_SET_FLD (f0, 16, b_17 + 479 + 16LL * 3LL, &a_2), &c_4); - - /* Line: 23 : UNSTRING : prog.cob */ - cob_unstring_init ((cob_field *)&c_9, NULL, 1); - cob_unstring_delimited ((cob_field *)&c_2, 0); - cob_unstring_into (COB_SET_FLD (f0, 16, b_17 + 479, &a_2), 0, 0); - cob_unstring_into (COB_SET_FLD (f0, 16, b_17 + 479 + 16LL * 1LL, &a_2), 0, 0); - cob_unstring_into (COB_SET_FLD (f0, 16, b_17 + 479 + 16LL * 2LL, &a_2), 0, 0); - cob_unstring_into (COB_SET_FLD (f0, 16, b_17 + 479 + 16LL * 3LL, &a_2), 0, 0); - cob_unstring_finish (); - - /* Line: 25 : DISPLAY : prog.cob */ - cob_display (0, 1, 1, &c_10); - - /* Line: 26 : DISPLAY : prog.cob */ - cob_display (0, 1, 3, &c_3, COB_SET_FLD (f0, 16, b_17 + 479, &a_2), &c_4); - - /* Line: 27 : DISPLAY : prog.cob */ - cob_display (0, 1, 3, &c_5, COB_SET_FLD (f0, 16, b_17 + 479 + 16LL * 1LL, &a_2), &c_4); - - /* Line: 28 : DISPLAY : prog.cob */ - cob_display (0, 1, 3, &c_6, COB_SET_FLD (f0, 16, b_17 + 479 + 16LL * 2LL, &a_2), &c_4); - - /* Line: 29 : DISPLAY : prog.cob */ - cob_display (0, 1, 3, &c_7, COB_SET_FLD (f0, 16, b_17 + 479 + 16LL * 3LL, &a_2), &c_4); - - /* Line: 30 : UNSTRING : prog.cob */ - cob_unstring_init (cob_intr_lower_case (0, 0, (cob_field *)&c_9), NULL, 1); - cob_unstring_delimited ((cob_field *)&c_2, 0); - cob_unstring_into (COB_SET_FLD (f0, 16, b_17 + 479, &a_2), 0, 0); - cob_unstring_into (COB_SET_FLD (f0, 16, b_17 + 479 + 16LL * 1LL, &a_2), 0, 0); - cob_unstring_into (COB_SET_FLD (f0, 16, b_17 + 479 + 16LL * 2LL, &a_2), 0, 0); - cob_unstring_into (COB_SET_FLD (f0, 16, b_17 + 479 + 16LL * 3LL, &a_2), 0, 0); - cob_unstring_finish (); - - /* Line: 33 : DISPLAY : prog.cob */ - cob_display (0, 1, 1, &c_11); - - /* Line: 34 : DISPLAY : prog.cob */ - cob_display (0, 1, 3, &c_3, COB_SET_FLD (f0, 16, b_17 + 479, &a_2), &c_4); - - /* Line: 35 : DISPLAY : prog.cob */ - cob_display (0, 1, 3, &c_5, COB_SET_FLD (f0, 16, b_17 + 479 + 16LL * 1LL, &a_2), &c_4); - - /* Line: 36 : DISPLAY : prog.cob */ - cob_display (0, 1, 3, &c_6, COB_SET_FLD (f0, 16, b_17 + 479 + 16LL * 2LL, &a_2), &c_4); - - /* Line: 37 : DISPLAY : prog.cob */ - cob_display (0, 1, 3, &c_7, COB_SET_FLD (f0, 16, b_17 + 479 + 16LL * 3LL, &a_2), &c_4); - - /* Line: 38 : STOP RUN : prog.cob */ - cob_stop_run (b_2); - - /* 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_module_path = cob_glob_ptr->cob_main_argv0; - - prog_module_init (module); - - module->collating_sequence = NULL; - module->crt_status = NULL; - module->cursor_pos = NULL; - module->xml_code = NULL; - module->xml_event = NULL; - module->xml_information = NULL; - module->xml_namespace = NULL; - module->xml_namespace_prefix = NULL; - module->xml_nnamespace = NULL; - module->xml_nnamespace_prefix = NULL; - module->xml_ntext = NULL; - module->xml_text = NULL; - module->json_code = NULL; - module->json_status = NULL; - - /* Initialize cancel callback */ - cob_set_cancel (module); - - /* Initialize WORKING-STORAGE */ - /* initialize field RETURN-CODE */ - b_2 = 0; - - /* initialize field FILLER 1 */ - memset (b_17, (unsigned char)' ', 543); - - - 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 'prog' */ - -/* Initialize module structure for prog */ -static void prog_module_init (cob_module *module) -{ - module->module_name = "prog"; - module->module_formatted_date = COB_MODULE_FORMATTED_DATE; - module->module_source = COB_SOURCE_FILE; - module->gc_version = COB_PACKAGE_VERSION; - module->module_entry.funcptr = (void *(*)())prog; - module->module_cancel.funcptr = (void *(*)())prog_; - 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->xml_mode = 1; - module->module_stmt = 0; - module->module_sources = NULL; -} - -/* End functions */ - - -]]) - -AT_DATA([prog.c.h], [[ -/* Generated by cobc 3.3-dev.0 */ -/* Generated from prog.cob */ -/* Generated at févr. 23 2024 17:01:49 */ -/* GnuCOBOL build date Feb 21 2024 15:41:43 */ -/* GnuCOBOL package date Feb 01 2024 13:58:21 UTC */ -/* Compile command cobc -Cx prog.cob */ - - -/* Module path */ -static const char *cob_module_path = NULL; - -/* Number of call parameters */ -static int cob_call_params = 0; - -/* Attributes */ - -static const cob_field_attr a_1 = {0x21, 0, 0, 0x1000, NULL}; -static const cob_field_attr a_2 = {0x21, 0, 0, 0x0000, NULL}; - - -/* Constants */ -static const cob_field c_1 = {19, (cob_u8_ptr)"The,Quick,Brown,Fox", &a_1}; -static const cob_field c_2 = {1, (cob_u8_ptr)",", &a_1}; -static const cob_field c_3 = {10, (cob_u8_ptr)"PRM(1) is ", &a_1}; -static const cob_field c_4 = {1, (cob_u8_ptr)":", &a_1}; -static const cob_field c_5 = {10, (cob_u8_ptr)"PRM(2) is ", &a_1}; -static const cob_field c_6 = {10, (cob_u8_ptr)"PRM(3) is ", &a_1}; -static const cob_field c_7 = {10, (cob_u8_ptr)"PRM(4) is ", &a_1}; -static const cob_field c_8 = {20, (cob_u8_ptr)"Now using UPPER-CASE", &a_1}; -static const cob_field c_9 = {25, (cob_u8_ptr)"Daddy,was,a,Rolling stone", &a_1}; -static const cob_field c_10 = {17, (cob_u8_ptr)"Now using Literal", &a_1}; -static const cob_field c_11 = {30, (cob_u8_ptr)"Now using Literal + LOWER-CASE", &a_1}; - - -]]) - -AT_DATA([prog.c.l.h], [[ -/* Generated by cobc 3.3-dev.0 */ -/* Generated from prog.cob */ -/* Generated at févr. 23 2024 17:01:49 */ -/* GnuCOBOL build date Feb 21 2024 15:41:43 */ -/* GnuCOBOL package date Feb 01 2024 13:58:21 UTC */ -/* Compile command cobc -Cx prog.cob */ - -/* Program local variables for 'prog' */ - -/* Module initialization indicator */ -static unsigned int initialized = 0; - -/* Module structure pointer */ -static cob_module *module = NULL; - -/* Global variable pointer */ -cob_global *cob_glob_ptr; - - -/* LINKAGE SECTION (Items not referenced by USING clause) */ -static unsigned char *b_9 = NULL; /* XML-NAMESPACE */ -static unsigned char *b_10 = NULL; /* XML-NAMESPACE-PREFIX */ -static unsigned char *b_11 = NULL; /* XML-NNAMESPACE */ -static unsigned char *b_12 = NULL; /* XML-NNAMESPACE-PREFIX */ -static unsigned char *b_13 = NULL; /* XML-NTEXT */ -static unsigned char *b_14 = NULL; /* XML-TEXT */ - - -/* Local cob_field items */ -cob_field f0; - - -/* Call parameters */ -cob_field *cob_procedure_params[1]; - -/* Perform frame stack */ -struct cob_frame *frame_ptr; -struct cob_frame frame_stack[255]; - - -/* Data storage */ -static int b_2; /* RETURN-CODE */ -static cob_u8_t b_17[543] __attribute__((aligned)); /* FILLER 1 */ - -/* End of local data storage */ - - -/* Fields (local) */ -static cob_field f_18 = {479, b_17, &a_2}; /* TSTUNS */ - -/* End of fields */ - - -]]) - - -AT_CHECK([$COMPILE prog.c], [0], [], []) -AT_CHECK([$COBCRUN_DIRECT ./prog], [0], -[PRM(1) is The : -PRM(2) is Quick : -PRM(3) is Brown : -PRM(4) is Fox : -Now using UPPER-CASE -PRM(1) is THE : -PRM(2) is QUICK : -PRM(3) is BROWN : -PRM(4) is FOX : -Now using Literal -PRM(1) is Daddy : -PRM(2) is was : -PRM(3) is a : -PRM(4) is Rolling stone : -Now using Literal + LOWER-CASE -PRM(1) is daddy : -PRM(2) is was : -PRM(3) is a : -PRM(4) is rolling stone : -], []) - -AT_CLEANUP