├── README.md ├── TODO.txt ├── build.tcl ├── doc ├── checklist.txt ├── critcl.man ├── critcl_application.man ├── critcl_application_package.man ├── critcl_bitmap.man ├── critcl_build.man ├── critcl_callback.man ├── critcl_changes.man ├── critcl_class.man ├── critcl_cproc.man ├── critcl_cutil.man ├── critcl_devguide.man ├── critcl_emap.man ├── critcl_enum.man ├── critcl_howto_install.man ├── critcl_howto_sources.man ├── critcl_howto_use.man ├── critcl_iassoc.man ├── critcl_license.man ├── critcl_literals.man ├── critcl_package.man ├── critcl_tcl9.man ├── critcl_util.man ├── figures │ ├── arch_application.dia │ ├── arch_application.png │ ├── arch_application.txt │ ├── arch_core.dia │ ├── arch_core.png │ ├── arch_core.txt │ ├── arch_support.dia │ ├── arch_support.png │ ├── arch_support.txt │ ├── architecture.dia │ ├── architecture.png │ └── architecture.txt ├── include │ ├── advert.inc │ ├── aoptions.inc │ ├── api.inc │ ├── api_aembedc.inc │ ├── api_bconfig.inc │ ├── api_bmgmt.inc │ ├── api_cbconfig.inc │ ├── api_control.inc │ ├── api_diversions.inc │ ├── api_embedc.inc │ ├── api_embedc_cnameoption.inc │ ├── api_generation.inc │ ├── api_introspection.inc │ ├── api_location.inc │ ├── api_meta.inc │ ├── api_rcache.inc │ ├── api_stubs.inc │ ├── api_tools.inc │ ├── architecture.inc │ ├── b_test.inc │ ├── b_unix.inc │ ├── b_windows.inc │ ├── build_install_options.inc │ ├── changes.inc │ ├── changes │ │ ├── 21.inc │ │ ├── 3.inc │ │ ├── 301.inc │ │ ├── 302.inc │ │ ├── 303.inc │ │ ├── 304.inc │ │ ├── 305.inc │ │ ├── 306.inc │ │ ├── 307.inc │ │ ├── 31.inc │ │ ├── 311.inc │ │ ├── 3110.inc │ │ ├── 3111.inc │ │ ├── 3112.inc │ │ ├── 3113.inc │ │ ├── 3114.inc │ │ ├── 3115.inc │ │ ├── 3116.inc │ │ ├── 3117.inc │ │ ├── 3118.inc │ │ ├── 31181.inc │ │ ├── 312.inc │ │ ├── 313.inc │ │ ├── 314.inc │ │ ├── 315.inc │ │ ├── 316.inc │ │ ├── 317.inc │ │ ├── 318.inc │ │ ├── 319.inc │ │ ├── 32.inc │ │ ├── 33.inc │ │ ├── 331.inc │ │ └── X.inc │ ├── changesX.inc │ ├── class_example.inc │ ├── class_spec.inc │ ├── class_spec_cdin.inc │ ├── class_spec_clife.inc │ ├── class_spec_cvarm.inc │ ├── class_spec_general.inc │ ├── class_spec_ilife.inc │ ├── class_spec_ivarm.inc │ ├── concepts.inc │ ├── cproc │ │ ├── api_extcproc.inc │ │ ├── api_extcproc1.inc │ │ ├── api_extcproc2.inc │ │ ├── api_stdat_cproc.inc │ │ ├── api_stdrt_cproc.inc │ │ ├── atypes_table.inc │ │ ├── rtypes_table.inc │ │ ├── using_eproc.inc │ │ ├── using_eprocstr.inc │ │ ├── using_eproctypes.inc │ │ ├── using_eproctypes2.inc │ │ ├── using_eproctypes3.inc │ │ └── using_eproctypes4.inc │ ├── feedback.inc │ ├── feedback2.inc │ ├── global.inc │ ├── iconfig.inc │ ├── largeexampleref.inc │ ├── mapping.inc │ ├── modes.inc │ ├── module.inc │ ├── module2.inc │ ├── pkg_users.inc │ ├── preload.inc │ ├── preload_search.inc │ ├── pstructure.inc │ ├── quad.inc │ ├── rcache.inc │ ├── reference_docs.inc │ ├── references.inc │ ├── rq_cc.inc │ ├── rq_cline.inc │ ├── rq_tcl.inc │ ├── rq_tcllib.inc │ ├── runtime.inc │ ├── skip.inc │ ├── smallexampleref.inc │ ├── stubs.inc │ ├── use │ │ ├── args.inc │ │ ├── args_binary.inc │ │ ├── args_check.inc │ │ ├── args_default.inc │ │ ├── args_list.inc │ │ ├── args_list_constrained.inc │ │ ├── args_obj.inc │ │ ├── args_range.inc │ │ ├── args_str.inc │ │ ├── args_structure.inc │ │ ├── build_help.inc │ │ ├── build_install.inc │ │ ├── build_package.inc │ │ ├── build_package_debug.inc │ │ ├── build_targets.inc │ │ ├── cconst.inc │ │ ├── csources.inc │ │ ├── csources_ii.inc │ │ ├── debugging.inc │ │ ├── env_query.inc │ │ ├── errors.inc │ │ ├── external_bitmap.inc │ │ ├── external_enum.inc │ │ ├── external_struct.inc │ │ ├── first.inc │ │ ├── first_pkg.inc │ │ ├── first_pkg.tcl │ │ ├── flags.inc │ │ ├── interp.inc │ │ ├── locations.inc │ │ ├── meta.inc │ │ ├── objtype_large.inc │ │ ├── objtype_structure.inc │ │ ├── results.inc │ │ ├── results_const_binary.inc │ │ ├── results_obj.inc │ │ ├── results_str.inc │ │ ├── results_structure.inc │ │ ├── runtime.inc │ │ ├── second.inc │ │ ├── second_pkg.inc │ │ ├── second_pkg.tcl │ │ ├── tcl_sources.inc │ │ └── template.inc │ └── welcome.inc ├── pkg_version.inc └── version.inc ├── embedded ├── man │ ├── files │ │ ├── critcl.n │ │ ├── critcl_application.n │ │ ├── critcl_application_package.n │ │ ├── critcl_bitmap.n │ │ ├── critcl_build.n │ │ ├── critcl_callback.n │ │ ├── critcl_changes.n │ │ ├── critcl_class.n │ │ ├── critcl_cproc.n │ │ ├── critcl_cutil.n │ │ ├── critcl_devguide.n │ │ ├── critcl_emap.n │ │ ├── critcl_enum.n │ │ ├── critcl_howto_install.n │ │ ├── critcl_howto_sources.n │ │ ├── critcl_howto_use.n │ │ ├── critcl_iassoc.n │ │ ├── critcl_license.n │ │ ├── critcl_literals.n │ │ ├── critcl_package.n │ │ ├── critcl_tcl9.n │ │ └── critcl_util.n │ ├── index.n │ └── toc.n ├── md │ ├── files │ │ ├── critcl.md │ │ ├── critcl_application.md │ │ ├── critcl_application_package.md │ │ ├── critcl_bitmap.md │ │ ├── critcl_build.md │ │ ├── critcl_callback.md │ │ ├── critcl_changes.md │ │ ├── critcl_class.md │ │ ├── critcl_cproc.md │ │ ├── critcl_cutil.md │ │ ├── critcl_devguide.md │ │ ├── critcl_emap.md │ │ ├── critcl_enum.md │ │ ├── critcl_howto_install.md │ │ ├── critcl_howto_sources.md │ │ ├── critcl_howto_use.md │ │ ├── critcl_iassoc.md │ │ ├── critcl_license.md │ │ ├── critcl_literals.md │ │ ├── critcl_package.md │ │ ├── critcl_tcl9.md │ │ └── critcl_util.md │ ├── image │ │ ├── arch_application.png │ │ ├── arch_core.png │ │ ├── arch_support.png │ │ └── architecture.png │ ├── index.md │ └── toc.md └── www │ ├── files │ ├── critcl.html │ ├── critcl_application.html │ ├── critcl_application_package.html │ ├── critcl_bitmap.html │ ├── critcl_build.html │ ├── critcl_callback.html │ ├── critcl_changes.html │ ├── critcl_class.html │ ├── critcl_cproc.html │ ├── critcl_cutil.html │ ├── critcl_devguide.html │ ├── critcl_emap.html │ ├── critcl_enum.html │ ├── critcl_howto_install.html │ ├── critcl_howto_sources.html │ ├── critcl_howto_use.html │ ├── critcl_iassoc.html │ ├── critcl_license.html │ ├── critcl_literals.html │ ├── critcl_package.html │ ├── critcl_tcl9.html │ └── critcl_util.html │ ├── image │ ├── arch_application.png │ ├── arch_core.png │ ├── arch_support.png │ └── architecture.png │ ├── index.html │ └── toc.html ├── examples ├── argtype │ ├── build.tcl │ ├── cr.tcl │ └── example.tcl ├── argtypes-ingress │ ├── build.tcl │ ├── cr.tcl │ ├── example.tcl │ └── ingress.tcl ├── bitmap │ ├── bitmap.tcl │ ├── build.tcl │ ├── cr.tcl │ └── example.tcl ├── build.tcl ├── clist │ ├── build.tcl │ ├── clist.tcl │ ├── clist_tcl.tcl │ ├── cr.tcl │ └── example.tcl ├── cr.tcl ├── emap-both │ ├── build.tcl │ ├── cr.tcl │ ├── emap-both.tcl │ └── example.tcl ├── emap-c │ ├── build.tcl │ ├── cr.tcl │ ├── emap-c.tcl │ └── example.tcl ├── emap │ ├── build.tcl │ ├── cr.tcl │ ├── emap-ex.tcl │ └── example.tcl ├── emapint-both │ ├── build.tcl │ ├── cr.tcl │ ├── emapint-both.tcl │ └── example.tcl ├── emapint-c │ ├── build.tcl │ ├── cr.tcl │ ├── emapint-c.tcl │ └── example.tcl ├── emapint │ ├── build.tcl │ ├── cr.tcl │ ├── emapint.tcl │ └── example.tcl ├── enum-list │ ├── build.tcl │ ├── cr.tcl │ ├── enum.tcl │ └── example.tcl ├── enum │ ├── build.tcl │ ├── cr.tcl │ ├── enum.tcl │ └── example.tcl ├── icounter │ ├── build.tcl │ ├── cr.tcl │ ├── example.tcl │ └── icounter.tcl ├── lit-both │ ├── build.tcl │ ├── cr.tcl │ ├── example.tcl │ └── pool.tcl ├── lit-c │ ├── build.tcl │ ├── cr.tcl │ ├── example.tcl │ └── pool.tcl ├── lit-list │ ├── build.tcl │ ├── cr.tcl │ ├── example.tcl │ └── pool.tcl ├── literals │ ├── build.tcl │ ├── cr.tcl │ ├── example.tcl │ └── pool.tcl ├── md5 │ ├── cr.tcl │ └── example.tcl ├── optional │ ├── build.tcl │ ├── cr.tcl │ ├── example.tcl │ └── optional.tcl ├── queue │ ├── README.txt │ ├── build.tcl │ ├── cr.tcl │ ├── example.tcl │ ├── queuec.tcl │ └── util.h ├── random │ ├── README.txt │ ├── build.tcl │ ├── random.tcl │ └── rnmath.tcl ├── selfcompanion │ ├── build.tcl │ ├── cr.tcl │ ├── example.tcl │ └── selfcompanion.tcl ├── stack │ ├── README.txt │ ├── build.tcl │ ├── cstack.c │ ├── cstack.h │ ├── cstack.tcl │ ├── cstackInt.h │ ├── stackc.tcl │ └── stackc │ │ ├── m.c │ │ ├── m.h │ │ └── util.h ├── tk8.4 │ ├── build.tcl │ ├── cr.tcl │ ├── example.tcl │ └── icounter.tcl ├── tk8.5 │ ├── build.tcl │ ├── cr.tcl │ ├── example.tcl │ └── icounter.tcl ├── tk8.6 │ ├── build.tcl │ ├── cr.tcl │ ├── example.tcl │ └── icounter.tcl ├── trace │ ├── build.tcl │ ├── cr.tcl │ ├── example.tcl │ └── pool.tcl ├── variadic │ ├── build.tcl │ ├── cr.tcl │ ├── example.tcl │ └── variadic.tcl └── zlibwrap │ ├── README.txt │ ├── build.tcl │ ├── zlib.tcl │ └── zlib │ ├── CMakeLists.txt │ ├── ChangeLog │ ├── FAQ │ ├── INDEX │ ├── Makefile │ ├── Makefile.in │ ├── README │ ├── adler32.c │ ├── amiga │ ├── Makefile.pup │ └── Makefile.sas │ ├── compress.c │ ├── configure │ ├── contrib │ ├── README.contrib │ ├── ada │ │ ├── buffer_demo.adb │ │ ├── mtest.adb │ │ ├── read.adb │ │ ├── readme.txt │ │ ├── test.adb │ │ ├── zlib-streams.adb │ │ ├── zlib-streams.ads │ │ ├── zlib-thin.adb │ │ ├── zlib-thin.ads │ │ ├── zlib.adb │ │ ├── zlib.ads │ │ └── zlib.gpr │ ├── amd64 │ │ └── amd64-match.S │ ├── asm686 │ │ ├── README.686 │ │ └── match.S │ ├── blast │ │ ├── Makefile │ │ ├── README │ │ ├── blast.c │ │ ├── blast.h │ │ ├── test.pk │ │ └── test.txt │ ├── delphi │ │ ├── ZLib.pas │ │ ├── ZLibConst.pas │ │ ├── readme.txt │ │ └── zlibd32.mak │ ├── dotzlib │ │ ├── DotZLib.build │ │ ├── DotZLib.chm │ │ ├── DotZLib.sln │ │ ├── DotZLib │ │ │ ├── AssemblyInfo.cs │ │ │ ├── ChecksumImpl.cs │ │ │ ├── CircularBuffer.cs │ │ │ ├── CodecBase.cs │ │ │ ├── Deflater.cs │ │ │ ├── DotZLib.cs │ │ │ ├── DotZLib.csproj │ │ │ ├── GZipStream.cs │ │ │ ├── Inflater.cs │ │ │ └── UnitTests.cs │ │ ├── LICENSE_1_0.txt │ │ └── readme.txt │ ├── gcc_gvmat64 │ │ └── gvmat64.S │ ├── infback9 │ │ ├── README │ │ ├── infback9.c │ │ ├── infback9.h │ │ ├── inffix9.h │ │ ├── inflate9.h │ │ ├── inftree9.c │ │ └── inftree9.h │ ├── inflate86 │ │ ├── inffas86.c │ │ └── inffast.S │ ├── iostream │ │ ├── test.cpp │ │ ├── zfstream.cpp │ │ └── zfstream.h │ ├── iostream2 │ │ ├── zstream.h │ │ └── zstream_test.cpp │ ├── iostream3 │ │ ├── README │ │ ├── TODO │ │ ├── test.cc │ │ ├── zfstream.cc │ │ └── zfstream.h │ ├── masmx64 │ │ ├── bld_ml64.bat │ │ ├── gvmat64.asm │ │ ├── inffas8664.c │ │ ├── inffasx64.asm │ │ └── readme.txt │ ├── masmx86 │ │ ├── bld_ml32.bat │ │ ├── inffas32.asm │ │ ├── match686.asm │ │ └── readme.txt │ ├── minizip │ │ ├── Makefile │ │ ├── MiniZip64_Changes.txt │ │ ├── MiniZip64_info.txt │ │ ├── crypt.h │ │ ├── ioapi.c │ │ ├── ioapi.h │ │ ├── iowin32.c │ │ ├── iowin32.h │ │ ├── make_vms.com │ │ ├── miniunz.c │ │ ├── minizip.c │ │ ├── mztools.c │ │ ├── mztools.h │ │ ├── unzip.c │ │ ├── unzip.h │ │ ├── zip.c │ │ └── zip.h │ ├── pascal │ │ ├── example.pas │ │ ├── readme.txt │ │ ├── zlibd32.mak │ │ └── zlibpas.pas │ ├── puff │ │ ├── Makefile │ │ ├── README │ │ ├── puff.c │ │ ├── puff.h │ │ └── zeros.raw │ ├── testzlib │ │ ├── testzlib.c │ │ └── testzlib.txt │ ├── untgz │ │ ├── Makefile │ │ ├── Makefile.msc │ │ └── untgz.c │ └── vstudio │ │ ├── readme.txt │ │ ├── vc10 │ │ ├── miniunz.vcxproj │ │ ├── miniunz.vcxproj.filters │ │ ├── miniunz.vcxproj.user │ │ ├── minizip.vcxproj │ │ ├── minizip.vcxproj.filters │ │ ├── minizip.vcxproj.user │ │ ├── testzlib.vcxproj │ │ ├── testzlib.vcxproj.filters │ │ ├── testzlib.vcxproj.user │ │ ├── testzlibdll.vcxproj │ │ ├── testzlibdll.vcxproj.filters │ │ ├── testzlibdll.vcxproj.user │ │ ├── zlib.rc │ │ ├── zlibstat.vcxproj │ │ ├── zlibstat.vcxproj.filters │ │ ├── zlibstat.vcxproj.user │ │ ├── zlibvc.def │ │ ├── zlibvc.sln │ │ ├── zlibvc.vcxproj │ │ ├── zlibvc.vcxproj.filters │ │ └── zlibvc.vcxproj.user │ │ └── vc9 │ │ ├── miniunz.vcproj │ │ ├── minizip.vcproj │ │ ├── testzlib.vcproj │ │ ├── testzlibdll.vcproj │ │ ├── zlib.rc │ │ ├── zlibstat.vcproj │ │ ├── zlibvc.def │ │ ├── zlibvc.sln │ │ └── zlibvc.vcproj │ ├── crc32.c │ ├── crc32.h │ ├── deflate.c │ ├── deflate.h │ ├── doc │ ├── algorithm.txt │ ├── rfc1950.txt │ ├── rfc1951.txt │ ├── rfc1952.txt │ └── txtvsbin.txt │ ├── example.c │ ├── examples │ ├── README.examples │ ├── enough.c │ ├── fitblk.c │ ├── gun.c │ ├── gzappend.c │ ├── gzjoin.c │ ├── gzlog.c │ ├── gzlog.h │ ├── zlib_how.html │ ├── zpipe.c │ └── zran.c │ ├── gzclose.c │ ├── gzguts.h │ ├── gzlib.c │ ├── gzread.c │ ├── gzwrite.c │ ├── infback.c │ ├── inffast.c │ ├── inffast.h │ ├── inffixed.h │ ├── inflate.c │ ├── inflate.h │ ├── inftrees.c │ ├── inftrees.h │ ├── make_vms.com │ ├── minigzip.c │ ├── msdos │ ├── Makefile.bor │ ├── Makefile.dj2 │ ├── Makefile.emx │ ├── Makefile.msc │ └── Makefile.tc │ ├── nintendods │ ├── Makefile │ └── README │ ├── old │ ├── Makefile.riscos │ ├── README │ ├── as400 │ │ ├── bndsrc │ │ ├── compile.clp │ │ ├── readme.txt │ │ └── zlib.inc │ ├── descrip.mms │ ├── os2 │ │ ├── Makefile.os2 │ │ └── zlib.def │ ├── visual-basic.txt │ └── visualc6 │ │ ├── README.txt │ │ ├── example.dsp │ │ ├── minigzip.dsp │ │ ├── zlib.dsp │ │ └── zlib.dsw │ ├── qnx │ └── package.qpg │ ├── treebuild.xml │ ├── trees.c │ ├── trees.h │ ├── uncompr.c │ ├── watcom │ ├── watcom_f.mak │ └── watcom_l.mak │ ├── win32 │ ├── DLL_FAQ.txt │ ├── Makefile.bor │ ├── Makefile.emx │ ├── Makefile.gcc │ ├── Makefile.msc │ ├── README-WIN32.txt │ ├── VisualC.txt │ ├── zlib.def │ └── zlib1.rc │ ├── zconf.h │ ├── zconf.h.cmakein │ ├── zconf.h.in │ ├── zlib.3 │ ├── zlib.3.pdf │ ├── zlib.h │ ├── zlib.map │ ├── zlib.pc.in │ ├── zlib2ansi │ ├── zutil.c │ └── zutil.h ├── genStubs.tcl ├── lib ├── app-critcl │ ├── critcl.tcl │ ├── pkgIndex.tcl │ ├── runtime.tcl │ └── tea │ │ ├── Config.in │ │ ├── Makefile.in │ │ ├── aclocal.m4 │ │ ├── configure.in │ │ └── tclconfig │ │ ├── README.txt │ │ ├── install-sh │ │ ├── license.terms │ │ └── tcl.m4 ├── critcl-bitmap │ ├── bitmap.tcl │ └── pkgIndex.tcl ├── critcl-callback │ ├── c │ │ ├── callback.c │ │ ├── callback.h │ │ └── callback_int.h │ └── callback.tcl ├── critcl-class │ ├── class.h │ ├── class.tcl │ └── pkgIndex.tcl ├── critcl-cutil │ ├── allocs │ │ └── critcl_alloc.h │ ├── asserts │ │ └── critcl_assert.h │ ├── cutil.tcl │ ├── pkgIndex.tcl │ └── trace │ │ ├── critcl_trace.h │ │ └── trace.c ├── critcl-emap │ ├── emap.tcl │ └── pkgIndex.tcl ├── critcl-enum │ ├── enum.tcl │ └── pkgIndex.tcl ├── critcl-iassoc │ ├── iassoc.tcl │ └── pkgIndex.tcl ├── critcl-literals │ ├── literals.tcl │ └── pkgIndex.tcl ├── critcl-md5c │ ├── md5c.tcl │ └── md5c_c │ │ ├── md5.c │ │ └── md5.h ├── critcl-platform │ ├── pkgIndex.tcl │ └── platform.tcl ├── critcl-util │ ├── pkgIndex.tcl │ └── util.tcl ├── critcl │ ├── Config │ ├── critcl.tcl │ ├── critcl_c │ │ ├── cdata.c │ │ ├── header.c │ │ ├── pkginit.c │ │ ├── pkginitend.c │ │ ├── pkginittk.c │ │ ├── preload.c │ │ ├── storageclass.c │ │ ├── stubs.c │ │ ├── stubs_e.c │ │ ├── tcl8.6 │ │ │ ├── X11 │ │ │ │ ├── X.h │ │ │ │ ├── Xatom.h │ │ │ │ ├── Xfuncproto.h │ │ │ │ ├── Xlib.h │ │ │ │ ├── Xutil.h │ │ │ │ ├── cursorfont.h │ │ │ │ ├── keysym.h │ │ │ │ ├── keysymdef.h │ │ │ │ └── tkIntXlibDecls.h │ │ │ ├── tcl.h │ │ │ ├── tclDecls.h │ │ │ ├── tclPlatDecls.h │ │ │ ├── tk.h │ │ │ ├── tkDecls.h │ │ │ └── tkPlatDecls.h │ │ ├── tcl8.7 │ │ │ ├── tcl.h │ │ │ ├── tclDecls.h │ │ │ └── tclPlatDecls.h │ │ ├── tcl9.0 │ │ │ ├── tcl.h │ │ │ ├── tclDecls.h │ │ │ └── tclPlatDecls.h │ │ ├── tclAppInit.c │ │ ├── tclpre9compat.h │ │ ├── tkstubs.c │ │ └── tkstubs_noconst.c │ ├── license.terms │ └── pkgIndex.tcl ├── critclf │ ├── Config │ ├── critclf.tcl │ ├── idx_wrap.tcl │ ├── pkgIndex.tcl │ ├── pkg_wrap.c │ ├── wrapfort.code │ ├── wrapfort.tcl │ └── wrapfort_libf.f90 ├── md5 │ ├── md5.tcl │ └── pkgIndex.tcl ├── stubs_container │ ├── container.tcl │ └── pkgIndex.tcl ├── stubs_gen_decl │ ├── gen_decl.tcl │ └── pkgIndex.tcl ├── stubs_gen_header │ ├── gen_header.tcl │ └── pkgIndex.tcl ├── stubs_gen_init │ ├── gen_init.tcl │ └── pkgIndex.tcl ├── stubs_gen_lib │ ├── gen_lib.tcl │ └── pkgIndex.tcl ├── stubs_gen_macro │ ├── gen_macro.tcl │ └── pkgIndex.tcl ├── stubs_gen_slot │ ├── gen_slot.tcl │ └── pkgIndex.tcl ├── stubs_genframe │ ├── genframe.tcl │ └── pkgIndex.tcl ├── stubs_reader │ ├── pkgIndex.tcl │ └── reader.tcl └── stubs_writer │ ├── pkgIndex.tcl │ └── writer.tcl ├── license.terms ├── main.tcl ├── sdemo.tcl ├── test ├── assets │ ├── ccommand-trace │ │ ├── 2.0 │ │ ├── 2.1 │ │ ├── 2.2 │ │ ├── 2.3 │ │ ├── 2.4 │ │ ├── 2.5 │ │ ├── 3.0 │ │ ├── 3.4 │ │ └── 3.5 │ ├── ccommand │ │ ├── 2.0 │ │ ├── 2.1 │ │ ├── 2.2 │ │ ├── 2.3 │ │ ├── 3.0 │ │ ├── 3.4 │ │ └── 3.5 │ ├── cconst-trace │ │ ├── 2.0 │ │ ├── 2.1 │ │ ├── 2.2 │ │ └── 2.3 │ ├── cconst │ │ ├── 2.0 │ │ ├── 2.1 │ │ ├── 2.2 │ │ └── 2.3 │ ├── cdata-trace │ │ ├── 2.0 │ │ ├── 2.1 │ │ └── 2.2 │ ├── cdata │ │ ├── 2.0 │ │ ├── 2.1 │ │ └── 2.2 │ ├── cproc-trace │ │ ├── 2.0 │ │ ├── 2.1 │ │ ├── 2.10 │ │ ├── 2.11 │ │ ├── 2.12 │ │ ├── 2.13 │ │ ├── 2.14 │ │ ├── 2.15 │ │ ├── 2.16 │ │ ├── 2.17 │ │ ├── 2.18 │ │ ├── 2.2 │ │ ├── 2.3 │ │ ├── 2.4 │ │ ├── 2.5 │ │ ├── 2.6 │ │ ├── 2.7 │ │ ├── 2.8 │ │ ├── 2.9 │ │ ├── 3.0 │ │ ├── 3.1 │ │ ├── 3.10 │ │ ├── 3.11 │ │ ├── 3.12 │ │ ├── 3.13 │ │ ├── 3.14 │ │ ├── 3.2 │ │ ├── 3.3 │ │ ├── 3.4 │ │ ├── 3.5 │ │ ├── 3.6 │ │ ├── 3.7 │ │ ├── 3.8 │ │ ├── 3.9 │ │ ├── 4.0-int │ │ ├── 4.1-bool │ │ ├── 4.10-object │ │ ├── 4.12-bytes │ │ ├── 4.13-channel │ │ ├── 4.14-unshared-channel │ │ ├── 4.15-take-channel │ │ ├── 4.16-vobject │ │ ├── 4.17-vint │ │ ├── 4.2-long │ │ ├── 4.3-wideint │ │ ├── 4.4-double │ │ ├── 4.5-float │ │ ├── 4.6-int_gt_0 │ │ ├── 4.7-char_ │ │ ├── 4.8-pstring │ │ ├── 4.9-list │ │ ├── 5.x │ │ ├── 6.0-int_gt_4 │ │ ├── 6.1-int_gt_4_le_8 │ │ ├── 6.10-int== │ │ ├── 6.11-int=2= │ │ ├── 6.2-int_lt_8 │ │ ├── 6.3-int_lt_8_ge_4 │ │ ├── 6.4-int_gt_2_ge_4 │ │ ├── 6.5-int_lt_2_lt_4_lt_6 │ │ ├── 6.6-int_lt_2_le_4 │ │ ├── 6.7-=2= │ │ ├── 6.8-==int │ │ ├── 6.9-=2=int │ │ └── 7.0 │ ├── cproc │ │ ├── 2.0 │ │ ├── 2.1 │ │ ├── 2.10 │ │ ├── 2.11 │ │ ├── 2.12 │ │ ├── 2.13 │ │ ├── 2.14 │ │ ├── 2.15 │ │ ├── 2.16 │ │ ├── 2.17 │ │ ├── 2.18 │ │ ├── 2.2 │ │ ├── 2.3 │ │ ├── 2.4 │ │ ├── 2.5 │ │ ├── 2.6 │ │ ├── 2.7 │ │ ├── 2.8 │ │ ├── 2.9 │ │ ├── 3.0 │ │ ├── 3.1 │ │ ├── 3.10 │ │ ├── 3.11 │ │ ├── 3.12 │ │ ├── 3.13 │ │ ├── 3.14 │ │ ├── 3.2 │ │ ├── 3.3 │ │ ├── 3.4 │ │ ├── 3.5 │ │ ├── 3.6 │ │ ├── 3.7 │ │ ├── 3.8 │ │ ├── 3.9 │ │ ├── 4.0-int │ │ ├── 4.1-bool │ │ ├── 4.10-object │ │ ├── 4.12-bytes │ │ ├── 4.13-channel │ │ ├── 4.14-unshared-channel │ │ ├── 4.15-take-channel │ │ ├── 4.16-vobject │ │ ├── 4.17-vint │ │ ├── 4.2-long │ │ ├── 4.3-wideint │ │ ├── 4.4-double │ │ ├── 4.5-float │ │ ├── 4.6-int_gt_0 │ │ ├── 4.7-char_ │ │ ├── 4.8-pstring │ │ ├── 4.9-list │ │ ├── 5.x │ │ ├── 6.0-int_gt_4 │ │ ├── 6.1-int_gt_4_le_8 │ │ ├── 6.10-int== │ │ ├── 6.11-int=2= │ │ ├── 6.2-int_lt_8 │ │ ├── 6.3-int_lt_8_ge_4 │ │ ├── 6.4-int_gt_2_ge_4 │ │ ├── 6.5-int_lt_2_lt_4_lt_6 │ │ ├── 6.6-int_lt_2_le_4 │ │ ├── 6.7-=2= │ │ ├── 6.8-==int │ │ ├── 6.9-=2=int │ │ └── 7.0 │ ├── def-2.0 │ └── undef-2.0 ├── attic │ ├── basic.tcl │ ├── basic.tst │ ├── c++direct-1.tcl │ ├── c++direct-2.tcl │ ├── c++indirect.tcl │ └── fbasic.tcl ├── bitmap.test ├── cache.test ├── callback.test ├── ccommand-trace.test ├── ccommand.test ├── cconst-trace.test ├── cconst.test ├── cdata-trace.test ├── cdata.test ├── class.test ├── cproc-rt.test ├── cproc-trace.test ├── cproc.test ├── emap.test ├── enum.test ├── iassoc.test ├── literals.test ├── md5.test ├── stubs_container.test ├── stubs_reader.test ├── stubs_writer.test ├── suites │ ├── ccommand.test │ ├── cconst.test │ ├── cdata.test │ └── cproc.test ├── support │ ├── crit_utils.tcl │ └── testutilities.tcl ├── util_def.test └── util_undef.test └── tools └── get-headers.sh /TODO.txt: -------------------------------------------------------------------------------- 1 | 2 | (7) Document the @placeholders@ available to the various C code fragments. 3 | 4 | (8) Note that we can use #define's to make the class and instance 5 | types available as fixed named without resorting to placeholders, 6 | and still keeping it in a local scope. 7 | 8 | --- 9 | 10 | idea: critcl::cproc -- api to register return types, argument types 11 | 12 | argument types: conversion from Tcl_Obj*, type checking (values) 13 | return types: conversion to Tcl_Obj*, (type/value checking ?) 14 | -------------------------------------------------------------------------------- /doc/checklist.txt: -------------------------------------------------------------------------------- 1 | When releasing: 2 | 3 | - Run the test suite. 4 | 5 | - Run the examples. 6 | 7 | - Bump version in `doc/version.inc`. 8 | 9 | - If necessary, further bump: 10 | - The versions of `package provide/ifneeded` in files: 11 | - `lib/critcl-app/pkgindex.tcl` 12 | - `lib/critcl/pkgindex.tcl` 13 | - `lib/critcl/critcl.tcl` 14 | - The version in `doc/pkg_version.inc`. 15 | 16 | - Regenerate the embedded documentation. 17 | 18 | - Commit 19 | 20 | - Push 21 | -------------------------------------------------------------------------------- /doc/critcl_build.man: -------------------------------------------------------------------------------- 1 | [comment {-*- mode: tcl ; fill-column: 90 -*- doctools manpage}] 2 | [comment {quadrant: reference}] 3 | [include version.inc] 4 | [manpage_begin critcl_build_tool n [vset VERSION]] 5 | [include include/module.inc] 6 | [titledesc {CriTcl build.tcl Tool Reference}] 7 | [description] 8 | [include include/welcome.inc] 9 | 10 | The script [file build.tcl] found in the top directory of the [vset critcl] sources is the 11 | main tool of use to a developer or maintainer of [vset critcl] itself. 12 | 13 | [para] Invoking it a via [example {./build.tcl help}] provides the online help for this 14 | tool, explaining the operations available, and their arguments. 15 | 16 | [include include/feedback.inc] 17 | [manpage_end] 18 | -------------------------------------------------------------------------------- /doc/critcl_changes.man: -------------------------------------------------------------------------------- 1 | [comment {-*- mode: tcl ; fill-column: 90 -*- doctools manpage}] 2 | [comment {quadrant: reference}] 3 | [include version.inc] 4 | [manpage_begin critcl_changes n [vset VERSION]] 5 | [include include/module.inc] 6 | [titledesc {CriTcl Releases & Changes}] 7 | [description] 8 | [include include/welcome.inc] 9 | [include include/advert.inc] 10 | 11 | See the changes done in each release of [vset critcl], from the latest at the top to the 12 | beginning of the project. 13 | 14 | [include include/changes.inc] 15 | [include include/feedback.inc] 16 | [manpage_end] 17 | -------------------------------------------------------------------------------- /doc/figures/arch_application.dia: -------------------------------------------------------------------------------- 1 | # -*- tcl -*- tcl.tk//DSL diagram//EN//1.0 2 | set mark 0 3 | source [file join [file dirname [file normalize [info script]]] architecture.dia] 4 | return 5 | -------------------------------------------------------------------------------- /doc/figures/arch_application.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andreas-kupries/critcl/a10f9ed4bca596cbb29a9d898d8111613c324479/doc/figures/arch_application.png -------------------------------------------------------------------------------- /doc/figures/arch_application.txt: -------------------------------------------------------------------------------- 1 | *================* 2 | |Applications | 3 | | critcl | 4 | | critcl::app | 5 | *================* 6 | 7 | +----------------+ 8 | |Core Packages | 9 | | critcl | 10 | | critcl::util | 11 | +----------------+ 12 | 13 | +----------------+ 14 | |Support Packages| 15 | | stubs::* | 16 | | md5, platform | 17 | | ... | 18 | +----------------+ 19 | -------------------------------------------------------------------------------- /doc/figures/arch_core.dia: -------------------------------------------------------------------------------- 1 | # -*- tcl -*- tcl.tk//DSL diagram//EN//1.0 2 | set mark 1 3 | source [file join [file dirname [file normalize [info script]]] architecture.dia] 4 | return 5 | -------------------------------------------------------------------------------- /doc/figures/arch_core.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andreas-kupries/critcl/a10f9ed4bca596cbb29a9d898d8111613c324479/doc/figures/arch_core.png -------------------------------------------------------------------------------- /doc/figures/arch_core.txt: -------------------------------------------------------------------------------- 1 | +----------------+ 2 | |Applications | 3 | | critcl | 4 | | critcl::app | 5 | +----------------+ 6 | 7 | *================* 8 | |Core Packages | 9 | | critcl | 10 | | critcl::util | 11 | *================* 12 | 13 | +----------------+ 14 | |Support Packages| 15 | | stubs::* | 16 | | md5, platform | 17 | | ... | 18 | +----------------+ 19 | -------------------------------------------------------------------------------- /doc/figures/arch_support.dia: -------------------------------------------------------------------------------- 1 | # -*- tcl -*- tcl.tk//DSL diagram//EN//1.0 2 | set mark 2 3 | source [file join [file dirname [file normalize [info script]]] architecture.dia] 4 | return 5 | -------------------------------------------------------------------------------- /doc/figures/arch_support.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andreas-kupries/critcl/a10f9ed4bca596cbb29a9d898d8111613c324479/doc/figures/arch_support.png -------------------------------------------------------------------------------- /doc/figures/arch_support.txt: -------------------------------------------------------------------------------- 1 | +----------------+ 2 | |Applications | 3 | | critcl | 4 | | critcl::app | 5 | +----------------+ 6 | 7 | +----------------+ 8 | |Core Packages | 9 | | critcl | 10 | | critcl::util | 11 | +----------------+ 12 | 13 | *================* 14 | |Support Packages| 15 | | stubs::* | 16 | | md5, platform | 17 | | ... | 18 | *================* 19 | -------------------------------------------------------------------------------- /doc/figures/architecture.dia: -------------------------------------------------------------------------------- 1 | # -*- tcl -*- tcl.tk//DSL diagram//EN//1.0 2 | # Parser Tools Architecture Diagram 3 | 4 | set counter 0 5 | if {![info exists mark]} { set mark -1 } 6 | 7 | proc xbox {args} { 8 | variable mark 9 | variable counter 10 | 11 | if {$mark == $counter} { 12 | lappend args color red stroke 2 13 | } 14 | incr counter 15 | return [uplevel 1 [list box {*}$args]] 16 | } 17 | 18 | proc area {label args} { 19 | set E [xbox fillcolor lightyellow {*}$args] 20 | group { 21 | text text $label with nw at [last box nw] 22 | } 23 | return $E 24 | } 25 | 26 | down 27 | set boxwidth [90 mm] 28 | set movelength [5 mm] 29 | 30 | set A [area Applications] 31 | move 32 | set C [area "Core Packages"] 33 | move 34 | set S [area "Support Packages"] 35 | 36 | text at $A "critcl\ncritcl::app" 37 | text at $C "critcl\ncritcl::util" 38 | text at $S "stubs::*, md5, platform ..." 39 | -------------------------------------------------------------------------------- /doc/figures/architecture.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andreas-kupries/critcl/a10f9ed4bca596cbb29a9d898d8111613c324479/doc/figures/architecture.png -------------------------------------------------------------------------------- /doc/figures/architecture.txt: -------------------------------------------------------------------------------- 1 | +----------------+ 2 | |Applications | 3 | | critcl | 4 | | critcl::app | 5 | +----------------+ 6 | 7 | +----------------+ 8 | |Core Packages | 9 | | critcl | 10 | | critcl::util | 11 | +----------------+ 12 | 13 | +----------------+ 14 | |Support Packages| 15 | | stubs::* | 16 | | md5, platform | 17 | | ... | 18 | +----------------+ 19 | -------------------------------------------------------------------------------- /doc/include/advert.inc: -------------------------------------------------------------------------------- 1 | [comment {-*- mode: tcl ; fill-column: 90 -*-}] 2 | 3 | [para] [vset slogan] 4 | [para] Improve performance by rewriting the performance bottlenecks in C. 5 | [para] Import the functionality of shared libraries into Tcl scripts. 6 | -------------------------------------------------------------------------------- /doc/include/api_embedc_cnameoption.inc: -------------------------------------------------------------------------------- 1 | [opt_def -cname [arg boolean]] 2 | 3 | If [const false] (the default), a name for the corresponding C function is 4 | automatically derived from the fully-qualified [arg tclname]. Otherwise, name 5 | of the C function is the last component of [arg tclname]. 6 | -------------------------------------------------------------------------------- /doc/include/api_rcache.inc: -------------------------------------------------------------------------------- 1 | 2 | The following commands control the [sectref {Result Cache}]. 3 | 4 | [vset not_needed_for_critcl_script] 5 | 6 | [list_begin definitions] 7 | [comment ---------------------------------------------------------------------] 8 | [call [cmd ::critcl::cache] [opt path]] 9 | 10 | Sets and returns the path to the directory for the package's result cache. 11 | 12 | [para] The default location is 13 | [file ~/.critcl/[lb]platform::generic[rb]] and usually does not 14 | require any changes. 15 | 16 | [comment ---------------------------------------------------------------------] 17 | [call [cmd ::critcl::clean_cache] [opt [arg pattern]...]] 18 | 19 | Cleans the result cache, i.e. removes any and all files 20 | and directories in it. If one or more patterns are specified then only 21 | the files and directories matching them are removed. 22 | 23 | [list_end] 24 | -------------------------------------------------------------------------------- /doc/include/b_test.inc: -------------------------------------------------------------------------------- 1 | [comment {-*- mode: tcl ; fill-column: 90 -*-}] 2 | 3 | Installing [vset critcl] contains an implicit test of its functionality. 4 | 5 | [para] One of its operation modes uses the MD5 hash internally to generate unique ids for 6 | sources, as a means of detecting changes. To make generation of such hashes fast a 7 | [vset critcl]-based package for MD5 is installed as part of the main installation process. 8 | 9 | [para] In other words, after installing the core packages of [vset critcl] this partial 10 | installation is used to build the rest. 11 | 12 | [para] This is possible because building a package from [vset critcl]-based sources is the 13 | operation mode not using MD5, therefore there is no circular dependency. 14 | 15 | [para] For our purposes this however is also a self-test of the system, verifying that the 16 | core of [vset critcl] works, as well as the C compiler. 17 | 18 | [para] For additional testing simply move on to section [sectref {The First Package}] of 19 | the guide on [term {How To Use CriTcl}]. 20 | -------------------------------------------------------------------------------- /doc/include/build_install_options.inc: -------------------------------------------------------------------------------- 1 | [comment {-*- mode: tcl ; fill-column: 90 -*-}] 2 | 3 | Use the options listed below to change the paths used for installation as desired. This is 4 | the same method as with [cmd configure] based packages. 5 | 6 | [list_begin options] 7 | [opt_def --prefix [arg path]] Base path for non-package files. 8 | [opt_def --include-dir [arg path]] Destination path for header files. 9 | [opt_def --exec-prefix [arg path]] Base path for applications and packages. 10 | [opt_def --bin-dir [arg path]] Destination path for applications. 11 | [opt_def --lib-dir [arg path]] Destination path for packages. 12 | [list_end] 13 | -------------------------------------------------------------------------------- /doc/include/changes.inc: -------------------------------------------------------------------------------- 1 | [para] The latest changes are found at the top. 2 | 3 | [include changes/33.inc] 4 | [include changes/32.inc] 5 | [include changes/31.inc] 6 | [include changes/3.inc] 7 | [include changes/21.inc] 8 | -------------------------------------------------------------------------------- /doc/include/changes/302.inc: -------------------------------------------------------------------------------- 1 | [section {Changes for version 3.0.2}] 2 | [list_begin enumerated] 3 | 4 | [enum] Fixed issue in compile-and-run mode where commands put into the 5 | auto_index are not found by Tcl's [lb]unknown[rb] command. 6 | 7 | [enum] Fixed an array key mismatch breaking usage of client data and 8 | delete function for procedure. Reported by Jos DeCoster, with patch. 9 | 10 | [enum] Implemented a command line option [option -L], an equivalent of 11 | option [option -I], just for library search paths. 12 | 13 | [enum] Fixed github issues 5 and 8. Working around a missing variable 14 | ::errorInfo. It should always be present, however there seem to be 15 | revisions of Tcl around which violate this assumption. 16 | 17 | [list_end] 18 | -------------------------------------------------------------------------------- /doc/include/changes/303.inc: -------------------------------------------------------------------------------- 1 | [section {Changes for version 3.0.3}] 2 | [list_begin enumerated] 3 | 4 | [enum] Fixed github issues 5 and 8, for the example build.tcl 5 | scripts. Working around a missing variable ::errorInfo. It should 6 | always be present, however there seem to be revisions of Tcl around 7 | which violate this assumption. 8 | 9 | [list_end] 10 | -------------------------------------------------------------------------------- /doc/include/changes/305.inc: -------------------------------------------------------------------------------- 1 | [section {Changes for version 3.0.5}] 2 | [list_begin enumerated] 3 | 4 | [enum] Fixed bug in the new code for #line pragmas triggered when 5 | specifying C code without leading whitespace. 6 | 7 | [enum] Extended the documentation to have manpages for the license, 8 | source retrieval, installer, and developer's guides. 9 | 10 | [list_end] 11 | -------------------------------------------------------------------------------- /doc/include/changes/306.inc: -------------------------------------------------------------------------------- 1 | [section {Changes for version 3.0.6}] 2 | [list_begin enumerated] 3 | 4 | [enum] Fixed github issue 10. The critcl application now delivers a 5 | proper exit code (1) on build failure, instead of always 6 | indicating success (status 0). 7 | 8 | [enum] Fixed github issue 13. Handling of bufferoverflowU.lib for 9 | release builds was inconsistent with handling for debug 10 | builds. It is now identically handled (conditional) by 11 | both cases. 12 | 13 | [enum] Documentation cleanup, mainly in the installation guide, and 14 | the README.md shown by github 15 | 16 | [list_end] 17 | -------------------------------------------------------------------------------- /doc/include/changes/307.inc: -------------------------------------------------------------------------------- 1 | [section {Changes for version 3.0.7}] 2 | [list_begin enumerated] 3 | 4 | [enum] Fixed the code generated by [cmd critcl::c++command]. 5 | The emitted code handed a non-static string table to 6 | [fun Tcl_GetIndexFromObj], in violation of the contract, which 7 | requires the table to have a fixed address. This was a memory 8 | smash waiting to happen. Thanks to Brian Griffin for alrerting 9 | us to the general problem. 10 | 11 | [list_end] 12 | -------------------------------------------------------------------------------- /doc/include/changes/311.inc: -------------------------------------------------------------------------------- 1 | [section {Changes for version 3.1.1}] 2 | [list_begin enumerated] 3 | 4 | [enum] Bugfixes all around. In detail: 5 | 6 | [enum] Fixed the generation of wrong#args errors for 7 | [cmd critcl::cproc] and derived code ([package critcl::class] 8 | cproc-based methods). Use NULL if there are no arguments, and 9 | take the offset into account. 10 | 11 | [enum] Fixed the handling of package names by 12 | [package critcl::class]. Forgot that they may contain namespace 13 | separators. Bumped to version 1.0.1. 14 | 15 | [enum] Extended a [package critcl::class] generated error message in 16 | instance creation for clarity. Bumped to version 1.0.2. 17 | 18 | [list_end] 19 | -------------------------------------------------------------------------------- /doc/include/changes/3110.inc: -------------------------------------------------------------------------------- 1 | [section {Changes for version 3.1.10}] 2 | [list_begin enumerated] 3 | 4 | [enum] Fixed code version numbering forgotten with 3.1.9. 5 | 6 | [enum] Fixed issue #35. In package mode (-pkg) the object cache 7 | directory is unique to the process, thus we do not need 8 | content-hashing to generate unique file names. A simple 9 | counter is sufficient and much faster. 10 | [para] 11 | Note that mode "compile & run" is not as blessed and still 12 | uses content-hasing with md5 to ensure unique file names 13 | in its per-user object cache. 14 | 15 | [enum] Fixed issue where the [cmd ccommand] forgot to use its body as 16 | input for the UUID generation. Thus ignoring changes to it in 17 | mode compile & run, and not rebuilding a library for changed 18 | sources. Bug and fix reported by Peter Spjuth. 19 | 20 | [list_end] 21 | -------------------------------------------------------------------------------- /doc/include/changes/3111.inc: -------------------------------------------------------------------------------- 1 | [section {Changes for version 3.1.11}] 2 | [list_begin enumerated] 3 | 4 | [enum] Fixed issue #37, via pull request #38, with thanks to 5 | Jos DeCoster. Information was stored into the v::delproc 6 | and v::clientdata arrays using a different key than when 7 | retrieving the same information, thus failing the latter. 8 | 9 | [enum] New convenience command [cmd critcl::include] for easy 10 | inclusion of headers and other C files. 11 | 12 | [enum] New command [cmd critcl::make] to generate a local header of 13 | other C files for use by other parts of a package through 14 | inclusion. 15 | 16 | [enum] New utility package [package critcl::literals] for quick and 17 | easy setup of and access to pools of fixed Tcl_Obj* strings. 18 | 19 | Built on top of [package critcl::iassoc]. 20 | 21 | [enum] New utility package [package critcl::bitmap] for quick and easy 22 | setup and use of mappings between C bitsets and Tcl lists whose 23 | string elements represent that set. 24 | 25 | Built on top of [package critcl::iassoc]. 26 | 27 | [list_end] 28 | -------------------------------------------------------------------------------- /doc/include/changes/3115.inc: -------------------------------------------------------------------------------- 1 | [section {Changes for version 3.1.15}] 2 | [list_begin enumerated] 3 | 4 | [enum] Fixed version number bogosity with [const 3.1.14]. 5 | 6 | [list_end] 7 | -------------------------------------------------------------------------------- /doc/include/changes/31181.inc: -------------------------------------------------------------------------------- 1 | [section {Changes for version 3.1.18.1}] 2 | [list_begin enumerated] 3 | 4 | [enum] [strong Attention]: While the overall version (of the bundle) 5 | moves to 3.1.18.1 the versions of packages [package critcl] and 6 | [package critcl::app] are [strong unchanged]. 7 | 8 | [enum] [strong Bugfix] Generally removed a number of 8.5-isms which 9 | slipped into 3.1.18, breaking ability to use it with Tcl 8.4. 10 | 11 | [enum] [strong Bugfix] Corrected broken [strong {build.tcl uninstall}]. 12 | 13 | [enum] [strong Bugfix] Package [package critcl::class] bumped to 14 | version 1.1.1. Fixed partial template substitution breaking 15 | compilation of the generated code. 16 | 17 | [list_end] 18 | -------------------------------------------------------------------------------- /doc/include/changes/312.inc: -------------------------------------------------------------------------------- 1 | [section {Changes for version 3.1.2}] 2 | [list_begin enumerated] 3 | 4 | [enum] Enhancement. In detail: 5 | 6 | [enum] Extended [cmd critcl::cproc] to be able to handle optional 7 | arguments, in a limited way. This is automatically available to 8 | [package critcl::class] cproc-based methods as well. 9 | 10 | [enum] Bugfix in [cmd lassign] emulation for Tcl 8.4. Properly set 11 | unused variables to the empty string. Bumped version of 12 | emulation package [package lassign84] to 1.0.1. 13 | 14 | [list_end] 15 | -------------------------------------------------------------------------------- /doc/include/changes/313.inc: -------------------------------------------------------------------------------- 1 | [section {Changes for version 3.1.3}] 2 | [list_begin enumerated] 3 | 4 | [enum] Enhancement. In detail: 5 | 6 | [enum] Added new argument type "pstring", for "Pascal String", a 7 | counted string, i.e. a combination of string pointer and string 8 | length. 9 | 10 | [enum] Added new methods [cmd critcl::argtypesupport] and 11 | [cmd ::critcl::argsupport] to define and use additional 12 | supporting code for an argument type, here used by "pstring" 13 | above to define the necessary structure. 14 | 15 | [enum] Semi-bugfixes in the packages [package critcl::class] and 16 | [package critcl::iassoc]. Pragmas for the AS meta data scanner 17 | to ensure that the template files are made part of the package. 18 | Versions bumped to 1.0.4 and 1.0.1 respectively. 19 | 20 | [list_end] 21 | -------------------------------------------------------------------------------- /doc/include/changes/314.inc: -------------------------------------------------------------------------------- 1 | [section {Changes for version 3.1.4}] 2 | [list_begin enumerated] 3 | 4 | [enum] Bugfix in package [package critcl::class]. Generate a dummy 5 | field in the class structure if the class has no class 6 | variables. Without this change the structure would be empty, 7 | and a number of compilers are not able to handle such a type. 8 | 9 | [enum] Fixed a typo which broke the win64 configuration. 10 | 11 | [enum] Fixed issue #16, a typo in the documentation of command 12 | [cmd critcl::class]. 13 | 14 | [list_end] 15 | -------------------------------------------------------------------------------- /doc/include/changes/315.inc: -------------------------------------------------------------------------------- 1 | [section {Changes for version 3.1.5}] 2 | [list_begin enumerated] 3 | 4 | [enum] Fixed issue #19. Made the regular expression extracting the 5 | MSVC version number more general to make it work on german 6 | language systems. This may have to be revisited in the future, 7 | for other Windows locales. 8 | 9 | [enum] Fixed issue #20. Made option -tea work on windows, at least in 10 | a unix emulation environment like msys/mingw. 11 | 12 | [list_end] 13 | -------------------------------------------------------------------------------- /doc/include/changes/317.inc: -------------------------------------------------------------------------------- 1 | [section {Changes for version 3.1.7}] 2 | [list_begin enumerated] 3 | 4 | [enum] Fixed issue #24. Extract and unconditionally display compiler 5 | warnings found in the build log. Prevents users from missing 6 | warnings which, while not causing the build to fail, may 7 | still indicate problems. 8 | 9 | [enum] New feature. Output hook. All non-messaging user output is now 10 | routed through the command [cmd critcl::print], and users are 11 | allowed to override it when using the critcl application-as-package. 12 | 13 | [enum] New feature, by Ashok P. Nadkarni. Platform configurations can 14 | inherit values from configurations defined before them. 15 | 16 | [list_end] 17 | -------------------------------------------------------------------------------- /doc/include/changes/318.inc: -------------------------------------------------------------------------------- 1 | [section {Changes for version 3.1.8}] 2 | [list_begin enumerated] 3 | 4 | [enum] Fixed issue with package indices generated for Tcl 8.4. 5 | Join the list of commands with semi-colon, not newline. 6 | 7 | [enum] Fixed issue #26 which brought up use-cases I had forgotten to 8 | consider while fixing bug #21 (see critcl 3.1.6). 9 | 10 | [list_end] 11 | -------------------------------------------------------------------------------- /doc/include/changes/331.inc: -------------------------------------------------------------------------------- 1 | [section {Changes for version 3.3.1}] 2 | [list_begin enumerated] 3 | 4 | [enum] Oops. Added refresh of tcl 8.6, 8.7 headers which was left behind behind. 5 | 6 | [enum] Oops. Fixed mismatch of package directories computed by install vs uninstall. 7 | 8 | [list_end] 9 | -------------------------------------------------------------------------------- /doc/include/changes/X.inc: -------------------------------------------------------------------------------- 1 | [section {Changes for version X}] 2 | [list_begin enumerated] 3 | 4 | [enum] [strong Feature]. Bumped [Package critcl::cutil] to version 5 | 0.2.1. Simplified the implementation of macro [cmd ASSERT] by 6 | taking the underlying Tcl_Panic's printf ability into account 7 | and added a new macro [cmd ASSERT_VA] exporting the same 8 | ability to the user. 9 | 10 | [list_end] 11 | -------------------------------------------------------------------------------- /doc/include/changesX.inc: -------------------------------------------------------------------------------- 1 | [section {Changes for version X}] 2 | [list_begin enumerated] 3 | 4 | [enum] [strong Feature]. Bumped [Package critcl::cutil] to version 5 | 0.2.1. Simplified the implementation of macro [cmd ASSERT] by 6 | taking the underlying Tcl_Panic's printf ability into account 7 | and added a new macro [cmd ASSERT_VA] exporting the same 8 | ability to the user. 9 | 10 | [list_end] 11 | -------------------------------------------------------------------------------- /doc/include/class_spec.inc: -------------------------------------------------------------------------------- 1 | 2 | Here we documents all class specification commands available inside of 3 | the class definition script argument of [cmd ::critcl::class::define]. 4 | 5 | [subsection {General configuration}] [include include/class_spec_general.inc] 6 | [subsection {Class lifetime management}] [include include/class_spec_clife.inc] 7 | [subsection {Instance lifetime management}] [include include/class_spec_ilife.inc] 8 | [subsection {Class variables and methods}] [include include/class_spec_cvarm.inc] 9 | [subsection {Instance variables and methods}] [include include/class_spec_ivarm.inc] 10 | [subsection {Context dependent interactions}] [include include/class_spec_cdin.inc] 11 | -------------------------------------------------------------------------------- /doc/include/concepts.inc: -------------------------------------------------------------------------------- 1 | [comment { 2 | CriTcl concepts necessary to understand the various commands. 3 | }] 4 | [subsection {Modes Of Operation/Use}] [include include/modes.inc] 5 | 6 | [para] Regarding the caching of results please read the section about 7 | the [sectref {Result Cache}] fore more details. 8 | 9 | [subsection {Runtime Behaviour}] [include include/runtime.inc] 10 | [subsection {File Mapping}] [include include/mapping.inc] 11 | [subsection {Result Cache}] [include include/rcache.inc] 12 | [subsection {Preloading functionality}] [include include/preload.inc] 13 | [subsection {Configuration Internals}] [include include/iconfig.inc] 14 | [subsection {Stubs Tables}] [include include/stubs.inc] 15 | -------------------------------------------------------------------------------- /doc/include/cproc/api_extcproc1.inc: -------------------------------------------------------------------------------- 1 | 2 | While the [cmd critcl::cproc] command understands the most common C 3 | types (see section [sectref {Embedded C Code}]), sometimes this is not 4 | enough. 5 | 6 | [include api_extcproc.inc] 7 | -------------------------------------------------------------------------------- /doc/include/cproc/api_extcproc2.inc: -------------------------------------------------------------------------------- 1 | 2 | While the [cmd critcl::cproc] command understands the most common C 3 | types (as per the previous 2 sections), sometimes this is not enough. 4 | 5 | [include api_extcproc.inc] 6 | -------------------------------------------------------------------------------- /doc/include/feedback.inc: -------------------------------------------------------------------------------- 1 | [comment {--- Standard trailer for all manpages in this module --}] 2 | [section Authors] 3 | Jean Claude Wippler, Steve Landers, Andreas Kupries 4 | 5 | [section {Bugs, Ideas, Feedback}] 6 | 7 | This document, and the package it describes, will undoubtedly contain 8 | bugs and other problems. 9 | 10 | Please report them at [uri https://github.com/andreas-kupries/critcl/issues]. 11 | 12 | Ideas for enhancements you may have for either package, application, 13 | and/or the documentation are also very welcome and should be reported 14 | at [uri https://github.com/andreas-kupries/critcl/issues] as well. 15 | -------------------------------------------------------------------------------- /doc/include/feedback2.inc: -------------------------------------------------------------------------------- 1 | [comment {--- Standard trailer for all manpages in this module --}] 2 | [section Authors] 3 | Andreas Kupries 4 | 5 | [section {Bugs, Ideas, Feedback}] 6 | 7 | This document, and the package it describes, will undoubtedly contain 8 | bugs and other problems. 9 | 10 | Please report such at [uri https://github.com/andreas-kupries/critcl]. 11 | 12 | Please also report any ideas for enhancements you may have for either 13 | package and/or documentation. 14 | -------------------------------------------------------------------------------- /doc/include/largeexampleref.inc: -------------------------------------------------------------------------------- 1 | 2 | [para] [strong Note] that the sources of CriTcl, should the reader have gotten them, also 3 | contain several examples show-casing various aspects of the system. These demonstration 4 | packages can all be found in the sub-directory [file examples/] of the sources. 5 | -------------------------------------------------------------------------------- /doc/include/module.inc: -------------------------------------------------------------------------------- 1 | [comment {--- Standard header for all manpages in this module --}] 2 | [comment {--- Standard links ---}] 3 | [include include/references.inc] 4 | [comment {--- Standard phrases ---}] 5 | [include include/global.inc] 6 | [comment {--- Copyright, Categorization, Keywords ---}] 7 | [copyright {Jean-Claude Wippler}] 8 | [copyright {Steve Landers}] 9 | [copyright {2011-2024 Andreas Kupries}] 10 | [moddesc {C Runtime In Tcl (CriTcl)}] 11 | [category {Glueing/Embedded C code}] 12 | [keywords {C code} {Embedded C Code}] 13 | [keywords {dynamic compilation} {calling C code from Tcl}] 14 | [keywords {on-the-fly compilation}] 15 | [keywords {on demand compilation}] 16 | [keywords {dynamic code generation}] 17 | [keywords compiler linker {code generator}] 18 | [keywords {compile & run}] 19 | [keywords {generate package}] 20 | -------------------------------------------------------------------------------- /doc/include/module2.inc: -------------------------------------------------------------------------------- 1 | [comment {--- Standard header for all manpages in this module --}] 2 | [copyright {2011-2024 Andreas Kupries}] 3 | [moddesc {C Runtime In Tcl (CriTcl)}] 4 | [category {Glueing/Embedded C code}] 5 | [keywords {C code} {Embedded C Code}] 6 | [keywords {dynamic compilation}] 7 | [keywords {on-the-fly compilation}] 8 | [keywords {on demand compilation}] 9 | [keywords {dynamic code generation}] 10 | [keywords compiler linker {code generator}] 11 | [keywords {compile & run}] 12 | [keywords {generate package}] 13 | -------------------------------------------------------------------------------- /doc/include/pkg_users.inc: -------------------------------------------------------------------------------- 1 | [comment {-*- mode: tcl ; fill-column: 90 -*-}] 2 | 3 | [list_begin itemized] 4 | [item] [uri https://core.tcl-lang.org/akupries/ankh AnKH] 5 | [item] [uri https://core.tcl.tk/akupries/tclyaml TclYAML] 6 | [item] [uri https://github.com/andreas-kupries/tcl-linenoise Linenoise] 7 | [item] [uri https://core.tcl.tk/akupries/kinetcl KineTcl] 8 | [item] [uri https://chiselapp.com/user/andreas_kupries/repository/inotify Inotify] 9 | [item] [uri https://core.tcl.tk/akupries/marpa TclMarpa] 10 | [item] [uri https://core.tcl.tk/akupries/crimp CRIMP] 11 | [list_end] 12 | -------------------------------------------------------------------------------- /doc/include/quad.inc: -------------------------------------------------------------------------------- 1 | 2 | [vset reference [sectref {References - Theoretical Work - To Gain Knowlegde} References]] 3 | [vset how-to [sectref {How-To Guides - Practical Work - To Solve Problems} {How-To Guides}]] 4 | [vset tu [sectref {Tutorials - Practical Study - To Learn} Tutorials]] 5 | [vset expla [sectref {Explanations - Theoretical Knowledge - To Understand} Explanations]] 6 | [example_begin] 7 | | Study | Work 8 | ----------- + --------------- + ----------------- 9 | Practical | [vset tu] | [vset how-to] 10 | | (Learning) | (Problem solving) 11 | ----------- + --------------- + ----------------- 12 | Theoretical | [vset expla] | [vset reference] 13 | | (Understanding) | (Knowledge) 14 | [example_end] 15 | -------------------------------------------------------------------------------- /doc/include/reference_docs.inc: -------------------------------------------------------------------------------- 1 | [enum] [term {CriTcl Application Reference}] 2 | [enum] [term {CriTcl Package Reference}] 3 | [enum] [term {CriTcl cproc Type Reference}] 4 | [enum] [term {CriTcl - Utilities}] 5 | [enum] [term {CriTcl - C-level Utilities}] 6 | [enum] [term {CriTcl - C-level Callback Utilities}] 7 | [enum] [term {CriTcl - Wrap Support - String/Integer mapping}] 8 | [enum] [term {CriTcl - Wrap Support - Bitset en- and decoding}] 9 | [enum] [term {CriTcl - Wrap Support - Enum en- and decoding}] 10 | [enum] [term {CriTcl - Code Gen - Constant string pools}] 11 | [enum] [term {CriTcl - Code Gen - Tcl Interp Associations}] 12 | [enum] [term {CriTcl - Code Gen - C Classes}] 13 | [enum] [term {CriTcl Application Package Reference}] 14 | -------------------------------------------------------------------------------- /doc/include/rq_cline.inc: -------------------------------------------------------------------------------- 1 | 2 | [para] This facility requires the use of a tclsh that provides 3 | [cmd {info frame}]. Otherwise, no [term #line] directives are emitted. The 4 | command is supported by Tcl 8.5 and higher. It is also supported by 5 | Tcl 8.4 provided that it was compiled with the define 6 | [option -DTCL_TIP280]. An example of such is ActiveState's ActiveTcl. 7 | -------------------------------------------------------------------------------- /doc/include/rq_tcl.inc: -------------------------------------------------------------------------------- 1 | [comment {-*- mode: tcl ; fill-column: 90 -*-}] 2 | 3 | [para] That a working installation of [vset critcl] will require a working installation of 4 | [vset tcl_home] should be obvious. 5 | 6 | [para] Installing Tcl however is out of scope here, same as for installing a working C 7 | compiler. 8 | 9 | [para] There are too many options, starting from 10 | [uri http://core.tcl-lang.org/tcl {building it from scratch}], installing what is provided 11 | by the platform's package manager ([vset zypper], [vset yum], [vset apt-get], and more), 12 | to using some vendor's [uri https://core.tcl-lang.org/dist.html distribution]. 13 | 14 | [para] A single piece of advice however. 15 | 16 | [para] While [vset critcl] currently supports running on Tcl 8.4 and higher, and the 17 | creation of packages for the same, the last release for this version was in 2013 (9 years 18 | ago at the time of writing). Similarly, the last release for Tcl 8.5 was in 2016 (6 years 19 | ago). Both are official end of life. 20 | 21 | [para] Given this I recommend to install and use Tcl 8.6. 22 | -------------------------------------------------------------------------------- /doc/include/skip.inc: -------------------------------------------------------------------------------- 1 | 2 | The audience of this section are developers wishing to understand 3 | and possibly modify the internals of critcl package and application. 4 | Package writers can skip this section. 5 | 6 | [para] 7 | -------------------------------------------------------------------------------- /doc/include/smallexampleref.inc: -------------------------------------------------------------------------------- 1 | 2 | [para] Lots of smaller examples can be found in the document 3 | [manpage {Using CriTcl}], an introduction to CriTcl by way of a of 4 | examples. These focus more on specific critcl commands than the 5 | overall picture shown by the large examples mentioned in the previous 6 | paragraph. 7 | -------------------------------------------------------------------------------- /doc/include/use/args_binary.inc: -------------------------------------------------------------------------------- 1 | [comment {-*- mode: tcl ; fill-column: 90 -*-}] 2 | 3 | [list_begin enumerated] 4 | 5 | [enum][vset base][example { 6 | critcl::cproc hello {bytes x} void { 7 | /* critcl_bytes x (.s, .len, .o); */ 8 | printf("hello world, with %d bytes \n data: ", x.len); 9 | for (i = 0; i < x.len; i++) { 10 | printf(" %02x", x.s[i]); 11 | if (i % 16 == 15) printf ("\ndata: "); 12 | } 13 | if (i % 16 != 0) printf ("\n"); 14 | } 15 | }][vset rebuild] 16 | 17 | [enum] To deal with strings holding binary data use the type [type bytes]. It ensures that 18 | the function sees the proper binary data, and not how Tcl is encoding it internally, as 19 | the string types would. 20 | 21 | [list_end] 22 | -------------------------------------------------------------------------------- /doc/include/use/args_range.inc: -------------------------------------------------------------------------------- 1 | [comment {-*- mode: tcl ; fill-column: 90 -*-}] 2 | 3 | [list_begin enumerated] 4 | 5 | [enum][vset base][example { 6 | critcl::cproc hello {{double > 5 < 22} x} void { 7 | /* double x, range 6-21; */ 8 | printf("hello world, we have %f\n", x); 9 | } 10 | }][vset rebuild] 11 | 12 | [enum] When dealing with simple arguments whose range of legal values is limited to a single 13 | continuous interval extend the base type with the necessary relations ([const >], [const >=], 14 | [const <], and [const <=]) and limiting values. 15 | 16 | [para][strong Note] that the limiting values have to be proper constant numbers acceptable by the 17 | base type. Symbolic values are not accepted. 18 | 19 | [para] Here the argument [arg x] of the changed function will reject all values outside of the 20 | interval 6 to 21. 21 | 22 | [list_end] 23 | -------------------------------------------------------------------------------- /doc/include/use/build_help.inc: -------------------------------------------------------------------------------- 1 | [comment {-*- mode: tcl ; fill-column: 90 -*-}] 2 | 3 | [list_begin enumerated] 4 | 5 | [enum] Invoke the command [example { 6 | critcl -help 7 | }] in a terminal to get help about the [syscmd critcl] application. 8 | 9 | [list_end] 10 | -------------------------------------------------------------------------------- /doc/include/use/build_package.inc: -------------------------------------------------------------------------------- 1 | [comment {-*- mode: tcl ; fill-column: 90 -*-}] 2 | 3 | [list_begin enumerated] 4 | 5 | [enum] Start at section [sectref Basics]. 6 | 7 | [list_end] 8 | -------------------------------------------------------------------------------- /doc/include/use/build_package_debug.inc: -------------------------------------------------------------------------------- 1 | [comment {-*- mode: tcl ; fill-column: 90 -*-}] 2 | 3 | [list_begin enumerated] 4 | 5 | [enum] Start at section [sectref Basics]. 6 | 7 | [list_end] 8 | -------------------------------------------------------------------------------- /doc/include/use/build_targets.inc: -------------------------------------------------------------------------------- 1 | [comment {-*- mode: tcl ; fill-column: 90 -*-}] 2 | 3 | [list_begin enumerated] 4 | 5 | [enum] Invoke the application as [example { 6 | critcl -show 7 | }] in a terminal to get the detailed configuration of the target for the current platform. 8 | 9 | [enum] Invoke the application as [example { 10 | critcl -show -target NAME 11 | }] in a terminal to get the detailed configuration of the named target. 12 | 13 | [enum] Invoke the application as [example { 14 | critcl -targets 15 | }] in a terminal to get a list of the available targets. 16 | 17 | [list_end] 18 | -------------------------------------------------------------------------------- /doc/include/use/csources_ii.inc: -------------------------------------------------------------------------------- 1 | [comment {-*- mode: tcl ; fill-column: 90 -*-}] 2 | 3 | [list_begin enumerated] 4 | 5 | [enum] See and reread the [sectref {Using External Libraries} {basic wrapper package}] for 6 | the introduction of the commands referenced below. 7 | 8 | [enum] Use the command [cmd critcl::ccode] to write C code residing outside of [cmd cproc] 9 | bodies. 10 | 11 | [enum] Or, alternatively, place the C code into one or more [file .c] files and use the 12 | command [cmd critcl::csources] to register them with [vset critcl] for compilation. 13 | 14 | [enum] This topic is also treated in section [sectref {Separating Local C Sources}]. 15 | 16 | [list_end] 17 | -------------------------------------------------------------------------------- /doc/include/use/debugging.inc: -------------------------------------------------------------------------------- 1 | [comment {-*- mode: tcl ; fill-column: 90 -*-}] 2 | 3 | [list_begin enumerated] 4 | 5 | [enum] See and reread the [sectref Basics {basic package}] for the introduction of the 6 | commands referenced below. 7 | 8 | [enum] Use the command [cmd critcl::debug] to activate various features supporting debugging. 9 | 10 | [para][example { 11 | critcl::debug memory ;# Activate Tcl memory debugging (-DTCL_MEM_DEBUG) 12 | critcl::debug symbols ;# Activate building and linking with debugger symbols (-g) 13 | critcl::debug all ;# Shorthand for both `memory` and `symbols`. 14 | }] 15 | 16 | [list_end] 17 | -------------------------------------------------------------------------------- /doc/include/use/env_query.inc: -------------------------------------------------------------------------------- 1 | [comment {-*- mode: tcl ; fill-column: 90 -*-}] 2 | 3 | [list_begin enumerated] 4 | 5 | [enum] Use the command [cmd critcl::check] to immediately check if a piece of C code can 6 | compiled successfully as a means of querying the compiler configuration itself. 7 | 8 | [para][example { 9 | if {[critcl::check { 10 | #include 11 | }]} { 12 | Do stuff with FOO.h present. 13 | } else { 14 | Do stuff without FOO.h 15 | } 16 | }] 17 | 18 | [para] All header and library paths which were registered with [vset critcl] before using 19 | [cmd critcl::check] take part in the attempted compilation. 20 | 21 | [para] Use the package [package critcl::util] and various convenience commands it 22 | provides. 23 | 24 | [enum] Use the full [term {Power of Tcl (tm)}] itself. 25 | 26 | [list_end] 27 | -------------------------------------------------------------------------------- /doc/include/use/external_struct.inc: -------------------------------------------------------------------------------- 1 | [comment {-*- mode: tcl ; fill-column: 90 -*-}] 2 | 3 | [list_begin enumerated] 4 | 5 | [enum] Handle structures provided by external libraries using either 6 | [sectref {Structure Types}] or [sectref {Large Structures}] as template. 7 | 8 | [enum] [emph Attention]. The choice is with the developer. 9 | 10 | [para] This is true even if the external structure is not reference counted by itself. 11 | 12 | [para] To reference count a structure [type S] without such simply wrap [type S] into a 13 | local structure which provides the reference count and has a field for [type S] (pointer 14 | or value). 15 | 16 | [enum] [emph Attention] Opaque external types, i.e. pointers to structures with hidden 17 | fields, can also be handled by the given templates. 18 | 19 | [list_end] 20 | -------------------------------------------------------------------------------- /doc/include/use/flags.inc: -------------------------------------------------------------------------------- 1 | [comment {-*- mode: tcl ; fill-column: 90 -*-}] 2 | 3 | [list_begin enumerated] 4 | 5 | [enum] See and reread the [sectref {Using External Libraries} {basic wrapper package}] for 6 | the introduction of the commands referenced below. 7 | 8 | [enum] Use the command [cmd critcl::cflags] to provide additional, non-standard flags to 9 | the compiler. 10 | 11 | [para][example { 12 | critcl::cflags -DBYTE_ORDER=bigendian 13 | }] 14 | 15 | [enum] Use the command [cmd critcl::ldflags] to provide additional, non-standard flags to 16 | the linker. 17 | 18 | [para][example { 19 | critcl::ldflags - 20 | }] 21 | 22 | [enum] Not answered in the above is how to determine such flags if they are not fixed 23 | across machines or platforms. 24 | 25 | [para] This is addressed by the next section. 26 | 27 | [list_end] 28 | -------------------------------------------------------------------------------- /doc/include/use/results_const_binary.inc: -------------------------------------------------------------------------------- 1 | [comment {-*- mode: tcl ; fill-column: 90 -*-}] 2 | 3 | [list_begin enumerated] 4 | 5 | [enum] Use the command [cmd critcl::cdata] to create a command taking no arguments and 6 | returning a constant ByteArray value. 7 | 8 | [para] [example { 9 | # P5 3 3 255 \n ... 10 | critcl::cdata cross3x3pgm { 11 | 80 52 32 51 32 51 32 50 53 53 10 12 | 0 255 0 13 | 255 255 255 14 | 0 255 0 15 | } 16 | }] 17 | 18 | [list_end] 19 | -------------------------------------------------------------------------------- /doc/include/use/runtime.inc: -------------------------------------------------------------------------------- 1 | [comment {-*- mode: tcl ; fill-column: 90 -*-}] 2 | 3 | [list_begin enumerated] 4 | 5 | [enum] See and reread the [sectref Basics {basic package}] for the introduction of the 6 | commands referenced below. 7 | 8 | [enum] Use the command [cmd critcl::tcl] to tell [vset critcl] the minimal version of Tcl 9 | the package is to be used with. 10 | 11 | [para] This determines which Tcl headers all files are compiled against, and what version 12 | of the public Tcl API is available to the C code. 13 | 14 | [para] Currently [const 8.4], [const 8.5] and [const 8.6] are supported. 15 | 16 | [para] If not specified [const 8.4] is assumed. 17 | 18 | [list_end] 19 | -------------------------------------------------------------------------------- /doc/include/use/template.inc: -------------------------------------------------------------------------------- 1 | [comment {-*- mode: tcl ; fill-column: 90 -*-}] 2 | 3 | [const {_ _ __ ___ _____ TODO _____ ___ __ _ _}] 4 | 5 | [list_begin enumerated] 6 | 7 | [enum] 8 | [example_begin] 9 | [example_end] 10 | 11 | [enum] 12 | 13 | [list_end] 14 | -------------------------------------------------------------------------------- /doc/include/welcome.inc: -------------------------------------------------------------------------------- 1 | [comment {-*- mode: tcl ; fill-column: 90 -*-}] 2 | 3 | Be welcome to the [vset ctlong] (short: [vset critcl]), a system for embedding and using C 4 | code from within [vset tcl_home] scripts. 5 | -------------------------------------------------------------------------------- /doc/pkg_version.inc: -------------------------------------------------------------------------------- 1 | [vset VERSION 3.3.1] 2 | -------------------------------------------------------------------------------- /doc/version.inc: -------------------------------------------------------------------------------- 1 | [vset VERSION 3.3.1] 2 | -------------------------------------------------------------------------------- /embedded/md/image/arch_application.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andreas-kupries/critcl/a10f9ed4bca596cbb29a9d898d8111613c324479/embedded/md/image/arch_application.png -------------------------------------------------------------------------------- /embedded/md/image/arch_core.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andreas-kupries/critcl/a10f9ed4bca596cbb29a9d898d8111613c324479/embedded/md/image/arch_core.png -------------------------------------------------------------------------------- /embedded/md/image/arch_support.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andreas-kupries/critcl/a10f9ed4bca596cbb29a9d898d8111613c324479/embedded/md/image/arch_support.png -------------------------------------------------------------------------------- /embedded/md/image/architecture.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andreas-kupries/critcl/a10f9ed4bca596cbb29a9d898d8111613c324479/embedded/md/image/architecture.png -------------------------------------------------------------------------------- /embedded/www/image/arch_application.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andreas-kupries/critcl/a10f9ed4bca596cbb29a9d898d8111613c324479/embedded/www/image/arch_application.png -------------------------------------------------------------------------------- /embedded/www/image/arch_core.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andreas-kupries/critcl/a10f9ed4bca596cbb29a9d898d8111613c324479/embedded/www/image/arch_core.png -------------------------------------------------------------------------------- /embedded/www/image/arch_support.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andreas-kupries/critcl/a10f9ed4bca596cbb29a9d898d8111613c324479/embedded/www/image/arch_support.png -------------------------------------------------------------------------------- /embedded/www/image/architecture.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andreas-kupries/critcl/a10f9ed4bca596cbb29a9d898d8111613c324479/embedded/www/image/architecture.png -------------------------------------------------------------------------------- /examples/argtype/example.tcl: -------------------------------------------------------------------------------- 1 | package require Tcl 8.6 9 2 | 3 | ex critcl::ArgumentConversion {int > 0} 4 | ex critcl::ArgumentConversion {double <= 0} 5 | -------------------------------------------------------------------------------- /examples/argtypes-ingress/example.tcl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env tclsh 2 | 3 | package require Tcl 8.6 9 4 | package require ingress 5 | 6 | # Main point is checking that all the conversions of all 7 | # (non-deprecated) builtin argument types generate code which compiles 8 | # without errors or even warnings. 9 | # 10 | # The command names match the type names. 11 | 12 | ex boolean true 13 | ex int 0 14 | ex long 0 15 | ex wideint 0 16 | 17 | ex double 0 18 | ex float 0 19 | 20 | ex char* string ;# const!? 21 | ex pstring pstring 22 | ex bytes bytearray 23 | 24 | ex bytearray bytearray ;# deprecated 25 | 26 | ex Tcl_Obj* an-object 27 | ex list {a list} 28 | 29 | ex channel stdout 30 | 31 | foreach t {int long wideint double float} { 32 | foreach {r v} { 33 | {> 0} 1 {>= 0} 0 {> 1} 2 {>= 1} 1 34 | {< 0} -1 {<= 0} 0 {< 1} 0 {<= 1} 1 35 | } { 36 | set type "$t $r" 37 | ex $type $v 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /examples/bitmap/example.tcl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env tclsh 2 | 3 | ex encode {exact filler} 4 | ex decode 5 5 | ex xencode global 6 | ex xdecode 6 7 | -------------------------------------------------------------------------------- /examples/build.tcl: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # -*- tcl -*- \ 3 | exec tclsh "$0" ${1+"$@"} 4 | set selfdir [file dirname [file normalize [info script]]] 5 | set self [file tail [info script]] 6 | 7 | # Run the build code in the sub-directories, passing any arguments. 8 | 9 | puts "" 10 | foreach b [glob -directory $selfdir */$self] { 11 | puts "$b _______________________________________________" 12 | eval [linsert $argv 0 exec 2>@ stderr >@ stdout [info nameofexecutable] $b] 13 | puts "" 14 | puts "" 15 | } 16 | -------------------------------------------------------------------------------- /examples/clist/clist_tcl.tcl: -------------------------------------------------------------------------------- 1 | # clist_tcl.tcl -- 2 | # 3 | # Tcl companion file to clist. Takes the primitives exported 4 | # by the C parts and arranges them into a nice and proper 5 | # ensemble command. 6 | # 7 | # Copyright (c) 2011,2022 Andreas Kupries 8 | 9 | # Example of using a Tcl companion file to put a layer of structure 10 | # (and/or policy) on top of a set of C primitives. 11 | 12 | # # ## ### ##### ######## ############# ##################### 13 | ## Requirements. 14 | 15 | # See clist.tcl 16 | 17 | # # ## ### ##### ######## ############# ##################### 18 | ## Implementation. 19 | 20 | namespace eval ::clist { 21 | namespace export map foldl filter 22 | namespace ensemble create 23 | } 24 | 25 | # ### ### ### ######### ######### ######### 26 | ## OK 27 | 28 | -------------------------------------------------------------------------------- /examples/clist/example.tcl: -------------------------------------------------------------------------------- 1 | 2 | package require Tcl 8.6 9 3 | package require lambda 4 | 5 | # Force compile and load. 6 | catch {clist::map} 7 | 8 | # squares 9 | ex clist map [lambda {x} { 10 | expr {$x * $x} 11 | }] {0 1 2 3 4 5 6 7 8 9} 12 | 13 | # filter out even numbers <=> select odd numbers 14 | ex ::clist::filter [lambda {x} { 15 | expr {$x % 2} 16 | }] {0 1 2 3 4 5 6 7 8 9} 17 | 18 | # sum 19 | ex ::clist foldl [lambda {a x} { 20 | expr {$a + $x} 21 | }] 0 {0 1 2 3 4 5 6 7 8 9} 22 | -------------------------------------------------------------------------------- /examples/cr.tcl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env tclsh 2 | # -*- tcl -*- 3 | 4 | set selfdir [file dirname [file normalize [info script]]] 5 | set self [file tail [info script]] 6 | 7 | set pattern [lindex $argv 0] 8 | if {$pattern eq ""} { 9 | set pattern * 10 | } 11 | # Perform "compile & run" in the sub-directories. 12 | 13 | puts "" 14 | foreach cr [lsort -dict [glob -directory $selfdir $pattern/$self]] { 15 | puts "$cr _______________________________________________" 16 | catch { 17 | eval [list exec 2>@ stderr >@ stdout [info nameofexecutable] $cr] 18 | } 19 | puts "" 20 | puts "" 21 | } 22 | -------------------------------------------------------------------------------- /examples/emap-both/example.tcl: -------------------------------------------------------------------------------- 1 | 2 | package require emap-both 3 | 4 | ex encode mix ;# 1 5 | ex xencode done ;# 2 6 | 7 | ex decode 0 ;# init 8 | ex xdecode 1 ;# mix 9 | 10 | ex encode foo 11 | ex xencode bar 12 | ex decode 55 13 | ex xdecode -2 14 | 15 | ex xencode MIX 16 | 17 | -------------------------------------------------------------------------------- /examples/emap-c/example.tcl: -------------------------------------------------------------------------------- 1 | 2 | package require emap-c 3 | 4 | ex encode mix ;# 1 5 | ex encode foo 6 | 7 | ex decode 0 ;# init 8 | ex decode 55 9 | -------------------------------------------------------------------------------- /examples/emap/example.tcl: -------------------------------------------------------------------------------- 1 | 2 | package require emap 3 | 4 | ex encode mix ;# 1 5 | ex xencode done ;# 2 6 | 7 | ex decode 0 ;# init 8 | ex xdecode 1 ;# mix 9 | 10 | ex encode foo 11 | ex xencode bar 12 | ex decode 55 13 | ex xdecode -2 14 | 15 | ex xencode MIX 16 | 17 | -------------------------------------------------------------------------------- /examples/emapint-both/example.tcl: -------------------------------------------------------------------------------- 1 | 2 | package require emapint-both 3 | 4 | ex encode mix ;# 1 5 | ex xencode done ;# 2 6 | 7 | ex decode 0 ;# init 8 | ex xdecode 1 ;# mix 9 | 10 | ex encode foo 11 | ex xencode bar 12 | ex decode 55 13 | ex decode 4 14 | ex xdecode -2 15 | ex xdecode 4 16 | ex xencode MIX 17 | -------------------------------------------------------------------------------- /examples/emapint-c/example.tcl: -------------------------------------------------------------------------------- 1 | 2 | package require emapint-c 3 | 4 | ex encode mix ;# 1 5 | ex encode foo 6 | 7 | ex decode 0 ;# init 8 | ex decode 55 9 | ex decode 4 10 | -------------------------------------------------------------------------------- /examples/emapint/example.tcl: -------------------------------------------------------------------------------- 1 | 2 | package require emapint 3 | 4 | ex encode mix ;# 1 5 | ex xencode done ;# 2 6 | 7 | ex decode 0 ;# init 8 | ex xdecode 1 ;# mix 9 | 10 | ex encode foo 11 | ex xencode bar 12 | ex decode 55 13 | ex decode 4 14 | ex xdecode -2 15 | ex xdecode 4 16 | ex xencode MIX 17 | -------------------------------------------------------------------------------- /examples/enum-list/example.tcl: -------------------------------------------------------------------------------- 1 | 2 | ex decode 2 3 | ex decode 1 0 2 4 | 5 | #ex decode 8 => panic, abort, core dump 6 | -------------------------------------------------------------------------------- /examples/enum/example.tcl: -------------------------------------------------------------------------------- 1 | 2 | ex encode exact 3 | ex xencode filler 4 | ex xencode-p glob 5 | ex xencode glob 6 | 7 | ex decode 2 8 | ex xdecode 0 9 | 10 | #ex decode 8 => panic, abort, core dump 11 | #ex xdecode 8 ditto 12 | -------------------------------------------------------------------------------- /examples/icounter/example.tcl: -------------------------------------------------------------------------------- 1 | 2 | # Force compile and load. 3 | catch {icounter 4} 4 | 5 | ex icounter 0 6 | ex ::icounter -1 7 | -------------------------------------------------------------------------------- /examples/lit-both/example.tcl: -------------------------------------------------------------------------------- 1 | 2 | # Force compile and load. 3 | catch {str} 4 | 5 | ex str 1 6 | ex cstr 2 7 | -------------------------------------------------------------------------------- /examples/lit-c/example.tcl: -------------------------------------------------------------------------------- 1 | 2 | # Force compile and load. 3 | catch {str} 4 | 5 | ex str 3 6 | -------------------------------------------------------------------------------- /examples/lit-list/example.tcl: -------------------------------------------------------------------------------- 1 | 2 | # Force compile and load. 3 | catch {str} 4 | 5 | ex strs 2 6 | ex strs 3 0 1 7 | -------------------------------------------------------------------------------- /examples/literals/example.tcl: -------------------------------------------------------------------------------- 1 | 2 | # Force compile and load. 3 | catch {str} 4 | 5 | ex str 1 6 | ex xstr 2 7 | -------------------------------------------------------------------------------- /examples/optional/example.tcl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env tclsh 2 | 3 | package require Tcl 8.5 9 4 | package require optional 5 | 6 | foreach a { 7 | {} 8 | {6} 9 | {6 7} 10 | {6 7 8} 11 | {6 7 8 9} 12 | {6 7 8 9 0} 13 | } { 14 | ex fixed {*}$a 15 | ex optional_head {*}$a 16 | ex optional_middle {*}$a 17 | ex optional_tail {*}$a 18 | } 19 | -------------------------------------------------------------------------------- /examples/queue/README.txt: -------------------------------------------------------------------------------- 1 | Example of critcl-based packages. 2 | 3 | A larger example written to demonstrate 4 | 5 | Easy writing of C classes, with class and instances 6 | represented as commands, through the utility package 7 | critcl::class 8 | 9 | Sources 10 | Package "queuec": queuec.tcl, queuec/*.[ch] 11 | 12 | Notes: 13 | -- 14 | -------------------------------------------------------------------------------- /examples/queue/example.tcl: -------------------------------------------------------------------------------- 1 | 2 | ex queuec new 3 | ex queuec1 size 4 | ex queuec1 clear 5 | ex queuec1 put a b c 6 | ex queuec1 peek 2 7 | ex queuec1 get 2 8 | ex queuec1 size 9 | ex queuec1 clear 10 | ex queuec1 size 11 | ex queuec1 destroy 12 | ex queuec1 13 | -------------------------------------------------------------------------------- /examples/queue/util.h: -------------------------------------------------------------------------------- 1 | /* stackc - critcl - layer 0 declarations 2 | * API general utilities 3 | */ 4 | 5 | #ifndef _UTIL_H 6 | #define _UTIL_H 1 7 | 8 | #include 9 | 10 | /* Allocation macros for common situations. 11 | */ 12 | 13 | #define ALLOC(type) (type *) ckalloc (sizeof (type)) 14 | #define NALLOC(n,type) (type *) ckalloc ((n) * sizeof (type)) 15 | 16 | /* Assertions in general, and asserting the proper range of an array index. 17 | */ 18 | 19 | #undef STACKC_DEBUG 20 | #define STACKC_DEBUG 1 21 | 22 | #ifdef STACKC_DEBUG 23 | #define XSTR(x) #x 24 | #define STR(x) XSTR(x) 25 | #define RANGEOK(i,n) ((0 <= (i)) && (i < (n))) 26 | #define ASSERT(x,msg) if (!(x)) { Tcl_Panic (msg " (" #x "), in file " __FILE__ " @line " STR(__LINE__));} 27 | #define ASSERT_BOUNDS(i,n) ASSERT (RANGEOK(i,n),"array index out of bounds: " STR(i) " > " STR(n)) 28 | #else 29 | #define ASSERT(x,msg) 30 | #define ASSERT_BOUNDS(i,n) 31 | #endif 32 | 33 | #endif /* _UTIL_H */ 34 | 35 | /* 36 | * Local Variables: 37 | * mode: c 38 | * c-basic-offset: 4 39 | * fill-column: 78 40 | * End: 41 | */ 42 | -------------------------------------------------------------------------------- /examples/random/README.txt: -------------------------------------------------------------------------------- 1 | Example of critcl-based packages. 2 | 3 | A larger example written to demonstrate 4 | 5 | Export of an API as Tcl stubs table (Package "rnmath") 6 | Import of an API defined as stubs-table (Package "random") 7 | 8 | Package "random" incidentially also demonstrates 9 | 10 | Programmatic access to the imported API for use in C code 11 | generation, and 12 | 13 | Complex C code generation (class and instance commands) from a 14 | few parameters (function name, arguments, ...). 15 | 16 | Sources 17 | Package "rnmath": rnmath.tcl 18 | Package "random": random.tcl 19 | 20 | Notes: 21 | 22 | * "rnmath" contains and exports low-level functions for 23 | generating random numbers following a variety of 24 | distributions. The functions are state-less. The system 25 | function random() (On win: rand()) is used internally as the 26 | basic source of random values. 27 | 28 | * "random" wraps the low-level math into a Tcl class/object 29 | system where generators are objects, each represented as a Tcl 30 | command. 31 | -------------------------------------------------------------------------------- /examples/selfcompanion/example.tcl: -------------------------------------------------------------------------------- 1 | 2 | ex self 3 | ex companion 4 | -------------------------------------------------------------------------------- /examples/stack/stackc/m.h: -------------------------------------------------------------------------------- 1 | /* ::stack - critcl - layer 3 declarations 2 | * Method functions. 3 | */ 4 | 5 | #ifndef _M_H 6 | #define _M_H 1 7 | 8 | #include "tcl.h" 9 | #include 10 | 11 | int stm_CLEAR (CSTACK s, Tcl_Interp* interp, int objc, Tcl_Obj* CONST* objv); 12 | int stm_DESTROY (CSTACK s, Tcl_Interp* interp, int objc, Tcl_Obj* CONST* objv); 13 | int stm_PEEK (CSTACK s, Tcl_Interp* interp, int objc, Tcl_Obj* CONST* objv, int pop, int revers); 14 | int stm_PUSH (CSTACK s, Tcl_Interp* interp, int objc, Tcl_Obj* CONST* objv); 15 | int stm_ROTATE (CSTACK s, Tcl_Interp* interp, int objc, Tcl_Obj* CONST* objv); 16 | int stm_SIZE (CSTACK s, Tcl_Interp* interp, int objc, Tcl_Obj* CONST* objv); 17 | int stm_GET (CSTACK s, Tcl_Interp* interp, int objc, Tcl_Obj* CONST* objv, int revers); 18 | int stm_TRIM (CSTACK s, Tcl_Interp* interp, int objc, Tcl_Obj* CONST* objv, int ret); 19 | 20 | #endif /* _M_H */ 21 | 22 | /* 23 | * Local Variables: 24 | * mode: c 25 | * c-basic-offset: 4 26 | * fill-column: 78 27 | * End: 28 | */ 29 | -------------------------------------------------------------------------------- /examples/stack/stackc/util.h: -------------------------------------------------------------------------------- 1 | /* stackc - critcl - layer 0 declarations 2 | * API general utilities 3 | */ 4 | 5 | #ifndef _UTIL_H 6 | #define _UTIL_H 1 7 | 8 | #include 9 | 10 | /* Allocation macros for common situations. 11 | */ 12 | 13 | #define ALLOC(type) (type *) ckalloc (sizeof (type)) 14 | #define NALLOC(n,type) (type *) ckalloc ((n) * sizeof (type)) 15 | 16 | /* Assertions in general, and asserting the proper range of an array index. 17 | */ 18 | 19 | #undef STACKC_DEBUG 20 | #define STACKC_DEBUG 1 21 | 22 | #ifdef STACKC_DEBUG 23 | #define XSTR(x) #x 24 | #define STR(x) XSTR(x) 25 | #define RANGEOK(i,n) ((0 <= (i)) && (i < (n))) 26 | #define ASSERT(x,msg) if (!(x)) { Tcl_Panic (msg " (" #x "), in file " __FILE__ " @line " STR(__LINE__));} 27 | #define ASSERT_BOUNDS(i,n) ASSERT (RANGEOK(i,n),"array index out of bounds: " STR(i) " > " STR(n)) 28 | #else 29 | #define ASSERT(x,msg) 30 | #define ASSERT_BOUNDS(i,n) 31 | #endif 32 | 33 | #endif /* _UTIL_H */ 34 | 35 | /* 36 | * Local Variables: 37 | * mode: c 38 | * c-basic-offset: 4 39 | * fill-column: 78 40 | * End: 41 | */ 42 | -------------------------------------------------------------------------------- /examples/tk8.4/example.tcl: -------------------------------------------------------------------------------- 1 | 2 | # Force compile and load. 3 | catch {icounter 4} 4 | 5 | ex icounter 0 6 | ex ::icounter -1 7 | -------------------------------------------------------------------------------- /examples/tk8.5/example.tcl: -------------------------------------------------------------------------------- 1 | 2 | # Force compile and load. 3 | catch {icounter 4} 4 | 5 | ex icounter 0 6 | ex ::icounter -1 7 | -------------------------------------------------------------------------------- /examples/tk8.6/example.tcl: -------------------------------------------------------------------------------- 1 | 2 | # Force compile and load. 3 | catch {icounter 4} 4 | 5 | ex icounter 0 6 | ex ::icounter -1 7 | -------------------------------------------------------------------------------- /examples/trace/example.tcl: -------------------------------------------------------------------------------- 1 | 2 | # Force compile and load. 3 | catch {str} 4 | 5 | ex str 1 6 | ex xstr 3 7 | ex moon 8 | ex nothing 9 | ex xstr sun 10 | -------------------------------------------------------------------------------- /examples/variadic/example.tcl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env tclsh 2 | 3 | package require Tcl 8.5 9 4 | package require variadic 5 | 6 | foreach a { 7 | {} 8 | {6} 9 | {6 7} 10 | {6 7 8} 11 | {6 7 8 9} 12 | {6 7 8 9 0} 13 | } { 14 | ex variadic {*}$a 15 | ex ovariadic {*}$a 16 | } 17 | -------------------------------------------------------------------------------- /examples/zlibwrap/README.txt: -------------------------------------------------------------------------------- 1 | Example of critcl-based packages. 2 | 3 | A larger example written to demonstrate 4 | 5 | Export of an API from an external 3rd party library as Tcl stubs table. 6 | Build switchability between 7 | linking a system instance of the 3rd party library 8 | and building a static library from local sources and 9 | linking against this. 10 | 11 | Sources 12 | Package "zlib": zlib.tcl 13 | Local sources of C zlib: zlib/ 14 | 15 | Notes: 16 | -------------------------------------------------------------------------------- /examples/zlibwrap/zlib/ChangeLog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andreas-kupries/critcl/a10f9ed4bca596cbb29a9d898d8111613c324479/examples/zlibwrap/zlib/ChangeLog -------------------------------------------------------------------------------- /examples/zlibwrap/zlib/Makefile: -------------------------------------------------------------------------------- 1 | all: 2 | -@echo "Please use ./configure first. Thank you." 3 | 4 | distclean: 5 | make -f Makefile.in distclean 6 | -------------------------------------------------------------------------------- /examples/zlibwrap/zlib/contrib/README.contrib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andreas-kupries/critcl/a10f9ed4bca596cbb29a9d898d8111613c324479/examples/zlibwrap/zlib/contrib/README.contrib -------------------------------------------------------------------------------- /examples/zlibwrap/zlib/contrib/ada/zlib.gpr: -------------------------------------------------------------------------------- 1 | project Zlib is 2 | 3 | for Languages use ("Ada"); 4 | for Source_Dirs use ("."); 5 | for Object_Dir use "."; 6 | for Main use ("test.adb", "mtest.adb", "read.adb", "buffer_demo"); 7 | 8 | package Compiler is 9 | for Default_Switches ("ada") use ("-gnatwcfilopru", "-gnatVcdfimorst", "-gnatyabcefhiklmnoprst"); 10 | end Compiler; 11 | 12 | package Linker is 13 | for Default_Switches ("ada") use ("-lz"); 14 | end Linker; 15 | 16 | package Builder is 17 | for Default_Switches ("ada") use ("-s", "-gnatQ"); 18 | end Builder; 19 | 20 | end Zlib; 21 | -------------------------------------------------------------------------------- /examples/zlibwrap/zlib/contrib/blast/Makefile: -------------------------------------------------------------------------------- 1 | blast: blast.c blast.h 2 | cc -DTEST -o blast blast.c 3 | 4 | test: blast 5 | blast < test.pk | cmp - test.txt 6 | 7 | clean: 8 | rm -f blast blast.o 9 | -------------------------------------------------------------------------------- /examples/zlibwrap/zlib/contrib/blast/README: -------------------------------------------------------------------------------- 1 | Read blast.h for purpose and usage. 2 | 3 | Mark Adler 4 | madler@alumni.caltech.edu 5 | -------------------------------------------------------------------------------- /examples/zlibwrap/zlib/contrib/blast/test.pk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andreas-kupries/critcl/a10f9ed4bca596cbb29a9d898d8111613c324479/examples/zlibwrap/zlib/contrib/blast/test.pk -------------------------------------------------------------------------------- /examples/zlibwrap/zlib/contrib/blast/test.txt: -------------------------------------------------------------------------------- 1 | AIAIAIAIAIAIA -------------------------------------------------------------------------------- /examples/zlibwrap/zlib/contrib/delphi/ZLibConst.pas: -------------------------------------------------------------------------------- 1 | unit ZLibConst; 2 | 3 | interface 4 | 5 | resourcestring 6 | sTargetBufferTooSmall = 'ZLib error: target buffer may be too small'; 7 | sInvalidStreamOp = 'Invalid stream operation'; 8 | 9 | implementation 10 | 11 | end. 12 | -------------------------------------------------------------------------------- /examples/zlibwrap/zlib/contrib/dotzlib/DotZLib.chm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andreas-kupries/critcl/a10f9ed4bca596cbb29a9d898d8111613c324479/examples/zlibwrap/zlib/contrib/dotzlib/DotZLib.chm -------------------------------------------------------------------------------- /examples/zlibwrap/zlib/contrib/dotzlib/DotZLib.sln: -------------------------------------------------------------------------------- 1 | Microsoft Visual Studio Solution File, Format Version 8.00 2 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DotZLib", "DotZLib\DotZLib.csproj", "{BB1EE0B1-1808-46CB-B786-949D91117FC5}" 3 | ProjectSection(ProjectDependencies) = postProject 4 | EndProjectSection 5 | EndProject 6 | Global 7 | GlobalSection(SolutionConfiguration) = preSolution 8 | Debug = Debug 9 | Release = Release 10 | EndGlobalSection 11 | GlobalSection(ProjectConfiguration) = postSolution 12 | {BB1EE0B1-1808-46CB-B786-949D91117FC5}.Debug.ActiveCfg = Debug|.NET 13 | {BB1EE0B1-1808-46CB-B786-949D91117FC5}.Debug.Build.0 = Debug|.NET 14 | {BB1EE0B1-1808-46CB-B786-949D91117FC5}.Release.ActiveCfg = Release|.NET 15 | {BB1EE0B1-1808-46CB-B786-949D91117FC5}.Release.Build.0 = Release|.NET 16 | EndGlobalSection 17 | GlobalSection(ExtensibilityGlobals) = postSolution 18 | EndGlobalSection 19 | GlobalSection(ExtensibilityAddIns) = postSolution 20 | EndGlobalSection 21 | EndGlobal 22 | -------------------------------------------------------------------------------- /examples/zlibwrap/zlib/contrib/dotzlib/DotZLib/ChecksumImpl.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andreas-kupries/critcl/a10f9ed4bca596cbb29a9d898d8111613c324479/examples/zlibwrap/zlib/contrib/dotzlib/DotZLib/ChecksumImpl.cs -------------------------------------------------------------------------------- /examples/zlibwrap/zlib/contrib/dotzlib/DotZLib/CircularBuffer.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andreas-kupries/critcl/a10f9ed4bca596cbb29a9d898d8111613c324479/examples/zlibwrap/zlib/contrib/dotzlib/DotZLib/CircularBuffer.cs -------------------------------------------------------------------------------- /examples/zlibwrap/zlib/contrib/dotzlib/DotZLib/CodecBase.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andreas-kupries/critcl/a10f9ed4bca596cbb29a9d898d8111613c324479/examples/zlibwrap/zlib/contrib/dotzlib/DotZLib/CodecBase.cs -------------------------------------------------------------------------------- /examples/zlibwrap/zlib/contrib/dotzlib/DotZLib/Deflater.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andreas-kupries/critcl/a10f9ed4bca596cbb29a9d898d8111613c324479/examples/zlibwrap/zlib/contrib/dotzlib/DotZLib/Deflater.cs -------------------------------------------------------------------------------- /examples/zlibwrap/zlib/contrib/dotzlib/DotZLib/DotZLib.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andreas-kupries/critcl/a10f9ed4bca596cbb29a9d898d8111613c324479/examples/zlibwrap/zlib/contrib/dotzlib/DotZLib/DotZLib.cs -------------------------------------------------------------------------------- /examples/zlibwrap/zlib/contrib/dotzlib/DotZLib/GZipStream.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andreas-kupries/critcl/a10f9ed4bca596cbb29a9d898d8111613c324479/examples/zlibwrap/zlib/contrib/dotzlib/DotZLib/GZipStream.cs -------------------------------------------------------------------------------- /examples/zlibwrap/zlib/contrib/dotzlib/DotZLib/Inflater.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andreas-kupries/critcl/a10f9ed4bca596cbb29a9d898d8111613c324479/examples/zlibwrap/zlib/contrib/dotzlib/DotZLib/Inflater.cs -------------------------------------------------------------------------------- /examples/zlibwrap/zlib/contrib/dotzlib/DotZLib/UnitTests.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andreas-kupries/critcl/a10f9ed4bca596cbb29a9d898d8111613c324479/examples/zlibwrap/zlib/contrib/dotzlib/DotZLib/UnitTests.cs -------------------------------------------------------------------------------- /examples/zlibwrap/zlib/contrib/infback9/README: -------------------------------------------------------------------------------- 1 | See infback9.h for what this is and how to use it. 2 | -------------------------------------------------------------------------------- /examples/zlibwrap/zlib/contrib/iostream/test.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "zfstream.h" 3 | 4 | int main() { 5 | 6 | // Construct a stream object with this filebuffer. Anything sent 7 | // to this stream will go to standard out. 8 | gzofstream os( 1, ios::out ); 9 | 10 | // This text is getting compressed and sent to stdout. 11 | // To prove this, run 'test | zcat'. 12 | os << "Hello, Mommy" << endl; 13 | 14 | os << setcompressionlevel( Z_NO_COMPRESSION ); 15 | os << "hello, hello, hi, ho!" << endl; 16 | 17 | setcompressionlevel( os, Z_DEFAULT_COMPRESSION ) 18 | << "I'm compressing again" << endl; 19 | 20 | os.close(); 21 | 22 | return 0; 23 | 24 | } 25 | -------------------------------------------------------------------------------- /examples/zlibwrap/zlib/contrib/iostream2/zstream_test.cpp: -------------------------------------------------------------------------------- 1 | #include "zstream.h" 2 | #include 3 | #include 4 | #include 5 | 6 | void main() { 7 | char h[256] = "Hello"; 8 | char* g = "Goodbye"; 9 | ozstream out("temp.gz"); 10 | out < "This works well" < h < g; 11 | out.close(); 12 | 13 | izstream in("temp.gz"); // read it back 14 | char *x = read_string(in), *y = new char[256], z[256]; 15 | in > y > z; 16 | in.close(); 17 | cout << x << endl << y << endl << z << endl; 18 | 19 | out.open("temp.gz"); // try ascii output; zcat temp.gz to see the results 20 | out << setw(50) << setfill('#') << setprecision(20) << x << endl << y << endl << z << endl; 21 | out << z << endl << y << endl << x << endl; 22 | out << 1.1234567890123456789 << endl; 23 | 24 | delete[] x; delete[] y; 25 | } 26 | -------------------------------------------------------------------------------- /examples/zlibwrap/zlib/contrib/iostream3/TODO: -------------------------------------------------------------------------------- 1 | Possible upgrades to gzfilebuf: 2 | 3 | - The ability to do putback (e.g. putbackfail) 4 | 5 | - The ability to seek (zlib supports this, but could be slow/tricky) 6 | 7 | - Simultaneous read/write access (does it make sense?) 8 | 9 | - Support for ios_base::ate open mode 10 | 11 | - Locale support? 12 | 13 | - Check public interface to see which calls give problems 14 | (due to dependence on library internals) 15 | 16 | - Override operator<<(ostream&, gzfilebuf*) to allow direct copying 17 | of stream buffer to stream ( i.e. os << is.rdbuf(); ) 18 | -------------------------------------------------------------------------------- /examples/zlibwrap/zlib/contrib/masmx64/bld_ml64.bat: -------------------------------------------------------------------------------- 1 | ml64.exe /Flinffasx64 /c /Zi inffasx64.asm 2 | ml64.exe /Flgvmat64 /c /Zi gvmat64.asm 3 | -------------------------------------------------------------------------------- /examples/zlibwrap/zlib/contrib/masmx86/bld_ml32.bat: -------------------------------------------------------------------------------- 1 | ml /coff /Zi /c /Flmatch686.lst match686.asm 2 | ml /coff /Zi /c /Flinffas32.lst inffas32.asm 3 | -------------------------------------------------------------------------------- /examples/zlibwrap/zlib/contrib/masmx86/readme.txt: -------------------------------------------------------------------------------- 1 | 2 | Summary 3 | ------- 4 | This directory contains ASM implementations of the functions 5 | longest_match() and inflate_fast(). 6 | 7 | 8 | Use instructions 9 | ---------------- 10 | Assemble using MASM, and copy the object files into the zlib source 11 | directory, then run the appropriate makefile, as suggested below. You can 12 | donwload MASM from here: 13 | 14 | http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=7a1c9da0-0510-44a2-b042-7ef370530c64 15 | 16 | You can also get objects files here: 17 | 18 | http://www.winimage.com/zLibDll/zlib124_masm_obj.zip 19 | 20 | Build instructions 21 | ------------------ 22 | * With Microsoft C and MASM: 23 | nmake -f win32/Makefile.msc LOC="-DASMV -DASMINF" OBJA="match686.obj inffas32.obj" 24 | 25 | * With Borland C and TASM: 26 | make -f win32/Makefile.bor LOCAL_ZLIB="-DASMV -DASMINF" OBJA="match686.obj inffas32.obj" OBJPA="+match686c.obj+match686.obj+inffas32.obj" 27 | 28 | -------------------------------------------------------------------------------- /examples/zlibwrap/zlib/contrib/minizip/Makefile: -------------------------------------------------------------------------------- 1 | CC=cc 2 | CFLAGS=-O -I../.. 3 | 4 | UNZ_OBJS = miniunz.o unzip.o ioapi.o ../../libz.a 5 | ZIP_OBJS = minizip.o zip.o ioapi.o ../../libz.a 6 | 7 | .c.o: 8 | $(CC) -c $(CFLAGS) $*.c 9 | 10 | all: miniunz minizip 11 | 12 | miniunz: $(UNZ_OBJS) 13 | $(CC) $(CFLAGS) -o $@ $(UNZ_OBJS) 14 | 15 | minizip: $(ZIP_OBJS) 16 | $(CC) $(CFLAGS) -o $@ $(ZIP_OBJS) 17 | 18 | test: miniunz minizip 19 | ./minizip test readme.txt 20 | ./miniunz -l test.zip 21 | mv readme.txt readme.old 22 | ./miniunz test.zip 23 | 24 | clean: 25 | /bin/rm -f *.o *~ minizip miniunz 26 | -------------------------------------------------------------------------------- /examples/zlibwrap/zlib/contrib/minizip/MiniZip64_Changes.txt: -------------------------------------------------------------------------------- 1 | 2 | MiniZip 1.1 was derrived from MiniZip at version 1.01f 3 | 4 | Change in 1.0 (Okt 2009) 5 | - **TODO - Add history** 6 | 7 | -------------------------------------------------------------------------------- /examples/zlibwrap/zlib/contrib/minizip/iowin32.h: -------------------------------------------------------------------------------- 1 | /* iowin32.h -- IO base function header for compress/uncompress .zip 2 | Version 1.1, February 14h, 2010 3 | part of the MiniZip project - ( http://www.winimage.com/zLibDll/minizip.html ) 4 | 5 | Copyright (C) 1998-2010 Gilles Vollant (minizip) ( http://www.winimage.com/zLibDll/minizip.html ) 6 | 7 | Modifications for Zip64 support 8 | Copyright (C) 2009-2010 Mathias Svensson ( http://result42.com ) 9 | 10 | For more info read MiniZip_info.txt 11 | 12 | */ 13 | 14 | #include 15 | 16 | 17 | #ifdef __cplusplus 18 | extern "C" { 19 | #endif 20 | 21 | void fill_win32_filefunc OF((zlib_filefunc_def* pzlib_filefunc_def)); 22 | void fill_win32_filefunc64 OF((zlib_filefunc64_def* pzlib_filefunc_def)); 23 | void fill_win32_filefunc64A OF((zlib_filefunc64_def* pzlib_filefunc_def)); 24 | void fill_win32_filefunc64W OF((zlib_filefunc64_def* pzlib_filefunc_def)); 25 | 26 | #ifdef __cplusplus 27 | } 28 | #endif 29 | -------------------------------------------------------------------------------- /examples/zlibwrap/zlib/contrib/minizip/make_vms.com: -------------------------------------------------------------------------------- 1 | $ if f$search("ioapi.h_orig") .eqs. "" then copy ioapi.h ioapi.h_orig 2 | $ open/write zdef vmsdefs.h 3 | $ copy sys$input: zdef 4 | $ deck 5 | #define unix 6 | #define fill_zlib_filefunc64_32_def_from_filefunc32 fillzffunc64from 7 | #define Write_Zip64EndOfCentralDirectoryLocator Write_Zip64EoDLocator 8 | #define Write_Zip64EndOfCentralDirectoryRecord Write_Zip64EoDRecord 9 | #define Write_EndOfCentralDirectoryRecord Write_EoDRecord 10 | $ eod 11 | $ close zdef 12 | $ copy vmsdefs.h,ioapi.h_orig ioapi.h 13 | $ cc/include=[--]/prefix=all ioapi.c 14 | $ cc/include=[--]/prefix=all miniunz.c 15 | $ cc/include=[--]/prefix=all unzip.c 16 | $ cc/include=[--]/prefix=all minizip.c 17 | $ cc/include=[--]/prefix=all zip.c 18 | $ link miniunz,unzip,ioapi,[--]libz.olb/lib 19 | $ link minizip,zip,ioapi,[--]libz.olb/lib 20 | $ mcr []minizip test minizip_info.txt 21 | $ mcr []miniunz -l test.zip 22 | $ rename minizip_info.txt; minizip_info.txt_old 23 | $ mcr []miniunz test.zip 24 | $ delete test.zip;* 25 | $exit 26 | -------------------------------------------------------------------------------- /examples/zlibwrap/zlib/contrib/minizip/mztools.h: -------------------------------------------------------------------------------- 1 | /* 2 | Additional tools for Minizip 3 | Code: Xavier Roche '2004 4 | License: Same as ZLIB (www.gzip.org) 5 | */ 6 | 7 | #ifndef _zip_tools_H 8 | #define _zip_tools_H 9 | 10 | #ifdef __cplusplus 11 | extern "C" { 12 | #endif 13 | 14 | #ifndef _ZLIB_H 15 | #include "zlib.h" 16 | #endif 17 | 18 | #include "unzip.h" 19 | 20 | /* Repair a ZIP file (missing central directory) 21 | file: file to recover 22 | fileOut: output file after recovery 23 | fileOutTmp: temporary file name used for recovery 24 | */ 25 | extern int ZEXPORT unzRepair(const char* file, 26 | const char* fileOut, 27 | const char* fileOutTmp, 28 | uLong* nRecovered, 29 | uLong* bytesRecovered); 30 | 31 | #endif 32 | -------------------------------------------------------------------------------- /examples/zlibwrap/zlib/contrib/puff/Makefile: -------------------------------------------------------------------------------- 1 | puff: puff.c puff.h 2 | cc -DTEST -o puff puff.c 3 | 4 | test: puff 5 | puff zeros.raw 6 | 7 | clean: 8 | rm -f puff puff.o 9 | -------------------------------------------------------------------------------- /examples/zlibwrap/zlib/contrib/puff/zeros.raw: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andreas-kupries/critcl/a10f9ed4bca596cbb29a9d898d8111613c324479/examples/zlibwrap/zlib/contrib/puff/zeros.raw -------------------------------------------------------------------------------- /examples/zlibwrap/zlib/contrib/testzlib/testzlib.txt: -------------------------------------------------------------------------------- 1 | To build testzLib with Visual Studio 2005: 2 | 3 | copy to a directory file from : 4 | - root of zLib tree 5 | - contrib/testzlib 6 | - contrib/masmx86 7 | - contrib/masmx64 8 | - contrib/vstudio/vc7 9 | 10 | and open testzlib8.sln -------------------------------------------------------------------------------- /examples/zlibwrap/zlib/contrib/untgz/Makefile: -------------------------------------------------------------------------------- 1 | CC=cc 2 | CFLAGS=-g 3 | 4 | untgz: untgz.o ../../libz.a 5 | $(CC) $(CFLAGS) -o untgz untgz.o -L../.. -lz 6 | 7 | untgz.o: untgz.c ../../zlib.h 8 | $(CC) $(CFLAGS) -c -I../.. untgz.c 9 | 10 | ../../libz.a: 11 | cd ../..; ./configure; make 12 | 13 | clean: 14 | rm -f untgz untgz.o *~ 15 | -------------------------------------------------------------------------------- /examples/zlibwrap/zlib/contrib/untgz/Makefile.msc: -------------------------------------------------------------------------------- 1 | CC=cl 2 | CFLAGS=-MD 3 | 4 | untgz.exe: untgz.obj ..\..\zlib.lib 5 | $(CC) $(CFLAGS) untgz.obj ..\..\zlib.lib 6 | 7 | untgz.obj: untgz.c ..\..\zlib.h 8 | $(CC) $(CFLAGS) -c -I..\.. untgz.c 9 | 10 | ..\..\zlib.lib: 11 | cd ..\.. 12 | $(MAKE) -f win32\makefile.msc 13 | cd contrib\untgz 14 | 15 | clean: 16 | -del untgz.obj 17 | -del untgz.exe 18 | -------------------------------------------------------------------------------- /examples/zlibwrap/zlib/contrib/vstudio/vc10/miniunz.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {048af943-022b-4db6-beeb-a54c34774ee2} 6 | cpp;c;cxx;def;odl;idl;hpj;bat;asm 7 | 8 | 9 | {c1d600d2-888f-4aea-b73e-8b0dd9befa0c} 10 | h;hpp;hxx;hm;inl;inc 11 | 12 | 13 | {0844199a-966b-4f19-81db-1e0125e141b9} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe 15 | 16 | 17 | 18 | 19 | Source Files 20 | 21 | 22 | -------------------------------------------------------------------------------- /examples/zlibwrap/zlib/contrib/vstudio/vc10/miniunz.vcxproj.user: -------------------------------------------------------------------------------- 1 |  2 | 3 | -------------------------------------------------------------------------------- /examples/zlibwrap/zlib/contrib/vstudio/vc10/minizip.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {c0419b40-bf50-40da-b153-ff74215b79de} 6 | cpp;c;cxx;def;odl;idl;hpj;bat;asm 7 | 8 | 9 | {bb87b070-735b-478e-92ce-7383abb2f36c} 10 | h;hpp;hxx;hm;inl;inc 11 | 12 | 13 | {f46ab6a6-548f-43cb-ae96-681abb5bd5db} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe 15 | 16 | 17 | 18 | 19 | Source Files 20 | 21 | 22 | -------------------------------------------------------------------------------- /examples/zlibwrap/zlib/contrib/vstudio/vc10/minizip.vcxproj.user: -------------------------------------------------------------------------------- 1 |  2 | 3 | -------------------------------------------------------------------------------- /examples/zlibwrap/zlib/contrib/vstudio/vc10/testzlib.vcxproj.user: -------------------------------------------------------------------------------- 1 |  2 | 3 | -------------------------------------------------------------------------------- /examples/zlibwrap/zlib/contrib/vstudio/vc10/testzlibdll.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {fa61a89f-93fc-4c89-b29e-36224b7592f4} 6 | cpp;c;cxx;def;odl;idl;hpj;bat;asm 7 | 8 | 9 | {d4b85da0-2ba2-4934-b57f-e2584e3848ee} 10 | h;hpp;hxx;hm;inl;inc 11 | 12 | 13 | {e573e075-00bd-4a7d-bd67-a8cc9bfc5aca} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe 15 | 16 | 17 | 18 | 19 | Source Files 20 | 21 | 22 | -------------------------------------------------------------------------------- /examples/zlibwrap/zlib/contrib/vstudio/vc10/testzlibdll.vcxproj.user: -------------------------------------------------------------------------------- 1 |  2 | 3 | -------------------------------------------------------------------------------- /examples/zlibwrap/zlib/contrib/vstudio/vc10/zlib.rc: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #define IDR_VERSION1 1 4 | IDR_VERSION1 VERSIONINFO MOVEABLE IMPURE LOADONCALL DISCARDABLE 5 | FILEVERSION 1,2,5,0 6 | PRODUCTVERSION 1,2,5,0 7 | FILEFLAGSMASK VS_FFI_FILEFLAGSMASK 8 | FILEFLAGS 0 9 | FILEOS VOS_DOS_WINDOWS32 10 | FILETYPE VFT_DLL 11 | FILESUBTYPE 0 // not used 12 | BEGIN 13 | BLOCK "StringFileInfo" 14 | BEGIN 15 | BLOCK "040904E4" 16 | //language ID = U.S. English, char set = Windows, Multilingual 17 | 18 | BEGIN 19 | VALUE "FileDescription", "zlib data compression and ZIP file I/O library\0" 20 | VALUE "FileVersion", "1.2.5\0" 21 | VALUE "InternalName", "zlib\0" 22 | VALUE "OriginalFilename", "zlib.dll\0" 23 | VALUE "ProductName", "ZLib.DLL\0" 24 | VALUE "Comments","DLL support by Alessandro Iacopetti & Gilles Vollant\0" 25 | VALUE "LegalCopyright", "(C) 1995-2010 Jean-loup Gailly & Mark Adler\0" 26 | END 27 | END 28 | BLOCK "VarFileInfo" 29 | BEGIN 30 | VALUE "Translation", 0x0409, 1252 31 | END 32 | END 33 | -------------------------------------------------------------------------------- /examples/zlibwrap/zlib/contrib/vstudio/vc10/zlibstat.vcxproj.user: -------------------------------------------------------------------------------- 1 |  2 | 3 | -------------------------------------------------------------------------------- /examples/zlibwrap/zlib/contrib/vstudio/vc10/zlibvc.vcxproj.user: -------------------------------------------------------------------------------- 1 |  2 | 3 | -------------------------------------------------------------------------------- /examples/zlibwrap/zlib/contrib/vstudio/vc9/zlib.rc: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #define IDR_VERSION1 1 4 | IDR_VERSION1 VERSIONINFO MOVEABLE IMPURE LOADONCALL DISCARDABLE 5 | FILEVERSION 1,2,5,0 6 | PRODUCTVERSION 1,2,5,0 7 | FILEFLAGSMASK VS_FFI_FILEFLAGSMASK 8 | FILEFLAGS 0 9 | FILEOS VOS_DOS_WINDOWS32 10 | FILETYPE VFT_DLL 11 | FILESUBTYPE 0 // not used 12 | BEGIN 13 | BLOCK "StringFileInfo" 14 | BEGIN 15 | BLOCK "040904E4" 16 | //language ID = U.S. English, char set = Windows, Multilingual 17 | 18 | BEGIN 19 | VALUE "FileDescription", "zlib data compression and ZIP file I/O library\0" 20 | VALUE "FileVersion", "1.2.5\0" 21 | VALUE "InternalName", "zlib\0" 22 | VALUE "OriginalFilename", "zlib.dll\0" 23 | VALUE "ProductName", "ZLib.DLL\0" 24 | VALUE "Comments","DLL support by Alessandro Iacopetti & Gilles Vollant\0" 25 | VALUE "LegalCopyright", "(C) 1995-2010 Jean-loup Gailly & Mark Adler\0" 26 | END 27 | END 28 | BLOCK "VarFileInfo" 29 | BEGIN 30 | VALUE "Translation", 0x0409, 1252 31 | END 32 | END 33 | -------------------------------------------------------------------------------- /examples/zlibwrap/zlib/gzclose.c: -------------------------------------------------------------------------------- 1 | /* gzclose.c -- zlib gzclose() function 2 | * Copyright (C) 2004, 2010 Mark Adler 3 | * For conditions of distribution and use, see copyright notice in zlib.h 4 | */ 5 | 6 | #include "gzguts.h" 7 | 8 | /* gzclose() is in a separate file so that it is linked in only if it is used. 9 | That way the other gzclose functions can be used instead to avoid linking in 10 | unneeded compression or decompression routines. */ 11 | int ZEXPORT gzclose(file) 12 | gzFile file; 13 | { 14 | #ifndef NO_GZCOMPRESS 15 | gz_statep state; 16 | 17 | if (file == NULL) 18 | return Z_STREAM_ERROR; 19 | state = (gz_statep)file; 20 | 21 | return state->mode == GZ_READ ? gzclose_r(file) : gzclose_w(file); 22 | #else 23 | return gzclose_r(file); 24 | #endif 25 | } 26 | -------------------------------------------------------------------------------- /examples/zlibwrap/zlib/inffast.h: -------------------------------------------------------------------------------- 1 | /* inffast.h -- header to use inffast.c 2 | * Copyright (C) 1995-2003, 2010 Mark Adler 3 | * For conditions of distribution and use, see copyright notice in zlib.h 4 | */ 5 | 6 | /* WARNING: this file should *not* be used by applications. It is 7 | part of the implementation of the compression library and is 8 | subject to change. Applications should only use zlib.h. 9 | */ 10 | 11 | void ZLIB_INTERNAL inflate_fast OF((z_streamp strm, unsigned start)); 12 | -------------------------------------------------------------------------------- /examples/zlibwrap/zlib/nintendods/README: -------------------------------------------------------------------------------- 1 | This Makefile requires devkitARM (http://www.devkitpro.org/category/devkitarm/) and works inside "contrib/nds". It is based on a devkitARM template. 2 | 3 | Eduardo Costa 4 | January 3, 2009 5 | 6 | -------------------------------------------------------------------------------- /examples/zlibwrap/zlib/old/README: -------------------------------------------------------------------------------- 1 | This directory contains files that have not been updated for zlib 1.2.x 2 | 3 | (Volunteers are encouraged to help clean this up. Thanks.) 4 | -------------------------------------------------------------------------------- /examples/zlibwrap/zlib/old/os2/zlib.def: -------------------------------------------------------------------------------- 1 | ; 2 | ; Slightly modified version of ../nt/zlib.dnt :-) 3 | ; 4 | 5 | LIBRARY Z 6 | DESCRIPTION "Zlib compression library for OS/2" 7 | CODE PRELOAD MOVEABLE DISCARDABLE 8 | DATA PRELOAD MOVEABLE MULTIPLE 9 | 10 | EXPORTS 11 | adler32 12 | compress 13 | crc32 14 | deflate 15 | deflateCopy 16 | deflateEnd 17 | deflateInit2_ 18 | deflateInit_ 19 | deflateParams 20 | deflateReset 21 | deflateSetDictionary 22 | gzclose 23 | gzdopen 24 | gzerror 25 | gzflush 26 | gzopen 27 | gzread 28 | gzwrite 29 | inflate 30 | inflateEnd 31 | inflateInit2_ 32 | inflateInit_ 33 | inflateReset 34 | inflateSetDictionary 35 | inflateSync 36 | uncompress 37 | zlibVersion 38 | gzprintf 39 | gzputc 40 | gzgetc 41 | gzseek 42 | gzrewind 43 | gztell 44 | gzeof 45 | gzsetparams 46 | zError 47 | inflateSyncPoint 48 | get_crc_table 49 | compress2 50 | gzputs 51 | gzgets 52 | -------------------------------------------------------------------------------- /examples/zlibwrap/zlib/win32/VisualC.txt: -------------------------------------------------------------------------------- 1 | 2 | To build zlib using the Microsoft Visual C++ environment, 3 | use the appropriate project from the projects/ directory. 4 | -------------------------------------------------------------------------------- /examples/zlibwrap/zlib/zlib.3.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andreas-kupries/critcl/a10f9ed4bca596cbb29a9d898d8111613c324479/examples/zlibwrap/zlib/zlib.3.pdf -------------------------------------------------------------------------------- /examples/zlibwrap/zlib/zlib.pc.in: -------------------------------------------------------------------------------- 1 | prefix=@prefix@ 2 | exec_prefix=@exec_prefix@ 3 | libdir=@libdir@ 4 | sharedlibdir=@sharedlibdir@ 5 | includedir=@includedir@ 6 | 7 | Name: zlib 8 | Description: zlib compression library 9 | Version: @VERSION@ 10 | 11 | Requires: 12 | Libs: -L${libdir} -L${sharedlibdir} -lz 13 | Cflags: -I${includedir} 14 | -------------------------------------------------------------------------------- /lib/app-critcl/pkgIndex.tcl: -------------------------------------------------------------------------------- 1 | if {![package vsatisfies [package provide Tcl] 8.6 9]} {return} 2 | package ifneeded critcl::app 3.3.1 [list source [file join $dir critcl.tcl]] 3 | -------------------------------------------------------------------------------- /lib/app-critcl/tea/tclconfig/README.txt: -------------------------------------------------------------------------------- 1 | These files comprise the basic building blocks for a Tcl Extension 2 | Architecture (TEA) extension. For more information on TEA see: 3 | 4 | http://www.tcl.tk/doc/tea/ 5 | 6 | This package is part of the Tcl project at SourceForge, but sources 7 | and bug/patch database are hosted on fossil here: 8 | 9 | https://core.tcl-lang.org/tclconfig 10 | 11 | This package is a freely available open source package. You can do 12 | virtually anything you like with it, such as modifying it, redistributing 13 | it, and selling it either in whole or in part. 14 | 15 | CONTENTS 16 | ======== 17 | The following is a short description of the files you will find in 18 | the sample extension. 19 | 20 | README.txt This file 21 | 22 | install-sh Program used for copying binaries and script files 23 | to their install locations. 24 | 25 | tcl.m4 Collection of Tcl autoconf macros. Included by a package's 26 | aclocal.m4 to define TEA_* macros. 27 | -------------------------------------------------------------------------------- /lib/critcl-bitmap/pkgIndex.tcl: -------------------------------------------------------------------------------- 1 | if {![package vsatisfies [package provide Tcl] 8.6 9]} {return} 2 | package ifneeded critcl::bitmap 1.1.1 [list source [file join $dir bitmap.tcl]] 3 | -------------------------------------------------------------------------------- /lib/critcl-callback/c/callback.h: -------------------------------------------------------------------------------- 1 | #ifndef CRITCL_CALLBACK_H 2 | #define CRITCL_CALLBACK_H 3 | 4 | /* 5 | * critcl callback class - declarations 6 | * 7 | * Opaque instance information and Tcl 8/9 compatibility layer. 8 | */ 9 | 10 | #include /* tcl.h + Portability Tcl <=8.6 */ 11 | 12 | typedef struct critcl_callback* critcl_callback_p; 13 | 14 | #endif 15 | 16 | /* 17 | * Local Variables: 18 | * mode: c 19 | * c-basic-offset: 4 20 | * fill-column: 78 21 | * End: 22 | */ 23 | -------------------------------------------------------------------------------- /lib/critcl-callback/c/callback_int.h: -------------------------------------------------------------------------------- 1 | #ifndef CRITCL_CALLBACK_INT_H 2 | #define CRITCL_CALLBACK_INT_H 3 | /* 4 | * critcl callback class - internal declarations 5 | * 6 | * Instance information. 7 | */ 8 | 9 | #include 10 | 11 | typedef struct critcl_callback { 12 | 13 | Tcl_Size nfixed; // Number of elements in the command prefix 14 | Tcl_Size nargs; // Number of elements to reserve for the command arguments 15 | Tcl_Obj** command; // Array for the command elements, prefix and arguments 16 | Tcl_Interp* interp; // The Tcl interpreter to run the command in 17 | 18 | } critcl_callback; 19 | 20 | #endif 21 | 22 | /* 23 | * Local Variables: 24 | * mode: c 25 | * c-basic-offset: 4 26 | * fill-column: 78 27 | * End: 28 | */ 29 | -------------------------------------------------------------------------------- /lib/critcl-class/pkgIndex.tcl: -------------------------------------------------------------------------------- 1 | if {![package vsatisfies [package provide Tcl] 8.6 9]} {return} 2 | package ifneeded critcl::class 1.2.1 [list source [file join $dir class.tcl]] 3 | -------------------------------------------------------------------------------- /lib/critcl-cutil/pkgIndex.tcl: -------------------------------------------------------------------------------- 1 | if {![package vsatisfies [package provide Tcl] 8.6 9]} {return} 2 | package ifneeded critcl::cutil 0.5 [list source [file join $dir cutil.tcl]] 3 | -------------------------------------------------------------------------------- /lib/critcl-emap/pkgIndex.tcl: -------------------------------------------------------------------------------- 1 | if {![package vsatisfies [package provide Tcl] 8.6 9]} {return} 2 | package ifneeded critcl::emap 1.3.1 [list source [file join $dir emap.tcl]] 3 | -------------------------------------------------------------------------------- /lib/critcl-enum/pkgIndex.tcl: -------------------------------------------------------------------------------- 1 | if {![package vsatisfies [package provide Tcl] 8.6 9]} {return} 2 | package ifneeded critcl::enum 1.2.1 [list source [file join $dir enum.tcl]] 3 | -------------------------------------------------------------------------------- /lib/critcl-iassoc/pkgIndex.tcl: -------------------------------------------------------------------------------- 1 | if {![package vsatisfies [package provide Tcl] 8.6 9]} {return} 2 | package ifneeded critcl::iassoc 1.2.1 [list source [file join $dir iassoc.tcl]] 3 | -------------------------------------------------------------------------------- /lib/critcl-literals/pkgIndex.tcl: -------------------------------------------------------------------------------- 1 | if {![package vsatisfies [package provide Tcl] 8.6 9]} {return} 2 | package ifneeded critcl::literals 1.4.1 [list source [file join $dir literals.tcl]] 3 | -------------------------------------------------------------------------------- /lib/critcl-platform/pkgIndex.tcl: -------------------------------------------------------------------------------- 1 | if {![package vsatisfies [package provide Tcl] 8.6 9]} {return} 2 | package ifneeded critcl::platform 1.1.1 [list source [file join $dir platform.tcl]] 3 | -------------------------------------------------------------------------------- /lib/critcl-util/pkgIndex.tcl: -------------------------------------------------------------------------------- 1 | if {![package vsatisfies [package provide Tcl] 8.6 9]} {return} 2 | package ifneeded critcl::util 1.2.1 [list source [file join $dir util.tcl]] 3 | -------------------------------------------------------------------------------- /lib/critcl/critcl_c/cdata.c: -------------------------------------------------------------------------------- 1 | static char script\[$count] = { 2 | $inittext 3 | }; 4 | Tcl_SetByteArrayObj(Tcl_GetObjResult(ip), (unsigned char*) script, $count); 5 | return TCL_OK; 6 | -------------------------------------------------------------------------------- /lib/critcl/critcl_c/header.c: -------------------------------------------------------------------------------- 1 | /* Generated by critcl on [clock format [clock seconds]] 2 | * source: $file 3 | * binary: $libfile 4 | */ 5 | $api 6 | #include "tclpre9compat.h" /* tcl.h + Portability Tcl <=8.6 */ 7 | -------------------------------------------------------------------------------- /lib/critcl/critcl_c/pkginit.c: -------------------------------------------------------------------------------- 1 | 2 | #ifdef __cplusplus 3 | extern "C" { 4 | #endif 5 | ${ext} 6 | DLLEXPORT int 7 | ${ininame}_Init(Tcl_Interp *interp) 8 | { 9 | #define ip interp 10 | #if USE_TCL_STUBS 11 | if (!MyInitTclStubs(interp)) return TCL_ERROR; 12 | #endif 13 | -------------------------------------------------------------------------------- /lib/critcl/critcl_c/pkginitend.c: -------------------------------------------------------------------------------- 1 | return TCL_OK; 2 | #undef ip 3 | } 4 | #ifdef __cplusplus 5 | } 6 | #endif 7 | -------------------------------------------------------------------------------- /lib/critcl/critcl_c/pkginittk.c: -------------------------------------------------------------------------------- 1 | 2 | # line 1 "MyInitTkStubs" 3 | #if USE_TK_STUBS 4 | if (!MyInitTkStubs(interp)) return TCL_ERROR; 5 | #endif 6 | -------------------------------------------------------------------------------- /lib/critcl/critcl_c/stubs_e.c: -------------------------------------------------------------------------------- 1 | 2 | #line 1 "MyInitTclStubs" 3 | 4 | #if USE_TCL_STUBS 5 | static int 6 | MyInitTclStubs (Tcl_Interp *ip) 7 | { 8 | return 1; 9 | } 10 | #endif 11 | -------------------------------------------------------------------------------- /lib/critcl/critcl_c/tkstubs.c: -------------------------------------------------------------------------------- 1 | 2 | #if USE_TK_STUBS 3 | 4 | const TkStubs *tkStubsPtr; 5 | const struct TkPlatStubs *tkPlatStubsPtr; 6 | const struct TkIntStubs *tkIntStubsPtr; 7 | const struct TkIntPlatStubs *tkIntPlatStubsPtr; 8 | const struct TkIntXlibStubs *tkIntXlibStubsPtr; 9 | 10 | static int 11 | MyInitTkStubs (Tcl_Interp *ip) 12 | { 13 | if (Tcl_PkgRequireEx(ip, "Tk", "8.1", 0, (ClientData*) &tkStubsPtr) == NULL) return 0; 14 | if (tkStubsPtr == NULL || tkStubsPtr->hooks == NULL) { 15 | Tcl_SetResult(ip, "This extension requires Tk stubs-support.", TCL_STATIC); 16 | return 0; 17 | } 18 | tkPlatStubsPtr = tkStubsPtr->hooks->tkPlatStubs; 19 | tkIntStubsPtr = tkStubsPtr->hooks->tkIntStubs; 20 | tkIntPlatStubsPtr = tkStubsPtr->hooks->tkIntPlatStubs; 21 | tkIntXlibStubsPtr = tkStubsPtr->hooks->tkIntXlibStubs; 22 | return 1; 23 | } 24 | #endif 25 | -------------------------------------------------------------------------------- /lib/critcl/critcl_c/tkstubs_noconst.c: -------------------------------------------------------------------------------- 1 | 2 | #if USE_TK_STUBS 3 | /* Pre 8.6 two of the variables are not declared const. 4 | * Prevent mismatch with tkDecls.h 5 | */ 6 | 7 | TkStubs *tkStubsPtr; 8 | const struct TkPlatStubs *tkPlatStubsPtr; 9 | const struct TkIntStubs *tkIntStubsPtr; 10 | const struct TkIntPlatStubs *tkIntPlatStubsPtr; 11 | struct TkIntXlibStubs *tkIntXlibStubsPtr; 12 | 13 | static int 14 | MyInitTkStubs (Tcl_Interp *ip) 15 | { 16 | if (Tcl_PkgRequireEx(ip, "Tk", "8.1", 0, (ClientData*) &tkStubsPtr) == NULL) return 0; 17 | if (tkStubsPtr == NULL || tkStubsPtr->hooks == NULL) { 18 | Tcl_SetResult(ip, "This extension requires Tk stubs-support.", TCL_STATIC); 19 | return 0; 20 | } 21 | tkPlatStubsPtr = tkStubsPtr->hooks->tkPlatStubs; 22 | tkIntStubsPtr = tkStubsPtr->hooks->tkIntStubs; 23 | tkIntPlatStubsPtr = tkStubsPtr->hooks->tkIntPlatStubs; 24 | tkIntXlibStubsPtr = tkStubsPtr->hooks->tkIntXlibStubs; 25 | return 1; 26 | } 27 | #endif 28 | -------------------------------------------------------------------------------- /lib/critcl/pkgIndex.tcl: -------------------------------------------------------------------------------- 1 | if {![package vsatisfies [package provide Tcl] 8.6 9]} {return} 2 | package ifneeded critcl 3.3.1 [list source [file join $dir critcl.tcl]] 3 | -------------------------------------------------------------------------------- /lib/critclf/Config: -------------------------------------------------------------------------------- 1 | # Fortran-specific flags 2 | # 3 | fcompile g95 -c 4 | fversion g95 -v 5 | flink g95 -shared 6 | finclude -I 7 | foutput -o $outfile 8 | foptimize -O2 9 | fextra_cflags -DFTN_UNDERSCORE -D__unix 10 | -------------------------------------------------------------------------------- /lib/critclf/idx_wrap.tcl: -------------------------------------------------------------------------------- 1 | # Package index file for PKGNAME 2 | # 3 | if { [package vsatisfies [package provide Tcl] 8.2]} {return} 4 | package ifneeded PKGNAME 1.0 [list load [file join $dir PKGNAME.dll]] 5 | 6 | # Note: add support for other platforms! 7 | -------------------------------------------------------------------------------- /lib/critclf/pkgIndex.tcl: -------------------------------------------------------------------------------- 1 | if {![package vsatisfies [package provide Tcl] 8.6 9]} {return} 2 | package ifneeded critclf 0.3 [list source [file join $dir critclf.tcl]] 3 | package ifneeded wrapfort 0.3 [list source [file join $dir wrapfort.tcl]] 4 | -------------------------------------------------------------------------------- /lib/critclf/wrapfort_libf.f90: -------------------------------------------------------------------------------- 1 | ! wrapfort_libf.f90 2 | ! Auxiliary Fortran routines for Wrapfort 3 | ! 4 | 5 | ! fort_set_logical -- 6 | ! Set a logical value (from C to Fortran) 7 | ! 8 | ! Arguments: 9 | ! var Variable to be set 10 | ! clog Set to true (if /= 0), to false (if 0) 11 | ! 12 | subroutine fort_set_logical( var, clog ) 13 | logical :: var 14 | integer :: clog 15 | 16 | var = clog .ne. 0 17 | end subroutine fort_set_logical 18 | 19 | ! fort_get_logical -- 20 | ! Get a logical value (from Fortran to C) 21 | ! 22 | ! Arguments: 23 | ! var Variable to be set 24 | ! log Set to 1 (if true), to 0 (if false) 25 | ! 26 | subroutine fort_get_logical( var, flog ) 27 | integer :: var 28 | logical :: flog 29 | 30 | var = merge(1,0,flog) 31 | end subroutine fort_get_logical 32 | -------------------------------------------------------------------------------- /lib/md5/pkgIndex.tcl: -------------------------------------------------------------------------------- 1 | if {![package vsatisfies [package provide Tcl] 8.6 9]} {return} 2 | package ifneeded md5 1.5 [list source [file join $dir md5.tcl]] 3 | -------------------------------------------------------------------------------- /lib/stubs_container/pkgIndex.tcl: -------------------------------------------------------------------------------- 1 | if {![package vsatisfies [package provide Tcl] 8.6 9]} {return} 2 | #checker -scope global exclude warnUndefinedVar 3 | package ifneeded stubs::container 1.1.1 [list source [file join $dir container.tcl]] 4 | -------------------------------------------------------------------------------- /lib/stubs_gen_decl/pkgIndex.tcl: -------------------------------------------------------------------------------- 1 | if {![package vsatisfies [package provide Tcl] 8.6 9]} {return} 2 | #checker -scope global exclude warnUndefinedVar 3 | package ifneeded stubs::gen::decl 1.1.1 [list source [file join $dir gen_decl.tcl]] 4 | -------------------------------------------------------------------------------- /lib/stubs_gen_header/pkgIndex.tcl: -------------------------------------------------------------------------------- 1 | if {![package vsatisfies [package provide Tcl] 8.6 9]} {return} 2 | #checker -scope global exclude warnUndefinedVar 3 | package ifneeded stubs::gen::header 1.1.1 [list source [file join $dir gen_header.tcl]] 4 | -------------------------------------------------------------------------------- /lib/stubs_gen_init/pkgIndex.tcl: -------------------------------------------------------------------------------- 1 | if {![package vsatisfies [package provide Tcl] 8.6 9]} {return} 2 | #checker -scope global exclude warnUndefinedVar 3 | package ifneeded stubs::gen::init 1.1.1 [list source [file join $dir gen_init.tcl]] 4 | -------------------------------------------------------------------------------- /lib/stubs_gen_lib/pkgIndex.tcl: -------------------------------------------------------------------------------- 1 | if {![package vsatisfies [package provide Tcl] 8.6 9]} {return} 2 | #checker -scope global exclude warnUndefinedVar 3 | package ifneeded stubs::gen::lib 1.1.1 [list source [file join $dir gen_lib.tcl]] 4 | -------------------------------------------------------------------------------- /lib/stubs_gen_macro/pkgIndex.tcl: -------------------------------------------------------------------------------- 1 | if {![package vsatisfies [package provide Tcl] 8.6 9]} {return} 2 | #checker -scope global exclude warnUndefinedVar 3 | package ifneeded stubs::gen::macro 1.1.1 [list source [file join $dir gen_macro.tcl]] 4 | -------------------------------------------------------------------------------- /lib/stubs_gen_slot/pkgIndex.tcl: -------------------------------------------------------------------------------- 1 | if {![package vsatisfies [package provide Tcl] 8.6 9]} {return} 2 | #checker -scope global exclude warnUndefinedVar 3 | package ifneeded stubs::gen::slot 1.1.1 [list source [file join $dir gen_slot.tcl]] 4 | -------------------------------------------------------------------------------- /lib/stubs_genframe/pkgIndex.tcl: -------------------------------------------------------------------------------- 1 | if {![package vsatisfies [package provide Tcl] 8.6 9]} {return} 2 | #checker -scope global exclude warnUndefinedVar 3 | package ifneeded stubs::gen 1.1.1 [list source [file join $dir genframe.tcl]] 4 | -------------------------------------------------------------------------------- /lib/stubs_reader/pkgIndex.tcl: -------------------------------------------------------------------------------- 1 | if {![package vsatisfies [package provide Tcl] 8.6 9]} {return} 2 | #checker -scope global exclude warnUndefinedVar 3 | package ifneeded stubs::reader 1.1.1 [list source [file join $dir reader.tcl]] 4 | -------------------------------------------------------------------------------- /lib/stubs_writer/pkgIndex.tcl: -------------------------------------------------------------------------------- 1 | if {![package vsatisfies [package provide Tcl] 8.6 9]} {return} 2 | #checker -scope global exclude warnUndefinedVar 3 | package ifneeded stubs::writer 1.1.1 [list source [file join $dir writer.tcl]] 4 | -------------------------------------------------------------------------------- /main.tcl: -------------------------------------------------------------------------------- 1 | if {![catch { 2 | # Kit related main: 3 | package require starkit 4 | }]} { 5 | if {[starkit::startup] == "sourced"} return 6 | } else { 7 | # Direct invoke without kit (sourced/debug/dev-edition), assume 8 | # relative location of the required packages: 9 | lappend ::auto_path [file join [file dirname [info script]] lib] 10 | } 11 | package require critcl::app 3 12 | #puts [package ifneeded critcl [package require critcl::app 3]] 13 | critcl::app::main $argv 14 | -------------------------------------------------------------------------------- /sdemo.tcl: -------------------------------------------------------------------------------- 1 | set dir [file dirname [file normalize [info script]]] 2 | source pkgIndex.tcl 3 | 4 | package require stubs::container 5 | package require stubs::gen 6 | package require stubs::gen::decl 7 | package require stubs::gen::header 8 | package require stubs::gen::init 9 | package require stubs::gen::macro 10 | package require stubs::gen::slot 11 | package require stubs::gen::stubs 12 | package require stubs::reader 13 | 14 | stubs::container::new C 15 | stubs::reader::file C [lindex $argv 0] 16 | 17 | interp alias {} CI {} stubs::container::interfaces C 18 | #interp alias {} G {} stubs::gen::decl 19 | #interp alias {} G {} stubs::gen::init 20 | #interp alias {} G {} stubs::gen::macro 21 | #interp alias {} G {} stubs::gen::slot 22 | #interp alias {} G {} stubs::gen::header 23 | interp alias {} G {} stubs::gen::stubs 24 | 25 | puts [G::gen C] 26 | foreach i [CI] { puts [G::gen C $i] } 27 | exit 28 | -------------------------------------------------------------------------------- /test/assets/ccommand-trace/2.0: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------- */ 2 | 3 | #define ns__command0 "::command" 4 | static int 5 | tcl__command0_actual(ClientData clientdata, Tcl_Interp *interp, Tcl_Size objc, Tcl_Obj *CONST objv[]) 6 | { 7 | return TCL_OK; 8 | } 9 | 10 | static int 11 | tcl__command0(ClientData clientdata, Tcl_Interp *interp, Tcl_Size objc, Tcl_Obj *CONST objv[]) 12 | { 13 | int _rv; 14 | critcl_trace_cmd_args (ns__command0, objc, objv); 15 | _rv = tcl__command0_actual (clientdata, interp, objc, objv); 16 | return critcl_trace_cmd_result (_rv, interp); 17 | } 18 | -------------------------------------------------------------------------------- /test/assets/ccommand-trace/2.1: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------- */ 2 | 3 | #define ns__command0 "::command" 4 | static int 5 | tcl__command0_actual(ClientData CD, Tcl_Interp *IP, Tcl_Size OC, Tcl_Obj *CONST OV[]) 6 | { 7 | return TCL_OK; 8 | } 9 | 10 | static int 11 | tcl__command0(ClientData CD, Tcl_Interp *IP, Tcl_Size OC, Tcl_Obj *CONST OV[]) 12 | { 13 | int _rv; 14 | critcl_trace_cmd_args (ns__command0, OC, OV); 15 | _rv = tcl__command0_actual (CD, IP, OC, OV); 16 | return critcl_trace_cmd_result (_rv, IP); 17 | } 18 | -------------------------------------------------------------------------------- /test/assets/ccommand-trace/2.2: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------- */ 2 | 3 | static int 4 | snafu_actual(ClientData clientdata, Tcl_Interp *interp, Tcl_Size objc, Tcl_Obj *CONST objv[]) 5 | { 6 | return TCL_OK; 7 | } 8 | 9 | static int 10 | snafu(ClientData clientdata, Tcl_Interp *interp, Tcl_Size objc, Tcl_Obj *CONST objv[]) 11 | { 12 | int _rv; 13 | critcl_trace_cmd_args ("snafu", objc, objv); 14 | _rv = snafu_actual (clientdata, interp, objc, objv); 15 | return critcl_trace_cmd_result (_rv, interp); 16 | } 17 | -------------------------------------------------------------------------------- /test/assets/ccommand-trace/2.3: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------- */ 2 | 3 | #define ns__the_command_max0 "::the::command+max" 4 | static int 5 | tcl__the_command_max0_actual(ClientData clientdata, Tcl_Interp *interp, Tcl_Size objc, Tcl_Obj *CONST objv[]) 6 | { 7 | return TCL_OK; 8 | } 9 | 10 | static int 11 | tcl__the_command_max0(ClientData clientdata, Tcl_Interp *interp, Tcl_Size objc, Tcl_Obj *CONST objv[]) 12 | { 13 | int _rv; 14 | critcl_trace_cmd_args (ns__the_command_max0, objc, objv); 15 | _rv = tcl__the_command_max0_actual (clientdata, interp, objc, objv); 16 | return critcl_trace_cmd_result (_rv, interp); 17 | } 18 | -------------------------------------------------------------------------------- /test/assets/ccommand-trace/2.4: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------- */ 2 | 3 | #define ns__command0 "::command" 4 | static int 5 | tcl__command0_actual(ClientData clientdata, Tcl_Interp *interp, Tcl_Size objc, Tcl_Obj *CONST objv[]) 6 | { 7 | return TCL_OK; 8 | } 9 | 10 | static int 11 | tcl__command0(ClientData clientdata, Tcl_Interp *interp, Tcl_Size objc, Tcl_Obj *CONST objv[]) 12 | { 13 | int _rv; 14 | critcl_trace_cmd_args (ns__command0, objc, objv); 15 | _rv = tcl__command0_actual (clientdata, interp, objc, objv); 16 | return critcl_trace_cmd_result (_rv, interp); 17 | } 18 | -------------------------------------------------------------------------------- /test/assets/ccommand-trace/2.5: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------- */ 2 | 3 | #define ns__command0 "::command" 4 | static int 5 | tcl__command0_actual(ClientData clientdata, Tcl_Interp *interp, Tcl_Size objc, Tcl_Obj *CONST objv[]) 6 | { 7 | return TCL_OK; 8 | } 9 | 10 | static int 11 | tcl__command0(ClientData clientdata, Tcl_Interp *interp, Tcl_Size objc, Tcl_Obj *CONST objv[]) 12 | { 13 | int _rv; 14 | critcl_trace_cmd_args (ns__command0, objc, objv); 15 | _rv = tcl__command0_actual (clientdata, interp, objc, objv); 16 | return critcl_trace_cmd_result (_rv, interp); 17 | } 18 | -------------------------------------------------------------------------------- /test/assets/ccommand-trace/3.0: -------------------------------------------------------------------------------- 1 | *#define ns__command0 "::command" 2 | static int 3 | tcl__command0_actual(ClientData clientdata, Tcl_Interp *interp, Tcl_Size objc, Tcl_Obj *CONST objv\[\]) 4 | { 5 | return TCL_OK; 6 | } 7 | 8 | static int 9 | tcl__command0(ClientData clientdata, Tcl_Interp *interp, Tcl_Size objc, Tcl_Obj *CONST objv\[\]) 10 | { 11 | int _rv; 12 | critcl_trace_cmd_args (ns__command0, objc, objv); 13 | _rv = tcl__command0_actual (clientdata, interp, objc, objv); 14 | return critcl_trace_cmd_result (_rv, interp); 15 | } 16 | * 17 | Fake_Init* 18 | *Tcl_CreateObjCommand2(interp, ns__command0, tcl__command0, NULL, NULL); 19 | * 20 | -------------------------------------------------------------------------------- /test/assets/ccommand-trace/3.4: -------------------------------------------------------------------------------- 1 | *#define ns__command0 "::command" 2 | static int 3 | tcl__command0_actual(ClientData clientdata, Tcl_Interp *interp, Tcl_Size objc, Tcl_Obj *CONST objv\[\]) 4 | { 5 | return TCL_OK; 6 | } 7 | 8 | static int 9 | tcl__command0(ClientData clientdata, Tcl_Interp *interp, Tcl_Size objc, Tcl_Obj *CONST objv\[\]) 10 | { 11 | int _rv; 12 | critcl_trace_cmd_args (ns__command0, objc, objv); 13 | _rv = tcl__command0_actual (clientdata, interp, objc, objv); 14 | return critcl_trace_cmd_result (_rv, interp); 15 | } 16 | * 17 | Fake_Init* 18 | *Tcl_CreateObjCommand2(interp, ns__command0, tcl__command0, NULL, DELE); 19 | * 20 | -------------------------------------------------------------------------------- /test/assets/ccommand-trace/3.5: -------------------------------------------------------------------------------- 1 | *#define ns__command0 "::command" 2 | static int 3 | tcl__command0_actual(ClientData clientdata, Tcl_Interp *interp, Tcl_Size objc, Tcl_Obj *CONST objv\[\]) 4 | { 5 | return TCL_OK; 6 | } 7 | 8 | static int 9 | tcl__command0(ClientData clientdata, Tcl_Interp *interp, Tcl_Size objc, Tcl_Obj *CONST objv\[\]) 10 | { 11 | int _rv; 12 | critcl_trace_cmd_args (ns__command0, objc, objv); 13 | _rv = tcl__command0_actual (clientdata, interp, objc, objv); 14 | return critcl_trace_cmd_result (_rv, interp); 15 | } 16 | * 17 | Fake_Init* 18 | *Tcl_CreateObjCommand2(interp, ns__command0, tcl__command0, ABC, NULL); 19 | * 20 | -------------------------------------------------------------------------------- /test/assets/ccommand/2.0: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------- */ 2 | 3 | #define ns__command0 "::command" 4 | static int 5 | tcl__command0(ClientData clientdata, Tcl_Interp *interp, Tcl_Size objc, Tcl_Obj *CONST objv[]) 6 | { 7 | return TCL_OK; 8 | } 9 | -------------------------------------------------------------------------------- /test/assets/ccommand/2.1: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------- */ 2 | 3 | #define ns__command0 "::command" 4 | static int 5 | tcl__command0(ClientData CD, Tcl_Interp *IP, Tcl_Size OC, Tcl_Obj *CONST OV[]) 6 | { 7 | return TCL_OK; 8 | } 9 | -------------------------------------------------------------------------------- /test/assets/ccommand/2.2: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------- */ 2 | 3 | static int 4 | snafu(ClientData clientdata, Tcl_Interp *interp, Tcl_Size objc, Tcl_Obj *CONST objv[]) 5 | { 6 | return TCL_OK; 7 | } 8 | -------------------------------------------------------------------------------- /test/assets/ccommand/2.3: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------- */ 2 | 3 | #define ns__the_command_max0 "::the::command+max" 4 | static int 5 | tcl__the_command_max0(ClientData clientdata, Tcl_Interp *interp, Tcl_Size objc, Tcl_Obj *CONST objv[]) 6 | { 7 | return TCL_OK; 8 | } 9 | -------------------------------------------------------------------------------- /test/assets/ccommand/3.0: -------------------------------------------------------------------------------- 1 | *#define ns__command0 "::command" 2 | static int 3 | tcl__command0(ClientData clientdata, Tcl_Interp *interp, Tcl_Size objc, Tcl_Obj *CONST objv\[\]) 4 | { 5 | return TCL_OK; 6 | } 7 | * 8 | Fake_Init* 9 | *Tcl_CreateObjCommand2(interp, ns__command0, tcl__command0, NULL, NULL); 10 | * 11 | -------------------------------------------------------------------------------- /test/assets/ccommand/3.4: -------------------------------------------------------------------------------- 1 | *#define ns__command0 "::command" 2 | static int 3 | tcl__command0(ClientData clientdata, Tcl_Interp *interp, Tcl_Size objc, Tcl_Obj *CONST objv\[\]) 4 | { 5 | return TCL_OK; 6 | } 7 | * 8 | Fake_Init* 9 | *Tcl_CreateObjCommand2(interp, ns__command0, tcl__command0, NULL, DELE); 10 | * 11 | -------------------------------------------------------------------------------- /test/assets/ccommand/3.5: -------------------------------------------------------------------------------- 1 | *#define ns__command0 "::command" 2 | static int 3 | tcl__command0(ClientData clientdata, Tcl_Interp *interp, Tcl_Size objc, Tcl_Obj *CONST objv\[\]) 4 | { 5 | return TCL_OK; 6 | } 7 | * 8 | Fake_Init* 9 | *Tcl_CreateObjCommand2(interp, ns__command0, tcl__command0, ABC, NULL); 10 | * 11 | -------------------------------------------------------------------------------- /test/assets/cconst-trace/2.0: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------- */ 2 | 3 | #define ns__alpha0 "::alpha" 4 | 5 | static int 6 | tcl__alpha0(ClientData cd, Tcl_Interp *interp, Tcl_Size oc, Tcl_Obj *CONST ov[]) 7 | { 8 | int rv; 9 | critcl_trace_cmd_args (ns__alpha0, oc, ov); 10 | 11 | if (oc != 1) { 12 | Tcl_WrongNumArgs(interp, 1, ov, NULL); 13 | return critcl_trace_cmd_result (TCL_ERROR, interp); 14 | } 15 | 16 | /* Const - - -- --- ----- -------- */ 17 | rv = 1; 18 | 19 | /* (bool return) - - -- --- ----- -------- */ 20 | Tcl_SetObjResult(interp, Tcl_NewIntObj(rv)); 21 | return critcl_trace_cmd_result (TCL_OK, interp); 22 | } 23 | -------------------------------------------------------------------------------- /test/assets/cconst-trace/2.1: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------- */ 2 | 3 | #define ns__alpha0 "::alpha" 4 | 5 | static int 6 | tcl__alpha0(ClientData cd, Tcl_Interp *interp, Tcl_Size oc, Tcl_Obj *CONST ov[]) 7 | { 8 | int rv; 9 | critcl_trace_cmd_args (ns__alpha0, oc, ov); 10 | 11 | if (oc != 1) { 12 | Tcl_WrongNumArgs(interp, 1, ov, NULL); 13 | return critcl_trace_cmd_result (TCL_ERROR, interp); 14 | } 15 | 16 | /* Const - - -- --- ----- -------- */ 17 | rv = FOO; 18 | 19 | /* (bool return) - - -- --- ----- -------- */ 20 | Tcl_SetObjResult(interp, Tcl_NewIntObj(rv)); 21 | return critcl_trace_cmd_result (TCL_OK, interp); 22 | } 23 | -------------------------------------------------------------------------------- /test/assets/cconst-trace/2.2: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------- */ 2 | 3 | #define ns__alpha0 "::alpha" 4 | 5 | static int 6 | tcl__alpha0(ClientData cd, Tcl_Interp *interp, Tcl_Size oc, Tcl_Obj *CONST ov[]) 7 | { 8 | int rv; 9 | critcl_trace_cmd_args (ns__alpha0, oc, ov); 10 | 11 | if (oc != 1) { 12 | Tcl_WrongNumArgs(interp, 1, ov, NULL); 13 | return critcl_trace_cmd_result (TCL_ERROR, interp); 14 | } 15 | 16 | /* Const - - -- --- ----- -------- */ 17 | rv = foo(); 18 | 19 | /* (bool return) - - -- --- ----- -------- */ 20 | Tcl_SetObjResult(interp, Tcl_NewIntObj(rv)); 21 | return critcl_trace_cmd_result (TCL_OK, interp); 22 | } 23 | -------------------------------------------------------------------------------- /test/assets/cconst-trace/2.3: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------- */ 2 | 3 | #define ns__the_alpha0 "::the::alpha" 4 | 5 | static int 6 | tcl__the_alpha0(ClientData cd, Tcl_Interp *interp, Tcl_Size oc, Tcl_Obj *CONST ov[]) 7 | { 8 | int rv; 9 | critcl_trace_cmd_args (ns__the_alpha0, oc, ov); 10 | 11 | if (oc != 1) { 12 | Tcl_WrongNumArgs(interp, 1, ov, NULL); 13 | return critcl_trace_cmd_result (TCL_ERROR, interp); 14 | } 15 | 16 | /* Const - - -- --- ----- -------- */ 17 | rv = 0; 18 | 19 | /* (bool return) - - -- --- ----- -------- */ 20 | Tcl_SetObjResult(interp, Tcl_NewIntObj(rv)); 21 | return critcl_trace_cmd_result (TCL_OK, interp); 22 | } 23 | -------------------------------------------------------------------------------- /test/assets/cconst/2.0: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------- */ 2 | 3 | #define ns__alpha0 "::alpha" 4 | 5 | static int 6 | tcl__alpha0(ClientData cd, Tcl_Interp *interp, Tcl_Size oc, Tcl_Obj *CONST ov[]) 7 | { 8 | int rv; 9 | if (oc != 1) { 10 | Tcl_WrongNumArgs(interp, 1, ov, NULL); 11 | return TCL_ERROR; 12 | } 13 | 14 | /* Const - - -- --- ----- -------- */ 15 | rv = 1; 16 | 17 | /* (bool return) - - -- --- ----- -------- */ 18 | Tcl_SetObjResult(interp, Tcl_NewIntObj(rv)); 19 | return TCL_OK; 20 | } 21 | -------------------------------------------------------------------------------- /test/assets/cconst/2.1: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------- */ 2 | 3 | #define ns__alpha0 "::alpha" 4 | 5 | static int 6 | tcl__alpha0(ClientData cd, Tcl_Interp *interp, Tcl_Size oc, Tcl_Obj *CONST ov[]) 7 | { 8 | int rv; 9 | if (oc != 1) { 10 | Tcl_WrongNumArgs(interp, 1, ov, NULL); 11 | return TCL_ERROR; 12 | } 13 | 14 | /* Const - - -- --- ----- -------- */ 15 | rv = FOO; 16 | 17 | /* (bool return) - - -- --- ----- -------- */ 18 | Tcl_SetObjResult(interp, Tcl_NewIntObj(rv)); 19 | return TCL_OK; 20 | } 21 | -------------------------------------------------------------------------------- /test/assets/cconst/2.2: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------- */ 2 | 3 | #define ns__alpha0 "::alpha" 4 | 5 | static int 6 | tcl__alpha0(ClientData cd, Tcl_Interp *interp, Tcl_Size oc, Tcl_Obj *CONST ov[]) 7 | { 8 | int rv; 9 | if (oc != 1) { 10 | Tcl_WrongNumArgs(interp, 1, ov, NULL); 11 | return TCL_ERROR; 12 | } 13 | 14 | /* Const - - -- --- ----- -------- */ 15 | rv = foo(); 16 | 17 | /* (bool return) - - -- --- ----- -------- */ 18 | Tcl_SetObjResult(interp, Tcl_NewIntObj(rv)); 19 | return TCL_OK; 20 | } 21 | -------------------------------------------------------------------------------- /test/assets/cconst/2.3: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------- */ 2 | 3 | #define ns__the_alpha0 "::the::alpha" 4 | 5 | static int 6 | tcl__the_alpha0(ClientData cd, Tcl_Interp *interp, Tcl_Size oc, Tcl_Obj *CONST ov[]) 7 | { 8 | int rv; 9 | if (oc != 1) { 10 | Tcl_WrongNumArgs(interp, 1, ov, NULL); 11 | return TCL_ERROR; 12 | } 13 | 14 | /* Const - - -- --- ----- -------- */ 15 | rv = 0; 16 | 17 | /* (bool return) - - -- --- ----- -------- */ 18 | Tcl_SetObjResult(interp, Tcl_NewIntObj(rv)); 19 | return TCL_OK; 20 | } 21 | -------------------------------------------------------------------------------- /test/assets/cdata-trace/2.0: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------- */ 2 | 3 | #define ns__alpha0 "::alpha" 4 | static int 5 | tcl__alpha0_actual(ClientData dummy, Tcl_Interp *ip, Tcl_Size objc, Tcl_Obj *CONST objv[]) 6 | { 7 | static char script[4] = { 8 | 98,101,116,97, 9 | }; 10 | Tcl_SetByteArrayObj(Tcl_GetObjResult(ip), (unsigned char*) script, 4); 11 | return TCL_OK; 12 | } 13 | 14 | static int 15 | tcl__alpha0(ClientData dummy, Tcl_Interp *ip, Tcl_Size objc, Tcl_Obj *CONST objv[]) 16 | { 17 | int _rv; 18 | critcl_trace_cmd_args (ns__alpha0, objc, objv); 19 | _rv = tcl__alpha0_actual (dummy, ip, objc, objv); 20 | return critcl_trace_cmd_result (_rv, ip); 21 | } 22 | -------------------------------------------------------------------------------- /test/assets/cdata-trace/2.1: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------- */ 2 | 3 | #define ns__alpha_x0 "::alpha-x" 4 | static int 5 | tcl__alpha_x0_actual(ClientData dummy, Tcl_Interp *ip, Tcl_Size objc, Tcl_Obj *CONST objv[]) 6 | { 7 | static char script[4] = { 8 | 98,101,116,97, 9 | }; 10 | Tcl_SetByteArrayObj(Tcl_GetObjResult(ip), (unsigned char*) script, 4); 11 | return TCL_OK; 12 | } 13 | 14 | static int 15 | tcl__alpha_x0(ClientData dummy, Tcl_Interp *ip, Tcl_Size objc, Tcl_Obj *CONST objv[]) 16 | { 17 | int _rv; 18 | critcl_trace_cmd_args (ns__alpha_x0, objc, objv); 19 | _rv = tcl__alpha_x0_actual (dummy, ip, objc, objv); 20 | return critcl_trace_cmd_result (_rv, ip); 21 | } 22 | -------------------------------------------------------------------------------- /test/assets/cdata-trace/2.2: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------- */ 2 | 3 | #define ns__the_alpha0 "::the::alpha" 4 | static int 5 | tcl__the_alpha0_actual(ClientData dummy, Tcl_Interp *ip, Tcl_Size objc, Tcl_Obj *CONST objv[]) 6 | { 7 | static char script[4] = { 8 | 98,101,116,97, 9 | }; 10 | Tcl_SetByteArrayObj(Tcl_GetObjResult(ip), (unsigned char*) script, 4); 11 | return TCL_OK; 12 | } 13 | 14 | static int 15 | tcl__the_alpha0(ClientData dummy, Tcl_Interp *ip, Tcl_Size objc, Tcl_Obj *CONST objv[]) 16 | { 17 | int _rv; 18 | critcl_trace_cmd_args (ns__the_alpha0, objc, objv); 19 | _rv = tcl__the_alpha0_actual (dummy, ip, objc, objv); 20 | return critcl_trace_cmd_result (_rv, ip); 21 | } 22 | -------------------------------------------------------------------------------- /test/assets/cdata/2.0: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------- */ 2 | 3 | #define ns__alpha0 "::alpha" 4 | static int 5 | tcl__alpha0(ClientData dummy, Tcl_Interp *ip, Tcl_Size objc, Tcl_Obj *CONST objv[]) 6 | { 7 | static char script[4] = { 8 | 98,101,116,97, 9 | }; 10 | Tcl_SetByteArrayObj(Tcl_GetObjResult(ip), (unsigned char*) script, 4); 11 | return TCL_OK; 12 | } 13 | -------------------------------------------------------------------------------- /test/assets/cdata/2.1: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------- */ 2 | 3 | #define ns__alpha_x0 "::alpha-x" 4 | static int 5 | tcl__alpha_x0(ClientData dummy, Tcl_Interp *ip, Tcl_Size objc, Tcl_Obj *CONST objv[]) 6 | { 7 | static char script[4] = { 8 | 98,101,116,97, 9 | }; 10 | Tcl_SetByteArrayObj(Tcl_GetObjResult(ip), (unsigned char*) script, 4); 11 | return TCL_OK; 12 | } 13 | -------------------------------------------------------------------------------- /test/assets/cdata/2.2: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------- */ 2 | 3 | #define ns__the_alpha0 "::the::alpha" 4 | static int 5 | tcl__the_alpha0(ClientData dummy, Tcl_Interp *ip, Tcl_Size objc, Tcl_Obj *CONST objv[]) 6 | { 7 | static char script[4] = { 8 | 98,101,116,97, 9 | }; 10 | Tcl_SetByteArrayObj(Tcl_GetObjResult(ip), (unsigned char*) script, 4); 11 | return TCL_OK; 12 | } 13 | -------------------------------------------------------------------------------- /test/assets/cproc-trace/2.0: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------- */ 2 | 3 | #define ns__aproc0 "::aproc" 4 | static void c__aproc0() 5 | { 6 | 7 | } 8 | 9 | static int 10 | tcl__aproc0(ClientData cd, Tcl_Interp *interp, Tcl_Size oc, Tcl_Obj *CONST ov[]) 11 | { 12 | 13 | critcl_trace_cmd_args (ns__aproc0, oc, ov); 14 | 15 | if (oc != 1) { 16 | Tcl_WrongNumArgs(interp, 1, ov, NULL); 17 | return critcl_trace_cmd_result (TCL_ERROR, interp); 18 | } 19 | 20 | /* Call - - -- --- ----- -------- */ 21 | c__aproc0(); 22 | 23 | /* (void return) - - -- --- ----- -------- */ 24 | return critcl_trace_cmd_result (TCL_OK, interp); 25 | } 26 | -------------------------------------------------------------------------------- /test/assets/cproc-trace/2.1: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------- */ 2 | 3 | #define ns__the_aproc0 "::the::aproc" 4 | static void c__the_aproc0() 5 | { 6 | 7 | } 8 | 9 | static int 10 | tcl__the_aproc0(ClientData cd, Tcl_Interp *interp, Tcl_Size oc, Tcl_Obj *CONST ov[]) 11 | { 12 | 13 | critcl_trace_cmd_args (ns__the_aproc0, oc, ov); 14 | 15 | if (oc != 1) { 16 | Tcl_WrongNumArgs(interp, 1, ov, NULL); 17 | return critcl_trace_cmd_result (TCL_ERROR, interp); 18 | } 19 | 20 | /* Call - - -- --- ----- -------- */ 21 | c__the_aproc0(); 22 | 23 | /* (void return) - - -- --- ----- -------- */ 24 | return critcl_trace_cmd_result (TCL_OK, interp); 25 | } 26 | -------------------------------------------------------------------------------- /test/assets/cproc-trace/2.14: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------- */ 2 | 3 | #define ns__aproc0 "::aproc" 4 | 5 | #ifndef CRITCL_variadic_object 6 | #define CRITCL_variadic_object 7 | 8 | typedef struct critcl_variadic_object { 9 | int c; 10 | Tcl_Obj* const* v; 11 | } critcl_variadic_object; 12 | 13 | #endif /* CRITCL_variadic_object _________ */ 14 | 15 | static void c__aproc0(critcl_variadic_object args) 16 | { 17 | 18 | } 19 | 20 | static int 21 | tcl__aproc0(ClientData cd, Tcl_Interp *interp, Tcl_Size oc, Tcl_Obj *CONST ov[]) 22 | { 23 | critcl_variadic_object _args; 24 | 25 | critcl_trace_cmd_args (ns__aproc0, oc, ov); 26 | /* (object args, ...) - - -- --- ----- -------- */ 27 | { 28 | _args.c = (oc-1); 29 | _args.v = &ov[1]; } 30 | 31 | /* Call - - -- --- ----- -------- */ 32 | c__aproc0(_args); 33 | 34 | /* (void return) - - -- --- ----- -------- */ 35 | return critcl_trace_cmd_result (TCL_OK, interp); 36 | } 37 | -------------------------------------------------------------------------------- /test/assets/cproc-trace/2.2: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------- */ 2 | 3 | #define ns__aproc_beta0 "::aproc+beta" 4 | static void c__aproc_beta0() 5 | { 6 | 7 | } 8 | 9 | static int 10 | tcl__aproc_beta0(ClientData cd, Tcl_Interp *interp, Tcl_Size oc, Tcl_Obj *CONST ov[]) 11 | { 12 | 13 | critcl_trace_cmd_args (ns__aproc_beta0, oc, ov); 14 | 15 | if (oc != 1) { 16 | Tcl_WrongNumArgs(interp, 1, ov, NULL); 17 | return critcl_trace_cmd_result (TCL_ERROR, interp); 18 | } 19 | 20 | /* Call - - -- --- ----- -------- */ 21 | c__aproc_beta0(); 22 | 23 | /* (void return) - - -- --- ----- -------- */ 24 | return critcl_trace_cmd_result (TCL_OK, interp); 25 | } 26 | -------------------------------------------------------------------------------- /test/assets/cproc-trace/2.3: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------- */ 2 | 3 | static void c_snafu() 4 | { 5 | 6 | } 7 | 8 | static int 9 | snafu(ClientData cd, Tcl_Interp *interp, Tcl_Size oc, Tcl_Obj *CONST ov[]) 10 | { 11 | 12 | critcl_trace_cmd_args ("snafu", oc, ov); 13 | 14 | if (oc != 1) { 15 | Tcl_WrongNumArgs(interp, 1, ov, NULL); 16 | return critcl_trace_cmd_result (TCL_ERROR, interp); 17 | } 18 | 19 | /* Call - - -- --- ----- -------- */ 20 | c_snafu(); 21 | 22 | /* (void return) - - -- --- ----- -------- */ 23 | return critcl_trace_cmd_result (TCL_OK, interp); 24 | } 25 | -------------------------------------------------------------------------------- /test/assets/cproc-trace/2.4: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------- */ 2 | 3 | #define ns__aproc0 "::aproc" 4 | static void c__aproc0(ClientData clientdata) 5 | { 6 | 7 | } 8 | 9 | static int 10 | tcl__aproc0(ClientData cd, Tcl_Interp *interp, Tcl_Size oc, Tcl_Obj *CONST ov[]) 11 | { 12 | 13 | critcl_trace_cmd_args (ns__aproc0, oc, ov); 14 | 15 | if (oc != 1) { 16 | Tcl_WrongNumArgs(interp, 1, ov, NULL); 17 | return critcl_trace_cmd_result (TCL_ERROR, interp); 18 | } 19 | 20 | /* Call - - -- --- ----- -------- */ 21 | c__aproc0(cd); 22 | 23 | /* (void return) - - -- --- ----- -------- */ 24 | return critcl_trace_cmd_result (TCL_OK, interp); 25 | } 26 | -------------------------------------------------------------------------------- /test/assets/cproc-trace/2.5: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------- */ 2 | 3 | #define ns__aproc0 "::aproc" 4 | static void c__aproc0() 5 | { 6 | 7 | } 8 | 9 | static int 10 | tcl__aproc0(ClientData cd, Tcl_Interp *interp, Tcl_Size oc, Tcl_Obj *CONST ov[]) 11 | { 12 | 13 | critcl_trace_cmd_args (ns__aproc0, oc, ov); 14 | 15 | if (oc != 4) { 16 | Tcl_WrongNumArgs(interp, 4, ov, NULL); 17 | return critcl_trace_cmd_result (TCL_ERROR, interp); 18 | } 19 | 20 | /* Call - - -- --- ----- -------- */ 21 | c__aproc0(); 22 | 23 | /* (void return) - - -- --- ----- -------- */ 24 | return critcl_trace_cmd_result (TCL_OK, interp); 25 | } 26 | -------------------------------------------------------------------------------- /test/assets/cproc-trace/2.6: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------- */ 2 | 3 | #define ns__aproc0 "::aproc" 4 | static void c__aproc0(int anargument) 5 | { 6 | 7 | } 8 | 9 | static int 10 | tcl__aproc0(ClientData cd, Tcl_Interp *interp, Tcl_Size oc, Tcl_Obj *CONST ov[]) 11 | { 12 | int _anargument; 13 | 14 | critcl_trace_cmd_args (ns__aproc0, oc, ov); 15 | 16 | if (oc != 2) { 17 | Tcl_WrongNumArgs(interp, 1, ov, "anargument"); 18 | return critcl_trace_cmd_result (TCL_ERROR, interp); 19 | } 20 | 21 | /* (int anargument) - - -- --- ----- -------- */ 22 | { 23 | if (Tcl_GetIntFromObj(interp, ov[1], &_anargument) != TCL_OK) return critcl_trace_cmd_result (TCL_ERROR, interp); } 24 | 25 | /* Call - - -- --- ----- -------- */ 26 | c__aproc0(_anargument); 27 | 28 | /* (void return) - - -- --- ----- -------- */ 29 | return critcl_trace_cmd_result (TCL_OK, interp); 30 | } 31 | -------------------------------------------------------------------------------- /test/assets/cproc-trace/2.9: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------- */ 2 | 3 | #define ns__aproc0 "::aproc" 4 | static int c__aproc0() 5 | { 6 | 7 | } 8 | 9 | static int 10 | tcl__aproc0(ClientData cd, Tcl_Interp *interp, Tcl_Size oc, Tcl_Obj *CONST ov[]) 11 | { 12 | int rv; 13 | critcl_trace_cmd_args (ns__aproc0, oc, ov); 14 | 15 | if (oc != 1) { 16 | Tcl_WrongNumArgs(interp, 1, ov, NULL); 17 | return critcl_trace_cmd_result (TCL_ERROR, interp); 18 | } 19 | 20 | /* Call - - -- --- ----- -------- */ 21 | rv = c__aproc0(); 22 | 23 | /* (int return) - - -- --- ----- -------- */ 24 | Tcl_SetObjResult(interp, Tcl_NewIntObj(rv)); 25 | return critcl_trace_cmd_result (TCL_OK, interp); 26 | } 27 | -------------------------------------------------------------------------------- /test/assets/cproc-trace/3.0: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------- */ 2 | 3 | #define ns__aproc0 "::aproc" 4 | static void c__aproc0() 5 | { 6 | 7 | } 8 | 9 | static int 10 | tcl__aproc0(ClientData cd, Tcl_Interp *interp, Tcl_Size oc, Tcl_Obj *CONST ov[]) 11 | { 12 | 13 | critcl_trace_cmd_args (ns__aproc0, oc, ov); 14 | 15 | if (oc != 1) { 16 | Tcl_WrongNumArgs(interp, 1, ov, NULL); 17 | return critcl_trace_cmd_result (TCL_ERROR, interp); 18 | } 19 | 20 | /* Call - - -- --- ----- -------- */ 21 | c__aproc0(); 22 | 23 | /* (void return) - - -- --- ----- -------- */ 24 | return critcl_trace_cmd_result (TCL_OK, interp); 25 | } 26 | -------------------------------------------------------------------------------- /test/assets/cproc-trace/3.1: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------- */ 2 | 3 | #define ns__aproc0 "::aproc" 4 | static int c__aproc0() 5 | { 6 | return TCL_OK; 7 | } 8 | 9 | static int 10 | tcl__aproc0(ClientData cd, Tcl_Interp *interp, Tcl_Size oc, Tcl_Obj *CONST ov[]) 11 | { 12 | int rv; 13 | critcl_trace_cmd_args (ns__aproc0, oc, ov); 14 | 15 | if (oc != 1) { 16 | Tcl_WrongNumArgs(interp, 1, ov, NULL); 17 | return critcl_trace_cmd_result (TCL_ERROR, interp); 18 | } 19 | 20 | /* Call - - -- --- ----- -------- */ 21 | rv = c__aproc0(); 22 | 23 | /* (ok return) - - -- --- ----- -------- */ 24 | return critcl_trace_cmd_result (rv, interp); 25 | } 26 | -------------------------------------------------------------------------------- /test/assets/cproc-trace/3.10: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------- */ 2 | 3 | #define ns__aproc0 "::aproc" 4 | static char* c__aproc0() 5 | { 6 | return alloc_string("bar"); 7 | } 8 | 9 | static int 10 | tcl__aproc0(ClientData cd, Tcl_Interp *interp, Tcl_Size oc, Tcl_Obj *CONST ov[]) 11 | { 12 | char* rv; 13 | critcl_trace_cmd_args (ns__aproc0, oc, ov); 14 | 15 | if (oc != 1) { 16 | Tcl_WrongNumArgs(interp, 1, ov, NULL); 17 | return critcl_trace_cmd_result (TCL_ERROR, interp); 18 | } 19 | 20 | /* Call - - -- --- ----- -------- */ 21 | rv = c__aproc0(); 22 | 23 | /* (dstring return) - - -- --- ----- -------- */ 24 | Tcl_SetResult (interp, rv, TCL_DYNAMIC); 25 | return critcl_trace_cmd_result (TCL_OK, interp); 26 | } 27 | -------------------------------------------------------------------------------- /test/assets/cproc-trace/3.11: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------- */ 2 | 3 | #define ns__aproc0 "::aproc" 4 | static Tcl_Obj* c__aproc0() 5 | { 6 | return Tcl_NewIntObj(0); 7 | } 8 | 9 | static int 10 | tcl__aproc0(ClientData cd, Tcl_Interp *interp, Tcl_Size oc, Tcl_Obj *CONST ov[]) 11 | { 12 | Tcl_Obj* rv; 13 | critcl_trace_cmd_args (ns__aproc0, oc, ov); 14 | 15 | if (oc != 1) { 16 | Tcl_WrongNumArgs(interp, 1, ov, NULL); 17 | return critcl_trace_cmd_result (TCL_ERROR, interp); 18 | } 19 | 20 | /* Call - - -- --- ----- -------- */ 21 | rv = c__aproc0(); 22 | 23 | /* (object return) - - -- --- ----- -------- */ 24 | if (rv == NULL) { return critcl_trace_cmd_result (TCL_ERROR, interp); } 25 | Tcl_SetObjResult(interp, rv); 26 | Tcl_DecrRefCount(rv); 27 | return critcl_trace_cmd_result (TCL_OK, interp); 28 | } 29 | -------------------------------------------------------------------------------- /test/assets/cproc-trace/3.12: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------- */ 2 | 3 | #define ns__aproc0 "::aproc" 4 | static Tcl_Channel c__aproc0() 5 | { 6 | return Tcl_OpenFileChannel (interp, "/tmp", "r", 0); 7 | } 8 | 9 | static int 10 | tcl__aproc0(ClientData cd, Tcl_Interp *interp, Tcl_Size oc, Tcl_Obj *CONST ov[]) 11 | { 12 | Tcl_Channel rv; 13 | critcl_trace_cmd_args (ns__aproc0, oc, ov); 14 | 15 | if (oc != 1) { 16 | Tcl_WrongNumArgs(interp, 1, ov, NULL); 17 | return critcl_trace_cmd_result (TCL_ERROR, interp); 18 | } 19 | 20 | /* Call - - -- --- ----- -------- */ 21 | rv = c__aproc0(); 22 | 23 | /* (new-channel return) - - -- --- ----- -------- */ 24 | if (rv == NULL) { return critcl_trace_cmd_result (TCL_ERROR, interp); } 25 | Tcl_RegisterChannel (interp, rv); 26 | Tcl_SetObjResult (interp, Tcl_NewStringObj (Tcl_GetChannelName (rv), -1)); 27 | return critcl_trace_cmd_result (TCL_OK, interp); 28 | } 29 | -------------------------------------------------------------------------------- /test/assets/cproc-trace/3.13: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------- */ 2 | 3 | #define ns__aproc0 "::aproc" 4 | static Tcl_Channel c__aproc0() 5 | { 6 | return Tcl_GetStdChannel (0); 7 | } 8 | 9 | static int 10 | tcl__aproc0(ClientData cd, Tcl_Interp *interp, Tcl_Size oc, Tcl_Obj *CONST ov[]) 11 | { 12 | Tcl_Channel rv; 13 | critcl_trace_cmd_args (ns__aproc0, oc, ov); 14 | 15 | if (oc != 1) { 16 | Tcl_WrongNumArgs(interp, 1, ov, NULL); 17 | return critcl_trace_cmd_result (TCL_ERROR, interp); 18 | } 19 | 20 | /* Call - - -- --- ----- -------- */ 21 | rv = c__aproc0(); 22 | 23 | /* (known-channel return) - - -- --- ----- -------- */ 24 | if (rv == NULL) { return critcl_trace_cmd_result (TCL_ERROR, interp); } 25 | Tcl_SetObjResult (interp, Tcl_NewStringObj (Tcl_GetChannelName (rv), -1)); 26 | return critcl_trace_cmd_result (TCL_OK, interp); 27 | } 28 | -------------------------------------------------------------------------------- /test/assets/cproc-trace/3.14: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------- */ 2 | 3 | #define ns__aproc0 "::aproc" 4 | static Tcl_Channel c__aproc0() 5 | { 6 | return 0; 7 | } 8 | 9 | static int 10 | tcl__aproc0(ClientData cd, Tcl_Interp *interp, Tcl_Size oc, Tcl_Obj *CONST ov[]) 11 | { 12 | Tcl_Channel rv; 13 | critcl_trace_cmd_args (ns__aproc0, oc, ov); 14 | 15 | if (oc != 1) { 16 | Tcl_WrongNumArgs(interp, 1, ov, NULL); 17 | return critcl_trace_cmd_result (TCL_ERROR, interp); 18 | } 19 | 20 | /* Call - - -- --- ----- -------- */ 21 | rv = c__aproc0(); 22 | 23 | /* (return-channel return) - - -- --- ----- -------- */ 24 | if (rv == NULL) { return critcl_trace_cmd_result (TCL_ERROR, interp); } 25 | Tcl_RegisterChannel (interp, rv); 26 | Tcl_UnregisterChannel(NULL, rv); 27 | Tcl_SetObjResult (interp, Tcl_NewStringObj (Tcl_GetChannelName (rv), -1)); 28 | return critcl_trace_cmd_result (TCL_OK, interp); 29 | } 30 | -------------------------------------------------------------------------------- /test/assets/cproc-trace/3.2: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------- */ 2 | 3 | #define ns__aproc0 "::aproc" 4 | static int c__aproc0() 5 | { 6 | return 0; 7 | } 8 | 9 | static int 10 | tcl__aproc0(ClientData cd, Tcl_Interp *interp, Tcl_Size oc, Tcl_Obj *CONST ov[]) 11 | { 12 | int rv; 13 | critcl_trace_cmd_args (ns__aproc0, oc, ov); 14 | 15 | if (oc != 1) { 16 | Tcl_WrongNumArgs(interp, 1, ov, NULL); 17 | return critcl_trace_cmd_result (TCL_ERROR, interp); 18 | } 19 | 20 | /* Call - - -- --- ----- -------- */ 21 | rv = c__aproc0(); 22 | 23 | /* (int return) - - -- --- ----- -------- */ 24 | Tcl_SetObjResult(interp, Tcl_NewIntObj(rv)); 25 | return critcl_trace_cmd_result (TCL_OK, interp); 26 | } 27 | -------------------------------------------------------------------------------- /test/assets/cproc-trace/3.3: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------- */ 2 | 3 | #define ns__aproc0 "::aproc" 4 | static int c__aproc0() 5 | { 6 | return 1; 7 | } 8 | 9 | static int 10 | tcl__aproc0(ClientData cd, Tcl_Interp *interp, Tcl_Size oc, Tcl_Obj *CONST ov[]) 11 | { 12 | int rv; 13 | critcl_trace_cmd_args (ns__aproc0, oc, ov); 14 | 15 | if (oc != 1) { 16 | Tcl_WrongNumArgs(interp, 1, ov, NULL); 17 | return critcl_trace_cmd_result (TCL_ERROR, interp); 18 | } 19 | 20 | /* Call - - -- --- ----- -------- */ 21 | rv = c__aproc0(); 22 | 23 | /* (bool return) - - -- --- ----- -------- */ 24 | Tcl_SetObjResult(interp, Tcl_NewIntObj(rv)); 25 | return critcl_trace_cmd_result (TCL_OK, interp); 26 | } 27 | -------------------------------------------------------------------------------- /test/assets/cproc-trace/3.4: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------- */ 2 | 3 | #define ns__aproc0 "::aproc" 4 | static int c__aproc0() 5 | { 6 | return 1; 7 | } 8 | 9 | static int 10 | tcl__aproc0(ClientData cd, Tcl_Interp *interp, Tcl_Size oc, Tcl_Obj *CONST ov[]) 11 | { 12 | int rv; 13 | critcl_trace_cmd_args (ns__aproc0, oc, ov); 14 | 15 | if (oc != 1) { 16 | Tcl_WrongNumArgs(interp, 1, ov, NULL); 17 | return critcl_trace_cmd_result (TCL_ERROR, interp); 18 | } 19 | 20 | /* Call - - -- --- ----- -------- */ 21 | rv = c__aproc0(); 22 | 23 | /* (boolean return) - - -- --- ----- -------- */ 24 | Tcl_SetObjResult(interp, Tcl_NewIntObj(rv)); 25 | return critcl_trace_cmd_result (TCL_OK, interp); 26 | } 27 | -------------------------------------------------------------------------------- /test/assets/cproc-trace/3.5: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------- */ 2 | 3 | #define ns__aproc0 "::aproc" 4 | static long c__aproc0() 5 | { 6 | return 1; 7 | } 8 | 9 | static int 10 | tcl__aproc0(ClientData cd, Tcl_Interp *interp, Tcl_Size oc, Tcl_Obj *CONST ov[]) 11 | { 12 | long rv; 13 | critcl_trace_cmd_args (ns__aproc0, oc, ov); 14 | 15 | if (oc != 1) { 16 | Tcl_WrongNumArgs(interp, 1, ov, NULL); 17 | return critcl_trace_cmd_result (TCL_ERROR, interp); 18 | } 19 | 20 | /* Call - - -- --- ----- -------- */ 21 | rv = c__aproc0(); 22 | 23 | /* (long return) - - -- --- ----- -------- */ 24 | Tcl_SetObjResult(interp, Tcl_NewLongObj(rv)); 25 | return critcl_trace_cmd_result (TCL_OK, interp); 26 | } 27 | -------------------------------------------------------------------------------- /test/assets/cproc-trace/3.6: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------- */ 2 | 3 | #define ns__aproc0 "::aproc" 4 | static Tcl_WideInt c__aproc0() 5 | { 6 | return 1; 7 | } 8 | 9 | static int 10 | tcl__aproc0(ClientData cd, Tcl_Interp *interp, Tcl_Size oc, Tcl_Obj *CONST ov[]) 11 | { 12 | Tcl_WideInt rv; 13 | critcl_trace_cmd_args (ns__aproc0, oc, ov); 14 | 15 | if (oc != 1) { 16 | Tcl_WrongNumArgs(interp, 1, ov, NULL); 17 | return critcl_trace_cmd_result (TCL_ERROR, interp); 18 | } 19 | 20 | /* Call - - -- --- ----- -------- */ 21 | rv = c__aproc0(); 22 | 23 | /* (wideint return) - - -- --- ----- -------- */ 24 | Tcl_SetObjResult(interp, Tcl_NewWideIntObj(rv)); 25 | return critcl_trace_cmd_result (TCL_OK, interp); 26 | } 27 | -------------------------------------------------------------------------------- /test/assets/cproc-trace/3.7: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------- */ 2 | 3 | #define ns__aproc0 "::aproc" 4 | static double c__aproc0() 5 | { 6 | return 0.; 7 | } 8 | 9 | static int 10 | tcl__aproc0(ClientData cd, Tcl_Interp *interp, Tcl_Size oc, Tcl_Obj *CONST ov[]) 11 | { 12 | double rv; 13 | critcl_trace_cmd_args (ns__aproc0, oc, ov); 14 | 15 | if (oc != 1) { 16 | Tcl_WrongNumArgs(interp, 1, ov, NULL); 17 | return critcl_trace_cmd_result (TCL_ERROR, interp); 18 | } 19 | 20 | /* Call - - -- --- ----- -------- */ 21 | rv = c__aproc0(); 22 | 23 | /* (double return) - - -- --- ----- -------- */ 24 | Tcl_SetObjResult(interp, Tcl_NewDoubleObj(rv)); 25 | return critcl_trace_cmd_result (TCL_OK, interp); 26 | } 27 | -------------------------------------------------------------------------------- /test/assets/cproc-trace/3.8: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------- */ 2 | 3 | #define ns__aproc0 "::aproc" 4 | static float c__aproc0() 5 | { 6 | return 0.; 7 | } 8 | 9 | static int 10 | tcl__aproc0(ClientData cd, Tcl_Interp *interp, Tcl_Size oc, Tcl_Obj *CONST ov[]) 11 | { 12 | float rv; 13 | critcl_trace_cmd_args (ns__aproc0, oc, ov); 14 | 15 | if (oc != 1) { 16 | Tcl_WrongNumArgs(interp, 1, ov, NULL); 17 | return critcl_trace_cmd_result (TCL_ERROR, interp); 18 | } 19 | 20 | /* Call - - -- --- ----- -------- */ 21 | rv = c__aproc0(); 22 | 23 | /* (float return) - - -- --- ----- -------- */ 24 | Tcl_SetObjResult(interp, Tcl_NewDoubleObj(rv)); 25 | return critcl_trace_cmd_result (TCL_OK, interp); 26 | } 27 | -------------------------------------------------------------------------------- /test/assets/cproc-trace/3.9: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------- */ 2 | 3 | #define ns__aproc0 "::aproc" 4 | static char* c__aproc0() 5 | { 6 | return "foo"; 7 | } 8 | 9 | static int 10 | tcl__aproc0(ClientData cd, Tcl_Interp *interp, Tcl_Size oc, Tcl_Obj *CONST ov[]) 11 | { 12 | char* rv; 13 | critcl_trace_cmd_args (ns__aproc0, oc, ov); 14 | 15 | if (oc != 1) { 16 | Tcl_WrongNumArgs(interp, 1, ov, NULL); 17 | return critcl_trace_cmd_result (TCL_ERROR, interp); 18 | } 19 | 20 | /* Call - - -- --- ----- -------- */ 21 | rv = c__aproc0(); 22 | 23 | /* (vstring return) - - -- --- ----- -------- */ 24 | Tcl_SetObjResult(interp, Tcl_NewStringObj(rv, -1)); 25 | return critcl_trace_cmd_result (TCL_OK, interp); 26 | } 27 | -------------------------------------------------------------------------------- /test/assets/cproc-trace/4.0-int: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------- */ 2 | 3 | #define ns__aproc0 "::aproc" 4 | static void c__aproc0(int x) 5 | { 6 | 7 | } 8 | 9 | static int 10 | tcl__aproc0(ClientData cd, Tcl_Interp *interp, Tcl_Size oc, Tcl_Obj *CONST ov[]) 11 | { 12 | int _x; 13 | 14 | critcl_trace_cmd_args (ns__aproc0, oc, ov); 15 | 16 | if (oc != 2) { 17 | Tcl_WrongNumArgs(interp, 1, ov, "x"); 18 | return critcl_trace_cmd_result (TCL_ERROR, interp); 19 | } 20 | 21 | /* (int x) - - -- --- ----- -------- */ 22 | { 23 | if (Tcl_GetIntFromObj(interp, ov[1], &_x) != TCL_OK) return critcl_trace_cmd_result (TCL_ERROR, interp); } 24 | 25 | /* Call - - -- --- ----- -------- */ 26 | c__aproc0(_x); 27 | 28 | /* (void return) - - -- --- ----- -------- */ 29 | return critcl_trace_cmd_result (TCL_OK, interp); 30 | } 31 | -------------------------------------------------------------------------------- /test/assets/cproc-trace/4.1-bool: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------- */ 2 | 3 | #define ns__aproc0 "::aproc" 4 | static void c__aproc0(int x) 5 | { 6 | 7 | } 8 | 9 | static int 10 | tcl__aproc0(ClientData cd, Tcl_Interp *interp, Tcl_Size oc, Tcl_Obj *CONST ov[]) 11 | { 12 | int _x; 13 | 14 | critcl_trace_cmd_args (ns__aproc0, oc, ov); 15 | 16 | if (oc != 2) { 17 | Tcl_WrongNumArgs(interp, 1, ov, "x"); 18 | return critcl_trace_cmd_result (TCL_ERROR, interp); 19 | } 20 | 21 | /* (bool x) - - -- --- ----- -------- */ 22 | { 23 | if (Tcl_GetBooleanFromObj(interp, ov[1], &_x) != TCL_OK) return critcl_trace_cmd_result (TCL_ERROR, interp); } 24 | 25 | /* Call - - -- --- ----- -------- */ 26 | c__aproc0(_x); 27 | 28 | /* (void return) - - -- --- ----- -------- */ 29 | return critcl_trace_cmd_result (TCL_OK, interp); 30 | } 31 | -------------------------------------------------------------------------------- /test/assets/cproc-trace/4.10-object: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------- */ 2 | 3 | #define ns__aproc0 "::aproc" 4 | static void c__aproc0(Tcl_Obj* x) 5 | { 6 | 7 | } 8 | 9 | static int 10 | tcl__aproc0(ClientData cd, Tcl_Interp *interp, Tcl_Size oc, Tcl_Obj *CONST ov[]) 11 | { 12 | Tcl_Obj* _x; 13 | 14 | critcl_trace_cmd_args (ns__aproc0, oc, ov); 15 | 16 | if (oc != 2) { 17 | Tcl_WrongNumArgs(interp, 1, ov, "x"); 18 | return critcl_trace_cmd_result (TCL_ERROR, interp); 19 | } 20 | 21 | /* (object x) - - -- --- ----- -------- */ 22 | { 23 | _x = ov[1]; } 24 | 25 | /* Call - - -- --- ----- -------- */ 26 | c__aproc0(_x); 27 | 28 | /* (void return) - - -- --- ----- -------- */ 29 | return critcl_trace_cmd_result (TCL_OK, interp); 30 | } 31 | -------------------------------------------------------------------------------- /test/assets/cproc-trace/4.13-channel: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------- */ 2 | 3 | #define ns__aproc0 "::aproc" 4 | static void c__aproc0(Tcl_Channel x) 5 | { 6 | 7 | } 8 | 9 | static int 10 | tcl__aproc0(ClientData cd, Tcl_Interp *interp, Tcl_Size oc, Tcl_Obj *CONST ov[]) 11 | { 12 | Tcl_Channel _x; 13 | 14 | critcl_trace_cmd_args (ns__aproc0, oc, ov); 15 | 16 | if (oc != 2) { 17 | Tcl_WrongNumArgs(interp, 1, ov, "x"); 18 | return critcl_trace_cmd_result (TCL_ERROR, interp); 19 | } 20 | 21 | /* (channel x) - - -- --- ----- -------- */ 22 | { 23 | int mode; 24 | _x = Tcl_GetChannel(interp, Tcl_GetString (ov[1]), &mode); 25 | if (_x == NULL) return critcl_trace_cmd_result (TCL_ERROR, interp); } 26 | 27 | /* Call - - -- --- ----- -------- */ 28 | c__aproc0(_x); 29 | 30 | /* (void return) - - -- --- ----- -------- */ 31 | return critcl_trace_cmd_result (TCL_OK, interp); 32 | } 33 | -------------------------------------------------------------------------------- /test/assets/cproc-trace/4.14-unshared-channel: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------- */ 2 | 3 | #define ns__aproc0 "::aproc" 4 | static void c__aproc0(Tcl_Channel x) 5 | { 6 | 7 | } 8 | 9 | static int 10 | tcl__aproc0(ClientData cd, Tcl_Interp *interp, Tcl_Size oc, Tcl_Obj *CONST ov[]) 11 | { 12 | Tcl_Channel _x; 13 | 14 | critcl_trace_cmd_args (ns__aproc0, oc, ov); 15 | 16 | if (oc != 2) { 17 | Tcl_WrongNumArgs(interp, 1, ov, "x"); 18 | return critcl_trace_cmd_result (TCL_ERROR, interp); 19 | } 20 | 21 | /* (unshared-channel x) - - -- --- ----- -------- */ 22 | { 23 | int mode; 24 | _x = Tcl_GetChannel(interp, Tcl_GetString (ov[1]), &mode); 25 | if (_x == NULL) return critcl_trace_cmd_result (TCL_ERROR, interp); 26 | if (Tcl_IsChannelShared (_x)) { 27 | Tcl_SetObjResult(interp, Tcl_NewStringObj("channel is shared", -1)); 28 | return critcl_trace_cmd_result (TCL_ERROR, interp); 29 | } } 30 | 31 | /* Call - - -- --- ----- -------- */ 32 | c__aproc0(_x); 33 | 34 | /* (void return) - - -- --- ----- -------- */ 35 | return critcl_trace_cmd_result (TCL_OK, interp); 36 | } 37 | -------------------------------------------------------------------------------- /test/assets/cproc-trace/4.16-vobject: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------- */ 2 | 3 | #define ns__aproc0 "::aproc" 4 | 5 | #ifndef CRITCL_variadic_object 6 | #define CRITCL_variadic_object 7 | 8 | typedef struct critcl_variadic_object { 9 | int c; 10 | Tcl_Obj* const* v; 11 | } critcl_variadic_object; 12 | 13 | #endif /* CRITCL_variadic_object _________ */ 14 | 15 | static void c__aproc0(critcl_variadic_object args) 16 | { 17 | 18 | } 19 | 20 | static int 21 | tcl__aproc0(ClientData cd, Tcl_Interp *interp, Tcl_Size oc, Tcl_Obj *CONST ov[]) 22 | { 23 | critcl_variadic_object _args; 24 | 25 | critcl_trace_cmd_args (ns__aproc0, oc, ov); 26 | /* (object args, ...) - - -- --- ----- -------- */ 27 | { 28 | _args.c = (oc-1); 29 | _args.v = &ov[1]; } 30 | 31 | /* Call - - -- --- ----- -------- */ 32 | c__aproc0(_args); 33 | 34 | /* (void return) - - -- --- ----- -------- */ 35 | return critcl_trace_cmd_result (TCL_OK, interp); 36 | } 37 | -------------------------------------------------------------------------------- /test/assets/cproc-trace/4.2-long: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------- */ 2 | 3 | #define ns__aproc0 "::aproc" 4 | static void c__aproc0(long x) 5 | { 6 | 7 | } 8 | 9 | static int 10 | tcl__aproc0(ClientData cd, Tcl_Interp *interp, Tcl_Size oc, Tcl_Obj *CONST ov[]) 11 | { 12 | long _x; 13 | 14 | critcl_trace_cmd_args (ns__aproc0, oc, ov); 15 | 16 | if (oc != 2) { 17 | Tcl_WrongNumArgs(interp, 1, ov, "x"); 18 | return critcl_trace_cmd_result (TCL_ERROR, interp); 19 | } 20 | 21 | /* (long x) - - -- --- ----- -------- */ 22 | { 23 | if (Tcl_GetLongFromObj(interp, ov[1], &_x) != TCL_OK) return critcl_trace_cmd_result (TCL_ERROR, interp); } 24 | 25 | /* Call - - -- --- ----- -------- */ 26 | c__aproc0(_x); 27 | 28 | /* (void return) - - -- --- ----- -------- */ 29 | return critcl_trace_cmd_result (TCL_OK, interp); 30 | } 31 | -------------------------------------------------------------------------------- /test/assets/cproc-trace/4.3-wideint: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------- */ 2 | 3 | #define ns__aproc0 "::aproc" 4 | static void c__aproc0(Tcl_WideInt x) 5 | { 6 | 7 | } 8 | 9 | static int 10 | tcl__aproc0(ClientData cd, Tcl_Interp *interp, Tcl_Size oc, Tcl_Obj *CONST ov[]) 11 | { 12 | Tcl_WideInt _x; 13 | 14 | critcl_trace_cmd_args (ns__aproc0, oc, ov); 15 | 16 | if (oc != 2) { 17 | Tcl_WrongNumArgs(interp, 1, ov, "x"); 18 | return critcl_trace_cmd_result (TCL_ERROR, interp); 19 | } 20 | 21 | /* (wideint x) - - -- --- ----- -------- */ 22 | { 23 | if (Tcl_GetWideIntFromObj(interp, ov[1], &_x) != TCL_OK) return critcl_trace_cmd_result (TCL_ERROR, interp); } 24 | 25 | /* Call - - -- --- ----- -------- */ 26 | c__aproc0(_x); 27 | 28 | /* (void return) - - -- --- ----- -------- */ 29 | return critcl_trace_cmd_result (TCL_OK, interp); 30 | } 31 | -------------------------------------------------------------------------------- /test/assets/cproc-trace/4.4-double: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------- */ 2 | 3 | #define ns__aproc0 "::aproc" 4 | static void c__aproc0(double x) 5 | { 6 | 7 | } 8 | 9 | static int 10 | tcl__aproc0(ClientData cd, Tcl_Interp *interp, Tcl_Size oc, Tcl_Obj *CONST ov[]) 11 | { 12 | double _x; 13 | 14 | critcl_trace_cmd_args (ns__aproc0, oc, ov); 15 | 16 | if (oc != 2) { 17 | Tcl_WrongNumArgs(interp, 1, ov, "x"); 18 | return critcl_trace_cmd_result (TCL_ERROR, interp); 19 | } 20 | 21 | /* (double x) - - -- --- ----- -------- */ 22 | { 23 | if (Tcl_GetDoubleFromObj(interp, ov[1], &_x) != TCL_OK) return critcl_trace_cmd_result (TCL_ERROR, interp); } 24 | 25 | /* Call - - -- --- ----- -------- */ 26 | c__aproc0(_x); 27 | 28 | /* (void return) - - -- --- ----- -------- */ 29 | return critcl_trace_cmd_result (TCL_OK, interp); 30 | } 31 | -------------------------------------------------------------------------------- /test/assets/cproc-trace/4.5-float: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------- */ 2 | 3 | #define ns__aproc0 "::aproc" 4 | static void c__aproc0(float x) 5 | { 6 | 7 | } 8 | 9 | static int 10 | tcl__aproc0(ClientData cd, Tcl_Interp *interp, Tcl_Size oc, Tcl_Obj *CONST ov[]) 11 | { 12 | float _x; 13 | 14 | critcl_trace_cmd_args (ns__aproc0, oc, ov); 15 | 16 | if (oc != 2) { 17 | Tcl_WrongNumArgs(interp, 1, ov, "x"); 18 | return critcl_trace_cmd_result (TCL_ERROR, interp); 19 | } 20 | 21 | /* (float x) - - -- --- ----- -------- */ 22 | { 23 | double t; 24 | if (Tcl_GetDoubleFromObj(interp, ov[1], &t) != TCL_OK) return critcl_trace_cmd_result (TCL_ERROR, interp); 25 | _x = (float) t; } 26 | 27 | /* Call - - -- --- ----- -------- */ 28 | c__aproc0(_x); 29 | 30 | /* (void return) - - -- --- ----- -------- */ 31 | return critcl_trace_cmd_result (TCL_OK, interp); 32 | } 33 | -------------------------------------------------------------------------------- /test/assets/cproc-trace/4.6-int_gt_0: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------- */ 2 | 3 | #define ns__aproc0 "::aproc" 4 | static void c__aproc0(int x) 5 | { 6 | 7 | } 8 | 9 | static int 10 | tcl__aproc0(ClientData cd, Tcl_Interp *interp, Tcl_Size oc, Tcl_Obj *CONST ov[]) 11 | { 12 | int _x; 13 | 14 | critcl_trace_cmd_args (ns__aproc0, oc, ov); 15 | 16 | if (oc != 2) { 17 | Tcl_WrongNumArgs(interp, 1, ov, "x"); 18 | return critcl_trace_cmd_result (TCL_ERROR, interp); 19 | } 20 | 21 | /* (int > 0 x) - - -- --- ----- -------- */ 22 | { 23 | { 24 | if (Tcl_GetIntFromObj(interp, ov[1], &_x) != TCL_OK) return critcl_trace_cmd_result (TCL_ERROR, interp); } 25 | /* Range check, assert (x > 0) */ 26 | if (!(_x > 0)) { 27 | Tcl_AppendResult (interp, "expected int > 0, but got \"", Tcl_GetString (ov[1]), "\"", NULL); 28 | return critcl_trace_cmd_result (TCL_ERROR, interp); 29 | } } 30 | 31 | /* Call - - -- --- ----- -------- */ 32 | c__aproc0(_x); 33 | 34 | /* (void return) - - -- --- ----- -------- */ 35 | return critcl_trace_cmd_result (TCL_OK, interp); 36 | } 37 | -------------------------------------------------------------------------------- /test/assets/cproc-trace/4.7-char_: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------- */ 2 | 3 | #define ns__aproc0 "::aproc" 4 | static void c__aproc0(const char* x) 5 | { 6 | 7 | } 8 | 9 | static int 10 | tcl__aproc0(ClientData cd, Tcl_Interp *interp, Tcl_Size oc, Tcl_Obj *CONST ov[]) 11 | { 12 | const char* _x; 13 | 14 | critcl_trace_cmd_args (ns__aproc0, oc, ov); 15 | 16 | if (oc != 2) { 17 | Tcl_WrongNumArgs(interp, 1, ov, "x"); 18 | return critcl_trace_cmd_result (TCL_ERROR, interp); 19 | } 20 | 21 | /* (char* x) - - -- --- ----- -------- */ 22 | { 23 | _x = Tcl_GetString(ov[1]); } 24 | 25 | /* Call - - -- --- ----- -------- */ 26 | c__aproc0(_x); 27 | 28 | /* (void return) - - -- --- ----- -------- */ 29 | return critcl_trace_cmd_result (TCL_OK, interp); 30 | } 31 | -------------------------------------------------------------------------------- /test/assets/cproc-trace/4.8-pstring: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------- */ 2 | 3 | #define ns__aproc0 "::aproc" 4 | #ifndef CRITCL_pstring 5 | #define CRITCL_pstring 6 | 7 | typedef struct critcl_pstring { 8 | Tcl_Obj* o; 9 | const char* s; 10 | Tcl_Size len; 11 | } critcl_pstring; 12 | 13 | #endif /* CRITCL_pstring _________ */ 14 | 15 | static void c__aproc0(critcl_pstring x) 16 | { 17 | 18 | } 19 | 20 | static int 21 | tcl__aproc0(ClientData cd, Tcl_Interp *interp, Tcl_Size oc, Tcl_Obj *CONST ov[]) 22 | { 23 | critcl_pstring _x; 24 | 25 | critcl_trace_cmd_args (ns__aproc0, oc, ov); 26 | 27 | if (oc != 2) { 28 | Tcl_WrongNumArgs(interp, 1, ov, "x"); 29 | return critcl_trace_cmd_result (TCL_ERROR, interp); 30 | } 31 | 32 | /* (pstring x) - - -- --- ----- -------- */ 33 | { 34 | _x.s = Tcl_GetStringFromObj(ov[1], &(_x.len)); 35 | _x.o = ov[1]; } 36 | 37 | /* Call - - -- --- ----- -------- */ 38 | c__aproc0(_x); 39 | 40 | /* (void return) - - -- --- ----- -------- */ 41 | return critcl_trace_cmd_result (TCL_OK, interp); 42 | } 43 | -------------------------------------------------------------------------------- /test/assets/cproc-trace/5.x: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------- */ 2 | 3 | #define ns__aproc0 "::aproc" 4 | static void c__aproc0(int x, int y) 5 | { 6 | 7 | } 8 | 9 | static int 10 | tcl__aproc0(ClientData cd, Tcl_Interp *interp, Tcl_Size oc, Tcl_Obj *CONST ov[]) 11 | { 12 | int _x; 13 | int _y; 14 | 15 | critcl_trace_cmd_args (ns__aproc0, oc, ov); 16 | 17 | if (oc != 3) { 18 | Tcl_WrongNumArgs(interp, 1, ov, "x y"); 19 | return critcl_trace_cmd_result (TCL_ERROR, interp); 20 | } 21 | 22 | /* (int x) - - -- --- ----- -------- */ 23 | { 24 | if (Tcl_GetIntFromObj(interp, ov[1], &_x) != TCL_OK) return critcl_trace_cmd_result (TCL_ERROR, interp); } 25 | 26 | 27 | /* (int y) - - -- --- ----- -------- */ 28 | { 29 | if (Tcl_GetIntFromObj(interp, ov[2], &_y) != TCL_OK) return critcl_trace_cmd_result (TCL_ERROR, interp); } 30 | 31 | /* Call - - -- --- ----- -------- */ 32 | c__aproc0(_x, _y); 33 | 34 | /* (void return) - - -- --- ----- -------- */ 35 | return critcl_trace_cmd_result (TCL_OK, interp); 36 | } 37 | -------------------------------------------------------------------------------- /test/assets/cproc-trace/6.0-int_gt_4: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------- */ 2 | 3 | #define ns__aproc0 "::aproc" 4 | static void c__aproc0(int x) 5 | { 6 | 7 | } 8 | 9 | static int 10 | tcl__aproc0(ClientData cd, Tcl_Interp *interp, Tcl_Size oc, Tcl_Obj *CONST ov[]) 11 | { 12 | int _x; 13 | 14 | critcl_trace_cmd_args (ns__aproc0, oc, ov); 15 | 16 | if (oc != 2) { 17 | Tcl_WrongNumArgs(interp, 1, ov, "x"); 18 | return critcl_trace_cmd_result (TCL_ERROR, interp); 19 | } 20 | 21 | /* (int > 4 x) - - -- --- ----- -------- */ 22 | { 23 | { 24 | if (Tcl_GetIntFromObj(interp, ov[1], &_x) != TCL_OK) return critcl_trace_cmd_result (TCL_ERROR, interp); } 25 | /* Range check, assert (x > 4) */ 26 | if (!(_x > 4)) { 27 | Tcl_AppendResult (interp, "expected int > 4, but got \"", Tcl_GetString (ov[1]), "\"", NULL); 28 | return critcl_trace_cmd_result (TCL_ERROR, interp); 29 | } } 30 | 31 | /* Call - - -- --- ----- -------- */ 32 | c__aproc0(_x); 33 | 34 | /* (void return) - - -- --- ----- -------- */ 35 | return critcl_trace_cmd_result (TCL_OK, interp); 36 | } 37 | -------------------------------------------------------------------------------- /test/assets/cproc-trace/6.2-int_lt_8: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------- */ 2 | 3 | #define ns__aproc0 "::aproc" 4 | static void c__aproc0(int x) 5 | { 6 | 7 | } 8 | 9 | static int 10 | tcl__aproc0(ClientData cd, Tcl_Interp *interp, Tcl_Size oc, Tcl_Obj *CONST ov[]) 11 | { 12 | int _x; 13 | 14 | critcl_trace_cmd_args (ns__aproc0, oc, ov); 15 | 16 | if (oc != 2) { 17 | Tcl_WrongNumArgs(interp, 1, ov, "x"); 18 | return critcl_trace_cmd_result (TCL_ERROR, interp); 19 | } 20 | 21 | /* (int < 8 x) - - -- --- ----- -------- */ 22 | { 23 | { 24 | if (Tcl_GetIntFromObj(interp, ov[1], &_x) != TCL_OK) return critcl_trace_cmd_result (TCL_ERROR, interp); } 25 | /* Range check, assert (x < 8) */ 26 | if (!(_x < 8)) { 27 | Tcl_AppendResult (interp, "expected int < 8, but got \"", Tcl_GetString (ov[1]), "\"", NULL); 28 | return critcl_trace_cmd_result (TCL_ERROR, interp); 29 | } } 30 | 31 | /* Call - - -- --- ----- -------- */ 32 | c__aproc0(_x); 33 | 34 | /* (void return) - - -- --- ----- -------- */ 35 | return critcl_trace_cmd_result (TCL_OK, interp); 36 | } 37 | -------------------------------------------------------------------------------- /test/assets/cproc-trace/6.4-int_gt_2_ge_4: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------- */ 2 | 3 | #define ns__aproc0 "::aproc" 4 | static void c__aproc0(int x) 5 | { 6 | 7 | } 8 | 9 | static int 10 | tcl__aproc0(ClientData cd, Tcl_Interp *interp, Tcl_Size oc, Tcl_Obj *CONST ov[]) 11 | { 12 | int _x; 13 | 14 | critcl_trace_cmd_args (ns__aproc0, oc, ov); 15 | 16 | if (oc != 2) { 17 | Tcl_WrongNumArgs(interp, 1, ov, "x"); 18 | return critcl_trace_cmd_result (TCL_ERROR, interp); 19 | } 20 | 21 | /* (int >= 4 x) - - -- --- ----- -------- */ 22 | { 23 | { 24 | if (Tcl_GetIntFromObj(interp, ov[1], &_x) != TCL_OK) return critcl_trace_cmd_result (TCL_ERROR, interp); } 25 | /* Range check, assert (x >= 4) */ 26 | if (!(_x >= 4)) { 27 | Tcl_AppendResult (interp, "expected int >= 4, but got \"", Tcl_GetString (ov[1]), "\"", NULL); 28 | return critcl_trace_cmd_result (TCL_ERROR, interp); 29 | } } 30 | 31 | /* Call - - -- --- ----- -------- */ 32 | c__aproc0(_x); 33 | 34 | /* (void return) - - -- --- ----- -------- */ 35 | return critcl_trace_cmd_result (TCL_OK, interp); 36 | } 37 | -------------------------------------------------------------------------------- /test/assets/cproc-trace/6.5-int_lt_2_lt_4_lt_6: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------- */ 2 | 3 | #define ns__aproc0 "::aproc" 4 | static void c__aproc0(int x) 5 | { 6 | 7 | } 8 | 9 | static int 10 | tcl__aproc0(ClientData cd, Tcl_Interp *interp, Tcl_Size oc, Tcl_Obj *CONST ov[]) 11 | { 12 | int _x; 13 | 14 | critcl_trace_cmd_args (ns__aproc0, oc, ov); 15 | 16 | if (oc != 2) { 17 | Tcl_WrongNumArgs(interp, 1, ov, "x"); 18 | return critcl_trace_cmd_result (TCL_ERROR, interp); 19 | } 20 | 21 | /* (int < 2 x) - - -- --- ----- -------- */ 22 | { 23 | { 24 | if (Tcl_GetIntFromObj(interp, ov[1], &_x) != TCL_OK) return critcl_trace_cmd_result (TCL_ERROR, interp); } 25 | /* Range check, assert (x < 2) */ 26 | if (!(_x < 2)) { 27 | Tcl_AppendResult (interp, "expected int < 2, but got \"", Tcl_GetString (ov[1]), "\"", NULL); 28 | return critcl_trace_cmd_result (TCL_ERROR, interp); 29 | } } 30 | 31 | /* Call - - -- --- ----- -------- */ 32 | c__aproc0(_x); 33 | 34 | /* (void return) - - -- --- ----- -------- */ 35 | return critcl_trace_cmd_result (TCL_OK, interp); 36 | } 37 | -------------------------------------------------------------------------------- /test/assets/cproc-trace/6.6-int_lt_2_le_4: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------- */ 2 | 3 | #define ns__aproc0 "::aproc" 4 | static void c__aproc0(int x) 5 | { 6 | 7 | } 8 | 9 | static int 10 | tcl__aproc0(ClientData cd, Tcl_Interp *interp, Tcl_Size oc, Tcl_Obj *CONST ov[]) 11 | { 12 | int _x; 13 | 14 | critcl_trace_cmd_args (ns__aproc0, oc, ov); 15 | 16 | if (oc != 2) { 17 | Tcl_WrongNumArgs(interp, 1, ov, "x"); 18 | return critcl_trace_cmd_result (TCL_ERROR, interp); 19 | } 20 | 21 | /* (int < 2 x) - - -- --- ----- -------- */ 22 | { 23 | { 24 | if (Tcl_GetIntFromObj(interp, ov[1], &_x) != TCL_OK) return critcl_trace_cmd_result (TCL_ERROR, interp); } 25 | /* Range check, assert (x < 2) */ 26 | if (!(_x < 2)) { 27 | Tcl_AppendResult (interp, "expected int < 2, but got \"", Tcl_GetString (ov[1]), "\"", NULL); 28 | return critcl_trace_cmd_result (TCL_ERROR, interp); 29 | } } 30 | 31 | /* Call - - -- --- ----- -------- */ 32 | c__aproc0(_x); 33 | 34 | /* (void return) - - -- --- ----- -------- */ 35 | return critcl_trace_cmd_result (TCL_OK, interp); 36 | } 37 | -------------------------------------------------------------------------------- /test/assets/cproc/2.0: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------- */ 2 | 3 | #define ns__aproc0 "::aproc" 4 | static void c__aproc0() 5 | { 6 | 7 | } 8 | 9 | static int 10 | tcl__aproc0(ClientData cd, Tcl_Interp *interp, Tcl_Size oc, Tcl_Obj *CONST ov[]) 11 | { 12 | 13 | if (oc != 1) { 14 | Tcl_WrongNumArgs(interp, 1, ov, NULL); 15 | return TCL_ERROR; 16 | } 17 | 18 | /* Call - - -- --- ----- -------- */ 19 | c__aproc0(); 20 | 21 | /* (void return) - - -- --- ----- -------- */ 22 | return TCL_OK; 23 | } 24 | -------------------------------------------------------------------------------- /test/assets/cproc/2.1: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------- */ 2 | 3 | #define ns__the_aproc0 "::the::aproc" 4 | static void c__the_aproc0() 5 | { 6 | 7 | } 8 | 9 | static int 10 | tcl__the_aproc0(ClientData cd, Tcl_Interp *interp, Tcl_Size oc, Tcl_Obj *CONST ov[]) 11 | { 12 | 13 | if (oc != 1) { 14 | Tcl_WrongNumArgs(interp, 1, ov, NULL); 15 | return TCL_ERROR; 16 | } 17 | 18 | /* Call - - -- --- ----- -------- */ 19 | c__the_aproc0(); 20 | 21 | /* (void return) - - -- --- ----- -------- */ 22 | return TCL_OK; 23 | } 24 | -------------------------------------------------------------------------------- /test/assets/cproc/2.14: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------- */ 2 | 3 | #define ns__aproc0 "::aproc" 4 | 5 | #ifndef CRITCL_variadic_object 6 | #define CRITCL_variadic_object 7 | 8 | typedef struct critcl_variadic_object { 9 | int c; 10 | Tcl_Obj* const* v; 11 | } critcl_variadic_object; 12 | 13 | #endif /* CRITCL_variadic_object _________ */ 14 | 15 | static void c__aproc0(critcl_variadic_object args) 16 | { 17 | 18 | } 19 | 20 | static int 21 | tcl__aproc0(ClientData cd, Tcl_Interp *interp, Tcl_Size oc, Tcl_Obj *CONST ov[]) 22 | { 23 | critcl_variadic_object _args; 24 | /* (object args, ...) - - -- --- ----- -------- */ 25 | { 26 | _args.c = (oc-1); 27 | _args.v = &ov[1]; } 28 | 29 | /* Call - - -- --- ----- -------- */ 30 | c__aproc0(_args); 31 | 32 | /* (void return) - - -- --- ----- -------- */ 33 | return TCL_OK; 34 | } 35 | -------------------------------------------------------------------------------- /test/assets/cproc/2.2: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------- */ 2 | 3 | #define ns__aproc_beta0 "::aproc+beta" 4 | static void c__aproc_beta0() 5 | { 6 | 7 | } 8 | 9 | static int 10 | tcl__aproc_beta0(ClientData cd, Tcl_Interp *interp, Tcl_Size oc, Tcl_Obj *CONST ov[]) 11 | { 12 | 13 | if (oc != 1) { 14 | Tcl_WrongNumArgs(interp, 1, ov, NULL); 15 | return TCL_ERROR; 16 | } 17 | 18 | /* Call - - -- --- ----- -------- */ 19 | c__aproc_beta0(); 20 | 21 | /* (void return) - - -- --- ----- -------- */ 22 | return TCL_OK; 23 | } 24 | -------------------------------------------------------------------------------- /test/assets/cproc/2.3: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------- */ 2 | 3 | static void c_snafu() 4 | { 5 | 6 | } 7 | 8 | static int 9 | snafu(ClientData cd, Tcl_Interp *interp, Tcl_Size oc, Tcl_Obj *CONST ov[]) 10 | { 11 | 12 | if (oc != 1) { 13 | Tcl_WrongNumArgs(interp, 1, ov, NULL); 14 | return TCL_ERROR; 15 | } 16 | 17 | /* Call - - -- --- ----- -------- */ 18 | c_snafu(); 19 | 20 | /* (void return) - - -- --- ----- -------- */ 21 | return TCL_OK; 22 | } 23 | -------------------------------------------------------------------------------- /test/assets/cproc/2.4: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------- */ 2 | 3 | #define ns__aproc0 "::aproc" 4 | static void c__aproc0(ClientData clientdata) 5 | { 6 | 7 | } 8 | 9 | static int 10 | tcl__aproc0(ClientData cd, Tcl_Interp *interp, Tcl_Size oc, Tcl_Obj *CONST ov[]) 11 | { 12 | 13 | if (oc != 1) { 14 | Tcl_WrongNumArgs(interp, 1, ov, NULL); 15 | return TCL_ERROR; 16 | } 17 | 18 | /* Call - - -- --- ----- -------- */ 19 | c__aproc0(cd); 20 | 21 | /* (void return) - - -- --- ----- -------- */ 22 | return TCL_OK; 23 | } 24 | -------------------------------------------------------------------------------- /test/assets/cproc/2.5: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------- */ 2 | 3 | #define ns__aproc0 "::aproc" 4 | static void c__aproc0() 5 | { 6 | 7 | } 8 | 9 | static int 10 | tcl__aproc0(ClientData cd, Tcl_Interp *interp, Tcl_Size oc, Tcl_Obj *CONST ov[]) 11 | { 12 | 13 | if (oc != 4) { 14 | Tcl_WrongNumArgs(interp, 4, ov, NULL); 15 | return TCL_ERROR; 16 | } 17 | 18 | /* Call - - -- --- ----- -------- */ 19 | c__aproc0(); 20 | 21 | /* (void return) - - -- --- ----- -------- */ 22 | return TCL_OK; 23 | } 24 | -------------------------------------------------------------------------------- /test/assets/cproc/2.6: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------- */ 2 | 3 | #define ns__aproc0 "::aproc" 4 | static void c__aproc0(int anargument) 5 | { 6 | 7 | } 8 | 9 | static int 10 | tcl__aproc0(ClientData cd, Tcl_Interp *interp, Tcl_Size oc, Tcl_Obj *CONST ov[]) 11 | { 12 | int _anargument; 13 | 14 | if (oc != 2) { 15 | Tcl_WrongNumArgs(interp, 1, ov, "anargument"); 16 | return TCL_ERROR; 17 | } 18 | 19 | /* (int anargument) - - -- --- ----- -------- */ 20 | { 21 | if (Tcl_GetIntFromObj(interp, ov[1], &_anargument) != TCL_OK) return TCL_ERROR; } 22 | 23 | /* Call - - -- --- ----- -------- */ 24 | c__aproc0(_anargument); 25 | 26 | /* (void return) - - -- --- ----- -------- */ 27 | return TCL_OK; 28 | } 29 | -------------------------------------------------------------------------------- /test/assets/cproc/2.7: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------- */ 2 | 3 | #define ns__aproc0 "::aproc" 4 | static void c__aproc0(int has_anargument, int anargument) 5 | { 6 | 7 | } 8 | 9 | static int 10 | tcl__aproc0(ClientData cd, Tcl_Interp *interp, Tcl_Size oc, Tcl_Obj *CONST ov[]) 11 | { 12 | int _has_anargument = 0; 13 | int _anargument; 14 | int idx_; 15 | int argc_; 16 | 17 | if ((oc < 1) || (2 < oc)) { 18 | Tcl_WrongNumArgs(interp, 1, ov, "?anargument?"); 19 | return TCL_ERROR; 20 | } 21 | 22 | idx_ = 1; 23 | argc_ = oc - 1; 24 | 25 | /* (int anargument, optional, default -1) - - -- --- ----- -------- */ 26 | if (argc_ > 0) { 27 | { 28 | if (Tcl_GetIntFromObj(interp, ov[idx_], &_anargument) != TCL_OK) return TCL_ERROR; } 29 | _has_anargument = 1; 30 | } else { 31 | _anargument = -1; 32 | } 33 | 34 | /* Call - - -- --- ----- -------- */ 35 | c__aproc0(_has_anargument, _anargument); 36 | 37 | /* (void return) - - -- --- ----- -------- */ 38 | return TCL_OK; 39 | } 40 | -------------------------------------------------------------------------------- /test/assets/cproc/2.9: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------- */ 2 | 3 | #define ns__aproc0 "::aproc" 4 | static int c__aproc0() 5 | { 6 | 7 | } 8 | 9 | static int 10 | tcl__aproc0(ClientData cd, Tcl_Interp *interp, Tcl_Size oc, Tcl_Obj *CONST ov[]) 11 | { 12 | int rv; 13 | if (oc != 1) { 14 | Tcl_WrongNumArgs(interp, 1, ov, NULL); 15 | return TCL_ERROR; 16 | } 17 | 18 | /* Call - - -- --- ----- -------- */ 19 | rv = c__aproc0(); 20 | 21 | /* (int return) - - -- --- ----- -------- */ 22 | Tcl_SetObjResult(interp, Tcl_NewIntObj(rv)); 23 | return TCL_OK; 24 | } 25 | -------------------------------------------------------------------------------- /test/assets/cproc/3.0: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------- */ 2 | 3 | #define ns__aproc0 "::aproc" 4 | static void c__aproc0() 5 | { 6 | 7 | } 8 | 9 | static int 10 | tcl__aproc0(ClientData cd, Tcl_Interp *interp, Tcl_Size oc, Tcl_Obj *CONST ov[]) 11 | { 12 | 13 | if (oc != 1) { 14 | Tcl_WrongNumArgs(interp, 1, ov, NULL); 15 | return TCL_ERROR; 16 | } 17 | 18 | /* Call - - -- --- ----- -------- */ 19 | c__aproc0(); 20 | 21 | /* (void return) - - -- --- ----- -------- */ 22 | return TCL_OK; 23 | } 24 | -------------------------------------------------------------------------------- /test/assets/cproc/3.1: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------- */ 2 | 3 | #define ns__aproc0 "::aproc" 4 | static int c__aproc0() 5 | { 6 | return TCL_OK; 7 | } 8 | 9 | static int 10 | tcl__aproc0(ClientData cd, Tcl_Interp *interp, Tcl_Size oc, Tcl_Obj *CONST ov[]) 11 | { 12 | int rv; 13 | if (oc != 1) { 14 | Tcl_WrongNumArgs(interp, 1, ov, NULL); 15 | return TCL_ERROR; 16 | } 17 | 18 | /* Call - - -- --- ----- -------- */ 19 | rv = c__aproc0(); 20 | 21 | /* (ok return) - - -- --- ----- -------- */ 22 | return rv; 23 | } 24 | -------------------------------------------------------------------------------- /test/assets/cproc/3.10: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------- */ 2 | 3 | #define ns__aproc0 "::aproc" 4 | static char* c__aproc0() 5 | { 6 | return alloc_string("bar"); 7 | } 8 | 9 | static int 10 | tcl__aproc0(ClientData cd, Tcl_Interp *interp, Tcl_Size oc, Tcl_Obj *CONST ov[]) 11 | { 12 | char* rv; 13 | if (oc != 1) { 14 | Tcl_WrongNumArgs(interp, 1, ov, NULL); 15 | return TCL_ERROR; 16 | } 17 | 18 | /* Call - - -- --- ----- -------- */ 19 | rv = c__aproc0(); 20 | 21 | /* (dstring return) - - -- --- ----- -------- */ 22 | Tcl_SetResult (interp, rv, TCL_DYNAMIC); 23 | return TCL_OK; 24 | } 25 | -------------------------------------------------------------------------------- /test/assets/cproc/3.11: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------- */ 2 | 3 | #define ns__aproc0 "::aproc" 4 | static Tcl_Obj* c__aproc0() 5 | { 6 | return Tcl_NewIntObj(0); 7 | } 8 | 9 | static int 10 | tcl__aproc0(ClientData cd, Tcl_Interp *interp, Tcl_Size oc, Tcl_Obj *CONST ov[]) 11 | { 12 | Tcl_Obj* rv; 13 | if (oc != 1) { 14 | Tcl_WrongNumArgs(interp, 1, ov, NULL); 15 | return TCL_ERROR; 16 | } 17 | 18 | /* Call - - -- --- ----- -------- */ 19 | rv = c__aproc0(); 20 | 21 | /* (object return) - - -- --- ----- -------- */ 22 | if (rv == NULL) { return TCL_ERROR; } 23 | Tcl_SetObjResult(interp, rv); 24 | Tcl_DecrRefCount(rv); 25 | return TCL_OK; 26 | } 27 | -------------------------------------------------------------------------------- /test/assets/cproc/3.12: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------- */ 2 | 3 | #define ns__aproc0 "::aproc" 4 | static Tcl_Channel c__aproc0() 5 | { 6 | return Tcl_OpenFileChannel (interp, "/tmp", "r", 0); 7 | } 8 | 9 | static int 10 | tcl__aproc0(ClientData cd, Tcl_Interp *interp, Tcl_Size oc, Tcl_Obj *CONST ov[]) 11 | { 12 | Tcl_Channel rv; 13 | if (oc != 1) { 14 | Tcl_WrongNumArgs(interp, 1, ov, NULL); 15 | return TCL_ERROR; 16 | } 17 | 18 | /* Call - - -- --- ----- -------- */ 19 | rv = c__aproc0(); 20 | 21 | /* (new-channel return) - - -- --- ----- -------- */ 22 | if (rv == NULL) { return TCL_ERROR; } 23 | Tcl_RegisterChannel (interp, rv); 24 | Tcl_SetObjResult (interp, Tcl_NewStringObj (Tcl_GetChannelName (rv), -1)); 25 | return TCL_OK; 26 | } 27 | -------------------------------------------------------------------------------- /test/assets/cproc/3.13: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------- */ 2 | 3 | #define ns__aproc0 "::aproc" 4 | static Tcl_Channel c__aproc0() 5 | { 6 | return Tcl_GetStdChannel (0); 7 | } 8 | 9 | static int 10 | tcl__aproc0(ClientData cd, Tcl_Interp *interp, Tcl_Size oc, Tcl_Obj *CONST ov[]) 11 | { 12 | Tcl_Channel rv; 13 | if (oc != 1) { 14 | Tcl_WrongNumArgs(interp, 1, ov, NULL); 15 | return TCL_ERROR; 16 | } 17 | 18 | /* Call - - -- --- ----- -------- */ 19 | rv = c__aproc0(); 20 | 21 | /* (known-channel return) - - -- --- ----- -------- */ 22 | if (rv == NULL) { return TCL_ERROR; } 23 | Tcl_SetObjResult (interp, Tcl_NewStringObj (Tcl_GetChannelName (rv), -1)); 24 | return TCL_OK; 25 | } 26 | -------------------------------------------------------------------------------- /test/assets/cproc/3.14: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------- */ 2 | 3 | #define ns__aproc0 "::aproc" 4 | static Tcl_Channel c__aproc0() 5 | { 6 | return 0; 7 | } 8 | 9 | static int 10 | tcl__aproc0(ClientData cd, Tcl_Interp *interp, Tcl_Size oc, Tcl_Obj *CONST ov[]) 11 | { 12 | Tcl_Channel rv; 13 | if (oc != 1) { 14 | Tcl_WrongNumArgs(interp, 1, ov, NULL); 15 | return TCL_ERROR; 16 | } 17 | 18 | /* Call - - -- --- ----- -------- */ 19 | rv = c__aproc0(); 20 | 21 | /* (return-channel return) - - -- --- ----- -------- */ 22 | if (rv == NULL) { return TCL_ERROR; } 23 | Tcl_RegisterChannel (interp, rv); 24 | Tcl_UnregisterChannel(NULL, rv); 25 | Tcl_SetObjResult (interp, Tcl_NewStringObj (Tcl_GetChannelName (rv), -1)); 26 | return TCL_OK; 27 | } 28 | -------------------------------------------------------------------------------- /test/assets/cproc/3.2: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------- */ 2 | 3 | #define ns__aproc0 "::aproc" 4 | static int c__aproc0() 5 | { 6 | return 0; 7 | } 8 | 9 | static int 10 | tcl__aproc0(ClientData cd, Tcl_Interp *interp, Tcl_Size oc, Tcl_Obj *CONST ov[]) 11 | { 12 | int rv; 13 | if (oc != 1) { 14 | Tcl_WrongNumArgs(interp, 1, ov, NULL); 15 | return TCL_ERROR; 16 | } 17 | 18 | /* Call - - -- --- ----- -------- */ 19 | rv = c__aproc0(); 20 | 21 | /* (int return) - - -- --- ----- -------- */ 22 | Tcl_SetObjResult(interp, Tcl_NewIntObj(rv)); 23 | return TCL_OK; 24 | } 25 | -------------------------------------------------------------------------------- /test/assets/cproc/3.3: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------- */ 2 | 3 | #define ns__aproc0 "::aproc" 4 | static int c__aproc0() 5 | { 6 | return 1; 7 | } 8 | 9 | static int 10 | tcl__aproc0(ClientData cd, Tcl_Interp *interp, Tcl_Size oc, Tcl_Obj *CONST ov[]) 11 | { 12 | int rv; 13 | if (oc != 1) { 14 | Tcl_WrongNumArgs(interp, 1, ov, NULL); 15 | return TCL_ERROR; 16 | } 17 | 18 | /* Call - - -- --- ----- -------- */ 19 | rv = c__aproc0(); 20 | 21 | /* (bool return) - - -- --- ----- -------- */ 22 | Tcl_SetObjResult(interp, Tcl_NewIntObj(rv)); 23 | return TCL_OK; 24 | } 25 | -------------------------------------------------------------------------------- /test/assets/cproc/3.4: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------- */ 2 | 3 | #define ns__aproc0 "::aproc" 4 | static int c__aproc0() 5 | { 6 | return 1; 7 | } 8 | 9 | static int 10 | tcl__aproc0(ClientData cd, Tcl_Interp *interp, Tcl_Size oc, Tcl_Obj *CONST ov[]) 11 | { 12 | int rv; 13 | if (oc != 1) { 14 | Tcl_WrongNumArgs(interp, 1, ov, NULL); 15 | return TCL_ERROR; 16 | } 17 | 18 | /* Call - - -- --- ----- -------- */ 19 | rv = c__aproc0(); 20 | 21 | /* (boolean return) - - -- --- ----- -------- */ 22 | Tcl_SetObjResult(interp, Tcl_NewIntObj(rv)); 23 | return TCL_OK; 24 | } 25 | -------------------------------------------------------------------------------- /test/assets/cproc/3.5: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------- */ 2 | 3 | #define ns__aproc0 "::aproc" 4 | static long c__aproc0() 5 | { 6 | return 1; 7 | } 8 | 9 | static int 10 | tcl__aproc0(ClientData cd, Tcl_Interp *interp, Tcl_Size oc, Tcl_Obj *CONST ov[]) 11 | { 12 | long rv; 13 | if (oc != 1) { 14 | Tcl_WrongNumArgs(interp, 1, ov, NULL); 15 | return TCL_ERROR; 16 | } 17 | 18 | /* Call - - -- --- ----- -------- */ 19 | rv = c__aproc0(); 20 | 21 | /* (long return) - - -- --- ----- -------- */ 22 | Tcl_SetObjResult(interp, Tcl_NewLongObj(rv)); 23 | return TCL_OK; 24 | } 25 | -------------------------------------------------------------------------------- /test/assets/cproc/3.6: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------- */ 2 | 3 | #define ns__aproc0 "::aproc" 4 | static Tcl_WideInt c__aproc0() 5 | { 6 | return 1; 7 | } 8 | 9 | static int 10 | tcl__aproc0(ClientData cd, Tcl_Interp *interp, Tcl_Size oc, Tcl_Obj *CONST ov[]) 11 | { 12 | Tcl_WideInt rv; 13 | if (oc != 1) { 14 | Tcl_WrongNumArgs(interp, 1, ov, NULL); 15 | return TCL_ERROR; 16 | } 17 | 18 | /* Call - - -- --- ----- -------- */ 19 | rv = c__aproc0(); 20 | 21 | /* (wideint return) - - -- --- ----- -------- */ 22 | Tcl_SetObjResult(interp, Tcl_NewWideIntObj(rv)); 23 | return TCL_OK; 24 | } 25 | -------------------------------------------------------------------------------- /test/assets/cproc/3.7: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------- */ 2 | 3 | #define ns__aproc0 "::aproc" 4 | static double c__aproc0() 5 | { 6 | return 0.; 7 | } 8 | 9 | static int 10 | tcl__aproc0(ClientData cd, Tcl_Interp *interp, Tcl_Size oc, Tcl_Obj *CONST ov[]) 11 | { 12 | double rv; 13 | if (oc != 1) { 14 | Tcl_WrongNumArgs(interp, 1, ov, NULL); 15 | return TCL_ERROR; 16 | } 17 | 18 | /* Call - - -- --- ----- -------- */ 19 | rv = c__aproc0(); 20 | 21 | /* (double return) - - -- --- ----- -------- */ 22 | Tcl_SetObjResult(interp, Tcl_NewDoubleObj(rv)); 23 | return TCL_OK; 24 | } 25 | -------------------------------------------------------------------------------- /test/assets/cproc/3.8: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------- */ 2 | 3 | #define ns__aproc0 "::aproc" 4 | static float c__aproc0() 5 | { 6 | return 0.; 7 | } 8 | 9 | static int 10 | tcl__aproc0(ClientData cd, Tcl_Interp *interp, Tcl_Size oc, Tcl_Obj *CONST ov[]) 11 | { 12 | float rv; 13 | if (oc != 1) { 14 | Tcl_WrongNumArgs(interp, 1, ov, NULL); 15 | return TCL_ERROR; 16 | } 17 | 18 | /* Call - - -- --- ----- -------- */ 19 | rv = c__aproc0(); 20 | 21 | /* (float return) - - -- --- ----- -------- */ 22 | Tcl_SetObjResult(interp, Tcl_NewDoubleObj(rv)); 23 | return TCL_OK; 24 | } 25 | -------------------------------------------------------------------------------- /test/assets/cproc/3.9: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------- */ 2 | 3 | #define ns__aproc0 "::aproc" 4 | static char* c__aproc0() 5 | { 6 | return "foo"; 7 | } 8 | 9 | static int 10 | tcl__aproc0(ClientData cd, Tcl_Interp *interp, Tcl_Size oc, Tcl_Obj *CONST ov[]) 11 | { 12 | char* rv; 13 | if (oc != 1) { 14 | Tcl_WrongNumArgs(interp, 1, ov, NULL); 15 | return TCL_ERROR; 16 | } 17 | 18 | /* Call - - -- --- ----- -------- */ 19 | rv = c__aproc0(); 20 | 21 | /* (vstring return) - - -- --- ----- -------- */ 22 | Tcl_SetObjResult(interp, Tcl_NewStringObj(rv, -1)); 23 | return TCL_OK; 24 | } 25 | -------------------------------------------------------------------------------- /test/assets/cproc/4.0-int: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------- */ 2 | 3 | #define ns__aproc0 "::aproc" 4 | static void c__aproc0(int x) 5 | { 6 | 7 | } 8 | 9 | static int 10 | tcl__aproc0(ClientData cd, Tcl_Interp *interp, Tcl_Size oc, Tcl_Obj *CONST ov[]) 11 | { 12 | int _x; 13 | 14 | if (oc != 2) { 15 | Tcl_WrongNumArgs(interp, 1, ov, "x"); 16 | return TCL_ERROR; 17 | } 18 | 19 | /* (int x) - - -- --- ----- -------- */ 20 | { 21 | if (Tcl_GetIntFromObj(interp, ov[1], &_x) != TCL_OK) return TCL_ERROR; } 22 | 23 | /* Call - - -- --- ----- -------- */ 24 | c__aproc0(_x); 25 | 26 | /* (void return) - - -- --- ----- -------- */ 27 | return TCL_OK; 28 | } 29 | -------------------------------------------------------------------------------- /test/assets/cproc/4.1-bool: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------- */ 2 | 3 | #define ns__aproc0 "::aproc" 4 | static void c__aproc0(int x) 5 | { 6 | 7 | } 8 | 9 | static int 10 | tcl__aproc0(ClientData cd, Tcl_Interp *interp, Tcl_Size oc, Tcl_Obj *CONST ov[]) 11 | { 12 | int _x; 13 | 14 | if (oc != 2) { 15 | Tcl_WrongNumArgs(interp, 1, ov, "x"); 16 | return TCL_ERROR; 17 | } 18 | 19 | /* (bool x) - - -- --- ----- -------- */ 20 | { 21 | if (Tcl_GetBooleanFromObj(interp, ov[1], &_x) != TCL_OK) return TCL_ERROR; } 22 | 23 | /* Call - - -- --- ----- -------- */ 24 | c__aproc0(_x); 25 | 26 | /* (void return) - - -- --- ----- -------- */ 27 | return TCL_OK; 28 | } 29 | -------------------------------------------------------------------------------- /test/assets/cproc/4.10-object: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------- */ 2 | 3 | #define ns__aproc0 "::aproc" 4 | static void c__aproc0(Tcl_Obj* x) 5 | { 6 | 7 | } 8 | 9 | static int 10 | tcl__aproc0(ClientData cd, Tcl_Interp *interp, Tcl_Size oc, Tcl_Obj *CONST ov[]) 11 | { 12 | Tcl_Obj* _x; 13 | 14 | if (oc != 2) { 15 | Tcl_WrongNumArgs(interp, 1, ov, "x"); 16 | return TCL_ERROR; 17 | } 18 | 19 | /* (object x) - - -- --- ----- -------- */ 20 | { 21 | _x = ov[1]; } 22 | 23 | /* Call - - -- --- ----- -------- */ 24 | c__aproc0(_x); 25 | 26 | /* (void return) - - -- --- ----- -------- */ 27 | return TCL_OK; 28 | } 29 | -------------------------------------------------------------------------------- /test/assets/cproc/4.12-bytes: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------- */ 2 | 3 | #define ns__aproc0 "::aproc" 4 | #ifndef CRITCL_bytes 5 | #define CRITCL_bytes 6 | 7 | typedef struct critcl_bytes { 8 | Tcl_Obj* o; 9 | const unsigned char* s; 10 | Tcl_Size len; 11 | } critcl_bytes; 12 | 13 | #endif /* CRITCL_bytes _________ */ 14 | 15 | static void c__aproc0(critcl_bytes x) 16 | { 17 | 18 | } 19 | 20 | static int 21 | tcl__aproc0(ClientData cd, Tcl_Interp *interp, Tcl_Size oc, Tcl_Obj *CONST ov[]) 22 | { 23 | critcl_bytes _x; 24 | 25 | if (oc != 2) { 26 | Tcl_WrongNumArgs(interp, 1, ov, "x"); 27 | return TCL_ERROR; 28 | } 29 | 30 | /* (bytes x) - - -- --- ----- -------- */ 31 | { 32 | /* Raw binary string _with_ length information */ 33 | _x.s = Tcl_GetBytesFromObj(interp, ov[1], &(_x.len)); 34 | if (_x.s == NULL) return TCL_ERROR; 35 | _x.o = ov[1]; } 36 | 37 | /* Call - - -- --- ----- -------- */ 38 | c__aproc0(_x); 39 | 40 | /* (void return) - - -- --- ----- -------- */ 41 | return TCL_OK; 42 | } 43 | -------------------------------------------------------------------------------- /test/assets/cproc/4.13-channel: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------- */ 2 | 3 | #define ns__aproc0 "::aproc" 4 | static void c__aproc0(Tcl_Channel x) 5 | { 6 | 7 | } 8 | 9 | static int 10 | tcl__aproc0(ClientData cd, Tcl_Interp *interp, Tcl_Size oc, Tcl_Obj *CONST ov[]) 11 | { 12 | Tcl_Channel _x; 13 | 14 | if (oc != 2) { 15 | Tcl_WrongNumArgs(interp, 1, ov, "x"); 16 | return TCL_ERROR; 17 | } 18 | 19 | /* (channel x) - - -- --- ----- -------- */ 20 | { 21 | int mode; 22 | _x = Tcl_GetChannel(interp, Tcl_GetString (ov[1]), &mode); 23 | if (_x == NULL) return TCL_ERROR; } 24 | 25 | /* Call - - -- --- ----- -------- */ 26 | c__aproc0(_x); 27 | 28 | /* (void return) - - -- --- ----- -------- */ 29 | return TCL_OK; 30 | } 31 | -------------------------------------------------------------------------------- /test/assets/cproc/4.14-unshared-channel: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------- */ 2 | 3 | #define ns__aproc0 "::aproc" 4 | static void c__aproc0(Tcl_Channel x) 5 | { 6 | 7 | } 8 | 9 | static int 10 | tcl__aproc0(ClientData cd, Tcl_Interp *interp, Tcl_Size oc, Tcl_Obj *CONST ov[]) 11 | { 12 | Tcl_Channel _x; 13 | 14 | if (oc != 2) { 15 | Tcl_WrongNumArgs(interp, 1, ov, "x"); 16 | return TCL_ERROR; 17 | } 18 | 19 | /* (unshared-channel x) - - -- --- ----- -------- */ 20 | { 21 | int mode; 22 | _x = Tcl_GetChannel(interp, Tcl_GetString (ov[1]), &mode); 23 | if (_x == NULL) return TCL_ERROR; 24 | if (Tcl_IsChannelShared (_x)) { 25 | Tcl_SetObjResult(interp, Tcl_NewStringObj("channel is shared", -1)); 26 | return TCL_ERROR; 27 | } } 28 | 29 | /* Call - - -- --- ----- -------- */ 30 | c__aproc0(_x); 31 | 32 | /* (void return) - - -- --- ----- -------- */ 33 | return TCL_OK; 34 | } 35 | -------------------------------------------------------------------------------- /test/assets/cproc/4.16-vobject: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------- */ 2 | 3 | #define ns__aproc0 "::aproc" 4 | 5 | #ifndef CRITCL_variadic_object 6 | #define CRITCL_variadic_object 7 | 8 | typedef struct critcl_variadic_object { 9 | int c; 10 | Tcl_Obj* const* v; 11 | } critcl_variadic_object; 12 | 13 | #endif /* CRITCL_variadic_object _________ */ 14 | 15 | static void c__aproc0(critcl_variadic_object args) 16 | { 17 | 18 | } 19 | 20 | static int 21 | tcl__aproc0(ClientData cd, Tcl_Interp *interp, Tcl_Size oc, Tcl_Obj *CONST ov[]) 22 | { 23 | critcl_variadic_object _args; 24 | /* (object args, ...) - - -- --- ----- -------- */ 25 | { 26 | _args.c = (oc-1); 27 | _args.v = &ov[1]; } 28 | 29 | /* Call - - -- --- ----- -------- */ 30 | c__aproc0(_args); 31 | 32 | /* (void return) - - -- --- ----- -------- */ 33 | return TCL_OK; 34 | } 35 | -------------------------------------------------------------------------------- /test/assets/cproc/4.2-long: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------- */ 2 | 3 | #define ns__aproc0 "::aproc" 4 | static void c__aproc0(long x) 5 | { 6 | 7 | } 8 | 9 | static int 10 | tcl__aproc0(ClientData cd, Tcl_Interp *interp, Tcl_Size oc, Tcl_Obj *CONST ov[]) 11 | { 12 | long _x; 13 | 14 | if (oc != 2) { 15 | Tcl_WrongNumArgs(interp, 1, ov, "x"); 16 | return TCL_ERROR; 17 | } 18 | 19 | /* (long x) - - -- --- ----- -------- */ 20 | { 21 | if (Tcl_GetLongFromObj(interp, ov[1], &_x) != TCL_OK) return TCL_ERROR; } 22 | 23 | /* Call - - -- --- ----- -------- */ 24 | c__aproc0(_x); 25 | 26 | /* (void return) - - -- --- ----- -------- */ 27 | return TCL_OK; 28 | } 29 | -------------------------------------------------------------------------------- /test/assets/cproc/4.3-wideint: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------- */ 2 | 3 | #define ns__aproc0 "::aproc" 4 | static void c__aproc0(Tcl_WideInt x) 5 | { 6 | 7 | } 8 | 9 | static int 10 | tcl__aproc0(ClientData cd, Tcl_Interp *interp, Tcl_Size oc, Tcl_Obj *CONST ov[]) 11 | { 12 | Tcl_WideInt _x; 13 | 14 | if (oc != 2) { 15 | Tcl_WrongNumArgs(interp, 1, ov, "x"); 16 | return TCL_ERROR; 17 | } 18 | 19 | /* (wideint x) - - -- --- ----- -------- */ 20 | { 21 | if (Tcl_GetWideIntFromObj(interp, ov[1], &_x) != TCL_OK) return TCL_ERROR; } 22 | 23 | /* Call - - -- --- ----- -------- */ 24 | c__aproc0(_x); 25 | 26 | /* (void return) - - -- --- ----- -------- */ 27 | return TCL_OK; 28 | } 29 | -------------------------------------------------------------------------------- /test/assets/cproc/4.4-double: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------- */ 2 | 3 | #define ns__aproc0 "::aproc" 4 | static void c__aproc0(double x) 5 | { 6 | 7 | } 8 | 9 | static int 10 | tcl__aproc0(ClientData cd, Tcl_Interp *interp, Tcl_Size oc, Tcl_Obj *CONST ov[]) 11 | { 12 | double _x; 13 | 14 | if (oc != 2) { 15 | Tcl_WrongNumArgs(interp, 1, ov, "x"); 16 | return TCL_ERROR; 17 | } 18 | 19 | /* (double x) - - -- --- ----- -------- */ 20 | { 21 | if (Tcl_GetDoubleFromObj(interp, ov[1], &_x) != TCL_OK) return TCL_ERROR; } 22 | 23 | /* Call - - -- --- ----- -------- */ 24 | c__aproc0(_x); 25 | 26 | /* (void return) - - -- --- ----- -------- */ 27 | return TCL_OK; 28 | } 29 | -------------------------------------------------------------------------------- /test/assets/cproc/4.5-float: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------- */ 2 | 3 | #define ns__aproc0 "::aproc" 4 | static void c__aproc0(float x) 5 | { 6 | 7 | } 8 | 9 | static int 10 | tcl__aproc0(ClientData cd, Tcl_Interp *interp, Tcl_Size oc, Tcl_Obj *CONST ov[]) 11 | { 12 | float _x; 13 | 14 | if (oc != 2) { 15 | Tcl_WrongNumArgs(interp, 1, ov, "x"); 16 | return TCL_ERROR; 17 | } 18 | 19 | /* (float x) - - -- --- ----- -------- */ 20 | { 21 | double t; 22 | if (Tcl_GetDoubleFromObj(interp, ov[1], &t) != TCL_OK) return TCL_ERROR; 23 | _x = (float) t; } 24 | 25 | /* Call - - -- --- ----- -------- */ 26 | c__aproc0(_x); 27 | 28 | /* (void return) - - -- --- ----- -------- */ 29 | return TCL_OK; 30 | } 31 | -------------------------------------------------------------------------------- /test/assets/cproc/4.6-int_gt_0: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------- */ 2 | 3 | #define ns__aproc0 "::aproc" 4 | static void c__aproc0(int x) 5 | { 6 | 7 | } 8 | 9 | static int 10 | tcl__aproc0(ClientData cd, Tcl_Interp *interp, Tcl_Size oc, Tcl_Obj *CONST ov[]) 11 | { 12 | int _x; 13 | 14 | if (oc != 2) { 15 | Tcl_WrongNumArgs(interp, 1, ov, "x"); 16 | return TCL_ERROR; 17 | } 18 | 19 | /* (int > 0 x) - - -- --- ----- -------- */ 20 | { 21 | { 22 | if (Tcl_GetIntFromObj(interp, ov[1], &_x) != TCL_OK) return TCL_ERROR; } 23 | /* Range check, assert (x > 0) */ 24 | if (!(_x > 0)) { 25 | Tcl_AppendResult (interp, "expected int > 0, but got \"", Tcl_GetString (ov[1]), "\"", NULL); 26 | return TCL_ERROR; 27 | } } 28 | 29 | /* Call - - -- --- ----- -------- */ 30 | c__aproc0(_x); 31 | 32 | /* (void return) - - -- --- ----- -------- */ 33 | return TCL_OK; 34 | } 35 | -------------------------------------------------------------------------------- /test/assets/cproc/4.7-char_: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------- */ 2 | 3 | #define ns__aproc0 "::aproc" 4 | static void c__aproc0(const char* x) 5 | { 6 | 7 | } 8 | 9 | static int 10 | tcl__aproc0(ClientData cd, Tcl_Interp *interp, Tcl_Size oc, Tcl_Obj *CONST ov[]) 11 | { 12 | const char* _x; 13 | 14 | if (oc != 2) { 15 | Tcl_WrongNumArgs(interp, 1, ov, "x"); 16 | return TCL_ERROR; 17 | } 18 | 19 | /* (char* x) - - -- --- ----- -------- */ 20 | { 21 | _x = Tcl_GetString(ov[1]); } 22 | 23 | /* Call - - -- --- ----- -------- */ 24 | c__aproc0(_x); 25 | 26 | /* (void return) - - -- --- ----- -------- */ 27 | return TCL_OK; 28 | } 29 | -------------------------------------------------------------------------------- /test/assets/cproc/4.8-pstring: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------- */ 2 | 3 | #define ns__aproc0 "::aproc" 4 | #ifndef CRITCL_pstring 5 | #define CRITCL_pstring 6 | 7 | typedef struct critcl_pstring { 8 | Tcl_Obj* o; 9 | const char* s; 10 | Tcl_Size len; 11 | } critcl_pstring; 12 | 13 | #endif /* CRITCL_pstring _________ */ 14 | 15 | static void c__aproc0(critcl_pstring x) 16 | { 17 | 18 | } 19 | 20 | static int 21 | tcl__aproc0(ClientData cd, Tcl_Interp *interp, Tcl_Size oc, Tcl_Obj *CONST ov[]) 22 | { 23 | critcl_pstring _x; 24 | 25 | if (oc != 2) { 26 | Tcl_WrongNumArgs(interp, 1, ov, "x"); 27 | return TCL_ERROR; 28 | } 29 | 30 | /* (pstring x) - - -- --- ----- -------- */ 31 | { 32 | _x.s = Tcl_GetStringFromObj(ov[1], &(_x.len)); 33 | _x.o = ov[1]; } 34 | 35 | /* Call - - -- --- ----- -------- */ 36 | c__aproc0(_x); 37 | 38 | /* (void return) - - -- --- ----- -------- */ 39 | return TCL_OK; 40 | } 41 | -------------------------------------------------------------------------------- /test/assets/cproc/4.9-list: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------- */ 2 | 3 | #define ns__aproc0 "::aproc" 4 | #ifndef CRITCL_list 5 | #define CRITCL_list 6 | 7 | typedef struct critcl_list { 8 | Tcl_Obj* o; 9 | Tcl_Obj* const* v; 10 | Tcl_Size c; 11 | } critcl_list; 12 | 13 | #endif /* CRITCL_list _________ */ 14 | 15 | static void c__aproc0(critcl_list x) 16 | { 17 | 18 | } 19 | 20 | static int 21 | tcl__aproc0(ClientData cd, Tcl_Interp *interp, Tcl_Size oc, Tcl_Obj *CONST ov[]) 22 | { 23 | critcl_list _x; 24 | 25 | if (oc != 2) { 26 | Tcl_WrongNumArgs(interp, 1, ov, "x"); 27 | return TCL_ERROR; 28 | } 29 | 30 | /* (list x) - - -- --- ----- -------- */ 31 | { 32 | if (Tcl_ListObjGetElements (interp, ov[1], /* OK tcl9 */ 33 | &(_x.c), (Tcl_Obj***) &(_x.v)) != TCL_OK) return TCL_ERROR; 34 | _x.o = ov[1]; } 35 | 36 | /* Call - - -- --- ----- -------- */ 37 | c__aproc0(_x); 38 | 39 | /* (void return) - - -- --- ----- -------- */ 40 | return TCL_OK; 41 | } 42 | -------------------------------------------------------------------------------- /test/assets/cproc/5.x: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------- */ 2 | 3 | #define ns__aproc0 "::aproc" 4 | static void c__aproc0(int x, int y) 5 | { 6 | 7 | } 8 | 9 | static int 10 | tcl__aproc0(ClientData cd, Tcl_Interp *interp, Tcl_Size oc, Tcl_Obj *CONST ov[]) 11 | { 12 | int _x; 13 | int _y; 14 | 15 | if (oc != 3) { 16 | Tcl_WrongNumArgs(interp, 1, ov, "x y"); 17 | return TCL_ERROR; 18 | } 19 | 20 | /* (int x) - - -- --- ----- -------- */ 21 | { 22 | if (Tcl_GetIntFromObj(interp, ov[1], &_x) != TCL_OK) return TCL_ERROR; } 23 | 24 | 25 | /* (int y) - - -- --- ----- -------- */ 26 | { 27 | if (Tcl_GetIntFromObj(interp, ov[2], &_y) != TCL_OK) return TCL_ERROR; } 28 | 29 | /* Call - - -- --- ----- -------- */ 30 | c__aproc0(_x, _y); 31 | 32 | /* (void return) - - -- --- ----- -------- */ 33 | return TCL_OK; 34 | } 35 | -------------------------------------------------------------------------------- /test/assets/cproc/6.0-int_gt_4: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------- */ 2 | 3 | #define ns__aproc0 "::aproc" 4 | static void c__aproc0(int x) 5 | { 6 | 7 | } 8 | 9 | static int 10 | tcl__aproc0(ClientData cd, Tcl_Interp *interp, Tcl_Size oc, Tcl_Obj *CONST ov[]) 11 | { 12 | int _x; 13 | 14 | if (oc != 2) { 15 | Tcl_WrongNumArgs(interp, 1, ov, "x"); 16 | return TCL_ERROR; 17 | } 18 | 19 | /* (int > 4 x) - - -- --- ----- -------- */ 20 | { 21 | { 22 | if (Tcl_GetIntFromObj(interp, ov[1], &_x) != TCL_OK) return TCL_ERROR; } 23 | /* Range check, assert (x > 4) */ 24 | if (!(_x > 4)) { 25 | Tcl_AppendResult (interp, "expected int > 4, but got \"", Tcl_GetString (ov[1]), "\"", NULL); 26 | return TCL_ERROR; 27 | } } 28 | 29 | /* Call - - -- --- ----- -------- */ 30 | c__aproc0(_x); 31 | 32 | /* (void return) - - -- --- ----- -------- */ 33 | return TCL_OK; 34 | } 35 | -------------------------------------------------------------------------------- /test/assets/cproc/6.2-int_lt_8: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------- */ 2 | 3 | #define ns__aproc0 "::aproc" 4 | static void c__aproc0(int x) 5 | { 6 | 7 | } 8 | 9 | static int 10 | tcl__aproc0(ClientData cd, Tcl_Interp *interp, Tcl_Size oc, Tcl_Obj *CONST ov[]) 11 | { 12 | int _x; 13 | 14 | if (oc != 2) { 15 | Tcl_WrongNumArgs(interp, 1, ov, "x"); 16 | return TCL_ERROR; 17 | } 18 | 19 | /* (int < 8 x) - - -- --- ----- -------- */ 20 | { 21 | { 22 | if (Tcl_GetIntFromObj(interp, ov[1], &_x) != TCL_OK) return TCL_ERROR; } 23 | /* Range check, assert (x < 8) */ 24 | if (!(_x < 8)) { 25 | Tcl_AppendResult (interp, "expected int < 8, but got \"", Tcl_GetString (ov[1]), "\"", NULL); 26 | return TCL_ERROR; 27 | } } 28 | 29 | /* Call - - -- --- ----- -------- */ 30 | c__aproc0(_x); 31 | 32 | /* (void return) - - -- --- ----- -------- */ 33 | return TCL_OK; 34 | } 35 | -------------------------------------------------------------------------------- /test/assets/cproc/6.4-int_gt_2_ge_4: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------- */ 2 | 3 | #define ns__aproc0 "::aproc" 4 | static void c__aproc0(int x) 5 | { 6 | 7 | } 8 | 9 | static int 10 | tcl__aproc0(ClientData cd, Tcl_Interp *interp, Tcl_Size oc, Tcl_Obj *CONST ov[]) 11 | { 12 | int _x; 13 | 14 | if (oc != 2) { 15 | Tcl_WrongNumArgs(interp, 1, ov, "x"); 16 | return TCL_ERROR; 17 | } 18 | 19 | /* (int >= 4 x) - - -- --- ----- -------- */ 20 | { 21 | { 22 | if (Tcl_GetIntFromObj(interp, ov[1], &_x) != TCL_OK) return TCL_ERROR; } 23 | /* Range check, assert (x >= 4) */ 24 | if (!(_x >= 4)) { 25 | Tcl_AppendResult (interp, "expected int >= 4, but got \"", Tcl_GetString (ov[1]), "\"", NULL); 26 | return TCL_ERROR; 27 | } } 28 | 29 | /* Call - - -- --- ----- -------- */ 30 | c__aproc0(_x); 31 | 32 | /* (void return) - - -- --- ----- -------- */ 33 | return TCL_OK; 34 | } 35 | -------------------------------------------------------------------------------- /test/assets/cproc/6.5-int_lt_2_lt_4_lt_6: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------- */ 2 | 3 | #define ns__aproc0 "::aproc" 4 | static void c__aproc0(int x) 5 | { 6 | 7 | } 8 | 9 | static int 10 | tcl__aproc0(ClientData cd, Tcl_Interp *interp, Tcl_Size oc, Tcl_Obj *CONST ov[]) 11 | { 12 | int _x; 13 | 14 | if (oc != 2) { 15 | Tcl_WrongNumArgs(interp, 1, ov, "x"); 16 | return TCL_ERROR; 17 | } 18 | 19 | /* (int < 2 x) - - -- --- ----- -------- */ 20 | { 21 | { 22 | if (Tcl_GetIntFromObj(interp, ov[1], &_x) != TCL_OK) return TCL_ERROR; } 23 | /* Range check, assert (x < 2) */ 24 | if (!(_x < 2)) { 25 | Tcl_AppendResult (interp, "expected int < 2, but got \"", Tcl_GetString (ov[1]), "\"", NULL); 26 | return TCL_ERROR; 27 | } } 28 | 29 | /* Call - - -- --- ----- -------- */ 30 | c__aproc0(_x); 31 | 32 | /* (void return) - - -- --- ----- -------- */ 33 | return TCL_OK; 34 | } 35 | -------------------------------------------------------------------------------- /test/assets/cproc/6.6-int_lt_2_le_4: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------- */ 2 | 3 | #define ns__aproc0 "::aproc" 4 | static void c__aproc0(int x) 5 | { 6 | 7 | } 8 | 9 | static int 10 | tcl__aproc0(ClientData cd, Tcl_Interp *interp, Tcl_Size oc, Tcl_Obj *CONST ov[]) 11 | { 12 | int _x; 13 | 14 | if (oc != 2) { 15 | Tcl_WrongNumArgs(interp, 1, ov, "x"); 16 | return TCL_ERROR; 17 | } 18 | 19 | /* (int < 2 x) - - -- --- ----- -------- */ 20 | { 21 | { 22 | if (Tcl_GetIntFromObj(interp, ov[1], &_x) != TCL_OK) return TCL_ERROR; } 23 | /* Range check, assert (x < 2) */ 24 | if (!(_x < 2)) { 25 | Tcl_AppendResult (interp, "expected int < 2, but got \"", Tcl_GetString (ov[1]), "\"", NULL); 26 | return TCL_ERROR; 27 | } } 28 | 29 | /* Call - - -- --- ----- -------- */ 30 | c__aproc0(_x); 31 | 32 | /* (void return) - - -- --- ----- -------- */ 33 | return TCL_OK; 34 | } 35 | -------------------------------------------------------------------------------- /test/assets/def-2.0: -------------------------------------------------------------------------------- 1 | 2 | #define foo 333 3 | -------------------------------------------------------------------------------- /test/assets/undef-2.0: -------------------------------------------------------------------------------- 1 | 2 | #undef foo 3 | -------------------------------------------------------------------------------- /test/attic/basic.tcl: -------------------------------------------------------------------------------- 1 | package require critcl 3.2 2 | 3 | critcl::cproc add {int x int y} int { 4 | return x + y; 5 | } 6 | 7 | critcl::cproc cube {int x} int { 8 | return x * x * x; 9 | } 10 | 11 | puts stderr "add 1 + 2 = [add 1 2]" 12 | puts stderr "cube 2 = [cube 2]" 13 | -------------------------------------------------------------------------------- /test/attic/basic.tst: -------------------------------------------------------------------------------- 1 | package require tcltest 2 | namespace import tcltest::* 3 | 4 | test basic "Basic compile + go" -body { 5 | puts stderr "exec = [info nameofexecutable]" 6 | puts stderr "prog = $starkit::topdir" 7 | } 8 | -------------------------------------------------------------------------------- /test/attic/c++direct-2.tcl: -------------------------------------------------------------------------------- 1 | package require critcl 3.2 2 | 3 | critcl::config language c++ 4 | critcl::clibraries -lstdc++ 5 | 6 | critcl::ccode { 7 | class A { 8 | int val; 9 | public: 10 | A() : val (123) {} 11 | int value() const { return val; } 12 | operator int() { return val; } 13 | int operator |(int o) { return val|o; } 14 | int operator &(int o) { return val&o; } 15 | }; 16 | } 17 | 18 | critcl::c++command tst A {} { 19 | int value {} 20 | int {int {operator int}} {} 21 | int {or {operator |}} {int} 22 | int {and {operator &}} {int} 23 | } 24 | 25 | tst A 26 | puts "tst = [A value]" 27 | puts "tst = [A int]" 28 | puts "tst = [A or 0xf]" 29 | puts "tst = [A and 0xf]" 30 | -------------------------------------------------------------------------------- /test/attic/c++indirect.tcl: -------------------------------------------------------------------------------- 1 | package require critcl 3.2 2 | 3 | critcl::config language c++ 4 | critcl::clibraries -lstdc++ 5 | 6 | critcl::ccode { 7 | class A { 8 | int value; 9 | public: 10 | A() : value (123) {} 11 | operator int() const { return value; } 12 | }; 13 | } 14 | 15 | critcl::cproc tryplus {} int { 16 | A var; 17 | return var; 18 | } 19 | 20 | puts "tryplus = [tryplus]" 21 | -------------------------------------------------------------------------------- /test/attic/fbasic.tcl: -------------------------------------------------------------------------------- 1 | # Basic test for Critclf 2 | -------------------------------------------------------------------------------- /test/ccommand-trace.test: -------------------------------------------------------------------------------- 1 | # critcl::ccommand -- Testing with trace code. 2 | # ------------------------------------------------------------------------- 3 | # Setup 4 | 5 | source [file join [file dirname [info script]] support testutilities.tcl] 6 | 7 | testsNeedTcl 8.6 9 8 | testsNeedTcltest 2 9 | 10 | useLocalFile test/support/crit_utils.tcl 11 | 12 | # ------------------------------------------------------------------------- 13 | 14 | trace-do ccommand 15 | 16 | # Local variables: 17 | # mode: tcl 18 | # indent-tabs-mode: nil 19 | # End: 20 | -------------------------------------------------------------------------------- /test/ccommand.test: -------------------------------------------------------------------------------- 1 | # critcl::ccommand -- Regular tests 2 | # ------------------------------------------------------------------------- 3 | # Setup 4 | 5 | source [file join [file dirname [info script]] support testutilities.tcl] 6 | 7 | testsNeedTcl 8.6 9 8 | testsNeedTcltest 2 9 | 10 | useLocalFile test/support/crit_utils.tcl 11 | 12 | # ------------------------------------------------------------------------- 13 | 14 | do ccommand 15 | 16 | # Local variables: 17 | # mode: tcl 18 | # indent-tabs-mode: nil 19 | # End: 20 | -------------------------------------------------------------------------------- /test/cconst-trace.test: -------------------------------------------------------------------------------- 1 | # critcl::cconst -- Testing with trace code. 2 | # ------------------------------------------------------------------------- 3 | # Setup 4 | 5 | source [file join [file dirname [info script]] support testutilities.tcl] 6 | 7 | testsNeedTcl 8.6 9 8 | testsNeedTcltest 2 9 | 10 | useLocalFile test/support/crit_utils.tcl 11 | 12 | # ------------------------------------------------------------------------- 13 | 14 | trace-do cconst 15 | 16 | # Local variables: 17 | # mode: tcl 18 | # indent-tabs-mode: nil 19 | # End: 20 | -------------------------------------------------------------------------------- /test/cconst.test: -------------------------------------------------------------------------------- 1 | # critcl::cconst -- Regular tests 2 | # ------------------------------------------------------------------------- 3 | # Setup 4 | 5 | source [file join [file dirname [info script]] support testutilities.tcl] 6 | 7 | testsNeedTcl 8.6 9 8 | testsNeedTcltest 2 9 | 10 | useLocalFile test/support/crit_utils.tcl 11 | 12 | # ------------------------------------------------------------------------- 13 | 14 | do cconst 15 | 16 | # Local variables: 17 | # mode: tcl 18 | # indent-tabs-mode: nil 19 | # End: 20 | -------------------------------------------------------------------------------- /test/cdata-trace.test: -------------------------------------------------------------------------------- 1 | # critcl::cdata -- Testing with trace code. 2 | # ------------------------------------------------------------------------- 3 | # Setup 4 | 5 | source [file join [file dirname [info script]] support testutilities.tcl] 6 | 7 | testsNeedTcl 8.6 9 8 | testsNeedTcltest 2 9 | 10 | useLocalFile test/support/crit_utils.tcl 11 | 12 | # ------------------------------------------------------------------------- 13 | 14 | trace-do cdata 15 | 16 | # Local variables: 17 | # mode: tcl 18 | # indent-tabs-mode: nil 19 | # End: 20 | -------------------------------------------------------------------------------- /test/cdata.test: -------------------------------------------------------------------------------- 1 | # critcl::cdata -- Regular tests 2 | # ------------------------------------------------------------------------- 3 | # Setup 4 | 5 | source [file join [file dirname [info script]] support testutilities.tcl] 6 | 7 | testsNeedTcl 8.6 9 8 | testsNeedTcltest 2 9 | 10 | useLocalFile test/support/crit_utils.tcl 11 | 12 | # ------------------------------------------------------------------------- 13 | 14 | do cdata 15 | 16 | # Local variables: 17 | # mode: tcl 18 | # indent-tabs-mode: nil 19 | # End: 20 | -------------------------------------------------------------------------------- /test/cproc-trace.test: -------------------------------------------------------------------------------- 1 | # critcl::cproc -- Testing with trace code. 2 | # ------------------------------------------------------------------------- 3 | # Setup 4 | 5 | source [file join [file dirname [info script]] support testutilities.tcl] 6 | 7 | testsNeedTcl 8.6 9 8 | testsNeedTcltest 2 9 | 10 | useLocalFile test/support/crit_utils.tcl 11 | 12 | # ------------------------------------------------------------------------- 13 | 14 | trace-do cproc 15 | 16 | # Local variables: 17 | # mode: tcl 18 | # indent-tabs-mode: nil 19 | # End: 20 | -------------------------------------------------------------------------------- /test/cproc.test: -------------------------------------------------------------------------------- 1 | # critcl::cproc -- Regular tests 2 | # ------------------------------------------------------------------------- 3 | # Setup 4 | 5 | source [file join [file dirname [info script]] support testutilities.tcl] 6 | 7 | testsNeedTcl 8.6 9 8 | testsNeedTcltest 2 9 | 10 | useLocalFile test/support/crit_utils.tcl 11 | 12 | # ------------------------------------------------------------------------- 13 | 14 | do cproc 15 | 16 | # Local variables: 17 | # mode: tcl 18 | # indent-tabs-mode: nil 19 | # End: 20 | -------------------------------------------------------------------------------- /tools/get-headers.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | src=$1 4 | dst=$2 5 | 6 | for header in \ 7 | tclDecls.h tcl.h tclPlatDecls.h 8 | do 9 | cp -v ${src}/generic/$header lib/critcl/critcl_c/$dst 10 | done 11 | --------------------------------------------------------------------------------