diff -Nru critcl-3.1.9/build.tcl critcl-3.1.17+dfsg/build.tcl --- critcl-3.1.9/build.tcl 2013-05-10 05:57:04.000000000 +0000 +++ critcl-3.1.17+dfsg/build.tcl 2017-10-14 02:48:11.000000000 +0000 @@ -1,6 +1,8 @@ #!/bin/sh # -*- tcl -*- \ exec tclsh "$0" ${1+"$@"} +package require Tcl 8.4 +unset -nocomplain ::errorInfo set me [file normalize [info script]] proc main {} { global argv @@ -11,14 +13,30 @@ exit 0 } set packages { - {critcl critcl.tcl} - {critcl-util util.tcl} - {critcl-class class.tcl} - {critcl-iassoc iassoc.tcl} - {app-critcl ../critcl/critcl.tcl critcl-app} - util84 - stubs - critcl-platform + {app-critcl ../critcl/critcl.tcl critcl-app} + {critcl critcl.tcl} + {critcl-bitmap bitmap.tcl} + {critcl-class class.tcl} + {critcl-cutil cutil.tcl} + {critcl-emap emap.tcl} + {critcl-enum enum.tcl} + {critcl-iassoc iassoc.tcl} + {critcl-literals literals.tcl} + {critcl-platform platform.tcl} + {critcl-util util.tcl} + {dict84 dict.tcl} + {lassign84 lassign.tcl} + {lmap84 lmap.tcl} + {stubs_container container.tcl} + {stubs_gen_decl gen_decl.tcl} + {stubs_gen_header gen_header.tcl} + {stubs_gen_init gen_init.tcl} + {stubs_gen_lib gen_lib.tcl} + {stubs_gen_macro gen_macro.tcl} + {stubs_gen_slot gen_slot.tcl} + {stubs_genframe genframe.tcl} + {stubs_reader reader.tcl} + {stubs_writer writer.tcl} } proc usage {{status 1}} { global errorInfo @@ -48,6 +66,14 @@ catch { file attributes $path -permissions ugo+x } return } +proc critapp {dst} { + global tcl_platform + set app $dst/critcl + if {$tcl_platform(platform) eq "windows"} { + append app .tcl + } + return $app +} proc grep {file pattern} { set lines [split [read [set chan [open $file r]]] \n] close $chan @@ -80,6 +106,22 @@ } return $path } +proc dstlfromlib {path} { + # kinda the inverse of findlib above, it returns the path to + # dstlpath, relative the */lib path returned by findlib. The path + # is returned as a list of segments + set relpath {} + while {1} { + if {[file tail $path] eq "lib"} { + break + } + set new [file dirname $path] + set relpath [linsert $relpath 0 [file tail $path]] + if {$new eq $path} break + set path $new + } + return $relpath +} proc id {cv vv} { upvar 1 $cv commit $vv version @@ -125,6 +167,27 @@ puts [lsort -dict $r] return } +proc Htest {} { return "\n\tRun the testsuite." } +proc _test {} { + global argv + set argv {} ;# clear -- tcltest shall see nothing + # Run all .test files in the test/ directory. + set selfdir [file dirname $::me] + foreach testsuite [lsort -dict [glob -directory $selfdir/test *.test]] { + puts "" + puts "_ _ __ ___ _____ ________ _____________ _____________________ *** [file tail $testsuite] ***" + if {[catch { + exec >@ stdout 2>@ stderr [info nameofexecutable] $testsuite + }]} { + puts $::errorInfo + } + } + + puts "" + puts "_ _ __ ___ _____ ________ _____________ _____________________" + puts "" + return +} proc Hdoc {} { return "\n\t(Re)Generate the embedded documentation." } proc _doc {} { cd [file dirname $::me]/doc @@ -182,6 +245,15 @@ # Get scratchpad to assemble the release in. # Get version and hash of the commit to be released. + puts -nonewline "Have you run the tests ? " + flush stdout + set a [string tolower [gets stdin]] + + if {($a ne "y" ) && ($a ne "yes")} { + puts "Please do" + exit 1 + } + set tmpdir [tmpdir] id commit version @@ -240,18 +312,38 @@ # # ## ### ##### ######## ############# return } -proc Hinstall {} { return "?destination?\n\tInstall all packages, and application.\n\tdestination = path of package directory, default \[info library\]." } -proc _install {{dst {}}} { - global packages +proc Htargets {} { return "?destination?\n\tShow available targets.\n\tExpects critcl app to be installed in destination." } +proc _targets {{dst {}}} { if {[llength [info level 0]] < 2} { + set dsta [file dirname [file dirname [file normalize [info nameofexecutable]/___]]] + } else { + set dsta [file dirname [findlib $dstl]]/bin + } + puts [join [split [exec $dsta/critcl -targets]] \n] + return +} + +proc Hinstall {} { return "?-target T? ?destination?\n\tInstall all packages, and application.\n\tdestination = path of package directory, default \[info library\]." } +proc _install {args} { + global packages me + + set target {} + if {[lindex $args 0] eq "-target"} { + set target [lindex $args 1] + set args [lrange $args 2 end] + } + + if {[llength $args] == 0} { set dstl [info library] set dsta [file dirname [file dirname [file normalize [info nameofexecutable]/___]]] } else { - set dstl $dst + set dstl [lindex $args 0] set dsta [file dirname [findlib $dstl]]/bin } + set selfdir [file dirname $me] + puts {Installing into:} puts \tPackages:\t$dstl puts \tApplication:\t$dsta @@ -276,12 +368,12 @@ } if {$vfile ne {}} { - set version [version [file dirname $::me]/lib/$dir/$vfile] + set version [version $selfdir/lib/$dir/$vfile] } else { set version {} } - file copy -force [file dirname $::me]/lib/$dir $dstl/${name}-new + file copy -force $selfdir/lib/$dir $dstl/${name}-new file delete -force $dstl/$name$version file rename $dstl/${name}-new $dstl/$name$version puts "${prefix}Installed package: $dstl/$name$version" @@ -290,12 +382,62 @@ # Application: critcl - set c [open $dsta/critcl w] - puts $c "#!/bin/sh\n# -*- tcl -*- \\\nexec [file dirname [file normalize [info nameofexecutable]/___]] \"\$0\" \$\{1+\"\$@\"\}\npackage require critcl::app\ncritcl::app::main \$argv" + set theapp [critapp $dsta] + set reldstl [dstlfromlib $dstl] + + set c [open $theapp w] + lappend map @bs@ "\\" + lappend map @exe@ [file dirname [file normalize [info nameofexecutable]/___]] + lappend map @path@ $reldstl ;# insert the dst path + lappend map "\t " {} ;# de-dent + puts $c [string trimleft [string map $map { + #!/bin/sh + # -*- tcl -*- @bs@ + exec "@exe@" "$0" ${1+"$@"} + + set libpath [file normalize [file join [file dirname [info script]] .. lib]] + set libpath [file join $libpath {@path@}] + if {[lsearch -exact $auto_path $libpath] < 0} {lappend auto_path $libpath} + + package require critcl::app + critcl::app::main $argv}]] close $c - +x $dsta/critcl + +x $theapp + + puts "${prefix}Installed application: $theapp" + + # Special package: critcl_md5c + # Local MD5 hash implementation. + + # It is special because it is a critcl-based package, not pure + # Tcl as everything else of critcl. Its installation makes it + # the first package which will be compiled with critcl on this + # machine. It uses the just-installed application for + # that. This is package-mode, where MD5 itself is not used, so + # there is no chicken vs. egg. + + set src $selfdir/lib/critcl-md5c/md5c.tcl + set version [version $src] + set name critcl_md5c + set dst $dstl/$name$version + + lappend cmd exec >@ stdout 2>@ stderr + if {$::tcl_platform(platform) eq "windows"} { + lappend cmd [info nameofexecutable] + } + lappend cmd $theapp + if {$target ne {}} { + lappend cmd -target $target + } + lappend cmd -libdir $dstl/tmp -pkg $src + eval $cmd + + file delete -force $dst + file rename $dstl/tmp/md5c $dst + file delete -force $dstl/tmp + + puts "${prefix}Installed package: $dst" - puts "${prefix}Installed application: $dsta/critcl" } msg]} { if {![string match {*permission denied*} $msg]} { return -code error -errorcode $::errorCode -errorinfo $::errorInfo $msg @@ -305,6 +447,9 @@ } return } +proc Huninstall {} { Hdrop } +proc _uninstall {args} { _drop {*}$args } + proc Hdrop {} { return "?destination?\n\tRemove packages.\n\tdestination = path of package directory, default \[info library\]." } proc _drop {{dst {}}} { global packages @@ -317,6 +462,10 @@ set dsta [file dirname $dst]/bin } + # Add the special package (see install). Not special with regard + # to removal. Except for the name + lappend packages [list critcl-md5c md5c.tcl critcl_md5c] + foreach item $packages { # Package: /name/ @@ -342,9 +491,9 @@ } # Application: critcl - - file delete $dsta/critcl - puts "Removed application: $dsta/critcl" + set theapp [critapp $dsta] + file delete $theapp + puts "Removed application: $theapp" return } proc Hstarkit {} { return "?destination? ?interpreter?\n\tGenerate a starkit\n\tdestination = path of result file, default 'critcl.kit'\n\tinterpreter = (path) name of tcl shell to use for execution, default 'tclkit'" } diff -Nru critcl-3.1.9/debian/changelog critcl-3.1.17+dfsg/debian/changelog --- critcl-3.1.9/debian/changelog 2016-09-01 14:42:16.000000000 +0000 +++ critcl-3.1.17+dfsg/debian/changelog 2018-06-07 10:29:12.000000000 +0000 @@ -1,8 +1,17 @@ -critcl (3.1.9-1build1) yakkety; urgency=medium +critcl (3.1.17+dfsg-1) unstable; urgency=medium - * No-change rebuild to default to tclsh8.6. + * Exclude the compiled CHM from the repacked source tarball. - -- Matthias Klose Thu, 01 Sep 2016 16:42:16 +0200 + -- Andrej Shadura Thu, 07 Jun 2018 12:29:12 +0200 + +critcl (3.1.17-1) unstable; urgency=medium + + * New upstream release. + * Refresh patches. + * Add gbp.conf. + * Update Vcs-*. + + -- Andrej Shadura Thu, 07 Jun 2018 12:01:30 +0200 critcl (3.1.9-1) unstable; urgency=low diff -Nru critcl-3.1.9/debian/control critcl-3.1.17+dfsg/debian/control --- critcl-3.1.9/debian/control 2013-05-10 22:04:44.000000000 +0000 +++ critcl-3.1.17+dfsg/debian/control 2018-06-07 10:29:12.000000000 +0000 @@ -5,8 +5,8 @@ Build-Depends: debhelper (>= 9), tcl-dev, tcllib (>= 1.13) Standards-Version: 3.9.4 Homepage: http://andreas-kupries.github.com/critcl/ -Vcs-Hg: http://anonscm.debian.org/hg/collab-maint/critcl -Vcs-Browser: http://anonscm.debian.org/hg/collab-maint/critcl/summary +Vcs-Git: https://salsa.debian.org/debian/critcl +Vcs-Browser: https://salsa.debian.org/debian/critcl Package: critcl Architecture: all diff -Nru critcl-3.1.9/debian/copyright critcl-3.1.17+dfsg/debian/copyright --- critcl-3.1.9/debian/copyright 2013-05-10 21:59:21.000000000 +0000 +++ critcl-3.1.17+dfsg/debian/copyright 2018-06-07 10:29:12.000000000 +0000 @@ -5,6 +5,8 @@ Copyright: 2001-2007 Jean-Claude Wippler 2002-2007 Steve Landers 2006-2013 Andreas Kupries +Files-Excluded: examples/zlibwrap/zlib/contrib/dotzlib/DotZLib.chm + License: BSD This software is copyrighted by Jean-Claude Wippler, Steve Landers other parties. diff -Nru critcl-3.1.9/debian/gbp.conf critcl-3.1.17+dfsg/debian/gbp.conf --- critcl-3.1.9/debian/gbp.conf 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/debian/gbp.conf 2018-06-07 10:29:12.000000000 +0000 @@ -0,0 +1,3 @@ +[DEFAULT] +debian-branch = debian/master +upstream-branch = upstream/latest diff -Nru critcl-3.1.9/debian/patches/01-put-manpages-under-3tcl.patch critcl-3.1.17+dfsg/debian/patches/01-put-manpages-under-3tcl.patch --- critcl-3.1.9/debian/patches/01-put-manpages-under-3tcl.patch 2013-05-10 22:07:52.000000000 +0000 +++ critcl-3.1.17+dfsg/debian/patches/01-put-manpages-under-3tcl.patch 2018-06-07 10:29:12.000000000 +0000 @@ -127,3 +127,62 @@ [include include/module.inc] [titledesc {Critcl - License}] [description] +--- a/doc/critcl_bitmap.man ++++ b/doc/critcl_bitmap.man +@@ -1,6 +1,6 @@ + [comment {-*- tcl -*- doctools manpage}] + [vset bitmap_version 1.0.1] +-[manpage_begin critcl::bitmap n [vset bitmap_version]] ++[manpage_begin critcl::bitmap 3tcl [vset bitmap_version]] + [include include/module2.inc] + [keywords singleton {Tcl Interp Association}] + [keywords bitmask bitset flags] +--- a/doc/critcl_cproc.man ++++ b/doc/critcl_cproc.man +@@ -1,6 +1,6 @@ + [comment {-*- tcl -*- doctools manpage}] + [include version.inc] +-[manpage_begin critcl-cproc-types n [vset VERSION]] ++[manpage_begin critcl-cproc-types 3tcl [vset VERSION]] + [include include/module.inc] + [titledesc {Critcl - cproc Type Reference}] + [require Tcl 8.4] +--- a/doc/critcl_cutil.man ++++ b/doc/critcl_cutil.man +@@ -1,5 +1,5 @@ + [comment {-*- tcl -*- doctools manpage}] +-[manpage_begin critcl::cutil n 0.1] ++[manpage_begin critcl::cutil 3tcl 0.1] + [include include/module2.inc] + [titledesc {CriTcl C-level Utilities}] + [require Tcl 8.4] +--- a/doc/critcl_emap.man ++++ b/doc/critcl_emap.man +@@ -1,6 +1,6 @@ + [comment {-*- tcl -*- doctools manpage}] + [vset emap_version 1] +-[manpage_begin critcl::emap n [vset emap_version]] ++[manpage_begin critcl::emap 3tcl [vset emap_version]] + [include include/module2.inc] + [keywords singleton {Tcl Interp Association}] + [keywords bitmask bitset flags] +--- a/doc/critcl_enum.man ++++ b/doc/critcl_enum.man +@@ -1,6 +1,6 @@ + [comment {-*- tcl -*- doctools manpage}] + [vset enum_version 1.0.1] +-[manpage_begin critcl::enum n [vset enum_version]] ++[manpage_begin critcl::enum 3tcl [vset enum_version]] + [include include/module2.inc] + [keywords singleton {Tcl Interp Association}] + [keywords {string pool} {literal pool}] +--- a/doc/critcl_literals.man ++++ b/doc/critcl_literals.man +@@ -1,6 +1,6 @@ + [comment {-*- tcl -*- doctools manpage}] + [vset literal_version 1.2] +-[manpage_begin critcl::literals n [vset literal_version]] ++[manpage_begin critcl::literals 3tcl [vset literal_version]] + [include include/module2.inc] + [keywords singleton {Tcl Interp Association}] + [keywords {string pool} {literal pool}] diff -Nru critcl-3.1.9/debian/patches/06-autoconf-2.50.patch critcl-3.1.17+dfsg/debian/patches/06-autoconf-2.50.patch --- critcl-3.1.9/debian/patches/06-autoconf-2.50.patch 2013-05-10 22:07:32.000000000 +0000 +++ critcl-3.1.17+dfsg/debian/patches/06-autoconf-2.50.patch 2018-06-07 10:29:12.000000000 +0000 @@ -3,7 +3,7 @@ --- a/lib/app-critcl/critcl.tcl +++ b/lib/app-critcl/critcl.tcl -@@ -1679,7 +1679,7 @@ +@@ -1717,7 +1717,7 @@ } proc ::critcl::app::LocateAutoconf {iswin} { diff -Nru critcl-3.1.9/doc/critcl_bitmap.man critcl-3.1.17+dfsg/doc/critcl_bitmap.man --- critcl-3.1.9/doc/critcl_bitmap.man 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/doc/critcl_bitmap.man 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,161 @@ +[comment {-*- tcl -*- doctools manpage}] +[vset bitmap_version 1.0.1] +[manpage_begin critcl::bitmap n [vset bitmap_version]] +[include include/module2.inc] +[keywords singleton {Tcl Interp Association}] +[keywords bitmask bitset flags] +[titledesc {CriTcl Utilities: Bitset en- and decoding}] +[require Tcl 8.4] +[require critcl [opt 3.1.11]] +[require critcl::bitmap [opt [vset bitmap_version]]] +[description] +[para] +[include include/welcome.inc] +[para] + +This document is the reference manpage for the +[package critcl::bitmap] package. This package provides convenience +commands for advanced functionality built on top of both critcl core +and package [package critcl::iassoc]. + +[para] C level libraries often use bit-sets to encode many flags into a +single value. Tcl bindings to such libraries now have the task of +converting a Tcl representation of such flags (like a list of strings) +into such bit-sets, and back. + +[emph Note] here that the C-level information has to be something which +already exists. The package does [emph not] create these values. This is +in contrast to the package [package critcl::enum] which creates an +enumeration based on the specified symbolic names. + +[para] This package was written to make the declaration and management +of such bit-sets and their associated conversions functions easy, +hiding all attendant complexity from the user. + +[para] Its intended audience are mainly developers wishing to write +Tcl packages with embedded C code. + +[para] This package resides in the Core Package Layer of CriTcl. +[para][image arch_core][para] + +[comment {===================================================================}] + +[section API] + +[list_begin definitions] +[call [cmd ::critcl::bitmap::def] [arg name] [arg definition] [opt [arg exclusions]]] + +This command defines two C functions for the conversion of the +[arg name]d bit-set into Tcl lists, and vice versa. + +The underlying mapping tables are automatically initialized on first +access, and finalized on interpreter destruction. + +[para] The [arg definition] dictionary provides the mapping from the +Tcl-level symbolic names of the flags to their C expressions (often +the name of the macro specifying the actual value). + +[emph Note] here that the C-level information has to be something which +already exists. The package does [emph not] create these values. This is +in contrast to the package [package critcl::enum] which creates an +enumeration based on the specified symbolic names. + +[para] The optional [arg exlusion] list is for the flags/bit-sets for +which conversion from bit-set to flag, i.e. decoding makes no +sense. One case for such, for example, are flags representing a +combination of other flags. + +[para] The package generates multiple things (declarations and +definitions) with names derived from [arg name], which has to be a +proper C identifier. + +[list_begin definitions] +[def [arg name]_encode] +The function for encoding a Tcl list of strings into the equivalent +bit-set. + +Its signature is +[para][example_begin] +int [arg name]_encode (Tcl_Interp* interp, Tcl_Obj* flags, int* result); +[example_end] + +[para] The return value of the function is a Tcl error code, +i.e. [const TCL_OK], [const TCL_ERROR], etc. + +[def [arg name]_decode] +The function for decoding a bit-set into the equivalent Tcl list of +strings. + +Its signature is +[para][example_begin] +Tcl_Obj* [arg name]_decode (Tcl_Interp* interp, int flags); +[example_end] + +[def [arg name].h] +A header file containing the declarations for the two conversion +functions, for use by other parts of the system, if necessary. + +[para] The generated file is stored in a place where it will not +interfere with the overall system outside of the package, yet also be +available for easy inclusion by package files ([cmd csources]). + +[def [arg name]] +The name of a critcl argument type encapsulating the encoder function +for use by [cmd critcl::cproc]. + +[def [arg name]] +The name of a critcl result type encapsulating the decoder function +for use by [cmd critcl::cproc]. + +[list_end] +[list_end] + +[comment {===================================================================}] +[section Example] + +The example shown below is the specification of the event flags pulled +from the draft work on a Tcl binding to Linux's inotify APIs. + +[example { +package require Tcl 8.5 +package require critcl 3.1.11 + +critcl::buildrequirement { + package require critcl::bitmap +} + +critcl::bitmap::def tcl_inotify_events { + accessed IN_ACCESS + all IN_ALL_EVENTS + attribute IN_ATTRIB + closed IN_CLOSE + closed-nowrite IN_CLOSE_NOWRITE + closed-write IN_CLOSE_WRITE + created IN_CREATE + deleted IN_DELETE + deleted-self IN_DELETE_SELF + dir-only IN_ONLYDIR + dont-follow IN_DONT_FOLLOW + modified IN_MODIFY + move IN_MOVE + moved-from IN_MOVED_FROM + moved-self IN_MOVE_SELF + moved-to IN_MOVED_TO + oneshot IN_ONESHOT + open IN_OPEN + overflow IN_Q_OVERFLOW + unmount IN_UNMOUNT +} { + all closed move oneshot +} + +# Declarations: tcl_inotify_events.h +# Encoder: int tcl_inotify_events_encode (Tcl_Interp* interp, Tcl_Obj* flags, int* result); +# Decoder: Tcl_Obj* tcl_inotify_events_decode (Tcl_Interp* interp, int flags); +# crit arg-type tcl_inotify_events +# crit res-type tcl_inotify_events +}] + +[comment {===================================================================}] +[include include/feedback2.inc] +[manpage_end] diff -Nru critcl-3.1.9/doc/critcl_cproc.man critcl-3.1.17+dfsg/doc/critcl_cproc.man --- critcl-3.1.9/doc/critcl_cproc.man 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/doc/critcl_cproc.man 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,41 @@ +[comment {-*- tcl -*- doctools manpage}] +[include version.inc] +[manpage_begin critcl-cproc-types n [vset VERSION]] +[include include/module.inc] +[titledesc {Critcl - cproc Type Reference}] +[require Tcl 8.4] +[require critcl [opt [vset VERSION]]] +[description] +[para] +[include include/welcome.inc] +[para] + +This document is a breakout of the descriptions for the predefined +argument- and result-types usable with the [cmd critcl::cproc] +command, as detailed in the reference manpage for the [package critcl] +package, plus the information on how to extend the predefined set with +custom types. The breakout was made to make this information easier to +find (toplevel document vs. having to search the large main reference). + +[para] Its intended audience are developers wishing to write Tcl +packages with embedded C code. + +[section {Standard argument types}] [include include/api_stdat_cproc.inc] +[section {Standard result types}] [include include/api_stdrt_cproc.inc] +[section {Advanced: Adding types}] [include include/api_extcproc2.inc] + +[section Examples] + +The examples shown here have been drawn from section "Embedding C" in +the document about [manpage {Using CriTcl}]. Please see that document +for many more examples. + +[include include/using_eproc.inc] [comment {%% cproc}] +[include include/using_eproctypes.inc] [comment {%% cproc types, intro & trivial}] +[include include/using_eproctypes2.inc] [comment {%% cproc types, semi-trivial}] +[include include/using_eproctypes3.inc] [comment {%% cproc types, support (incl alloc'd)}] +[include include/using_eproctypes4.inc] [comment {%% cproc types, results}] + +[comment {===================================================================}] +[include include/feedback.inc] +[manpage_end] diff -Nru critcl-3.1.9/doc/critcl_cutil.man critcl-3.1.17+dfsg/doc/critcl_cutil.man --- critcl-3.1.9/doc/critcl_cutil.man 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/doc/critcl_cutil.man 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,393 @@ +[comment {-*- tcl -*- doctools manpage}] +[manpage_begin critcl::cutil n 0.1] +[include include/module2.inc] +[titledesc {CriTcl C-level Utilities}] +[require Tcl 8.4] +[require critcl [opt 2.1]] +[require critcl::cutil [opt 0.1]] +[description] +[para] +[include include/welcome.inc] +[para] + +This document is the reference manpage for the [package critcl::cutil] +package. This package encapsulates a number of C-level utilites for +easier writing of memory allocations, assertions, and narrative tracing +and provides convenience commands to make these utilities accessible +to critcl projects. + +Its intended audience are mainly developers wishing to write Tcl +packages with embedded C code. +[para] + +This package resides in the Core Package Layer of CriTcl. +[para][image arch_core][para] + +The reason for this is that the main [package critcl] package makes +use of the facilities for narrative tracing when +[cmd {critcl::config trace}] is set, to instrument commands and +procedures. + +[comment {===================================================================}] +[section API] + +[list_begin definitions] +[comment {* * ** *** ***** ******** ************* *********************}] +[call [cmd ::critcl::cutil::alloc]] + +This command provides a number C-preprocessor macros which make the +writing of memory allocations for structures and arrays of structures +easier. + +[para] When run the header file [file critcl_alloc.h] is directly made +available to the [file .critcl] file containing the command, and +becomes available for use in [cmd {#include}] directives of companion +C code declared via [cmd critcl::csources]. + +[para] The macros definitions and their signatures are: + +[example { + type* ALLOC (type) + type* NALLOC (type, int n) + type* REALLOC (type* var, type, int n) + void FREE (type* var) +}] + +[para] The details of the semantics are explained in section +[sectref Allocation]. + +[para] The result of the command is an empty string. + +[comment {* * ** *** ***** ******** ************* *********************}] +[call [cmd ::critcl::cutil::assertions] [opt [arg enable]]] + +This command provides a number C-preprocessor macros for the writing +of assertions in C code. + +[para] When invoked the header file [file critcl_assert.h] is directly +made available to the [file .critcl] file containing the command, and +becomes available for use in [cmd {#include}] directives of companion +C code declared via [cmd critcl::csources]. + +[para] The macro definitions and their signatures are + +[example { + void ASSERT (expression, char* message); + void ASSERT_BOUNDS (int index, int size); + + void STOPAFTER (int n); + + void STREP (Tcl_Obj* o, char* s, int len); + void STREP_DS (Tcl_Obj* o, Tcl_DString* ds); +}] + +[para] Note that these definitions are conditional on the existence of +the macro [const CRITCL_ASSERT]. + +Without a [cmd {critcl::cflags -DCRITCL_ASSERT}] all assertions in the +C code are quiescent and not compiled into the object file. In other +words, assertions can be (de)activated at will during build time, as +needed by the user. + +[para] For convenience this is controlled by [arg enable]. By default +([const false]) the facility available, but not active. + +Using [const true] not only makes it available, but activates it as +well. + +[para] The details of the semantics are explained in section +[sectref Assertions]. + +[para] The result of the command is an empty string. + +[comment {* * ** *** ***** ******** ************* *********************}] +[call [cmd ::critcl::cutil::tracer] [opt [arg enable]]] + +This command provides a number C-preprocessor macros for tracing +C-level internals. + +[para] When invoked the header file [file critcl_trace.h] is directly +made available to the [file .critcl] file containing the command, and +becomes available for use in [cmd {#include}] directives of companion +C code declared via [cmd critcl::csources]. Furthermore the [file .c] +file containing the runtime support is added to the set of C companion +files + +[para] The macro definitions and their signatures are + +[example { + /* (de)activation of named logical streams. + * These are declarators, not statements. + */ + + TRACE_ON; + TRACE_OFF; + TRACE_TAG_ON (tag_identifier); + TRACE_TAG_OFF (tag_identifier); + + /* + * Higher level trace statements (convenience commands) + */ + + void TRACE_FUNC (const char* format, ...); + void TRACE_FUNC_VOID; + any TRACE_RETURN (const char* format, any x); + void TRACE_RETURN_VOID; + void TRACE (const char* format, ...); + + /* + * Low-level trace statements the higher level ones above + * are composed from. Scope management and output management. + */ + + void TRACE_PUSH_SCOPE (const char* scope); + void TRACE_PUSH_FUNC; + void TRACE_POP; + + void TRACE_HEADER (int indent); + void TRACE_ADD (const char* format, ...); + void TRACE_CLOSER; + + /* + * Convert tag to the underlying status variable. + */ + + TRACE_TAG_VAR (tag) + + /* + * Conditional use of arbitrary code. + */ + + TRACE_RUN (code); + TRACE_DO (code); + TRACE_TAG_DO (code); +}] + +[para] Note that these definitions are conditional on the existence of +the macro [const CRITCL_TRACER]. + +Without a [cmd {critcl::cflags -DCRITCL_TRACER}] all trace +functionality in the C code is quiescent and not compiled into the +object file. In other words, tracing can be (de)activated at will +during build time, as needed by the user. + +[para] For convenience this is controlled by [arg enable]. By default +([const false]) the facility available, but not active. + +Using [const true] not only makes it available, but activates it as +well. + +Further note that the command [cmd critcl::config] now accepts a +boolean option [const trace]. Setting it activates enter/exit tracing +in all commands based on [cmd critcl::cproc], with proper printing of +arguments and results. This implicitly activates the tracing facility +in general. + +[para] The details of the semantics are explained in section +[sectref Tracing] + +[para] The result of the command is an empty string. + +[list_end] + +[comment {===================================================================}] +[section Allocation] + +[list_begin definitions] +[comment {* * ** *** ***** ******** ************* *********************}] +[call [cmd {type* ALLOC (type)}]] + +This macro allocates a single element of the given [arg type] and +returns a pointer to that memory. + +[call [cmd {type* NALLOC (type, int n)}]] + +This macro allocates [arg n] elements of the given [arg type] and +returns a pointer to that memory. + +[call [cmd {type* REALLOC (type* var, type, int n)}]] + +This macro expands or shrinks the memory associated with the C +variable [arg var] of type [arg type] to hold [arg n] elements of the +type. It returns a pointer to that memory. + +Remember, a reallocation may move the data to a new location in memory +to satisfy the request. Returning a pointer instead of immediately +assigning it to the [arg var] allows the user to validate the new +pointer before trying to use it. + +[call [cmd {void FREE (type* var)}]] + +This macro releases the memory referenced by the pointer variable +[arg var]. + +[list_end] + +[comment {===================================================================}] +[section Assertions] + +[list_begin definitions] +[comment {* * ** *** ***** ******** ************* *********************}] +[call [cmd {void ASSERT (expression, char* message}]] + +This macro tests the [arg expression] and panics if it does not hold. +The specified [arg message] is used as part of the panic. +The [arg message] has to be a static string, it cannot be a variable. + +[comment {* * ** *** ***** ******** ************* *********************}] +[call [cmd {void ASSERT_BOUNDS (int index, int size)}]] + +This macro ensures that the [arg index] is in the +range [const 0] to [const {size-1}]. + +[comment {* * ** *** ***** ******** ************* *********************}] +[call [cmd {void STOPAFTER(n)}]] + +This macro throws a panic after it is called [arg n] times. +Note, each separate instance of the macro has its own counter. + +[comment {* * ** *** ***** ******** ************* *********************}] +[call [cmd {void STREP (Tcl_Obj* o, char* s, int len)}]] + +This macro properly sets the string representation of the Tcl object +[arg o] to a copy of the string [arg s], expected to be of length +[arg len]. + +[comment {* * ** *** ***** ******** ************* *********************}] +[call [cmd {void STREP_DS (Tcl_Obj* o, Tcl_DString* ds)}]] + +This macro properly sets the string representation of the Tcl object +[arg o] to a copy of the string held by the [type DString] [arg ds]. + +[list_end] + +[comment {===================================================================}] +[section Tracing] + +All output is printed to [const stdout]. + +[list_begin definitions] + +[comment {* * ** *** ***** ******** ************* *********************}] +[call [cmd TRACE_ON]] +[call [cmd TRACE_OFF]] +[call [cmd {TRACE_TAG_ON (identifier)}]] +[call [cmd {TRACE_TAG_OFF (identifier)}]] + +These "commands" are actually declarators, for use outside of +functions. They (de)activate specific logical streams, named either +explicitly by the user, or implicitly, refering to the current file. + +[para] For example: +[para][example { + TRACE_TAG_ON (lexer_in); +}] + +[para] All high- and low-level trace commands producing output have +the controlling tag as an implicit argument. The scope management +commands do not take tags. + + +[comment {* * ** *** ***** ******** ************* *********************}] +[call [cmd {void TRACE_FUNC}]] +[call [cmd {void TRACE_TAG_FUNC (tag)}]] +[call [cmd {void TRACE_FUNC_VOID}]] +[call [cmd {void TRACE_TAG_FUNC_VOID (tag)}]] + +Use these macros at the beginning of a C function to record entry into +it. The name of the entered function is an implicit argument +([var __func__]), forcing users to have a C99 compiler.. + +[para] The tracer's runtime maintains a stack of active functions and +expects that function return is signaled by either [fun TRACE_RETURN], +[fun TRACE_RETURN_VOID], or the equivalent forms taking a tag. + +[comment {* * ** *** ***** ******** ************* *********************}] +[call [cmd {void TRACE_RETURN_VOID}]] +[call [cmd {void TRACE_TAG_RETURN_VOID (tag)}]] + +Use these macros instead of [example {return}] to return from a void +function. Beyond returning from the function this also signals the +same to the tracer's runtime, popping the last entered function from +its stack of active functions. + +[comment {* * ** *** ***** ******** ************* *********************}] +[call [cmd {any TRACE_RETURN ( char* format, any x)}]] +[call [cmd {any TRACE_TAG_RETURN (tag, char* format, any x)}]] + +Use this macro instead of [example {return x}] to return from a +non-void function. + +Beyond returning from the function with value [arg x] this also +signals the same to the tracer's runtime, popping the last entered +function from its stack of active functions. + +The [arg format] is expected to be a proper formatting string for +[fun printf] and analogues, able to stringify [arg x]. + +[comment {* * ** *** ***** ******** ************* *********************}] +[call [cmd {void TRACE ( char* format, ...)}]] +[call [cmd {void TRACE_TAG (tag, char* format, ...)}]] + +This macro is the trace facilities' equivalent of [fun printf], +printing arbitrary data under the control of the [arg format]. + +[para] The printed text is closed with a newline, and indented as per +the stack of active functions. + +[comment {* * ** *** ***** ******** ************* *********************}] +[call [cmd {void TRACE_HEADER (int indent)}]] +[call [cmd {void TRACE_TAG_HEADER (tag, int indent)}]] + +This is the low-level macro which prints the beginning of a trace +line. This prefix consists of physical location (file name and line +number), if available, indentation as per the stack of active scopes +(if activated), and the name of the active scope. + +[comment {* * ** *** ***** ******** ************* *********************}] +[call [cmd {void TRACE_CLOSER}]] +[call [cmd {void TRACE_TAG_CLOSER (tag)}]] + +This is the low-level macro which prints the end of a trace +line. + +[comment {* * ** *** ***** ******** ************* *********************}] +[call [cmd {void TRACE_ADD (const char* format, ...)}]] +[call [cmd {void TRACE_TAG_ADD (tag, const char* format, ...)}]] + +This is the low-level macro which adds formatted data to the line. + +[comment {* * ** *** ***** ******** ************* *********************}] +[call [cmd {void TRACE_PUSH_SCOPE (const char* name)}]] +[call [cmd {void TRACE_PUSH_FUNC}]] +[call [cmd {void TRACE_PUSH_POP}]] + +These are the low-level macros for scope management. The first two +forms push a new scope on the stack of active scopes, and the last +forms pops the last scope pushed. + +[comment {* * ** *** ***** ******** ************* *********************}] +[call [cmd {TRACE_TAG_VAR (tag)}]] + +Helper macro converting from a tag identifier to the name of the +underlying status variable. + +[comment {* * ** *** ***** ******** ************* *********************}] +[call [cmd {TRACE_RUN (code);}]] + +Conditionally insert the [arg code] at compile time when the tracing +facility is activated. + +[comment {* * ** *** ***** ******** ************* *********************}] +[call [cmd {TRACE_DO (code);}]] +[call [cmd {TRACE_TAG_DO (tag, code);}]] + +Insert the [arg code] at compile time when the tracing facility is +activated, and execute the same when either the implicit tag for the +file or the user-specified tag is active. + +[list_end] + +[comment {===================================================================}] +[include include/feedback2.inc] +[manpage_end] diff -Nru critcl-3.1.9/doc/critcl_emap.man critcl-3.1.17+dfsg/doc/critcl_emap.man --- critcl-3.1.9/doc/critcl_emap.man 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/doc/critcl_emap.man 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,185 @@ +[comment {-*- tcl -*- doctools manpage}] +[vset emap_version 1] +[manpage_begin critcl::emap n [vset emap_version]] +[include include/module2.inc] +[keywords singleton {Tcl Interp Association}] +[keywords bitmask bitset flags] +[titledesc {CriTcl Utilities: Enum en- and decoding}] +[require Tcl 8.4] +[require critcl [opt 3.1.11]] +[require critcl::emap [opt [vset emap_version]]] +[description] +[para] +[include include/welcome.inc] +[para] + +This document is the reference manpage for the +[package critcl::emap] package. This package provides convenience +commands for advanced functionality built on top of both critcl core +and package [package critcl::iassoc]. + +[para] C level libraries often use enumerations or integer values to encode +information, like the state of a system. Tcl bindings to such libraries now +have the task of converting a Tcl representation, i.e. a string into such +state, and back. + +[emph Note] here that the C-level information has to be something which +already exists. The package does [emph not] create these values. This is +in contrast to the package [package critcl::enum] which creates an +enumeration based on the specified symbolic names. + +[para] This package was written to make the declaration and management +of such enumerations and their associated conversions functions easy, +hiding all attendant complexity from the user. + +[para] Its intended audience are mainly developers wishing to write +Tcl packages with embedded C code. + +[para] This package resides in the Core Package Layer of CriTcl. +[para][image arch_core][para] + +[comment {===================================================================}] + +[section API] + +[list_begin definitions] +[call [cmd ::critcl::emap::def] [arg name] [arg definition] \ + [opt [option -nocase]] \ + [opt "[option -mode] [arg mode]"]] + +This command defines C functions for the conversion of the [arg name]d +state code into a Tcl string, and vice versa. + +The underlying mapping tables are automatically initialized on first +access (if not fully constant), and finalized on interpreter +destruction. + +[para] The [arg definition] dictionary provides the mapping from the +Tcl-level symbolic names of the state to their C expressions (often +the name of the macro specifying the actual value). + +[emph Note] here that the C-level information has to be something which +already exists. The package does [emph not] create these values. This is +in contrast to the package [package critcl::enum] which creates an +enumeration based on the specified symbolic names. + +[para] Further note that multiple strings can be mapped to the same C +expression. When converting to Tcl the first string for the mapping is +returned. An important thing to know: If all C expressions are +recognizable as integer numbers and their covered range is not too +large (at most 50) the package will generate code using direct and +fast mapping tables instead of using a linear search. + +[para] If the option [option -nocase] is specified then the encoder +will match strings case-insensitively, and the decoder will always +return a lower-case string, regardless of the string's case in the +[arg definition]. + +[para] If the option [option -mode] is specified its contents will +interpreted as a list of access modes to support. The two allowed +modes are [const c] and [const tcl]. Both modes can be used +together. The default mode is [const tcl]. + +[para] The package generates multiple things (declarations and +definitions) with names derived from [arg name], which has to be a +proper C identifier. Some of the things are generated conditional on +the chosen [arg mode]s. + +[list_begin definitions] +[def [arg name]_encode] +The [const tcl]-mode function for encoding a Tcl string into the +equivalent state code. + +Its signature is +[para][example_begin] +int [arg name]_encode (Tcl_Interp* interp, Tcl_Obj* state, int* result); +[example_end] + +[para] The return value of the function is a Tcl error code, +i.e. [const TCL_OK], [const TCL_ERROR], etc. + +[def [arg name]_encode_cstr] +The [const c]-mode function for encoding a C string into the +equivalent state code. + +Its signature is +[para][example_begin] +int [arg name]_encode_cstr (const char* state); +[example_end] + +[para] The return value of the function is the encoded state, or -1 if +the argument is not a vlaid state. + +[def [arg name]_decode] +The [const tcl]-mode function for decoding a state code into the +equivalent Tcl string. + +Its signature is +[para][example_begin] +Tcl_Obj* [arg name]_decode (Tcl_Interp* interp, int state); +[example_end] + +[def [arg name]_decode_cstr] +The [const c]-mode function for decoding a state code into the +equivalent C string. + +Its signature is +[para][example_begin] +const char* [arg name]_decode_cstr (int state); +[example_end] + +[para] The return value of the function is the C string for the state, +or [const NULL] if the [arg state] argument does not contain a valid +state value. + + +[def [arg name].h] +A header file containing the declarations for the conversion +functions, for use by other parts of the system, if necessary. + +[para] The generated file is stored in a place where it will not +interfere with the overall system outside of the package, yet also be +available for easy inclusion by package files ([cmd csources]). + +[def [arg name]] +For mode [const tcl] the command registers a new argument-type for +[cmd critcl::cproc] with critcl, encapsulating the encoder function. + +[def [arg name]] +For mode [const tcl] the command registers a new result-type for +[cmd critcl::cproc] with critcl, encapsulating the decoder function. + +[list_end] +[list_end] + +[comment {===================================================================}] +[section Example] + +The example shown below is the specification for the possible modes of +entry (normal, no feedback, stars) used by the Tcl binding to the +linenoise library. + +[example { +package require Tcl 8.5 +package require critcl 3.1.11 + +critcl::buildrequirement { + package require critcl::emap +} + +critcl::emap::def hiddenmode { + no 0 n 0 off 0 false 0 0 0 + all 1 yes 1 y 1 on 1 true 1 1 1 + stars 2 +} -nocase + +# Declarations: hiddenmode.h +# Encoder: int hiddenmode_encode (Tcl_Interp* interp, Tcl_Obj* state, int* result); +# Decoder: Tcl_Obj* hiddenmode_decode (Tcl_Interp* interp, int state); +# ResultType: hiddenmode +# ArgumentType: hiddenmode +}] + +[comment {===================================================================}] +[include include/feedback2.inc] +[manpage_end] diff -Nru critcl-3.1.9/doc/critcl_enum.man critcl-3.1.17+dfsg/doc/critcl_enum.man --- critcl-3.1.9/doc/critcl_enum.man 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/doc/critcl_enum.man 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,138 @@ +[comment {-*- tcl -*- doctools manpage}] +[vset enum_version 1.0.1] +[manpage_begin critcl::enum n [vset enum_version]] +[include include/module2.inc] +[keywords singleton {Tcl Interp Association}] +[keywords {string pool} {literal pool}] +[keywords {string to int mapping} conversion] +[keywords {int to string mapping}] +[titledesc {CriTcl Utilities: String/Integer mapping}] +[require Tcl 8.4] +[require critcl [opt 3.1.11]] +[require critcl::enum [opt [vset enum_version]]] +[description] +[para] +[include include/welcome.inc] +[para] + +This document is the reference manpage for the +[package critcl::enum] package. This package provides convenience +commands for advanced functionality built on top of both critcl core +and package [package critcl::literals]. + +[para] It is an extended form of string pool which not only converts +integer values into Tcl-level strings, but also handles the reverse +direction, converting from strings to the associated integer values. + +[para] It essentially provides a bi-directional mapping between a C +enumeration type and a set of strings, one per enumeration value. + +[emph Note] that the C enumeration in question is created by the +definition. It is not possible to use the symbols of an existing +enumeration type. + +[para] This package was written to make the declaration and management +of such mappings easy. It uses a string pool for one of the directions, +using its ability to return shared literals and conserve memory. + +[para] Its intended audience are mainly developers wishing to write +Tcl packages with embedded C code. + +[para] This package resides in the Core Package Layer of CriTcl. +[para][image arch_core][para] + +[comment {===================================================================}] + +[section API] + +[list_begin definitions] +[call [cmd ::critcl::enum::def] [arg name] [arg definition]] + +This command defines two C functions for the conversion between +C values and Tcl_Obj'ects, with named derived from [arg name]. + +[para] The [arg definition] dictionary provides the mapping from the +specified C-level symbolic names to the strings themselves. + +[para] The package generates multiple things (declarations and +definitions) with names derived from [arg name], which has to be a +proper C identifier. + +[list_begin definitions] +[def [arg name]_pool_names] +The C enumeration type containing the specified symbolic names. + +[def [arg name]_ToObj] +The function converting from integer value to Tcl string. + +Its signature is +[para][example_begin] +Tcl_Obj* [arg name]_ToObj (Tcl_Interp* interp, [arg name]_names literal); +[example_end] + +[def [arg name]_GetFromObj] +The function converting from Tcl string to integer value. + +Its signature is +[para][example_begin] +int [arg name]_GetFromObj (Tcl_Interp* interp, Tcl_Obj* obj, int flags, int* literal); +[example_end] + +The [arg flags] are like for [fun Tcl_GetIndexFromObj]. + +[def [arg name].h] + +A header file containing the declarations for the converter functions, +for use by other parts of the system, if necessary. + +[para] The generated file is stored in a place where it will not +interfere with the overall system outside of the package, yet also be +available for easy inclusion by package files ([cmd csources]). + +[def [arg name]] +At the level of critcl itself the command registers a new result-type +for [cmd critcl::cproc], which takes an integer result from the function +and converts it to the equivalent string in the pool for the script. + +[def [arg name]] +At the level of critcl itself the command registers a new argument-type +for [cmd critcl::cproc], which takes a Tcl string and converts it to the +equivalent integer for delivery to the function. + +[list_end] +[list_end] + +[comment {===================================================================}] +[section Example] + +The example shown below is the specification for a set of actions, methods, +and the like, a function may take as argument. + +[example { +package require Tcl 8.5 +package require critcl 3.1.11 + +critcl::buildrequirement { + package require critcl::enum +} + +critcl::enum::def action { + w_create "create" + w_directory "directory" + w_events "events" + w_file "file" + w_handler "handler" + w_remove "remove" +} + +# Declarations: action.h +# Type: action_names +# Accessor: Tcl_Obj* action_ToObj (Tcl_Interp* interp, int literal); +# Accessor: int action_GetFromObj (Tcl_Interp* interp, Tcl_Obj* o, int flags, int* literal); +# ResultType: action +# ArgType: action +}] + +[comment {===================================================================}] +[include include/feedback2.inc] +[manpage_end] diff -Nru critcl-3.1.9/doc/critcl_installer.man critcl-3.1.17+dfsg/doc/critcl_installer.man --- critcl-3.1.9/doc/critcl_installer.man 2013-05-10 05:57:04.000000000 +0000 +++ critcl-3.1.17+dfsg/doc/critcl_installer.man 2017-10-14 02:48:11.000000000 +0000 @@ -34,6 +34,7 @@ For details see [sectref Tcl]. [enum] Various packages from the Tcllib bundle for [syscmd Tcl]. For details see [sectref Tcllib]. +[enum] A working C compiler and development environment. [list_end] This list assumes that the machine where Critcl is to be installed is @@ -44,93 +45,14 @@ [include include/rq_tcl.inc] [include include/rq_tcllib.inc] +[include include/rq_cc.inc] -[section {Build & Installation}] +[comment {===================================================================}] +[section {Build & Installation Instructions}] -To install Critcl simply run - -[example { - /path/to/tclsh /path/to/critcl/build.tcl install -}] - -where [file /path/to/tclsh] is the tclsh of your Tcl installation, and -[file /path/to/critcl] the location of the Critcl sources on your system. - -[para] - -This builds all packages and then places them in a directory where the -[cmd tclsh] will find them. - -[para] - -It further creates a [file critcl] application script and places it -into the directory [cmd tclsh] resides in, making it a sibling of that -executable. The critcl application is written to use that executable -as well, and not search for it in the [var PATH]. - -[para] - -On Windows you can invoke the file [file build.tcl] with a -double-click. This will pop up a small graphical interface for -entering the destination and performing the installation. This -handling of a double-click is restricted to Windows only however. - -[para] - -On unix the same GUI is acessible by invoking [file build.tcl] without -any arguments. - -[para] - -To get help about the methods of [file build.tcl], and their complete -syntax, invoke [file build.tcl] with argument [method help], i.e., like - -[example { - /path/to/tclsh /path/to/critcl/build.tcl help -}] - -[section {First Use, Testing the Installation}] - -With critcl installed it is now the time to try at least one of the -examples distributed with it. This will also test if the installation -was successful. - -[para] Below I show the steps to generate and then use the low- and -high-level stack example packages. I am intentionally bypassing the -[file build.tcl] file the example is coming with, to show the use of -[cmd critcl] itself. - -[para][example { - - > cd examples/stack - > /path/to/critcl -keep -cache B -pkg cstack.tcl - > /path/to/critcl -keep -cache B -pkg stackc.tcl - > tclsh - % lappend auto_path [pwd]/lib - % package require stackc - % join [info loaded] \n - % stackc S - % S push FOO - % S size - % S destroy - % exit - > -}] - -[para] Some explanations: -[list_begin itemized] -[item] The example shows only the commands entered on the shell (and - tclsh) command line. Their responses are left out. -[item] Use of option [option -keep] causes critcl to leave the - generated .c files behind, for edification. Normally this - happens only in case of trouble. -[item] Use of option [option -cache] redirects the location of the - directory to hold generated and build files to a local - directory with a known name, for an easy look after. -[item] Both [package cstack] and [package stackc] have to use the - [emph same] [option -cache] so that [package stackc] will - find the stub table headers exported by [package cstack]. -[list_end] +[include include/b_unix.inc] +[include include/b_windows.inc] +[include include/b_test.inc] [include include/feedback.inc] [manpage_end] diff -Nru critcl-3.1.9/doc/critcl_literals.man critcl-3.1.17+dfsg/doc/critcl_literals.man --- critcl-3.1.9/doc/critcl_literals.man 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/doc/critcl_literals.man 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,146 @@ +[comment {-*- tcl -*- doctools manpage}] +[vset literal_version 1.2] +[manpage_begin critcl::literals n [vset literal_version]] +[include include/module2.inc] +[keywords singleton {Tcl Interp Association}] +[keywords {string pool} {literal pool}] +[titledesc {CriTcl Utilities: Constant string pools}] +[require Tcl 8.4] +[require critcl [opt 3.1.11]] +[require critcl::literals [opt [vset literal_version]]] +[description] +[para] +[include include/welcome.inc] +[para] + +This document is the reference manpage for the +[package critcl::literals] package. This package provides convenience +commands for advanced functionality built on top of both critcl core +and package [package critcl::iassoc]. + +[para] Many packages will have a fixed set of string constants +occuring in one or places. Most of them will be coded to create a new +string [const Tcl_Obj*] from a C [const char*] every time the constant +is needed, as this is easy to to, despite the inherent waste of +memory. + +[para] This package was written to make declaration and management of +string pools which do not waste memory as easy as the wasteful +solution, hiding all attendant complexity from the user. + +[para] Its intended audience are mainly developers wishing to write +Tcl packages with embedded C code. + +[para] This package resides in the Core Package Layer of CriTcl. +[para][image arch_core][para] + +[comment {===================================================================}] + +[section API] + +[list_begin definitions] +[call [cmd ::critcl::literals::def] [arg name] [arg definition] [opt [arg mode]]] + +This command defines a C function with the given [arg name] which +provides access to a pool of constant strings with a Tcl interpreter. + +[para] The [arg definition] dictionary provides the mapping from the +C-level symbolic names to the string themselves. + +[para] The [arg mode]-list configures the output somewhat. The two +allowed modes are [const c] and [const tcl]. Both modes can be used +together. The default mode is [const tcl]. + +[para] For mode [const tcl] the new function has two arguments, a +[const Tcl_Interp*] pointer refering to the interpreter holding the +string pool, and a code of type "[arg name]_names" (see below), the +symbolic name of the literal to return. The result of the function is +a [const Tcl_Obj*] pointer to the requested string constant. + +[para] For mode [const c] the new function has one argument, a code of +type "[arg name]_names" (see below), the symbolic name of the literal +to return. The result of the function is a [const {const char*}] +pointer to the requested string constant. + +[para] The underlying string pool is automatically initialized on +first access, and finalized on interpreter destruction. + +[para] The package generates multiple things (declarations and +definitions) with names derived from [arg name], which has to be a +proper C identifier. + +[list_begin definitions] +[def [arg name]] +The mode [const tcl] function providing access to the string pool. + +Its signature is +[para][example_begin] +Tcl_Obj* [arg name] (Tcl_Interp* interp, [arg name]_names literal); +[example_end] + +[def [arg name]_cstr] +The mode [const c] function providing access to the string pool. + +Its signature is +[para][example_begin] +const char* [arg name]_cstr ([arg name]_names literal); +[example_end] + +[def [arg name]_names] +A C enumeration type containing the symbolic names of the strings +provided by the pool. + +[def [arg name].h] +A header file containing the declarations for the accessor functions +and the enumeration type, for use by other parts of the system, if +necessary. + +[para] The generated file is stored in a place where it will not +interfere with the overall system outside of the package, yet also be +available for easy inclusion by package files ([cmd csources]). + +[def [arg name]] +[emph {New in version 1.1}]: + +For mode [const tcl] the command registers a new result-type for +[cmd critcl::cproc] with critcl, which takes an integer result from +the function and converts it to the equivalent string in the pool for +the script. + +[list_end] +[list_end] + +[comment {===================================================================}] +[section Example] + +The example shown below is the specification of the string pool pulled +from the draft work on a Tcl binding to Linux's inotify APIs. + +[example { +package require Tcl 8.5 +package require critcl 3.1.11 + +critcl::buildrequirement { + package require critcl::literals +} + +critcl::literals::def tcl_inotify_strings { + w_create "create" + w_directory "directory" + w_events "events" + w_file "file" + w_handler "handler" + w_remove "remove" +} {c tcl} + +# Declarations: tcl_inotify_strings.h +# Type: tcl_inotify_strings_names +# Accessor: Tcl_Obj* tcl_inotify_strings (Tcl_Interp* interp, +# tcl_inotify_strings_names literal); +# Accessor: const char* tcl_inotify_strings_cstr (tcl_inotify_strings_names literal); +# ResultType: tcl_inotify_strings +}] + +[comment {===================================================================}] +[include include/feedback2.inc] +[manpage_end] diff -Nru critcl-3.1.9/doc/critcl_util.man critcl-3.1.17+dfsg/doc/critcl_util.man --- critcl-3.1.9/doc/critcl_util.man 2013-05-10 05:57:04.000000000 +0000 +++ critcl-3.1.17+dfsg/doc/critcl_util.man 2017-10-14 02:48:11.000000000 +0000 @@ -22,10 +22,10 @@ [para][image arch_core][para] [comment {===================================================================}] - [section API] [list_begin definitions] +[comment {* * ** *** ***** ******** ************* *********************}] [call [cmd ::critcl::util::checkfun] [arg name] [opt [arg label]]] This command checks the build-time environment for the existence of @@ -33,6 +33,54 @@ It returns [const true] on success, and [const false] otherwise. + +[comment {* * ** *** ***** ******** ************* *********************}] +[call [cmd ::critcl::util::def] [arg path] [arg define] [opt [arg value]]] + +This command extends the specified configuration file [arg path] with a +[const \#define] directive for the named [arg define]. If the [arg value] +is not specified it will default to [const 1]. + +[para] The result of the command is an empty string. + +[para] Note that the configuration file is maintained in the [cmd critcl::cache] +directory. + + +[comment {* * ** *** ***** ******** ************* *********************}] +[call [cmd ::critcl::util::undef] [arg path] [arg define]] + +This command extends the specified configuration file [arg path] with an +[const \#undef] directive for the named [arg define]. + +[para] The result of the command is an empty string. + +[para] Note that the configuration file is maintained in the [cmd critcl::cache] +directory. + + +[comment {* * ** *** ***** ******** ************* *********************}] +[call [cmd ::critcl::util::locate] [arg label] [arg paths] [opt [arg cmd]]] + +This command checks the build-time environment for the existence of a file +in a set of possible [arg paths]. + +[para] If the option [arg cmd] prefix is specified it will be called with +the full path of a found file as its only argument to perform further checks. +A return value of [const false] will reject the path and continue the search. + +[para] The return value of the command is the found path, as listed in +[arg paths]. As a side effect the command will also print the found path, +prefixed with the [arg label], using [cmd critcl::msg]. + +[para] Failure to find the path is reported via [cmd critcl::error], and a +possible empty string as the result, if [cmd critcl::error] does not +terminate execution. + +[para] Relative paths are allowed as elements of [arg paths], and are +normalized relative to the directory containing the currently handled +critcl file. + [list_end] [comment {===================================================================}] diff -Nru critcl-3.1.9/doc/include/api_bmgmt.inc critcl-3.1.17+dfsg/doc/include/api_bmgmt.inc --- critcl-3.1.9/doc/include/api_bmgmt.inc 2013-05-10 05:57:04.000000000 +0000 +++ critcl-3.1.17+dfsg/doc/include/api_bmgmt.inc 2017-10-14 02:48:11.000000000 +0000 @@ -26,6 +26,14 @@ This flag tells the package whether to embed #line directives into the generated C code (when [const true]) or not. By default this is [const on]. +[opt_def trace bool] + +Inactive by default. + +When active code tracing entry and exit of [cmd critcl::cproc]-based +is inserted into the C code. This implicitly activates the tracing +facility in general. (See package [package critcl::cutil]). + [include rq_cline.inc] [para] Developers of higher-level packages generating their own C diff -Nru critcl-3.1.9/doc/include/api_control.inc critcl-3.1.17+dfsg/doc/include/api_control.inc --- critcl-3.1.9/doc/include/api_control.inc 2013-05-10 05:57:04.000000000 +0000 +++ critcl-3.1.17+dfsg/doc/include/api_control.inc 2017-10-14 02:48:11.000000000 +0000 @@ -34,12 +34,13 @@ current [file .critcl] file. [para] [emph Note] further that this declaration does not cause the -specified header files to be [const {#include}]'d automatically. This -still has to be done via [cmd critcl::ccode] where necessary. +specified header files to be automatically +[const {#include}]'d. Inclusion still has to be done via either +[cmd critcl::include] or [cmd critcl::ccode], where necessary. It does simply ensure that the compiler will be able to find these files when invoked, by providing the necessary command line flags -extending the compiler's search paths. +to extend the compiler's search paths. [para] Multiple invocations of this command accumulate their information. @@ -49,7 +50,7 @@ This command provides the compile step with additional C source files. -[para] All arguments are intepreted as glob patterns. Patterns +[para] All arguments are interpreted as glob patterns. Patterns matching no file or non-existing files cause the command to throw an error. The files matching the patterns are made available to the compiler when it is invoked for the current [file .critcl] file. This diff -Nru critcl-3.1.9/doc/include/api_embedc.inc critcl-3.1.17+dfsg/doc/include/api_embedc.inc --- critcl-3.1.9/doc/include/api_embedc.inc 2013-05-10 05:57:04.000000000 +0000 +++ critcl-3.1.17+dfsg/doc/include/api_embedc.inc 2017-10-14 02:48:11.000000000 +0000 @@ -107,12 +107,36 @@ [comment ---------------------------------------------------------------------] [call [cmd ::critcl::cdata] [arg tclname] [arg data]] -This command a new Tcl command named [arg tclname] which returns +This command creates a new Tcl command named [arg tclname] which returns [arg data] as a ByteArray result. [para] The result of [cmd critcl::cdata] itself is the empty string. [comment ---------------------------------------------------------------------] +[call [cmd ::critcl::cconst] [arg tclname] [arg resulttype] [arg value]] + +This command creates a new Tcl command named [arg tclname] which returns +the constant [arg value] as its result, with Tcl type [arg resulttype]. + +[para] The result of [cmd critcl::cconst] itself is the empty string. + +[para] The command is similar to [cmd critcl::cdata] in that it returns a +constant value. Contrary to [cmd critcl::cdata] however it is not restricted +to ByteArray results, but accepts all result-types known to [cmd critcl::cproc]. +Its semantics are actually equivalent to + +[example { + cproc $tclname {} $resulttype "return $value ;" +}] + +[para] Contrary to [cmd critcl::cproc] however it is internally optimized to +avoid generating a superfluous C function. + +[para] Note that nothing prevents the user from using a C define for the +[arg value]. Any visible C function is actually also allowed, as long as +it does not take arguments. + +[comment ---------------------------------------------------------------------] [call [cmd ::critcl::cdefines] [arg definitions] [opt [arg namespace]]] This command creates Tcl variables in the specified [arg namespace] @@ -190,101 +214,15 @@ [list_end] -The list below shows the values which are legal for [arg resulttype], -and details their semantics: +Below is the list of predefined types legal for [arg resulttype], plus +the details of their semantics. Note that it is possible to extend +this list with custom types if the standard does not support what is +needed. See section [sectref {Advanced: Extending cproc}] for details. [comment {% % %% %%% %%%%% %%%%%%%% %%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%}] -[list_begin definitions] -[comment {% % %% %%% %%%%% %%%%%%%% %%%%%%%%%%%%%}] -[def Tcl_Obj*] -[def object] -The function returns a value of type "Tcl_Obj*". -This value becomes the interpreter result, if not [const 0]. -The Tcl status is TCL_ERROR when a [const 0] is returned, and TCL_OK otherwise. - -[para][emph Attention]: The conversion assumes that the value belonged to -the function, with an associated reference count, and decrements the -reference count to indicate the loss of ownership by the -function. This means that it is an error to return a value whose -reference count is zero. - -[comment {% % %% %%% %%%%% %%%%%%%% %%%%%%%%%%%%%}] -[def char*] -[def vstring] -The function returns a value of type "char*". -This value becomes the interpreter result, wrapped in a String. - -It is assumed that the string is volatile in some way, with the -wrapping in a String duplicating it before making it the result, -ensuring that we will not access a dangling pointer in the future. - -The Tcl status is always TCL_OK. - -[comment {% % %% %%% %%%%% %%%%%%%% %%%%%%%%%%%%%}] -[def {const char*}] -Like type [const char*] above, except that the returned string is const-qualified. - -[comment {% % %% %%% %%%%% %%%%%%%% %%%%%%%%%%%%%}] -[def string] -[def dstring] -The function returns a value of type "char*". - -Contrary to the previous string types here it is assumed that the -value is dynamically allocated, via [fun Tcl_Alloc]. - -This value becomes the interpreter result, as usual, but is [emph not] copied. -The Tcl status is always TCL_OK. - -[comment {% % %% %%% %%%%% %%%%%%%% %%%%%%%%%%%%%}] -[def double] -The function returns a value of type "double". -This value becomes the interpreter result, properly wrapped (Int). -The Tcl status is always TCL_OK. - -[comment {% % %% %%% %%%%% %%%%%%%% %%%%%%%%%%%%%}] -[def float] -The function returns a value of type "float". -This value becomes the interpreter result, properly wrapped (Double). -The Tcl status is always TCL_OK. - -[comment {% % %% %%% %%%%% %%%%%%%% %%%%%%%%%%%%%}] -[def boolean] -[def bool] -The function returns a value of type "int", interpreted as boolean. -This value becomes the interpreter result, properly wrapped (Int). -The Tcl status is always TCL_OK. - -[comment {% % %% %%% %%%%% %%%%%%%% %%%%%%%%%%%%%}] -[def int] -The function returns a value of type "int". -This value becomes the interpreter result, properly wrapped (Int). -The Tcl status is always TCL_OK. - -[comment {% % %% %%% %%%%% %%%%%%%% %%%%%%%%%%%%%}] -[def long] -The function returns a value of type "long int". -This value becomes the interpreter result, properly wrapped (Long). -The Tcl status is always TCL_OK. - -[comment {% % %% %%% %%%%% %%%%%%%% %%%%%%%%%%%%%}] -[def ok] -The function returns a value of type "int". -It is interpreted as the Tcl status code. -The interpreter result is left untouched (empty). - -[comment {% % %% %%% %%%%% %%%%%%%% %%%%%%%%%%%%%}] -[def void] -The function does not return a value. -The interpreter result is left untouched (empty). -The Tcl status is always TCL_OK. - -[list_end] +[include api_stdrt_cproc.inc] [comment {% % %% %%% %%%%% %%%%%%%% %%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%}] -[para] Please note that it is possible to extend the above with custom -types if these types are not enough. See section -[sectref {Advanced: Extending cproc}] for details. - [para] The [arg arguments] parameter has the overall syntax of a Tcl dictionary value, except that keys (argument names) and values (argument types) are specified in reverse order. Consider the @@ -302,127 +240,31 @@ For example, in the declaration [example { int {x 1} }] [arg x] is an optional argument of type [type int] and default value [const 1]. -[para] One limitation, and one caveat! - -[para] First, the set of optional arguments must be a single -contiguous segment in the argument list. This limits them to a series -of optional arguments at either the beginning, end, or middle of the -list. Multiple segments separated by non-optional arguments are -rejected, as the system cannot determine in these cases which -arguments are present and what to set where. - -[para] Second, the default value is assigned unconditionally. If a +[para] A caveat! The default value is assigned unconditionally. If a custom argument type uses more complex validation, and the default may be invalid according to it, then the relevant checks have to be done in the procedure body. The argument conversion cannot do it as it is completely bypassed when the argument is not present. Overcoming this requires the separation of argument conversion and validation code. -[para] The list below shows the values which are legal for argument -types, and details their semantics: - -[comment {% % %% %%% %%%%% %%%%%%%% %%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%}] -[list_begin definitions] -[comment {% % %% %%% %%%%% %%%%%%%% %%%%%%%%%%%%%}] -[def Tcl_Obj*] -[def object] -The function takes an argument of type "Tcl_Obj*". -No argument checking is done. -The Tcl level word is passed to the argument as-is. - -[comment {% % %% %%% %%%%% %%%%%%%% %%%%%%%%%%%%%}] -[def bytearray] -[def rawchar*] -[def rawchar] -The function takes an argument of type "char*". - -The Tcl argument must be convertible to ByteArray, an error is thrown -otherwise. - -[emph Note] that the length of the ByteArray is [emph not] passed to -the function. - -[comment {% % %% %%% %%%%% %%%%%%%% %%%%%%%%%%%%%}] -[def char*] -The function takes an argument of type "char*". -The string representation of the Tcl argument is passed in. - -[comment {% % %% %%% %%%%% %%%%%%%% %%%%%%%%%%%%%}] -[def double] -The function takes an argument of type "double". - -The Tcl argument must be convertible to Double, an error is thrown -otherwise. - -[comment {% % %% %%% %%%%% %%%%%%%% %%%%%%%%%%%%%}] -[def float] -The function takes an argument of type "float". - -The Tcl argument must be convertible to Double, an error is thrown -otherwise. - -[comment {% % %% %%% %%%%% %%%%%%%% %%%%%%%%%%%%%}] -[def boolean] -[def bool] -The function takes an argument of type "int". - -The Tcl argument must be convertible to Boolean, an error is thrown -otherwise. - -[comment {% % %% %%% %%%%% %%%%%%%% %%%%%%%%%%%%%}] -[def int] -The function takes an argument of type "int". - -The Tcl argument must be convertible to Int, an error is thrown -otherwise. - -[comment {% % %% %%% %%%%% %%%%%%%% %%%%%%%%%%%%%}] -[def long] -The function takes an argument of type "long int". - -The Tcl argument must be convertible to Long, an error is thrown -otherwise. - -[comment {% % %% %%% %%%%% %%%%%%%% %%%%%%%%%%%%%}] -[def void*] - -[comment {% % %% %%% %%%%% %%%%%%%% %%%%%%%%%%%%%}] -[def double*] -[def float*] -[def int*] - -The function takes an argument of the same-named C type. - -The Tcl argument must be convertible to ByteArray, an error is thrown -otherwise. - -The bytes in the ByteArray are then re-interpreted as the raw -representation of a C pointer of the given type which is then passed -as argument to the function. - -In other words, this is for Tcl values somehow holding raw C pointers, -i.e. memory addresses. - -[para] [emph Attention]: These types are considered [emph DEPRECATED]. -It is planned to remove their documentation in release 3.2, and their -implementation in release 3.3. Their deprecation can be undone if -good use cases are shown. - -[list_end] -[comment {% % %% %%% %%%%% %%%%%%%% %%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%}] - -[para] [emph Note] that optional arguments are not possible. This -restriction is inherited from C. +[para] Below is the list of predefined types legal for arguments, plus +the details of their semantics. Note that it is possible to extend +this list with custom types if the standard does not support what is +needed. See section [sectref {Advanced: Extending cproc}] for details. [para] Further note that the type of the first argument is allowed to be [const Tcl_Interp*]. In that case the argument in question is [emph not] counted as an argument of the new Tcl command. +[comment {% % %% %%% %%%%% %%%%%%%% %%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%}] +[include api_stdat_cproc.inc] +[comment {% % %% %%% %%%%% %%%%%%%% %%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%}] + [comment ---------------------------------------------------------------------] [call [cmd ::critcl::cproc] [arg name] [arg arguments] [arg resulttype]] This variant of [cmd critcl::cproc] assumes that the functionality to -connect is implemented by the C function [arg name] which has the +connect to is implemented by the C function [arg name] which has the signature described by the [arg arguments] and [arg resulttype]. [para] It creates only the shim performing the conversions required by @@ -433,23 +275,41 @@ This command compiles the C code in [arg text] and [arg externals]. -[para] Both have access to all definitions created by the previously -listed commands, regardless of their and its placement in the -[file .critcl] file. See section [sectref {Runtime Behaviour}] for -more details. +[para] Both arguments have access to all definitions created by the +previously listed commands, regardless of their placement in the +[file .critcl] file relative to this command. +See section [sectref {Runtime Behaviour}] for more details. [para] The C code in [arg text] is put into the body of the initialization function of the shared library backing the [file .critcl] file, and is executed when this library is loaded into the interpreter. +[para] This code has access to a variable [var interp] of type +[const Tcl_Interp*] referencing the Tcl interpreter currently being +initialized. + [para] The code in [arg externals] on the other hand is placed outside and just before the initialization function, making this is a good place for any external symbols required by initialization function which should not be accessible by any other parts of the C code. +[para] Multiple invokations of this command are allowed, and a later +call has access to the information of all preceding ones. + [para] The result of the command is the empty string. [comment ---------------------------------------------------------------------] +[call [cmd ::critcl::include] [arg path]] + +This command is a convenient shorthand for + +[example { +critcl::code { + #include <${path}> +} +}] + +[comment ---------------------------------------------------------------------] [list_end] diff -Nru critcl-3.1.9/doc/include/api_extcproc1.inc critcl-3.1.17+dfsg/doc/include/api_extcproc1.inc --- critcl-3.1.9/doc/include/api_extcproc1.inc 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/doc/include/api_extcproc1.inc 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,6 @@ + +While the [cmd critcl::cproc] command understands the most common C +types (see section [sectref {Embedded C Code}]), sometimes this is not +enough. + +[include api_extcproc.inc] diff -Nru critcl-3.1.9/doc/include/api_extcproc2.inc critcl-3.1.17+dfsg/doc/include/api_extcproc2.inc --- critcl-3.1.9/doc/include/api_extcproc2.inc 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/doc/include/api_extcproc2.inc 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,5 @@ + +While the [cmd critcl::cproc] command understands the most common C +types (as per the previous 2 sections), sometimes this is not enough. + +[include api_extcproc.inc] diff -Nru critcl-3.1.9/doc/include/api_extcproc.inc critcl-3.1.17+dfsg/doc/include/api_extcproc.inc --- critcl-3.1.9/doc/include/api_extcproc.inc 2013-05-10 05:57:04.000000000 +0000 +++ critcl-3.1.17+dfsg/doc/include/api_extcproc.inc 2017-10-14 02:48:11.000000000 +0000 @@ -1,16 +1,20 @@ -While the [cmd critcl::cproc] command understands the most common C -types (see section [sectref {Embedded C Code}]), sometimes this is not -enough. - [para] To get around this limitation the commands in this section enable users of [package critcl] to extend the set of argument and -result types understood by [cmd critcl::cproc]. In other words, to -define their own custom types. +result types understood by [cmd critcl::cproc]. In other words, they +allow them to define their own, custom, types. [list_begin definitions] [comment {- - -- --- ----- -------- ------------- ---------------------}] +[call [cmd ::critcl::has-resulttype] [arg name]] + +This command tests if the named result-type is known or not. + +It returns a boolean value, [const true] if the type is known and +[const false] otherwise. + +[comment {- - -- --- ----- -------- ------------- ---------------------}] [call [cmd ::critcl::resulttype] [arg name] [arg body] [opt [arg ctype]]] This command defines the result type [arg name], and associates it @@ -24,7 +28,7 @@ [emph Attention!] The standard result type [const void] is special as it has no accompanying result variable. This cannot be expressed -by the this extension command. +by this extension command. [para] The [arg body]'s responsibility is the conversion of the functions result into a Tcl result and a Tcl status. The first has to @@ -63,6 +67,15 @@ alias of result type [arg origname], which has to be defined already. If this is not the case an error is thrown. + +[comment {- - -- --- ----- -------- ------------- ---------------------}] +[call [cmd ::critcl::has-argtype] [arg name]] + +This command tests if the named argument-type is known or not. + +It returns a boolean value, [const true] if the type is known and +[const false] otherwise. + [comment {- - -- --- ----- -------- ------------- ---------------------}] [call [cmd ::critcl::argtype] [arg name] [arg body] [opt [arg ctype]] [opt [arg ctypefun]]] @@ -116,16 +129,36 @@ this is not the case an error is thrown. [comment ---------------------------------------------------------------------] -[call [cmd ::critcl::argtypesupport] [arg name] [arg code]] +[call [cmd ::critcl::argtypesupport] [arg name] [arg code] [opt [arg guard]]] This command defines a C code fragment for the already defined argument type [arg name] which will be inserted before all functions using that type. Its purpose is the definition of any supporting C types needed by the argument type. -If the type is used by many functions the system ensure that only the +If the type is used by many functions the system ensures that only the first of the multiple insertions of the code fragment is active, and the others disabled. +The guard identifier is normally derived from [arg name], but can also +be set explicitly, via [arg guard]. This latter allows different +custom types to share a common support structure without having to +perform their own guarding. + +[comment ---------------------------------------------------------------------] +[call [cmd ::critcl::argtyperelease] [arg name] [arg code]] + +This command defines a C code fragment for the already defined +argument type [arg name] which will be inserted whenever the worker +function of a [cmd critcl::cproc] returns to the shim. It is the +responsibility of this fragment to unconditionally release any +resources the [cmd critcl::argtype] conversion code allocated. + +An example of this are the [emph variadic] types for the support of +the special, variadic [arg args] argument to [cmd critcl::cproc]'s. +They allocate a C array for the collected arguments which has to be +released when the worker returns. This command defines the C code +for doing that. + [comment {- - -- --- ----- -------- ------------- ---------------------}] [list_end] diff -Nru critcl-3.1.9/doc/include/api_generation.inc critcl-3.1.17+dfsg/doc/include/api_generation.inc --- critcl-3.1.9/doc/include/api_generation.inc 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/doc/include/api_generation.inc 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,37 @@ + +While file generation is related to the diversions explained in the +previous section they are not the same. + +Even so, like diversions this feature is for higher-level packages +generating their own C code. + +[para] Three examples of utility packages using this facility comes +with critcl itself. + +See the implementations of packages [package critcl::literals], +[package critcl::bitmap], and [package critcl::enum]. + +[para] When splitting a package implementation into pieces it is often +sensible to have a number of pure C companion files containing +low-level code, yet these files may require information about the code +in the main [file .critcl] file. Such declarations are normally not +exportable and using the stub table support does not make sense, as +this is completely internal to the package. + +[para] With the file generation command below the main [file .critcl] +file can generate any number of header files for the C companions to +pick up. + +[list_begin definitions] +[comment {- - -- --- ----- -------- ------------- ---------------------}] +[call [cmd ::critcl::make] [arg path] [arg contents]] + +This command creates the file [arg path] in a location where the C +companion files of the package are able to pick it up by simple +inclusion of [arg path] during their compilation, without interfering +with the outer system at all. + +[para] The generated file will contain the specified [arg contents]. + +[comment {- - -- --- ----- -------- ------------- ---------------------}] +[list_end] diff -Nru critcl-3.1.9/doc/include/api.inc critcl-3.1.17+dfsg/doc/include/api.inc --- critcl-3.1.9/doc/include/api.inc 2013-05-10 05:57:04.000000000 +0000 +++ critcl-3.1.17+dfsg/doc/include/api.inc 2017-10-14 02:48:11.000000000 +0000 @@ -29,4 +29,5 @@ [subsection {Custom Build Configuration}] [include include/api_cbconfig.inc] [subsection {Advanced: Location management}] [include include/api_location.inc] [subsection {Advanced: Diversions}] [include include/api_diversions.inc] -[subsection {Advanced: Extending cproc}] [include include/api_extcproc.inc] +[subsection {Advanced: File Generation}] [include include/api_generation.inc] +[subsection {Advanced: Extending cproc}] [include include/api_extcproc1.inc] diff -Nru critcl-3.1.9/doc/include/api_introspection.inc critcl-3.1.17+dfsg/doc/include/api_introspection.inc --- critcl-3.1.9/doc/include/api_introspection.inc 2013-05-10 05:57:04.000000000 +0000 +++ critcl-3.1.17+dfsg/doc/include/api_introspection.inc 2017-10-14 02:48:11.000000000 +0000 @@ -104,18 +104,20 @@ [call [cmd ::critcl::failed]] This command returns a boolean value. It returns [const true] if -critcl has failed to build the package. As part of this it forces the -building of the package, but not its loading. Note that it will -attempt to build the package only on the first call; future calls for -the same package will return a cached result. +critcl has failed to build the package, and [const false] otherwise, +i.e. success. As part of this it forces the building of the package, +but not its loading. Note that it will attempt to build the package +only on the first call; future calls for the same package will return +a cached result. [para] This enables a critcl-based package to check itself for -availability and throw an error if it could not be built. +availability and throw an error if it could not be built. [emph Note] +that the command does [emph not] throw such an error itself. -[para] [emph Note] that this command is only useful from within in a -[file .critcl] file. The result is managed on a per-file basis, like -is done for the commands embedding C code and controlling the -behaviour of compiler and linker. +[para] [emph Note] further that this command is only useful from +within in a [file .critcl] file. The result is managed on a per-file +basis, like is done for the commands embedding C code and controlling +the behaviour of compiler and linker. [comment ---------------------------------------------------------------------] [call [cmd ::critcl::load]] @@ -125,16 +127,18 @@ its result has reversed sense. [para] It returns [const true] if critcl succeeded in building and -loading the package. +loading the package, and [const false] otherwise, i.e. build- or +load-failure. [para] This enables a critcl-based package to to not only check itself for availability and throw an error if it could not be built, but also force an immediate load, circumventing the default behaviour, which is -lazy. See also section [sectref {Runtime Behaviour}]. +lazy. See also section [sectref {Runtime Behaviour}]. [emph Note] that +the command does [emph not] throw any error itself. -[para] [emph Note] that this command is only useful from within in a -[file .critcl] file. The result is managed on a per-file basis, like -is done for the commands embedding C code and controlling the -behaviour of compiler and linker. +[para] [emph Note] further that this command is only useful from +within in a [file .critcl] file. The result is managed on a per-file +basis, like is done for the commands embedding C code and controlling +the behaviour of compiler and linker. [list_end] diff -Nru critcl-3.1.9/doc/include/api_location.inc critcl-3.1.17+dfsg/doc/include/api_location.inc --- critcl-3.1.9/doc/include/api_location.inc 2013-05-10 05:57:04.000000000 +0000 +++ critcl-3.1.17+dfsg/doc/include/api_location.inc 2017-10-14 02:48:11.000000000 +0000 @@ -62,7 +62,7 @@ The result of the command is the empty string. -[para] In terms of [cmd ::critcl::at::caller]] this is equivalent to +[para] In terms of [cmd ::critcl::at::caller] this is equivalent to [example { critcl::at::caller 0 1 }] diff -Nru critcl-3.1.9/doc/include/api_stdat_cproc.inc critcl-3.1.17+dfsg/doc/include/api_stdat_cproc.inc --- critcl-3.1.9/doc/include/api_stdat_cproc.inc 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/doc/include/api_stdat_cproc.inc 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,158 @@ + +[list_begin definitions] +[comment {% % %% %%% %%%%% %%%%%%%% %%%%%%%%%%%%%}] +[def Tcl_Obj*] +[def object] + +The function takes an argument of type [type Tcl_Obj*]. +No argument checking is done. +The Tcl level word is passed to the argument as-is. + +[comment {% % %% %%% %%%%% %%%%%%%% %%%%%%%%%%%%%}] +[def pstring] + +The function takes an argument of type [type critcl_pstring] +containing the original [type Tcl_Obj*] reference of the Tcl argument, +plus the length of the string and a pointer to the character array. + +[example { +typedef struct critcl_pstring { + Tcl_Obj* o; + char* s; + int len; +} critcl_pstring; +}] + +[comment {% % %% %%% %%%%% %%%%%%%% %%%%%%%%%%%%%}] +[def list] + +The function takes an argument of type [type critcl_list] containing +the original [type Tcl_Obj*] reference of the Tcl argument, plus the +length of the Tcl list and a pointer to the array of the list +elements. + +[example { +typedef struct critcl_list { + Tcl_Obj* o; + Tcl_Obj** v; + int c; +} critcl_list; +}] + +The Tcl argument must be convertible to [type List], an error is +thrown otherwise. + +[comment {% % %% %%% %%%%% %%%%%%%% %%%%%%%%%%%%%}] +[def bytearray] +[def rawchar*] +[def rawchar] + +The function takes an argument of type [type char*]. + +The Tcl argument must be convertible to [type ByteArray], an error is +thrown otherwise. + +[emph Note] that the length of the [type ByteArray] is [emph not] +passed to the function, making this type not very usable. + +[comment {% % %% %%% %%%%% %%%%%%%% %%%%%%%%%%%%%}] +[def bytes] + +This is the [emph new] and usable [type ByteArray] type. + +[para] The function takes an argument of type [type critcl_bytes] +containing the original [type Tcl_Obj*] reference of the Tcl argument, +plus the length of the byte array and a pointer to the byte data. + +[example { +typedef struct critcl_bytes { + Tcl_Obj* o; + char* s; + int len; +} critcl_list; +}] + +The Tcl argument must be convertible to [type ByteArray], an error is +thrown otherwise. + +[comment {% % %% %%% %%%%% %%%%%%%% %%%%%%%%%%%%%}] +[def char*] + +The function takes an argument of type [type char*]. +The string representation of the Tcl argument is passed in. + +[comment {% % %% %%% %%%%% %%%%%%%% %%%%%%%%%%%%%}] +[def double] + +The function takes an argument of type [type double]. + +The Tcl argument must be convertible to [type Double], an error is +thrown otherwise. + +[comment {% % %% %%% %%%%% %%%%%%%% %%%%%%%%%%%%%}] +[def float] + +The function takes an argument of type [type float]. + +The Tcl argument must be convertible to [type Double], an error is +thrown otherwise. + +[comment {% % %% %%% %%%%% %%%%%%%% %%%%%%%%%%%%%}] +[def boolean] +[def bool] + +The function takes an argument of type [type int]. + +The Tcl argument must be convertible to [type Boolean], an error is +thrown otherwise. + +[comment {% % %% %%% %%%%% %%%%%%%% %%%%%%%%%%%%%}] +[def int] + +The function takes an argument of type [type int]. + +The Tcl argument must be convertible to [type Int], an error is thrown +otherwise. + +[comment {% % %% %%% %%%%% %%%%%%%% %%%%%%%%%%%%%}] +[def long] + +The function takes an argument of type [type {long int}]. + +The Tcl argument must be convertible to [type Long], an error is +thrown otherwise. + +[comment {% % %% %%% %%%%% %%%%%%%% %%%%%%%%%%%%%}] +[def wideint] + +The function takes an argument of type [type Tcl_WideInt]. + +The Tcl argument must be convertible to [type WideInt], an error is +thrown otherwise. + +[comment {% % %% %%% %%%%% %%%%%%%% %%%%%%%%%%%%%}] +[def void*] + +[comment {% % %% %%% %%%%% %%%%%%%% %%%%%%%%%%%%%}] +[def double*] +[def float*] +[def int*] + +The function takes an argument of the same-named C type. + +The Tcl argument must be convertible to ByteArray, an error is thrown +otherwise. + +The bytes in the ByteArray are then re-interpreted as the raw +representation of a single C pointer of the given type which is then +passed as argument to the function. + +In other words, this is for Tcl values somehow holding raw C pointers, +i.e. memory addresses. + +[para] [emph Attention]: These types are considered [emph DEPRECATED]. +It is planned to remove their documentation in release 3.2, and their +implementation in release 3.3. Their deprecation can be undone if +good use cases are shown. + +[list_end] diff -Nru critcl-3.1.9/doc/include/api_stdrt_cproc.inc critcl-3.1.17+dfsg/doc/include/api_stdrt_cproc.inc --- critcl-3.1.9/doc/include/api_stdrt_cproc.inc 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/doc/include/api_stdrt_cproc.inc 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,159 @@ + +[list_begin definitions] +[comment {% % %% %%% %%%%% %%%%%%%% %%%%%%%%%%%%%}] +[def Tcl_Obj*] +[def object] + +The function returns a value of type [type Tcl_Obj*]. + +This value becomes the interpreter result, if not [const 0]. The Tcl +status is [const TCL_ERROR] when a [const 0] is returned, and +[const TCL_OK] otherwise. + +[para][emph Note] how it is the responsibility of the function to set +the interpreter result to an appropriate error message when returning +[const 0]. + +[para][emph Attention]: The conversion assumes that the value belonged +to the function, with an associated reference count, and decrements +the reference count to indicate the loss of ownership by the +function. This means that it is an error to return a value whose +reference count is zero. The system will crash at some point after the +return due to reuse of the freed memory. + +[comment {% % %% %%% %%%%% %%%%%%%% %%%%%%%%%%%%%}] +[def Tcl_Obj*0] +[def object0] + +The function returns a value of type [type Tcl_Obj*]. + +This value becomes the interpreter result, if not [const 0]. The Tcl +status is [const TCL_ERROR] when a [const 0] is returned, and +[const TCL_OK] otherwise. + +[para][emph Note] how it is the responsibility of the function to set +the interpreter result to an appropriate error message when returning +[const 0]. + +[para][emph Attention]: Contrary to [const Tcl_Obj*] above this +conversion assumes that the returned value has a reference count of +[const 0] and performs [emph no] decrement. Returning a value whose +reference count is greater than zero will likely cause a memory leak. + +[comment {% % %% %%% %%%%% %%%%%%%% %%%%%%%%%%%%%}] +[def char*] +[def vstring] + +The function returns a value of type [type char*]. + +This value becomes the interpreter result, wrapped in a [type String]. + +It is assumed that the string is volatile in some way, with the +wrapping in a [type String] duplicating it before making it the +result, ensuring that we will not access a dangling pointer in the +future. + +The Tcl status is [emph always] [const TCL_OK]. + +[comment {% % %% %%% %%%%% %%%%%%%% %%%%%%%%%%%%%}] +[def {const char*}] + +Like type [const char*] above, except that the returned string is +[const const]-qualified. + +[comment {% % %% %%% %%%%% %%%%%%%% %%%%%%%%%%%%%}] +[def string] +[def dstring] + +The function returns a value of type [type char*]. + +Contrary to the previous string types here it is assumed that the +value is dynamically allocated, via [fun Tcl_Alloc]. + +This value becomes the interpreter result, as usual, but is [emph not] +copied. + +The Tcl status is [emph always] [const TCL_OK]. + +[comment {% % %% %%% %%%%% %%%%%%%% %%%%%%%%%%%%%}] +[def double] + +The function returns a value of type [type double]. + +This value becomes the interpreter result, properly wrapped as a +[type Double]. + +The Tcl status is [emph always] [const TCL_OK]. + +[comment {% % %% %%% %%%%% %%%%%%%% %%%%%%%%%%%%%}] +[def float] + +The function returns a value of type [type float]. + +This value becomes the interpreter result, properly wrapped as a +[type Double]. + +The Tcl status is [emph always] [const TCL_OK]. + +[comment {% % %% %%% %%%%% %%%%%%%% %%%%%%%%%%%%%}] +[def boolean] +[def bool] + +The function returns a value of type [type int], interpreted as boolean. + +This value becomes the interpreter result, properly wrapped as a +[type Int]. + +The Tcl status is [emph always] [const TCL_OK]. + +[comment {% % %% %%% %%%%% %%%%%%%% %%%%%%%%%%%%%}] +[def int] + +The function returns a value of type [type int]. + +This value becomes the interpreter result, properly wrapped as a +[type Int]. + +The Tcl status is [emph always] [const TCL_OK]. + +[comment {% % %% %%% %%%%% %%%%%%%% %%%%%%%%%%%%%}] +[def long] + +The function returns a value of type [type {long int}]. + +This value becomes the interpreter result, properly wrapped as a +[type Long]. + +The Tcl status is [emph always] [const TCL_OK]. + +[comment {% % %% %%% %%%%% %%%%%%%% %%%%%%%%%%%%%}] +[def wideint] + +The function returns a value of type [type Tcl_WideInt]. + +This value becomes the interpreter result, properly wrapped as a +[type WideInt]. + +The Tcl status is [emph always] [const TCL_OK]. + +[comment {% % %% %%% %%%%% %%%%%%%% %%%%%%%%%%%%%}] +[def ok] + +The function returns a value of type [type int]. + +It is interpreted as the Tcl status code. + +The interpreter result is left untouched (empty). For a different +outcome the function has to set the interpreter result by itself. + +[comment {% % %% %%% %%%%% %%%%%%%% %%%%%%%%%%%%%}] +[def void] + +The function does not return a value. + +The interpreter result is left untouched (empty). For a different +outcome the function has to set the interpreter result by itself. + +The Tcl status is [emph always] [const TCL_OK]. + +[list_end] diff -Nru critcl-3.1.9/doc/include/api_tools.inc critcl-3.1.17+dfsg/doc/include/api_tools.inc --- critcl-3.1.9/doc/include/api_tools.inc 2013-05-10 05:57:04.000000000 +0000 +++ critcl-3.1.17+dfsg/doc/include/api_tools.inc 2017-10-14 02:48:11.000000000 +0000 @@ -71,8 +71,12 @@ the [file .critcl] [arg file] to run successfully. [def [const log]] -The build log in case of failure, and [cmd ::critcl::buildforpackage] -having signaled the build of a package. Otherwise the empty string. +The full build log generated by the compiler/linker, including command +line data from critcl, and other things. + +[def [const exl]] +The raw build log generated by the compiler/linker. This key contains +only the output generated by the invoked applications. [list_end] [comment ---------------------------------------------------------------------] diff -Nru critcl-3.1.9/doc/include/b_test.inc critcl-3.1.17+dfsg/doc/include/b_test.inc --- critcl-3.1.9/doc/include/b_test.inc 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/doc/include/b_test.inc 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,68 @@ +[subsection {First Use, Testing the Installation}] + +With critcl installed it is now the time to try at least one of the +examples distributed with it. This will also test if the installation +was successful. + +[para] Below I show the steps to generate and then use the low- and +high-level stack example packages. I am intentionally bypassing the +[file build.tcl] file the example is coming with, to show the use of +[cmd critcl] itself. + +[para] Some more explanations before running the example: + +[list_begin itemized] + +[item] Here [file path/to/critcl] is the path to the installed + critcl application, not the critcl source directory. + +[para] Also, on Windows(tm) this part of the example must be + replaced with + + [example { /path/to/tclsh /path/to/critcl }] + + as the installed application has no extension and + thus Windows will not know how to execute the script. + +[para] Only if the installed application was manually renamed to + [file critcl.tcl] and the machine has an association for + [file .tcl] to either [syscmd tclsh] or [syscmd wish] then + the [file /path/to/tclsh] can be left out. + +[item] The example shows only the commands entered on the shell (and + tclsh) command line. Their responses are left out. + +[para] If any command throws an error, i.e. has a problem, then all + following commands will run into some other error as well, + as a consequence of the first problem. + +[item] Use of option [option -keep] causes critcl to leave the + generated .c files behind, for edification. Normally this + happens only in case of trouble. + +[item] Use of option [option -cache] redirects the location of the + directory to hold generated and build files to a local + directory with a known name, for an easy look after. + +[item] Both [package cstack] and [package stackc] have to use the + [emph same] [option -cache] so that [package stackc] will + find the stub table headers exported by [package cstack]. +[list_end] + +[para][example { + + > cd examples/stack + > /path/to/critcl -keep -cache B -pkg cstack.tcl + > /path/to/critcl -keep -cache B -pkg stackc.tcl + + > tclsh + % lappend auto_path [pwd]/lib + % package require stackc + % join [info loaded] \n + % stackc S + % S push FOO + % S size + % S destroy + % exit + > +}] diff -Nru critcl-3.1.9/doc/include/b_unix.inc critcl-3.1.17+dfsg/doc/include/b_unix.inc --- critcl-3.1.9/doc/include/b_unix.inc 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/doc/include/b_unix.inc 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,54 @@ +[subsection {Build & Installation (Unix)}] + +This section describes the actions required to install CriTcl on Unix +systems (Linux, BSD, and related, including OS X). + +If you have to install CriTcl on a Windows machine see section +[sectref {Build & Installation (Windows)}] instead. + +To install Critcl simply run + +[example { + /path/to/tclsh /path/to/critcl/build.tcl install +}] + +where [file /path/to/tclsh] is the tclsh of your Tcl installation, and +[file /path/to/critcl] the location of the Critcl sources on your system. + +[para] + +This builds all packages and then places them in a directory where the +[cmd tclsh] will find them. + +[para] + +It further creates a [file critcl] application script and places it +into the directory [cmd tclsh] resides in, making it a sibling of that +executable. + +Note that the installed critcl application is modified to use the +chosen tclsh instead of searching for one on the [var PATH]. + +[para] + +On Windows you can invoke the file [file build.tcl] with a +double-click. This will pop up a small graphical interface for +entering the destination and performing the installation. This +handling of a double-click is restricted to Windows only however. + +[para] + +The build system provides a small GUI for those not comfortable with +the command line. + +This GUI is accessible by invoking [file build.tcl] without any +arguments. + +[para] + +To get help about the methods of [file build.tcl], and their complete +syntax, invoke [file build.tcl] with argument [method help], i.e., like + +[example { + /path/to/tclsh /path/to/critcl/build.tcl help +}] diff -Nru critcl-3.1.9/doc/include/b_windows.inc critcl-3.1.17+dfsg/doc/include/b_windows.inc --- critcl-3.1.9/doc/include/b_windows.inc 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/doc/include/b_windows.inc 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,61 @@ +[subsection {Build & Installation (Windows)}] + +This section describes the actions required to install CriTcl on +Windows(tm) systems. + +If you have to install CriTcl on a Unix machine (Linux, BSD, and +related, including OS X) see section +[sectref {Build & Installation (Unix)}] instead. + +To install Critcl simply run + +[example { + /path/to/tclsh /path/to/critcl/build.tcl install +}] + +where [file /path/to/tclsh] is the tclsh of your Tcl installation, and +[file /path/to/critcl] the location of the Critcl sources on your system. + +[para] + +This builds all packages and then places them in a directory where the +[cmd tclsh] will find them. + +[para] + +It further creates a [file critcl] application script and places it +into the directory [cmd tclsh] resides in, making it a sibling of that +executable. + +[para][emph Attention!] Note that while the installed critcl +application is modified to use the chosen tclsh instead of searching +for one on the [var PATH] this is useless for Windows, which +associates executables with files through their extension. + +[para][emph Attention!] The current installer does not put an +extension on the [syscmd critcl] application, forcing users to either +explicitly choose the [syscmd tclsh] to run the application, or +manually rename the installed file to [file critcl.tcl], if an +association for [file .tcl] is available, to either [syscmd tclsh], or +[syscmd wish]. + +[para] + +On Windows you can invoke the file [file build.tcl] with a +double-click. This will pop up a small graphical interface for +entering the destination and performing the installation. This +handling of a double-click is restricted to Windows only however. + +[para] + +This GUI is also accessible by invoking [file build.tcl] without any +arguments. + +[para] + +To get help about the methods of [file build.tcl], and their complete +syntax, invoke [file build.tcl] with argument [method help], i.e., like + +[example { + /path/to/tclsh /path/to/critcl/build.tcl help +}] diff -Nru critcl-3.1.9/doc/include/changes3110.inc critcl-3.1.17+dfsg/doc/include/changes3110.inc --- critcl-3.1.9/doc/include/changes3110.inc 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/doc/include/changes3110.inc 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,20 @@ +[section {Changes for version 3.1.10}] +[list_begin enumerated] + +[enum] Fixed code version numbering forgotten with 3.1.9. + +[enum] Fixed issue #35. In package mode (-pkg) the object cache + directory is unique to the process, thus we do not need + content-hashing to generate unique file names. A simple + counter is sufficient and much faster. +[para] + Note that mode "compile & run" is not as blessed and still + uses content-hasing with md5 to ensure unique file names + in its per-user object cache. + +[enum] Fixed issue where the [cmd ccommand] forgot to use its body as + input for the UUID generation. Thus ignoring changes to it in + mode compile & run, and not rebuilding a library for changed + sources. Bug and fix reported by Peter Spjuth. + +[list_end] diff -Nru critcl-3.1.9/doc/include/changes3111.inc critcl-3.1.17+dfsg/doc/include/changes3111.inc --- critcl-3.1.9/doc/include/changes3111.inc 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/doc/include/changes3111.inc 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,27 @@ +[section {Changes for version 3.1.11}] +[list_begin enumerated] + +[enum] Fixed issue #37, via pull request #38, with thanks to + Jos DeCoster. Information was stored into the v::delproc + and v::clientdata arrays using a different key than when + retrieving the same information, thus failing the latter. + +[enum] New convenience command [cmd critcl::include] for easy + inclusion of headers and other C files. + +[enum] New command [cmd critcl::make] to generate a local header of + other C files for use by other parts of a package through + inclusion. + +[enum] New utility package [package critcl::literals] for quick and + easy setup of and access to pools of fixed Tcl_Obj* strings. + + Built on top of [package critcl::iassoc]. + +[enum] New utility package [package critcl::bitmap] for quick and easy + setup and use of mappings between C bitsets and Tcl lists whose + string elements represent that set. + + Built on top of [package critcl::iassoc]. + +[list_end] diff -Nru critcl-3.1.9/doc/include/changes3112.inc critcl-3.1.17+dfsg/doc/include/changes3112.inc --- critcl-3.1.9/doc/include/changes3112.inc 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/doc/include/changes3112.inc 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,36 @@ +[section {Changes for version 3.1.12}] +[list_begin enumerated] + +[enum] Fixed issue 42. Clear ::errorInfo immediately after startup to + prevent leakage of irrelevant (caught) errors into our script + and confusing the usage code. + +[enum] Fixed issue 40. Keep the order of libraries, and allow + duplicates. Both are things which are occasionally required for + proper linking. + +[enum] Extended the utility package [package critcl::literals] to + declare a cproc result-type for a pool. + +[para] Further fixed the generated header to handle multiple inclusion. + +[para] Bumped version to 1.1. + +[enum] Fixed issue with utility package [package critcl::bitmap]. + +[para] Fixed the generated header to handle multiple inclusion. + +[para] Bumped version to 1.0.1. + +[enum] Created new utility package [package critcl::enum] for the + quick and easy setup and use of mappings between C values + and Tcl strings. + + Built on top of [package critcl::literals]. + +[enum] Added examples demonstrating the use of the utility packages + [package critcl::literals], + [package critcl::bitmap], and + [package critcl::enum] + +[list_end] diff -Nru critcl-3.1.9/doc/include/changes3113.inc critcl-3.1.17+dfsg/doc/include/changes3113.inc --- critcl-3.1.9/doc/include/changes3113.inc 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/doc/include/changes3113.inc 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,69 @@ +[section {Changes for version 3.1.13}] +[list_begin enumerated] + +[enum] Merged PR #43. Fixed bug loading adjunct Tcl sources. + +[enum] Fixes in documentation and generated code of package + "critcl::enum". Bumped to version 1.0.1. + +[enum] Fixes in documentation of package "critcl::bitmap". + +[enum] New package "critcl::emap". In essence a variant or cross of + "critcl::bitmap" with behaviour like "critcl::enum". + +[enum] Merged PR #49. Fixed documentation typo. + +[enum] Merged PR #46. Fixed documentation typo. + +[enum] Merged PR #47. Fixes to test results to match the accumulated + code changes. Also made portable across Tcl versions (varying + error syntax). + +[enum] New predefined argument- and result-type "wideint" mapping to + Tcl_WideInt. + +[enum] New predefined argument-type "bytes" mapping to tuple of + byte-array data and length. Note: The existing "bytearray" + type (and its aliases) was left untouched, to keep backward + compatibility. + +[enum] Modified the internal interface between the Tcl shim and C + function underneath "critcl::cproc" with respect to the + handling of optional arguments. + + An optional argument "X" now induces the use of two C + arguments, "X" and "has_X". The new argument "has_X" is of + boolean (int) type. It is set to true when X is set, and set + to false when X has the default value. C code which cares + about knowing if the argument is default or not is now able to + check that quickly, without having to code the default value + inside. + + NOTE: This change is visible in the output of the advanced + commands "argcnames", "argcsignature", "argvardecls", + and "argconversion". + +[enum] Fixed issue #50 and documented the availability of variable + "interp" (type Tcl_Interp*) within "critcl::cinit" C code + fragments. + + Note that while the old, undocumented name of the variable, + "ip", is still usable, it is deprecated. It will be fully + removed in two releases, i.e. for release 3.1.15. + + The variable name was changed to be consistent with other code + environments. + +[enum] Fixed issue #51. Disabled the generation of #line directives + for "critcl::config lines 0" coming from template files, or + code generated with them before the final value of this + setting was known. + +[enum] Fixed issue with handling of namespaced package names in + "critcl::iassoc". Equivalent to a bug in "critcl::class" fixed + for critcl 3.1.1, critcl::class 1.0.1. + + Note: "literals", "enum", "emap", and "bitmap" do not require + a fix as they are all built on top of "iassoc". + +[list_end] diff -Nru critcl-3.1.9/doc/include/changes3114.inc critcl-3.1.17+dfsg/doc/include/changes3114.inc --- critcl-3.1.9/doc/include/changes3114.inc 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/doc/include/changes3114.inc 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,38 @@ +[section {Changes for version 3.1.14}] +[list_begin enumerated] + +[enum] Fixed issue #36. Added message to target [const all] of the + Makefile generated for TEA mode. Additionally tweaked other + parts of the output to be less noisy. + +[enum] Accepted request implied in issue #54. Unconditionally save + the compiler/linker build log into key [const log] of the + dictionary returned by [cmd cresults], and save a copy of only + the execution output in the new key [const exl] ("execution + log"). + +[enum] Fixed issue #53. Clarified the documentation of commands + [cmd critcl::load] and [cmd critcl::failed] with regard + to their results and the throwing of errors (does not happen). + +[enum] Fixed issue #48. Modified mode "compile & run" to allow new + declarations in a file, after it was build, instead of + erroring out. The new decls are build when needed. Mode + "precompile" is unchanged and will continue to trap the + situation. + +[enum] Fixed issue #52. Updated the local Tcl/Tk headers to + 8.4.20, 8.5.13, and 8.6.4. + +[enum] Fixed issue #45. New feature command [cmd critcl::cconst]. + +[enum] [package critcl::util]: New command [cmd locate] to find a + file across a set of paths, and report an error when not + found. This is for use in autoconf-like header-searches and + similar configuration tests. + +[enum] Modified 'AbortWhenCalledAfterBuild' to dump the entire stack + (info frame!). This should make it easier to determine the + location of the troubling declaration. + +[list_end] diff -Nru critcl-3.1.9/doc/include/changes3115.inc critcl-3.1.17+dfsg/doc/include/changes3115.inc --- critcl-3.1.9/doc/include/changes3115.inc 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/doc/include/changes3115.inc 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,6 @@ +[section {Changes for version 3.1.15}] +[list_begin enumerated] + +[enum] Fixed version number bogosity with [const 3.1.14]. + +[list_end] diff -Nru critcl-3.1.9/doc/include/changes3116.inc critcl-3.1.17+dfsg/doc/include/changes3116.inc --- critcl-3.1.9/doc/include/changes3116.inc 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/doc/include/changes3116.inc 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,59 @@ +[section {Changes for version 3.1.16}] +[list_begin enumerated] + +[enum] New feature. Extended [cmd critcl::cproc]'s argument handling + to allow arbitrary mixing of required and optional arguments. + +[enum] New feature. + [emph {Potential Incompatibility}]. +[para] Extended [cmd critcl::cproc]'s argument handling to treat an + argument [const args] as variadic if it is the last argument of + the procedure. + +[enum] New feature. Added two introspection commands, + [cmd critcl::has-argtype] and [cmd critcl::has-resulttype]. + These enable a user to test if a specific (named) type + conversion is implemented or not. + +[enum] Added new result type [const Tcl_Obj*0], with alias + [const object0]. The difference to [const Tcl_Obj*] is in + the reference counting. + +[enum] Extended the command [cmd critcl::argtypesupport] with new + optional argument through which to explicitly specify the + identifier for guarding against multiple definitions. + +[enum] Bugfix: Fixed problem with the implementation of issue #54 (See + 3.1.14). Always create the secondary log file. Otherwise + end-of-log handling may break, unconditionally assuming its + existence. + +[enum] Bugfix: Fixed problem with the internal change to the hook + [const HandleDeclAfterBuild]. Corrected the forgotten + [cmd critcl::cconst]. + +[enum] Debugging aid: Added comment holding the name of the result + type when emitting result conversions. + +[enum] Bugfix: Fixed issue #60. Unbundled the package directories + containing multiple packages. All directories under [file lib/] + now contain exactly one package. + +[enum] Bugfix: Fixed issue #62, a few [cmd {dict exists}] commands + operating on a fixed string instead of a variable. + +[enum] Bugfix: Fixed issue #56. Release builders are reminded to run + the tests. + +[enum] Bugfix: Fixed issue #55. For FreeBSD critcl's platform package + now identifies the Kernel ABI version. Initialization of the + cache directory now also uses [cmd platform::identify] for the + default path, instead of [cmd platform::generic]. + +[enum] Bugfix: Fixed issue #58. Simplified the setup and use of + md5. Critcl now makes use of its own package for md5, using + itself to built it. There is no chicken/egg problem with this + as the [option -pkg] mode used for this does not use md5. That + is limited to mode [term {compile & run}]. + +[list_end] diff -Nru critcl-3.1.9/doc/include/changes3117.inc critcl-3.1.17+dfsg/doc/include/changes3117.inc --- critcl-3.1.9/doc/include/changes3117.inc 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/doc/include/changes3117.inc 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,65 @@ +[section {Changes for version 3.1.17}] +[list_begin enumerated] + +[enum] Extension: Allow duplicate arg- and result-type definitions if + they are fully identical. + +[enum] Bugfix. The application mishandled the possibility of + identical-named [cmd critcl::tsource]s. Possible because + [cmd critcl::tsource]s can be in subdirectories, a structure + which is [emph not] retained in the assembled package, causing + such files to overwrite each other and at least one lost. Fixed + by adding a serial number to the file names in the assembled + package. + +[enum] Bugfix in the static scanner which made it loose requirement + information. Further added code to generally cleanup results at + the end (removal of duplicates, mainly). + +[enum] Bugfix: Fixed issue #76. + Support installation directories which are not in the [var auto_path]. + Without the patch the installed [cmd critcl] will not find its + own packages and fail. Thank you to + [uri https://github.com/lupylucke {Simon Bachmann}] for the + report and patch, and then his patience with me to getting to + actually apply it. + +[enum] Bugfix: Fixed issue #75. + Extended [cmd critcl::include] to now take multiple paths. + +[enum] Added new compatibility package [package lmap84]. + +[enum] Fixed typos in various documentation files. + +[enum] Fixed bug introduced by commit 86f415dd30 (3.1.16 release). The + separation of [cmd critcl::ccode] into user and work layers + means that location retrieval has to go one more level up to + find the user location. + +[enum] New supporting package [package critcl::cutil]. Provides common + C level facilities useful to packages (assertions, tracing, + memory allocation shorthands). + +[enum] Modified package [package critcl] to make use of the new + tracing facilities to provide tracing of arguments and results + for [cmd critcl::ccommand] and [cmd critcl::cproc] invokations. + +[enum] Modified packages [package critcl] and [package critcl::class] + to provide better function names for (class) method tracing. + Bumped package [package critcl::class] to version 1.0.7. + +[enum] Extended the support package [package critcl::literals] with + limited configurability. It is now able to generate code for + C-level access to the pool without Tcl types (Mode [const c]). + The previously existing functionality is accesssible under mode + [const tcl], which also is the default. Both modes can be used + together. + +[enum] Extended the support package [package critcl::emap] with + limited configurability. It is now able to generate code for + C-level access to the mapping without Tcl types + (Mode [const c]). The previously existing functionality is + accessible under mode [const tcl], which also is the + default. Both modes can be used together. + +[list_end] diff -Nru critcl-3.1.9/doc/include/changes319.inc critcl-3.1.17+dfsg/doc/include/changes319.inc --- critcl-3.1.9/doc/include/changes319.inc 2013-05-10 05:57:04.000000000 +0000 +++ critcl-3.1.17+dfsg/doc/include/changes319.inc 2017-10-14 02:48:11.000000000 +0000 @@ -26,6 +26,6 @@ [enum] Fixed issue #32. Merged pull request by Andrew Shadura. Various typos in documentation and comments. -[enum] Fixed issue #33. Handle files starting with a dot better. +[enum] Fixed issue #34. Handle files starting with a dot better. [list_end] diff -Nru critcl-3.1.9/doc/include/changes31.inc critcl-3.1.17+dfsg/doc/include/changes31.inc --- critcl-3.1.9/doc/include/changes31.inc 2013-05-10 05:57:04.000000000 +0000 +++ critcl-3.1.17+dfsg/doc/include/changes31.inc 2017-10-14 02:48:11.000000000 +0000 @@ -1,3 +1,21 @@ +[include changes3117.inc] +[include changes3116.inc] +[include changes3115.inc] +[include changes3114.inc] +[include changes3113.inc] +[include changes3112.inc] +[include changes3111.inc] +[include changes3110.inc] +[include changes319.inc] +[include changes318.inc] +[include changes317.inc] +[include changes316.inc] +[include changes315.inc] +[include changes314.inc] +[include changes313.inc] +[include changes312.inc] +[include changes311.inc] + [section {Changes for version 3.1}] [list_begin enumerated] @@ -85,13 +103,3 @@ [comment {- - -- --- ----- -------- ------------- ---------------------}] [list_end] - -[include changes311.inc] -[include changes312.inc] -[include changes313.inc] -[include changes314.inc] -[include changes315.inc] -[include changes316.inc] -[include changes317.inc] -[include changes318.inc] -[include changes319.inc] diff -Nru critcl-3.1.9/doc/include/changes3.inc critcl-3.1.17+dfsg/doc/include/changes3.inc --- critcl-3.1.9/doc/include/changes3.inc 2013-05-10 05:57:04.000000000 +0000 +++ critcl-3.1.17+dfsg/doc/include/changes3.inc 2017-10-14 02:48:11.000000000 +0000 @@ -1,3 +1,11 @@ +[include changes307.inc] +[include changes306.inc] +[include changes305.inc] +[include changes304.inc] +[include changes303.inc] +[include changes302.inc] +[include changes301.inc] + [section {Changes for version 3}] [list_begin enumerated] @@ -81,11 +89,3 @@ [package critcl] package documentation for details. [list_end] - -[include changes301.inc] -[include changes302.inc] -[include changes303.inc] -[include changes304.inc] -[include changes305.inc] -[include changes306.inc] -[include changes307.inc] diff -Nru critcl-3.1.9/doc/include/changes.inc critcl-3.1.17+dfsg/doc/include/changes.inc --- critcl-3.1.9/doc/include/changes.inc 2013-05-10 05:57:04.000000000 +0000 +++ critcl-3.1.17+dfsg/doc/include/changes.inc 2017-10-14 02:48:11.000000000 +0000 @@ -1,3 +1,5 @@ -[include changes21.inc] -[include changes3.inc] +[para] The latest changes are found at the top. + [include changes31.inc] +[include changes3.inc] +[include changes21.inc] diff -Nru critcl-3.1.9/doc/include/class_spec_general.inc critcl-3.1.17+dfsg/doc/include/class_spec_general.inc --- critcl-3.1.9/doc/include/class_spec_general.inc 2013-05-10 05:57:04.000000000 +0000 +++ critcl-3.1.17+dfsg/doc/include/class_spec_general.inc 2017-10-14 02:48:11.000000000 +0000 @@ -25,7 +25,7 @@ [para] The command can be used multiple times, each adding another segment of C code to insert. It is of course possible to not use this -command at all, for classes not requiring swupporting code. +command at all, for classes not requiring supporting code. [para] The result of the command is the empty string. diff -Nru critcl-3.1.9/doc/include/module2.inc critcl-3.1.17+dfsg/doc/include/module2.inc --- critcl-3.1.9/doc/include/module2.inc 2013-05-10 05:57:04.000000000 +0000 +++ critcl-3.1.17+dfsg/doc/include/module2.inc 2017-10-14 02:48:11.000000000 +0000 @@ -1,5 +1,5 @@ [comment {--- Standard header for all manpages in this module --}] -[copyright {2011-2012 Andreas Kupries}] +[copyright {2011-2015 Andreas Kupries}] [moddesc {C Runtime In Tcl (CriTcl)}] [category {Glueing/Embedded C code}] [keywords {C code} {Embedded C Code}] diff -Nru critcl-3.1.9/doc/include/module.inc critcl-3.1.17+dfsg/doc/include/module.inc --- critcl-3.1.9/doc/include/module.inc 2013-05-10 05:57:04.000000000 +0000 +++ critcl-3.1.17+dfsg/doc/include/module.inc 2017-10-14 02:48:11.000000000 +0000 @@ -1,7 +1,7 @@ [comment {--- Standard header for all manpages in this module --}] [copyright {Jean-Claude Wippler}] [copyright {Steve Landers}] -[copyright {2011-2013 Andreas Kupries}] +[copyright {2011-2015 Andreas Kupries}] [moddesc {C Runtime In Tcl (CriTcl)}] [category {Glueing/Embedded C code}] [keywords {C code} {Embedded C Code}] diff -Nru critcl-3.1.9/doc/include/rq_cc.inc critcl-3.1.17+dfsg/doc/include/rq_cc.inc --- critcl-3.1.9/doc/include/rq_cc.inc 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/doc/include/rq_cc.inc 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,33 @@ + +[subsection {C compiler}] + +To actually build packages based on critcl we need a working C +compiler. + +[para] How to install such and all the associated header files, +libraries, etc. is heavily platform- and system-dependent, and thus +outside of the scope of this document. + +Note that I am willing to extend this section with links of interest +to tutorials, howtos and references for the various platforms. + +[para] The important pieces of information are this: + +[list_begin enumerated] + +[enum] The path to the C compiler binary must be found in the + environment variable [var PATH], for critcl to find it. + +[enum] On Windows(tm) the environment variable [var LIB] must be + present and contain the paths of the directories holding + Microsoft's libraries. The standard critcl configuration + for this platform searches these paths to fine-tune its + settings based on available libraries and compiler version. + +[list_end] + +[para] Links of interest: + +[list_begin definitions] +[def [uri http://www.tldp.org/HOWTO/HOWTO-INDEX/programming.html]] +[list_end] diff -Nru critcl-3.1.9/doc/include/rq_tcllib.inc critcl-3.1.17+dfsg/doc/include/rq_tcllib.inc --- critcl-3.1.9/doc/include/rq_tcllib.inc 2013-05-10 05:57:04.000000000 +0000 +++ critcl-3.1.17+dfsg/doc/include/rq_tcllib.inc 2017-10-14 02:48:11.000000000 +0000 @@ -39,13 +39,13 @@ to make this happen. [para] Now, for those wishing to install the packages from source, -the CVS repository for the two bundles can be found at -[uri https://sourceforge.net/projects/tcllib]. +the fossil repository for the two bundles can be found at +[uri https://core.tcl.tk/tcllib] and [uri https://core.tcl.tk/tklib]. -[para] Releases of Tcllib can be found in the associated Files -section, or CVS can be used to check out the sub-project tcllib. +[para] Releases of Tcllib and Tklib can be found there as well, or +[syscmd fossil] can be used to check out specific revisions. -[para] Tcllib comes with its own installation instructions. These will -not be repeated here. If there are problems with its directions please -file a bug against the Tcllib project at the above url, and not -Critcl. +[para] Tcl- and Tklib come with their own installation instructions. +These will not be repeated here. If there are problems with their +directions please file a bug against the Tcllib project at the above +url, and not CriTcl. diff -Nru critcl-3.1.9/doc/include/using_ecommand.inc critcl-3.1.17+dfsg/doc/include/using_ecommand.inc --- critcl-3.1.9/doc/include/using_ecommand.inc 2013-05-10 05:57:04.000000000 +0000 +++ critcl-3.1.17+dfsg/doc/include/using_ecommand.inc 2017-10-14 02:48:11.000000000 +0000 @@ -4,54 +4,55 @@ translation to C can be. Is it still as easy when we introduce something moderately complex like handling a variable number of arguments ? A feature which is needed to handle commands with options -and optional arguments ? Unfortunately not. +and optional arguments ? -We can use [cmd critcl::cproc] only if the number of arguments is -known beforehand, i.e. at the time of declaration. This of course also -means that they do not support default arguments either. +[para] Well, starting with version 3.1.16 [cmd critcl::cproc] does +have full support for optional arguments, [arg args]-style variadics, +and default values, extending its range to everything covered by the +builtin [cmd proc]. The only thing not truly supported are options +(i.e. flag arguments) of any kind. + +[para] For the moment, and the example, let us pretend that we can use +[cmd critcl::cproc] only if the number of arguments is fully known +beforehand, i.e. at the time of declaration. -[para] - -Thus, to handle something like the example below +Then we have to use [cmd critcl::ccommand] to handle the translation +of the procedure shown below: [example { proc math {args} { set sum 0 - foreach y { set sum [expr {$sum + $y}] } - return $sum + foreach y $args { set sum [expr {$sum + $y}] } + return $sum } }] -we have to use [cmd critcl::ccommand] instead. - [para] Its advantage: Access to the low-level C arguments representing -the Tcl arguments of the command. - -That allows things like variable number of arguments, optional -arguments, options, etc. +the Tcl arguments of the command. Full control over argument +conversion, argument validation, etc. [para] Its disadvantage: Access to the low-level C arguments -representing the Tcl arguments of the command. - -Where [cmd critcl::cproc] handles the task of converting from Tcl to C +representing the Tcl arguments of the command. Assuming the burden of +having to write argument conversion, argument validation, etc. Where +[cmd critcl::cproc] handles the task of converting from Tcl to C values (for arguments) and back (for the result), with -[cmd critcl::command]s we have to do this on our own. +[cmd critcl::command] it is the developer who has to write all this +code. -[para] Here is the translation of the example: +[para] Under our restriction the translation of the example is: [example { - package require critcl - critcl::ccommand math {cd ip oc ov} { double sum = 0; double y; + oc --; while (oc) { if (Tcl_GetDoubleFromObj (ip, ov[oc], &y) != TCL_OK) { - return TCL_ERROR; + return TCL_ERROR; } sum += y; - oc --; + oc --; } Tcl_SetObjResult (ip, Tcl_NewDoubleObj (sum)); @@ -87,3 +88,21 @@ [enum] objv [list_end] [list_end] + +[para] Now, letting go of our pretenses regarding the limitations of +[cmd critcl::cproc], due to the support it does have for +[arg args]-style variadics (since version 3.1.16) we can write a much +simpler translation: + +[example { + critcl::cproc math {double args} double { + double sum = 0; + + args.c --; + while (args.c) { + sum += args.v[args.c]; + args.c --; + } + return sum; + } +}] diff -Nru critcl-3.1.9/doc/include/using_econst.inc critcl-3.1.17+dfsg/doc/include/using_econst.inc --- critcl-3.1.9/doc/include/using_econst.inc 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/doc/include/using_econst.inc 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,28 @@ +[subsection {Constant values}] + +While one might believe that there is no need for commands which +returns constant values that is not true. Commands reporting on +compile-time configuration, like version numbers, available features, +etc. are at least one use case for such commands. + +[para] The reason for creating critcl commands to support them ? +Convenience to the user, yes, but further than that, the ability to +optimize the internals, i.e. the generated code. + +[para] A [cmd cproc] would be easy to write, but incurs overhead due +to a superfluous work function. A [cmd ccommand] has no overhead, +except that of the user having to write the argument checking and +result conversion. + +[para] Using [cmd critcl::cconst] is both convenient and without code +overhead. + +Our example is a function found in package [package tcl-linenoise], +that is, if [cmd cconst] had existed at the time of writing. It +returns a configuration value reporting to the policy layer if an +extended mode for hidden input is available from the bound +[package linenoise], or not. + +[example { + critcl::cconst linenoise::hidden_extended boolean 1 +}] diff -Nru critcl-3.1.9/doc/include/using_embed.inc critcl-3.1.17+dfsg/doc/include/using_embed.inc --- critcl-3.1.9/doc/include/using_embed.inc 2013-05-10 05:57:04.000000000 +0000 +++ critcl-3.1.17+dfsg/doc/include/using_embed.inc 2017-10-14 02:48:11.000000000 +0000 @@ -27,9 +27,14 @@ meat of things. [include using_eproc.inc] [comment {%% cproc}] +[include using_eproctypes.inc] [comment {%% cproc types, intro & trivial}] +[include using_eproctypes2.inc] [comment {%% cproc types, semi-trivial}] +[include using_eproctypes3.inc] [comment {%% cproc types, support (incl alloc'd)}] +[include using_eproctypes4.inc] [comment {%% cproc types, results}] [include using_ecommand.inc] [comment {%% ccommand}] [include using_edata.inc] [comment {%% cdata}] [include using_ecode.inc] [comment {%% ccode}] +[include using_econst.inc] [comment {%% cconst}] [include using_edefines.inc] [comment {%% cdefines}] [include using_eheaders.inc] [comment {%% cheaders}] [include using_ecsources.inc] [comment {%% csources}] @@ -46,4 +51,5 @@ [comment { No examples for: cinit, compiling, compiled, preload, done + No examples for the supporting generator classes. }] diff -Nru critcl-3.1.9/doc/include/using_eproc.inc critcl-3.1.17+dfsg/doc/include/using_eproc.inc --- critcl-3.1.9/doc/include/using_eproc.inc 2013-05-10 05:57:04.000000000 +0000 +++ critcl-3.1.17+dfsg/doc/include/using_eproc.inc 2017-10-14 02:48:11.000000000 +0000 @@ -13,11 +13,9 @@ slow. Converting this to C we get: [example { - package require critcl - critcl::cproc math {double x double y double z} double { double up = rand () * sin (x); - double down = pow(y, log (z); + double down = pow(y, log (z)); return up/down; } }] diff -Nru critcl-3.1.9/doc/include/using_eproctypes2.inc critcl-3.1.17+dfsg/doc/include/using_eproctypes2.inc --- critcl-3.1.9/doc/include/using_eproctypes2.inc 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/doc/include/using_eproctypes2.inc 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,100 @@ +[subsection {Custom Types, Semi-trivial}] + +A more involved custom argument type would be to map from Tcl strings +to some internal representation, like an integer code. + +[para] The first example is taken from the [package tclyaml] package, +a binding to the [package libyaml] library. In a few places we have to +map readable names for block styles, scalar styles, etc. to the +internal enumeration. + +[example { + critcl::argtype yaml_sequence_style_t { + if (!encode_sequence_style (interp, @@, &@A)) return TCL_ERROR; + } + + ... + + critcl::ccode { + static const char* ty_block_style_names [] = { + "any", "block", "flow", NULL + }; + + static int + encode_sequence_style (Tcl_Interp* interp, Tcl_Obj* style, + yaml_sequence_style_t* estyle) + { + int value; + if (Tcl_GetIndexFromObj (interp, style, ty_block_style_names, + "sequence style", 0, &value) != TCL_OK) { + return 0; + } + *estyle = value; + return 1; + } + } + + ... + + method sequence_start proc { + pstring anchor + pstring tag + int implicit + yaml_sequence_style_t style + } ok { + /* Syntax: seq_start - -

[ - Table Of Contents + Table Of Contents | Keyword Index -]
-

critcl_changes(n) 3.1.8 doc "C Runtime In Tcl (CriTcl)"

+ ]
+

critcl_changes(n) 3.1.17 doc "C Runtime In Tcl (CriTcl)"

Name

critcl_changes - CriTcl Changes

@@ -111,27 +111,35 @@
-

Changes for version 2.1

+

Changes for version 3.1.17

    -
  1. Fixed bug where critcl::tsources interpreted relative -paths as relative to the current working directory instead of -relative to the ".critcl" file using the command, as all other -commands of this type do.

  2. -
  3. Fixed internals, preventing information collected for multiple -".critcl" files to leak between them. Notably, critcl::tk -is not a global configuration option anymore.

  4. -
  5. Fixed the command critcl::license to be a null-operation -in mode "compile & run", instead of throwing an error.

  6. -
  7. Fixed the critcl application's interference with the "compile & -run" result cache in -pkg mode by having it use a wholly -separate (and by default transient) directory for that mode.

  8. -
  9. Fixed bug where changes to a ".critcl" file did not result -in a rebuild for mode "compile & run". All relevant API commands now -ensure UUID changes.

  10. -
  11. Fixed bug in the backend handling of critcl::debug where -the companion c-sources of a ".critcl" file were not compiled -with debug options, although the ".critcl" file was.

  12. -
  13. Fixed bug in critcl::debug which prevented recognition of -mode "all" when it was not the first argument to the command.

  14. -
  15. Fixed bug in "preload.c" preventing its compilation on -non-windows platforms.

  16. -
  17. Fixed long-standing bug in the handling of namespace qualifiers -in the command name argument of critcl::cproc and -critcl::ccommand. It is now possible to specify a fully -qualified command name without issues.

  18. -
  19. Extended/reworked critcl::tsources to be the canonical -way of declaring ".tcl" companion files even for mode "compile & -run".

  20. -
  21. Extended/reworked critcl::tsources to allow the use of a -".critcl" file as its own Tcl companion file.

  22. -
  23. Extended critcl::framework to internally check for OS X -build target, and to ignore the declaration if its not.

  24. -
  25. Extended critcl::failed to be callable more than once in -a ".critcl" file. The first call forces the build, if it was not -done already, to get the result. Further calls return the cached -result of the first call.

  26. -
  27. Extended the handling of environment variable CC in the code -determining the compiler to use to deal with (i.e. remove) paths to -the compiler, compiler file extensions, and compiler options specified -after the compiler itself, leaving only the bare name of the compiler.

  28. -
  29. Extended the code handling the search for preloaded libraries -to print the paths it searched, making debugging of a search failure -easier.

  30. -
  31. A new command critcl::tcl can be used to declare the -version of Tcl minimally needed to build and run the ".critcl" -file and package. Defaults to 8.4 if not declared. Extended critcl to -have the stubs and headers for all of Tcl 8.4, 8.5, and 8.6.

  32. -
  33. A new command critcl::load forces the build and load of a -".critcl" file. This is the official way for overriding critcl's -default lazy-build-&-load-on-demand scheme for mode "compile & run".

    -

    Note that after using critcl::load / -critcl::failed in a ".critcl" file it is not possible to -use critcl commands in that file anymore. Doing so will throw an -error.

  34. -
  35. Extended the generation of '#line' pragmas to use -info frame (if available) to provide the C compiler with exact -line numbers into the ".critcl" file for the reporting of -warnings and errors.

  36. -
  37. Extended critcl::check with logging to help with -debugging build-time checks of the environment, plus an additional -optional argument to provide labeling.

  38. -
  39. Added a new command critcl::checklink which not only -tries to check the environment via compiling the code, but also -its linkability.

  40. -
  41. Added a new command critcl::msg for messaging, like -command critcl::error is for error reporting. Likewise this is a -hook a user of the package is allowed to override. The default -implementation, used by mode compile & run does nothing. The -implementation for mode generate package prints the message -to stdout.

    -

    Envisioned use is for the reporting of results determined by -critcl::check and critcl::checklink during building, to -help with debugging when something goes wrong with a check.

  42. -
  43. Exposed the argument processing internals of critcl::proc -for use by advanced users. The new commands are

    -
      -
    1. critcl::argnames

    2. -
    3. critcl::argcnames

    4. -
    5. critcl::argcsignature

    6. -
    7. critcl::argvardecls

    8. -
    9. critcl::argconversion

    10. +
    11. Extension: Allow duplicate arg- and result-type definitions if + they are fully identical.

    12. +
    13. Bugfix. The application mishandled the possibility of + identical-named critcl::tsources. Possible because + critcl::tsources can be in subdirectories, a structure + which is not retained in the assembled package, causing + such files to overwrite each other and at least one lost. Fixed + by adding a serial number to the file names in the assembled + package.

    14. +
    15. Bugfix in the static scanner which made it loose requirement + information. Further added code to generally cleanup results at + the end (removal of duplicates, mainly).

    16. +
    17. Bugfix: Fixed issue #76. + Support installation directories which are not in the auto_path. + Without the patch the installed critcl will not find its + own packages and fail. Thank you to + Simon Bachmann for the + report and patch, and then his patience with me to getting to + actually apply it.

    18. +
    19. Bugfix: Fixed issue #75. + Extended critcl::include to now take multiple paths.

    20. +
    21. Added new compatibility package lmap84.

    22. +
    23. Fixed typos in various documentation files.

    24. +
    25. Fixed bug introduced by commit 86f415dd30 (3.1.16 release). The + separation of critcl::ccode into user and work layers + means that location retrieval has to go one more level up to + find the user location.

    26. +
    27. New supporting package critcl::cutil. Provides common + C level facilities useful to packages (assertions, tracing, + memory allocation shorthands).

    28. +
    29. Modified package critcl to make use of the new + tracing facilities to provide tracing of arguments and results + for critcl::ccommand and critcl::cproc invokations.

    30. +
    31. Modified packages critcl and critcl::class + to provide better function names for (class) method tracing. + Bumped package critcl::class to version 1.0.7.

    32. +
    33. Extended the support package critcl::literals with + limited configurability. It is now able to generate code for + C-level access to the pool without Tcl types (Mode c). + The previously existing functionality is accesssible under mode + tcl, which also is the default. Both modes can be used + together.

    34. +
    35. Extended the support package critcl::emap with + limited configurability. It is now able to generate code for + C-level access to the mapping without Tcl types + (Mode c). The previously existing functionality is + accessible under mode tcl, which also is the + default. Both modes can be used together.

    36. +
    +
+

Changes for version 3.1.16

+
    +
  1. New feature. Extended critcl::cproc's argument handling + to allow arbitrary mixing of required and optional arguments.

  2. +
  3. New feature. + Potential Incompatibility.

    +

    Extended critcl::cproc's argument handling to treat an + argument args as variadic if it is the last argument of + the procedure.

  4. +
  5. New feature. Added two introspection commands, + critcl::has-argtype and critcl::has-resulttype. + These enable a user to test if a specific (named) type + conversion is implemented or not.

  6. +
  7. Added new result type Tcl_Obj*0, with alias + object0. The difference to Tcl_Obj* is in + the reference counting.

  8. +
  9. Extended the command critcl::argtypesupport with new + optional argument through which to explicitly specify the + identifier for guarding against multiple definitions.

  10. +
  11. Bugfix: Fixed problem with the implementation of issue #54 (See + 3.1.14). Always create the secondary log file. Otherwise + end-of-log handling may break, unconditionally assuming its + existence.

  12. +
  13. Bugfix: Fixed problem with the internal change to the hook + HandleDeclAfterBuild. Corrected the forgotten + critcl::cconst.

  14. +
  15. Debugging aid: Added comment holding the name of the result + type when emitting result conversions.

  16. +
  17. Bugfix: Fixed issue #60. Unbundled the package directories + containing multiple packages. All directories under "lib/" + now contain exactly one package.

  18. +
  19. Bugfix: Fixed issue #62, a few dict exists commands + operating on a fixed string instead of a variable.

  20. +
  21. Bugfix: Fixed issue #56. Release builders are reminded to run + the tests.

  22. +
  23. Bugfix: Fixed issue #55. For FreeBSD critcl's platform package + now identifies the Kernel ABI version. Initialization of the + cache directory now also uses platform::identify for the + default path, instead of platform::generic.

  24. +
  25. Bugfix: Fixed issue #58. Simplified the setup and use of + md5. Critcl now makes use of its own package for md5, using + itself to built it. There is no chicken/egg problem with this + as the -pkg mode used for this does not use md5. That + is limited to mode compile & run.

  26. +
+
+

Changes for version 3.1.15

+
    +
  1. Fixed version number bogosity with 3.1.14.

  2. +
+
+

Changes for version 3.1.14

+
    +
  1. Fixed issue #36. Added message to target all of the + Makefile generated for TEA mode. Additionally tweaked other + parts of the output to be less noisy.

  2. +
  3. Accepted request implied in issue #54. Unconditionally save + the compiler/linker build log into key log of the + dictionary returned by cresults, and save a copy of only + the execution output in the new key exl ("execution + log").

  4. +
  5. Fixed issue #53. Clarified the documentation of commands + critcl::load and critcl::failed with regard + to their results and the throwing of errors (does not happen).

  6. +
  7. Fixed issue #48. Modified mode "compile & run" to allow new + declarations in a file, after it was build, instead of + erroring out. The new decls are build when needed. Mode + "precompile" is unchanged and will continue to trap the + situation.

  8. +
  9. Fixed issue #52. Updated the local Tcl/Tk headers to + 8.4.20, 8.5.13, and 8.6.4.

  10. +
  11. Fixed issue #45. New feature command critcl::cconst.

  12. +
  13. critcl::util: New command locate to find a + file across a set of paths, and report an error when not + found. This is for use in autoconf-like header-searches and + similar configuration tests.

  14. +
  15. Modified 'AbortWhenCalledAfterBuild' to dump the entire stack + (info frame!). This should make it easier to determine the + location of the troubling declaration.

  16. +
+
+

Changes for version 3.1.13

+
    +
  1. Merged PR #43. Fixed bug loading adjunct Tcl sources.

  2. +
  3. Fixes in documentation and generated code of package + "critcl::enum". Bumped to version 1.0.1.

  4. +
  5. Fixes in documentation of package "critcl::bitmap".

  6. +
  7. New package "critcl::emap". In essence a variant or cross of + "critcl::bitmap" with behaviour like "critcl::enum".

  8. +
  9. Merged PR #49. Fixed documentation typo.

  10. +
  11. Merged PR #46. Fixed documentation typo.

  12. +
  13. Merged PR #47. Fixes to test results to match the accumulated + code changes. Also made portable across Tcl versions (varying + error syntax).

  14. +
  15. New predefined argument- and result-type "wideint" mapping to + Tcl_WideInt.

  16. +
  17. New predefined argument-type "bytes" mapping to tuple of + byte-array data and length. Note: The existing "bytearray" + type (and its aliases) was left untouched, to keep backward + compatibility.

  18. +
  19. Modified the internal interface between the Tcl shim and C + function underneath "critcl::cproc" with respect to the + handling of optional arguments. + An optional argument "X" now induces the use of two C + arguments, "X" and "has_X". The new argument "has_X" is of + boolean (int) type. It is set to true when X is set, and set + to false when X has the default value. C code which cares + about knowing if the argument is default or not is now able to + check that quickly, without having to code the default value + inside. + + NOTE: This change is visible in the output of the advanced + commands "argcnames", "argcsignature", "argvardecls", + and "argconversion".

  20. +
  21. Fixed issue #50 and documented the availability of variable + "interp" (type Tcl_Interp*) within "critcl::cinit" C code + fragments. + Note that while the old, undocumented name of the variable, + "ip", is still usable, it is deprecated. It will be fully + removed in two releases, i.e. for release 3.1.15. + The variable name was changed to be consistent with other code + environments.

  22. +
  23. Fixed issue #51. Disabled the generation of #line directives + for "critcl::config lines 0" coming from template files, or + code generated with them before the final value of this + setting was known.

  24. +
  25. Fixed issue with handling of namespaced package names in + "critcl::iassoc". Equivalent to a bug in "critcl::class" fixed + for critcl 3.1.1, critcl::class 1.0.1. + Note: "literals", "enum", "emap", and "bitmap" do not require + a fix as they are all built on top of "iassoc".

  26. +
+
+

Changes for version 3.1.12

+
    +
  1. Fixed issue 42. Clear ::errorInfo immediately after startup to + prevent leakage of irrelevant (caught) errors into our script + and confusing the usage code.

  2. +
  3. Fixed issue 40. Keep the order of libraries, and allow + duplicates. Both are things which are occasionally required for + proper linking.

  4. +
  5. Extended the utility package critcl::literals to + declare a cproc result-type for a pool.

    +

    Further fixed the generated header to handle multiple inclusion.

    +

    Bumped version to 1.1.

  6. +
  7. Fixed issue with utility package critcl::bitmap.

    +

    Fixed the generated header to handle multiple inclusion.

    +

    Bumped version to 1.0.1.

  8. +
  9. Created new utility package critcl::enum for the + quick and easy setup and use of mappings between C values + and Tcl strings. + Built on top of critcl::literals.

  10. +
  11. Added examples demonstrating the use of the utility packages + critcl::literals, + critcl::bitmap, and + critcl::enum

  12. +
+
+

Changes for version 3.1.11

+
    +
  1. Fixed issue #37, via pull request #38, with thanks to + Jos DeCoster. Information was stored into the v::delproc + and v::clientdata arrays using a different key than when + retrieving the same information, thus failing the latter.

  2. +
  3. New convenience command critcl::include for easy + inclusion of headers and other C files.

  4. +
  5. New command critcl::make to generate a local header of + other C files for use by other parts of a package through + inclusion.

  6. +
  7. New utility package critcl::literals for quick and + easy setup of and access to pools of fixed Tcl_Obj* strings. + Built on top of critcl::iassoc.

  8. +
  9. New utility package critcl::bitmap for quick and easy + setup and use of mappings between C bitsets and Tcl lists whose + string elements represent that set. + Built on top of critcl::iassoc.

  10. +
+
+

Changes for version 3.1.10

+
    +
  1. Fixed code version numbering forgotten with 3.1.9.

  2. +
  3. Fixed issue #35. In package mode (-pkg) the object cache + directory is unique to the process, thus we do not need + content-hashing to generate unique file names. A simple + counter is sufficient and much faster.

    +

    Note that mode "compile & run" is not as blessed and still + uses content-hasing with md5 to ensure unique file names + in its per-user object cache.

  4. +
  5. Fixed issue where the ccommand forgot to use its body as + input for the UUID generation. Thus ignoring changes to it in + mode compile & run, and not rebuilding a library for changed + sources. Bug and fix reported by Peter Spjuth.

-

Please see section Advanced Embedded C Code of the -critcl package documentation for details.

-
  • Extended the critcl package to intercept package -provide and record the file -> package name mapping. Plus other -internal changes now allow the use of namespaced package names while -still using proper path names and init function.

  • -
  • Dropped the unused commands critcl::optimize and -critcl::include.

  • -
  • Dropped -lib mode from the critcl application.

  • -
  • Dropped remnants of support for Tcl 8.3 and before.

  • +
    +

    Changes for version 3.1.9

    +
      +
    1. Fixed issue #27. Added missing platform definitions for + various alternate linux and OS X targets.

    2. +
    3. Fixed issue #28. Added missing -mXX flags for linking at the + linux-{32,64}-* targets.

    4. +
    5. Fixed issue #29. Replaced the use of raw "cheaders" + information in the processing of "cdefines" with the proper + include directives derived from it.

    6. +
    7. Fixed the issue behind rejected pull request #30 by Andrew + Shadura. Dynamically extract the stubs variable declarations + from the Tcl header files and generate matching variable + definitions for use in the package code. The generated code + will now be always consistent with the headers, even when + critcl's own copy of them is replaced by system headers.

    8. +
    9. Fixed issue #31. Accepted patch by Andrew Shadura, with + changes (comments), for easier integration of critcl with + OS package systems, replacing critcl's copies of Tcl headers + with their own.

    10. +
    11. Fixed issue #32. Merged pull request by Andrew Shadura. + Various typos in documentation and comments.

    12. +
    13. Fixed issue #34. Handle files starting with a dot better.

    -

    Changes for version 3

    +

    Changes for version 3.1.8

      -
    1. The command critcl::platform was deprecated in version -2.1, superceded by critcl::targetplatform, yet kept for -compatibility. Now it has been removed.

    2. -
    3. The command critcl::compiled was kept with in version 2.1 -with semantics in contradiction to its, for compatibility. This -contradiction has been removed, changing the visible semantics of the -command to be in line with its name.

    4. -
    5. The change to version 3 became necessary because of the two -incompatible visible changes above.

    6. -
    7. Extended the application package with code handling a new -option -tea. Specifying this option invokes a special mode -where critcl generates a TEA package, i.e. wraps the input into a -directory hierarchy and support files which provide it TEA-lookalike -buildsystem.

      -

      This new option, and -pkg, exclude each other. If -both are specified the last used option takes precedence.

      -

      The generated package directory hierarchy is mostly -self-contained, but not fully. It requires not only a working -installation of Tcl, but also working installations of the packages -md5 and cmdline. Both of these are provided by the -Tcllib bundle. Not required, but recommended to have -installed are any of the packages which can accelerate md5's -operation, i.e. cryptkit, tcllibc, or -Trf.

    8. -
    9. Extended the critcl package with a new command -critcl::scan taking the path to a ".critcl" file, -statically scanning it, and returning license, version, a list of its -companion files, list of imported APIs, and list of -developer-specified custom configuration options. This data is the -foundation for the TEA wrapping described above.

      -

      Note that this is a static scan. While the other build -modes can (must) execute the ".critcl" file and make -platform-specific decisions regarding the assembled C code, companion -files, etc. the TEA wrap mode is not in a position to make -platform-specific decisions. It has to wrap everything which might -conceivably be needed when actually building. Hence the static scan. -This has however its own set of problems, namely the inability to -figure out any dynamic construction of companion file paths, at least -on its own. Thus:

    10. -
    11. Extended the API used by critcl-based packages with the command -critcl::owns. While this command is ignored by the regular build -modes the static scanner described above takes its arguments as the -names of companion files which have to be wrapped into the TEA package -and could not be figured by the scanner otherwise, like because of -dynamic paths to critcl::tsources, critcl::csources, -getting sourced directly, or simply being adjunct datafiles.

    12. -
    13. Extended the API used by critcl-based packages with the command -critcl::api for the management of stubs tables, be it their use, -and/or declaration and export.

      -

      Please see section Stubs Table Management of the -critcl package documentation for details.

    14. -
    15. Extended the API used by critcl-based packages with the command -critcl::userconfig for the management of developer-specified -custom configuration options, be it their use and/or declaration.

      -

      Please see section Custom Build Configuration of the -critcl package documentation for details.

    16. -
    17. Extended the API used by critcl-based packages with the -commands critcl::description, critcl::summary, -critcl::subject, critcl::meta, and -critcl::buildrequirement for the declaration of TEApot meta data -for/about the package.

      -

      Please see section Package Meta Data of the -critcl package documentation for details.

    18. +
    19. Fixed issue with package indices generated for Tcl 8.4. + Join the list of commands with semi-colon, not newline.

    20. +
    21. Fixed issue #26 which brought up use-cases I had forgotten to + consider while fixing bug #21 (see critcl 3.1.6).

    -

    Changes for version 3.0.1

    +

    Changes for version 3.1.7

      -
    1. Bugfixes all around. In detail:

    2. -
    3. Fixed recording of Tcl version requirements. Keep package name -and version together, unbreaking generated meta data and generated -package load command.

    4. -
    5. Fixed the build scripts: When installing, or wrapping for TEA, -generate any missing directories

    6. -
    7. Modified the build scripts to properly exit the application -when the window of their GUI is closed through the (X) button.

    8. -
    9. Removed an 8.5-ism (open wb) which had slipped into the main -build script.

    10. -
    11. Modified the example build scripts to separate the output for -the different examples (and packages) by adding empty lines.

    12. -
    13. stack::c example bugfix: Include API declarations for use in -the companion files.

    14. -
    15. Extended the documentation: Noted the need for a working -installation of a C compiler.

    16. -
    17. Extended the Windows target definitions and code to handle the -manifest files used by modern MS development environments. Note that -this code handles both possibilities, environment using manifests, and -(old(er)) environments without.

    18. -
    19. Extended the Windows 64bit target definitions and code to -auto-detect the need for the helper library "bufferoverflowU.lib" and -reconfigure the compile and link commands appropriately. We assume -that the library must be linked when present. This should be no harm -if the library is present, yet not needed. Just superfluous. We search -for the library in the paths specified by the environment variable -LIB.

    20. +
    21. Fixed issue #24. Extract and unconditionally display compiler + warnings found in the build log. Prevents users from missing + warnings which, while not causing the build to fail, may + still indicate problems.

    22. +
    23. New feature. Output hook. All non-messaging user output is now + routed through the command critcl::print, and users are + allowed to override it when using the critcl application-as-package.

    24. +
    25. New feature, by Ashok P. Nadkarni. Platform configurations can + inherit values from configurations defined before them.

    -

    Changes for version 3.0.2

    +

    Changes for version 3.1.6

      -
    1. Fixed issue in compile-and-run mode where commands put into the -auto_index are not found by Tcl's [unknown] command.

    2. -
    3. Fixed an array key mismatch breaking usage of client data and -delete function for procedure. Reported by Jos DeCoster, with patch.

    4. -
    5. Implemented a command line option -L, an equivalent of -option -I, just for library search paths.

    6. -
    7. Fixed github issues 5 and 8. Working around a missing variable -::errorInfo. It should always be present, however there seem to be -revisions of Tcl around which violate this assumption.

    8. +
    9. Fixed issue #21. While the multi-definition of the stub-table + pointer variables was ok with for all the C linkers seen so far + C++ linkers did not like this at all. Reworked the code to + ensure that this set of variables is generated only once, in + the wrapper around all the pieces to assemble.

    10. +
    11. Fixed issue #22, the handling of the command identifier + arguments of critcl::ccommand, critcl::cproc, and + critcl::cdata. We now properly allow any Tcl identifier + and generate proper internal C identifiers from them.

      +

      As part of this the signature of command critcl::name2c + changed. The command now delivers a list of four values instead + of three. The new value was added at the end.

      +

      Further adapted the implementation of package + critcl::class, a user of critcl::name2c. + This package is now at version 1.0.6 and requires critcl 3.1.6

      +

      Lastly fixed the mis-handling of option -cname in + critcl::ccommand, and critcl::cproc.

    12. +
    13. Fixed issue #23.

    -

    Changes for version 3.0.3

    +

    Changes for version 3.1.5

      -
    1. Fixed github issues 5 and 8, for the example build.tcl -scripts. Working around a missing variable ::errorInfo. It should -always be present, however there seem to be revisions of Tcl around -which violate this assumption.

    2. +
    3. Fixed issue #19. Made the regular expression extracting the + MSVC version number more general to make it work on german + language systems. This may have to be revisited in the future, + for other Windows locales.

    4. +
    5. Fixed issue #20. Made option -tea work on windows, at least in + a unix emulation environment like msys/mingw.

    -

    Changes for version 3.0.4

    +

    Changes for version 3.1.4

      -
    1. Fixed generation of the package's initname when the incoming - code is read from stdin and has no proper path.

    2. -
    3. Fixed github issue 11. Now using /LIBPATH instead of -L - on Windows (libinclude configuration setting).

    4. -
    5. Extended critcl to handle -l:path format of -l options. - GNU ld 2.22+ handles this by searching for the path as - is. Good when specifying static libraries, as plain -l looks - for shared libraries in preference over static. critcl handles - it now, as older GNU ld's do not understand it, nor the - various vendor-specific linkers.

    6. -
    7. Fixed github issue #12. Critcl now determines the version of - MSVC in use and uses it to switch between various link debug - options. Simplified the handling of bufferoverflowU.lib also, - making use of the same mechanism and collapsing the two - configurations sections we had back into one.

    8. -
    9. Reworked the insertion of #line pragmas into the generated C - code to avoid limitations on the line number argument imposed - by various compilers, and be more accurate.

    10. -
    11. Modified argument processing. Option -libdir now also - implies -L for its argument.

    12. -
    13. Extended handling of option -show (critcl::showconfig) - to list the path of the configuration file the data is coming - from. Good for debugging configuration processing.

    14. -
    15. Extended the build script with targets to regenerate the - embedded documentation, and diagrams, and to generate a - release.

    16. +
    17. Bugfix in package critcl::class. Generate a dummy + field in the class structure if the class has no class + variables. Without this change the structure would be empty, + and a number of compilers are not able to handle such a type.

    18. +
    19. Fixed a typo which broke the win64 configuration.

    20. +
    21. Fixed issue #16, a typo in the documentation of command + critcl::class.

    -

    Changes for version 3.0.5

    +

    Changes for version 3.1.3

      -
    1. Fixed bug in the new code for #line pragmas triggered when - specifying C code without leading whitespace.

    2. -
    3. Extended the documentation to have manpages for the license, - source retrieval, installer, and developer's guides.

    4. +
    5. Enhancement. In detail:

    6. +
    7. Added new argument type "pstring", for "Pascal String", a + counted string, i.e. a combination of string pointer and string + length.

    8. +
    9. Added new methods critcl::argtypesupport and + ::critcl::argsupport to define and use additional + supporting code for an argument type, here used by "pstring" + above to define the necessary structure.

    10. +
    11. Semi-bugfixes in the packages critcl::class and + critcl::iassoc. Pragmas for the AS meta data scanner + to ensure that the template files are made part of the package. + Versions bumped to 1.0.4 and 1.0.1 respectively.

    -

    Changes for version 3.0.6

    +

    Changes for version 3.1.2

      -
    1. Fixed github issue 10. The critcl application now delivers a - proper exit code (1) on build failure, instead of always - indicating success (status 0).

    2. -
    3. Fixed github issue 13. Handling of bufferoverflowU.lib for - release builds was inconsistent with handling for debug - builds. It is now identically handled (conditional) by - both cases.

    4. -
    5. Documentation cleanup, mainly in the installation guide, and - the README.md shown by github

    6. +
    7. Enhancement. In detail:

    8. +
    9. Extended critcl::cproc to be able to handle optional + arguments, in a limited way. This is automatically available to + critcl::class cproc-based methods as well.

    10. +
    11. Bugfix in lassign emulation for Tcl 8.4. Properly set + unused variables to the empty string. Bumped version of + emulation package lassign84 to 1.0.1.

    -

    Changes for version 3.0.7

    +

    Changes for version 3.1.1

      -
    1. Fixed the code generated by critcl::c++command. - The emitted code handed a non-static string table to - Tcl_GetIndexFromObj, in violation of the contract, which - requires the table to have a fixed address. This was a memory - smash waiting to happen. Thanks to Brian Griffin for alrerting - us to the general problem.

    2. +
    3. Bugfixes all around. In detail:

    4. +
    5. Fixed the generation of wrong#args errors for +critcl::cproc and derived code (critcl::class +cproc-based methods). Use NULL if there are no arguments, and +take the offset into account.

    6. +
    7. Fixed the handling of package names by +critcl::class. Forgot that they may contain namespace +separators. Bumped to version 1.0.1.

    8. +
    9. Extended a critcl::class generated error message in +instance creation for clarity. Bumped to version 1.0.2.

    -

    Changes for version 3.1

    +

    Changes for version 3.1

    1. Added a new higher-level package critcl::iassoc.

      This package simplifies the creation of code associating data @@ -481,139 +588,287 @@ details of the provided commands.

    -

    Changes for version 3.1.1

    +

    Changes for version 3.0.7

      -
    1. Bugfixes all around. In detail:

    2. -
    3. Fixed the generation of wrong#args errors for -critcl::cproc and derived code (critcl::class -cproc-based methods). Use NULL if there are no arguments, and -take the offset into account.

    4. -
    5. Fixed the handling of package names by -critcl::class. Forgot that they may contain namespace -separators. Bumped to version 1.0.1.

    6. -
    7. Extended a critcl::class generated error message in -instance creation for clarity. Bumped to version 1.0.2.

    8. +
    9. Fixed the code generated by critcl::c++command. + The emitted code handed a non-static string table to + Tcl_GetIndexFromObj, in violation of the contract, which + requires the table to have a fixed address. This was a memory + smash waiting to happen. Thanks to Brian Griffin for alrerting + us to the general problem.

    -

    Changes for version 3.1.2

    +

    Changes for version 3.0.6

      -
    1. Enhancement. In detail:

    2. -
    3. Extended critcl::cproc to be able to handle optional - arguments, in a limited way. This is automatically available to - critcl::class cproc-based methods as well.

    4. -
    5. Bugfix in lassign emulation for Tcl 8.4. Properly set - unused variables to the empty string. Bumped version of - emulation package lassign84 to 1.0.1.

    6. +
    7. Fixed github issue 10. The critcl application now delivers a + proper exit code (1) on build failure, instead of always + indicating success (status 0).

    8. +
    9. Fixed github issue 13. Handling of bufferoverflowU.lib for + release builds was inconsistent with handling for debug + builds. It is now identically handled (conditional) by + both cases.

    10. +
    11. Documentation cleanup, mainly in the installation guide, and + the README.md shown by github

    -

    Changes for version 3.1.3

    +

    Changes for version 3.0.5

      -
    1. Enhancement. In detail:

    2. -
    3. Added new argument type "pstring", for "Pascal String", a - counted string, i.e. a combination of string pointer and string - length.

    4. -
    5. Added new methods critcl::argtypesupport and - ::critcl::argsupport to define and use additional - supporting code for an argument type, here used by "pstring" - above to define the necessary structure.

    6. -
    7. Semi-bugfixes in the packages critcl::class and - critcl::iassoc. Pragmas for the AS meta data scanner - to ensure that the template files are made part of the package. - Versions bumped to 1.0.4 and 1.0.1 respectively.

    8. +
    9. Fixed bug in the new code for #line pragmas triggered when + specifying C code without leading whitespace.

    10. +
    11. Extended the documentation to have manpages for the license, + source retrieval, installer, and developer's guides.

    -

    Changes for version 3.1.4

    +

    Changes for version 3.0.4

      -
    1. Bugfix in package critcl::class. Generate a dummy - field in the class structure if the class has no class - variables. Without this change the structure would be empty, - and a number of compilers are not able to handle such a type.

    2. -
    3. Fixed a typo which broke the win64 configuration.

    4. -
    5. Fixed issue #16, a typo in the documentation of command - critcl::class.

    6. +
    7. Fixed generation of the package's initname when the incoming + code is read from stdin and has no proper path.

    8. +
    9. Fixed github issue 11. Now using /LIBPATH instead of -L + on Windows (libinclude configuration setting).

    10. +
    11. Extended critcl to handle -l:path format of -l options. + GNU ld 2.22+ handles this by searching for the path as + is. Good when specifying static libraries, as plain -l looks + for shared libraries in preference over static. critcl handles + it now, as older GNU ld's do not understand it, nor the + various vendor-specific linkers.

    12. +
    13. Fixed github issue #12. Critcl now determines the version of + MSVC in use and uses it to switch between various link debug + options. Simplified the handling of bufferoverflowU.lib also, + making use of the same mechanism and collapsing the two + configurations sections we had back into one.

    14. +
    15. Reworked the insertion of #line pragmas into the generated C + code to avoid limitations on the line number argument imposed + by various compilers, and be more accurate.

    16. +
    17. Modified argument processing. Option -libdir now also + implies -L for its argument.

    18. +
    19. Extended handling of option -show (critcl::showconfig) + to list the path of the configuration file the data is coming + from. Good for debugging configuration processing.

    20. +
    21. Extended the build script with targets to regenerate the + embedded documentation, and diagrams, and to generate a + release.

    -

    Changes for version 3.1.5

    +

    Changes for version 3.0.3

      -
    1. Fixed issue #19. Made the regular expression extracting the - MSVC version number more general to make it work on german - language systems. This may have to be revisited in the future, - for other Windows locales.

    2. -
    3. Fixed issue #20. Made option -tea work on windows, at least in - a unix emulation environment like msys/mingw.

    4. +
    5. Fixed github issues 5 and 8, for the example build.tcl +scripts. Working around a missing variable ::errorInfo. It should +always be present, however there seem to be revisions of Tcl around +which violate this assumption.

    -

    Changes for version 3.1.6

    +

    Changes for version 3.0.2

      -
    1. Fixed issue #21. While the multi-definition of the stub-table - pointer variables was ok with for all the C linkers seen so far - C++ linkers did not like this at all. Reworked the code to - ensure that this set of variables is generated only once, in - the wrapper around all the pieces to assemble.

    2. -
    3. Fixed issue #22, the handling of the command identifier - arguments of critcl::ccommand, critcl::cproc, and - critcl::cdata. We now properly allow any Tcl identifier - and generate proper internal C identifiers from them.

      -

      As part of this the signature of command critcl::name2c - changed. The command now delivers a list of four values instead - of three. The new value was added at the end.

      -

      Further adapted the implementation of package - critcl::class, a user of critcl::name2c. - This package is now at version 1.0.6 and requires critcl 3.1.6

      -

      Lastly fixed the mis-handling of option -cname in - critcl::ccommand, and critcl::cproc.

    4. -
    5. Fixed issue #23.

    6. +
    7. Fixed issue in compile-and-run mode where commands put into the +auto_index are not found by Tcl's [unknown] command.

    8. +
    9. Fixed an array key mismatch breaking usage of client data and +delete function for procedure. Reported by Jos DeCoster, with patch.

    10. +
    11. Implemented a command line option -L, an equivalent of +option -I, just for library search paths.

    12. +
    13. Fixed github issues 5 and 8. Working around a missing variable +::errorInfo. It should always be present, however there seem to be +revisions of Tcl around which violate this assumption.

    -

    Changes for version 3.1.7

    +

    Changes for version 3.0.1

      -
    1. Fixed issue #24. Extract and unconditionally display compiler - warnings found in the build log. Prevents users from missing - warnings which, while not causing the build to fail, may - still indicate problems.

    2. -
    3. New feature. Output hook. All non-messaging user output is now - routed through the command critcl::print, and users are - allowed to override it when using the critcl application-as-package.

    4. -
    5. New feature, by Ashok P. Nadkarni. Platform configurations can - inherit values from configurations defined before them.

    6. +
    7. Bugfixes all around. In detail:

    8. +
    9. Fixed recording of Tcl version requirements. Keep package name +and version together, unbreaking generated meta data and generated +package load command.

    10. +
    11. Fixed the build scripts: When installing, or wrapping for TEA, +generate any missing directories

    12. +
    13. Modified the build scripts to properly exit the application +when the window of their GUI is closed through the (X) button.

    14. +
    15. Removed an 8.5-ism (open wb) which had slipped into the main +build script.

    16. +
    17. Modified the example build scripts to separate the output for +the different examples (and packages) by adding empty lines.

    18. +
    19. stack::c example bugfix: Include API declarations for use in +the companion files.

    20. +
    21. Extended the documentation: Noted the need for a working +installation of a C compiler.

    22. +
    23. Extended the Windows target definitions and code to handle the +manifest files used by modern MS development environments. Note that +this code handles both possibilities, environment using manifests, and +(old(er)) environments without.

    24. +
    25. Extended the Windows 64bit target definitions and code to +auto-detect the need for the helper library "bufferoverflowU.lib" and +reconfigure the compile and link commands appropriately. We assume +that the library must be linked when present. This should be no harm +if the library is present, yet not needed. Just superfluous. We search +for the library in the paths specified by the environment variable +LIB.

    -

    Changes for version 3.1.8

    +

    Changes for version 3

      -
    1. Fixed issue with package indices generated for Tcl 8.4. - Join the list of commands with semi-colon, not newline.

    2. -
    3. Fixed issue #26 which brought up use-cases I had forgotten to - consider while fixing bug #21 (see critcl 3.1.6).

    4. +
    5. The command critcl::platform was deprecated in version +2.1, superceded by critcl::targetplatform, yet kept for +compatibility. Now it has been removed.

    6. +
    7. The command critcl::compiled was kept with in version 2.1 +with semantics in contradiction to its, for compatibility. This +contradiction has been removed, changing the visible semantics of the +command to be in line with its name.

    8. +
    9. The change to version 3 became necessary because of the two +incompatible visible changes above.

    10. +
    11. Extended the application package with code handling a new +option -tea. Specifying this option invokes a special mode +where critcl generates a TEA package, i.e. wraps the input into a +directory hierarchy and support files which provide it TEA-lookalike +buildsystem.

      +

      This new option, and -pkg, exclude each other. If +both are specified the last used option takes precedence.

      +

      The generated package directory hierarchy is mostly +self-contained, but not fully. It requires not only a working +installation of Tcl, but also working installations of the packages +md5 and cmdline. Both of these are provided by the +Tcllib bundle. Not required, but recommended to have +installed are any of the packages which can accelerate md5's +operation, i.e. cryptkit, tcllibc, or +Trf.

    12. +
    13. Extended the critcl package with a new command +critcl::scan taking the path to a ".critcl" file, +statically scanning it, and returning license, version, a list of its +companion files, list of imported APIs, and list of +developer-specified custom configuration options. This data is the +foundation for the TEA wrapping described above.

      +

      Note that this is a static scan. While the other build +modes can (must) execute the ".critcl" file and make +platform-specific decisions regarding the assembled C code, companion +files, etc. the TEA wrap mode is not in a position to make +platform-specific decisions. It has to wrap everything which might +conceivably be needed when actually building. Hence the static scan. +This has however its own set of problems, namely the inability to +figure out any dynamic construction of companion file paths, at least +on its own. Thus:

    14. +
    15. Extended the API used by critcl-based packages with the command +critcl::owns. While this command is ignored by the regular build +modes the static scanner described above takes its arguments as the +names of companion files which have to be wrapped into the TEA package +and could not be figured by the scanner otherwise, like because of +dynamic paths to critcl::tsources, critcl::csources, +getting sourced directly, or simply being adjunct datafiles.

    16. +
    17. Extended the API used by critcl-based packages with the command +critcl::api for the management of stubs tables, be it their use, +and/or declaration and export.

      +

      Please see section Stubs Table Management of the +critcl package documentation for details.

    18. +
    19. Extended the API used by critcl-based packages with the command +critcl::userconfig for the management of developer-specified +custom configuration options, be it their use and/or declaration.

      +

      Please see section Custom Build Configuration of the +critcl package documentation for details.

    20. +
    21. Extended the API used by critcl-based packages with the +commands critcl::description, critcl::summary, +critcl::subject, critcl::meta, and +critcl::buildrequirement for the declaration of TEApot meta data +for/about the package.

      +

      Please see section Package Meta Data of the +critcl package documentation for details.

    -

    Changes for version 3.1.9

    +

    Changes for version 2.1

      -
    1. Fixed issue #27. Added missing platform definitions for - various alternate linux and OS X targets.

    2. -
    3. Fixed issue #28. Added missing -mXX flags for linking at the - linux-{32,64}-* targets.

    4. -
    5. Fixed issue #29. Replaced the use of raw "cheaders" - information in the processing of "cdefines" with the proper - include directives derived from it.

    6. -
    7. Fixed the issue behind rejected pull request #30 by Andrew - Shadura. Dynamically extract the stubs variable declarations - from the Tcl header files and generate matching variable - definitions for use in the package code. The generated code - will now be always consistent with the headers, even when - critcl's own copy of them is replaced by system headers.

    8. -
    9. Fixed issue #31. Accepted patch by Andrew Shadura, with - changes (comments), for easier integration of critcl with - OS package systems, replacing critcl's copies of Tcl headers - with their own.

    10. -
    11. Fixed issue #32. Merged pull request by Andrew Shadura. - Various typos in documentation and comments.

    12. -
    13. Fixed issue #33. Handle files starting with a dot better.

    14. +
    15. Fixed bug where critcl::tsources interpreted relative +paths as relative to the current working directory instead of +relative to the ".critcl" file using the command, as all other +commands of this type do.

    16. +
    17. Fixed internals, preventing information collected for multiple +".critcl" files to leak between them. Notably, critcl::tk +is not a global configuration option anymore.

    18. +
    19. Fixed the command critcl::license to be a null-operation +in mode "compile & run", instead of throwing an error.

    20. +
    21. Fixed the critcl application's interference with the "compile & +run" result cache in -pkg mode by having it use a wholly +separate (and by default transient) directory for that mode.

    22. +
    23. Fixed bug where changes to a ".critcl" file did not result +in a rebuild for mode "compile & run". All relevant API commands now +ensure UUID changes.

    24. +
    25. Fixed bug in the backend handling of critcl::debug where +the companion c-sources of a ".critcl" file were not compiled +with debug options, although the ".critcl" file was.

    26. +
    27. Fixed bug in critcl::debug which prevented recognition of +mode "all" when it was not the first argument to the command.

    28. +
    29. Fixed bug in "preload.c" preventing its compilation on +non-windows platforms.

    30. +
    31. Fixed long-standing bug in the handling of namespace qualifiers +in the command name argument of critcl::cproc and +critcl::ccommand. It is now possible to specify a fully +qualified command name without issues.

    32. +
    33. Extended/reworked critcl::tsources to be the canonical +way of declaring ".tcl" companion files even for mode "compile & +run".

    34. +
    35. Extended/reworked critcl::tsources to allow the use of a +".critcl" file as its own Tcl companion file.

    36. +
    37. Extended critcl::framework to internally check for OS X +build target, and to ignore the declaration if its not.

    38. +
    39. Extended critcl::failed to be callable more than once in +a ".critcl" file. The first call forces the build, if it was not +done already, to get the result. Further calls return the cached +result of the first call.

    40. +
    41. Extended the handling of environment variable CC in the code +determining the compiler to use to deal with (i.e. remove) paths to +the compiler, compiler file extensions, and compiler options specified +after the compiler itself, leaving only the bare name of the compiler.

    42. +
    43. Extended the code handling the search for preloaded libraries +to print the paths it searched, making debugging of a search failure +easier.

    44. +
    45. A new command critcl::tcl can be used to declare the +version of Tcl minimally needed to build and run the ".critcl" +file and package. Defaults to 8.4 if not declared. Extended critcl to +have the stubs and headers for all of Tcl 8.4, 8.5, and 8.6.

    46. +
    47. A new command critcl::load forces the build and load of a +".critcl" file. This is the official way for overriding critcl's +default lazy-build-&-load-on-demand scheme for mode "compile & run".

      +

      Note that after using critcl::load / +critcl::failed in a ".critcl" file it is not possible to +use critcl commands in that file anymore. Doing so will throw an +error.

    48. +
    49. Extended the generation of '#line' pragmas to use +info frame (if available) to provide the C compiler with exact +line numbers into the ".critcl" file for the reporting of +warnings and errors.

    50. +
    51. Extended critcl::check with logging to help with +debugging build-time checks of the environment, plus an additional +optional argument to provide labeling.

    52. +
    53. Added a new command critcl::checklink which not only +tries to check the environment via compiling the code, but also +its linkability.

    54. +
    55. Added a new command critcl::msg for messaging, like +command critcl::error is for error reporting. Likewise this is a +hook a user of the package is allowed to override. The default +implementation, used by mode compile & run does nothing. The +implementation for mode generate package prints the message +to stdout.

      +

      Envisioned use is for the reporting of results determined by +critcl::check and critcl::checklink during building, to +help with debugging when something goes wrong with a check.

    56. +
    57. Exposed the argument processing internals of critcl::proc +for use by advanced users. The new commands are

      +
        +
      1. critcl::argnames

      2. +
      3. critcl::argcnames

      4. +
      5. critcl::argcsignature

      6. +
      7. critcl::argvardecls

      8. +
      9. critcl::argconversion

      10. +
      +

      Please see section Advanced Embedded C Code of the +critcl package documentation for details.

    58. +
    59. Extended the critcl package to intercept package +provide and record the file -> package name mapping. Plus other +internal changes now allow the use of namespaced package names while +still using proper path names and init function.

    60. +
    61. Dropped the unused commands critcl::optimize and +critcl::include.

    62. +
    63. Dropped -lib mode from the critcl application.

    64. +
    65. Dropped remnants of support for Tcl 8.3 and before.

    -

    Authors

    +

    Authors

    Jean Claude Wippler, Steve Landers, Andreas Kupries

    -

    Bugs, Ideas, Feedback

    +

    Bugs, Ideas, Feedback

    This document, and the package it describes, will undoubtedly contain bugs and other problems. Please report them at https://github.com/andreas-kupries/critcl/issues. @@ -630,6 +885,6 @@

    diff -Nru critcl-3.1.9/embedded/www/files/critcl_app.html critcl-3.1.17+dfsg/embedded/www/files/critcl_app.html --- critcl-3.1.9/embedded/www/files/critcl_app.html 2013-05-10 05:57:04.000000000 +0000 +++ critcl-3.1.17+dfsg/embedded/www/files/critcl_app.html 2017-10-14 02:48:11.000000000 +0000 @@ -92,18 +92,18 @@ } --> - -

    [ - Table Of Contents + Table Of Contents | Keyword Index -]
    -

    critcl_app(n) 3.1.8 doc "C Runtime In Tcl (CriTcl)"

    + ]
    +

    critcl_app(n) 3.1.17 doc "C Runtime In Tcl (CriTcl)"

    Name

    critcl_app - CriTcl Application

    @@ -114,27 +114,35 @@
  • Description
  • Application Options
  • Package Structure
  • -
  • Changes for version 2.1
  • -
  • Changes for version 3
  • -
  • Changes for version 3.0.1
  • -
  • Changes for version 3.0.2
  • -
  • Changes for version 3.0.3
  • -
  • Changes for version 3.0.4
  • -
  • Changes for version 3.0.5
  • -
  • Changes for version 3.0.6
  • -
  • Changes for version 3.0.7
  • -
  • Changes for version 3.1
  • -
  • Changes for version 3.1.1
  • -
  • Changes for version 3.1.2
  • -
  • Changes for version 3.1.3
  • +
  • Changes for version 3.1.17
  • +
  • Changes for version 3.1.16
  • +
  • Changes for version 3.1.15
  • +
  • Changes for version 3.1.14
  • +
  • Changes for version 3.1.13
  • +
  • Changes for version 3.1.12
  • +
  • Changes for version 3.1.11
  • +
  • Changes for version 3.1.10
  • +
  • Changes for version 3.1.9
  • +
  • Changes for version 3.1.8
  • +
  • Changes for version 3.1.7
  • +
  • Changes for version 3.1.6
  • +
  • Changes for version 3.1.5
  • Changes for version 3.1.4
  • -
  • Changes for version 3.1.5
  • -
  • Changes for version 3.1.6
  • -
  • Changes for version 3.1.7
  • -
  • Changes for version 3.1.8
  • -
  • Changes for version 3.1.9
  • -
  • Authors
  • -
  • Bugs, Ideas, Feedback
  • +
  • Changes for version 3.1.3
  • +
  • Changes for version 3.1.2
  • +
  • Changes for version 3.1.1
  • +
  • Changes for version 3.1
  • +
  • Changes for version 3.0.7
  • +
  • Changes for version 3.0.6
  • +
  • Changes for version 3.0.5
  • +
  • Changes for version 3.0.4
  • +
  • Changes for version 3.0.3
  • +
  • Changes for version 3.0.2
  • +
  • Changes for version 3.0.1
  • +
  • Changes for version 3
  • +
  • Changes for version 2.1
  • +
  • Authors
  • +
  • Bugs, Ideas, Feedback
  • Keywords
  • Category
  • Copyright
  • @@ -469,285 +477,384 @@ +- <platformN> +- <shared libraryN> +

    The latest changes are found at the top.

    -

    Changes for version 2.1

    +

    Changes for version 3.1.17

      -
    1. Fixed bug where critcl::tsources interpreted relative -paths as relative to the current working directory instead of -relative to the ".critcl" file using the command, as all other -commands of this type do.

    2. -
    3. Fixed internals, preventing information collected for multiple -".critcl" files to leak between them. Notably, critcl::tk -is not a global configuration option anymore.

    4. -
    5. Fixed the command critcl::license to be a null-operation -in mode "compile & run", instead of throwing an error.

    6. -
    7. Fixed the critcl application's interference with the "compile & -run" result cache in -pkg mode by having it use a wholly -separate (and by default transient) directory for that mode.

    8. -
    9. Fixed bug where changes to a ".critcl" file did not result -in a rebuild for mode "compile & run". All relevant API commands now -ensure UUID changes.

    10. -
    11. Fixed bug in the backend handling of critcl::debug where -the companion c-sources of a ".critcl" file were not compiled -with debug options, although the ".critcl" file was.

    12. -
    13. Fixed bug in critcl::debug which prevented recognition of -mode "all" when it was not the first argument to the command.

    14. -
    15. Fixed bug in "preload.c" preventing its compilation on -non-windows platforms.

    16. -
    17. Fixed long-standing bug in the handling of namespace qualifiers -in the command name argument of critcl::cproc and -critcl::ccommand. It is now possible to specify a fully -qualified command name without issues.

    18. -
    19. Extended/reworked critcl::tsources to be the canonical -way of declaring ".tcl" companion files even for mode "compile & -run".

    20. -
    21. Extended/reworked critcl::tsources to allow the use of a -".critcl" file as its own Tcl companion file.

    22. -
    23. Extended critcl::framework to internally check for OS X -build target, and to ignore the declaration if its not.

    24. -
    25. Extended critcl::failed to be callable more than once in -a ".critcl" file. The first call forces the build, if it was not -done already, to get the result. Further calls return the cached -result of the first call.

    26. -
    27. Extended the handling of environment variable CC in the code -determining the compiler to use to deal with (i.e. remove) paths to -the compiler, compiler file extensions, and compiler options specified -after the compiler itself, leaving only the bare name of the compiler.

    28. -
    29. Extended the code handling the search for preloaded libraries -to print the paths it searched, making debugging of a search failure -easier.

    30. -
    31. A new command critcl::tcl can be used to declare the -version of Tcl minimally needed to build and run the ".critcl" -file and package. Defaults to 8.4 if not declared. Extended critcl to -have the stubs and headers for all of Tcl 8.4, 8.5, and 8.6.

    32. -
    33. A new command critcl::load forces the build and load of a -".critcl" file. This is the official way for overriding critcl's -default lazy-build-&-load-on-demand scheme for mode "compile & run".

      -

      Note that after using critcl::load / -critcl::failed in a ".critcl" file it is not possible to -use critcl commands in that file anymore. Doing so will throw an -error.

    34. -
    35. Extended the generation of '#line' pragmas to use -info frame (if available) to provide the C compiler with exact -line numbers into the ".critcl" file for the reporting of -warnings and errors.

    36. -
    37. Extended critcl::check with logging to help with -debugging build-time checks of the environment, plus an additional -optional argument to provide labeling.

    38. -
    39. Added a new command critcl::checklink which not only -tries to check the environment via compiling the code, but also -its linkability.

    40. -
    41. Added a new command critcl::msg for messaging, like -command critcl::error is for error reporting. Likewise this is a -hook a user of the package is allowed to override. The default -implementation, used by mode compile & run does nothing. The -implementation for mode generate package prints the message -to stdout.

      -

      Envisioned use is for the reporting of results determined by -critcl::check and critcl::checklink during building, to -help with debugging when something goes wrong with a check.

    42. -
    43. Exposed the argument processing internals of critcl::proc -for use by advanced users. The new commands are

      -
        -
      1. critcl::argnames

      2. -
      3. critcl::argcnames

      4. -
      5. critcl::argcsignature

      6. -
      7. critcl::argvardecls

      8. -
      9. critcl::argconversion

      10. +
      11. Extension: Allow duplicate arg- and result-type definitions if + they are fully identical.

      12. +
      13. Bugfix. The application mishandled the possibility of + identical-named critcl::tsources. Possible because + critcl::tsources can be in subdirectories, a structure + which is not retained in the assembled package, causing + such files to overwrite each other and at least one lost. Fixed + by adding a serial number to the file names in the assembled + package.

      14. +
      15. Bugfix in the static scanner which made it loose requirement + information. Further added code to generally cleanup results at + the end (removal of duplicates, mainly).

      16. +
      17. Bugfix: Fixed issue #76. + Support installation directories which are not in the auto_path. + Without the patch the installed critcl will not find its + own packages and fail. Thank you to + Simon Bachmann for the + report and patch, and then his patience with me to getting to + actually apply it.

      18. +
      19. Bugfix: Fixed issue #75. + Extended critcl::include to now take multiple paths.

      20. +
      21. Added new compatibility package lmap84.

      22. +
      23. Fixed typos in various documentation files.

      24. +
      25. Fixed bug introduced by commit 86f415dd30 (3.1.16 release). The + separation of critcl::ccode into user and work layers + means that location retrieval has to go one more level up to + find the user location.

      26. +
      27. New supporting package critcl::cutil. Provides common + C level facilities useful to packages (assertions, tracing, + memory allocation shorthands).

      28. +
      29. Modified package critcl to make use of the new + tracing facilities to provide tracing of arguments and results + for critcl::ccommand and critcl::cproc invokations.

      30. +
      31. Modified packages critcl and critcl::class + to provide better function names for (class) method tracing. + Bumped package critcl::class to version 1.0.7.

      32. +
      33. Extended the support package critcl::literals with + limited configurability. It is now able to generate code for + C-level access to the pool without Tcl types (Mode c). + The previously existing functionality is accesssible under mode + tcl, which also is the default. Both modes can be used + together.

      34. +
      35. Extended the support package critcl::emap with + limited configurability. It is now able to generate code for + C-level access to the mapping without Tcl types + (Mode c). The previously existing functionality is + accessible under mode tcl, which also is the + default. Both modes can be used together.

      36. +
      +
    +

    Changes for version 3.1.16

    +
      +
    1. New feature. Extended critcl::cproc's argument handling + to allow arbitrary mixing of required and optional arguments.

    2. +
    3. New feature. + Potential Incompatibility.

      +

      Extended critcl::cproc's argument handling to treat an + argument args as variadic if it is the last argument of + the procedure.

    4. +
    5. New feature. Added two introspection commands, + critcl::has-argtype and critcl::has-resulttype. + These enable a user to test if a specific (named) type + conversion is implemented or not.

    6. +
    7. Added new result type Tcl_Obj*0, with alias + object0. The difference to Tcl_Obj* is in + the reference counting.

    8. +
    9. Extended the command critcl::argtypesupport with new + optional argument through which to explicitly specify the + identifier for guarding against multiple definitions.

    10. +
    11. Bugfix: Fixed problem with the implementation of issue #54 (See + 3.1.14). Always create the secondary log file. Otherwise + end-of-log handling may break, unconditionally assuming its + existence.

    12. +
    13. Bugfix: Fixed problem with the internal change to the hook + HandleDeclAfterBuild. Corrected the forgotten + critcl::cconst.

    14. +
    15. Debugging aid: Added comment holding the name of the result + type when emitting result conversions.

    16. +
    17. Bugfix: Fixed issue #60. Unbundled the package directories + containing multiple packages. All directories under "lib/" + now contain exactly one package.

    18. +
    19. Bugfix: Fixed issue #62, a few dict exists commands + operating on a fixed string instead of a variable.

    20. +
    21. Bugfix: Fixed issue #56. Release builders are reminded to run + the tests.

    22. +
    23. Bugfix: Fixed issue #55. For FreeBSD critcl's platform package + now identifies the Kernel ABI version. Initialization of the + cache directory now also uses platform::identify for the + default path, instead of platform::generic.

    24. +
    25. Bugfix: Fixed issue #58. Simplified the setup and use of + md5. Critcl now makes use of its own package for md5, using + itself to built it. There is no chicken/egg problem with this + as the -pkg mode used for this does not use md5. That + is limited to mode compile & run.

    26. +
    +
    +

    Changes for version 3.1.15

    +
      +
    1. Fixed version number bogosity with 3.1.14.

    2. +
    +
    +

    Changes for version 3.1.14

    +
      +
    1. Fixed issue #36. Added message to target all of the + Makefile generated for TEA mode. Additionally tweaked other + parts of the output to be less noisy.

    2. +
    3. Accepted request implied in issue #54. Unconditionally save + the compiler/linker build log into key log of the + dictionary returned by cresults, and save a copy of only + the execution output in the new key exl ("execution + log").

    4. +
    5. Fixed issue #53. Clarified the documentation of commands + critcl::load and critcl::failed with regard + to their results and the throwing of errors (does not happen).

    6. +
    7. Fixed issue #48. Modified mode "compile & run" to allow new + declarations in a file, after it was build, instead of + erroring out. The new decls are build when needed. Mode + "precompile" is unchanged and will continue to trap the + situation.

    8. +
    9. Fixed issue #52. Updated the local Tcl/Tk headers to + 8.4.20, 8.5.13, and 8.6.4.

    10. +
    11. Fixed issue #45. New feature command critcl::cconst.

    12. +
    13. critcl::util: New command locate to find a + file across a set of paths, and report an error when not + found. This is for use in autoconf-like header-searches and + similar configuration tests.

    14. +
    15. Modified 'AbortWhenCalledAfterBuild' to dump the entire stack + (info frame!). This should make it easier to determine the + location of the troubling declaration.

    16. +
    +
    +

    Changes for version 3.1.13

    +
      +
    1. Merged PR #43. Fixed bug loading adjunct Tcl sources.

    2. +
    3. Fixes in documentation and generated code of package + "critcl::enum". Bumped to version 1.0.1.

    4. +
    5. Fixes in documentation of package "critcl::bitmap".

    6. +
    7. New package "critcl::emap". In essence a variant or cross of + "critcl::bitmap" with behaviour like "critcl::enum".

    8. +
    9. Merged PR #49. Fixed documentation typo.

    10. +
    11. Merged PR #46. Fixed documentation typo.

    12. +
    13. Merged PR #47. Fixes to test results to match the accumulated + code changes. Also made portable across Tcl versions (varying + error syntax).

    14. +
    15. New predefined argument- and result-type "wideint" mapping to + Tcl_WideInt.

    16. +
    17. New predefined argument-type "bytes" mapping to tuple of + byte-array data and length. Note: The existing "bytearray" + type (and its aliases) was left untouched, to keep backward + compatibility.

    18. +
    19. Modified the internal interface between the Tcl shim and C + function underneath "critcl::cproc" with respect to the + handling of optional arguments. + An optional argument "X" now induces the use of two C + arguments, "X" and "has_X". The new argument "has_X" is of + boolean (int) type. It is set to true when X is set, and set + to false when X has the default value. C code which cares + about knowing if the argument is default or not is now able to + check that quickly, without having to code the default value + inside. + + NOTE: This change is visible in the output of the advanced + commands "argcnames", "argcsignature", "argvardecls", + and "argconversion".

    20. +
    21. Fixed issue #50 and documented the availability of variable + "interp" (type Tcl_Interp*) within "critcl::cinit" C code + fragments. + Note that while the old, undocumented name of the variable, + "ip", is still usable, it is deprecated. It will be fully + removed in two releases, i.e. for release 3.1.15. + The variable name was changed to be consistent with other code + environments.

    22. +
    23. Fixed issue #51. Disabled the generation of #line directives + for "critcl::config lines 0" coming from template files, or + code generated with them before the final value of this + setting was known.

    24. +
    25. Fixed issue with handling of namespaced package names in + "critcl::iassoc". Equivalent to a bug in "critcl::class" fixed + for critcl 3.1.1, critcl::class 1.0.1. + Note: "literals", "enum", "emap", and "bitmap" do not require + a fix as they are all built on top of "iassoc".

    26. +
    +
    +

    Changes for version 3.1.12

    +
      +
    1. Fixed issue 42. Clear ::errorInfo immediately after startup to + prevent leakage of irrelevant (caught) errors into our script + and confusing the usage code.

    2. +
    3. Fixed issue 40. Keep the order of libraries, and allow + duplicates. Both are things which are occasionally required for + proper linking.

    4. +
    5. Extended the utility package critcl::literals to + declare a cproc result-type for a pool.

      +

      Further fixed the generated header to handle multiple inclusion.

      +

      Bumped version to 1.1.

    6. +
    7. Fixed issue with utility package critcl::bitmap.

      +

      Fixed the generated header to handle multiple inclusion.

      +

      Bumped version to 1.0.1.

    8. +
    9. Created new utility package critcl::enum for the + quick and easy setup and use of mappings between C values + and Tcl strings. + Built on top of critcl::literals.

    10. +
    11. Added examples demonstrating the use of the utility packages + critcl::literals, + critcl::bitmap, and + critcl::enum

    12. +
    +
    +

    Changes for version 3.1.11

    +
      +
    1. Fixed issue #37, via pull request #38, with thanks to + Jos DeCoster. Information was stored into the v::delproc + and v::clientdata arrays using a different key than when + retrieving the same information, thus failing the latter.

    2. +
    3. New convenience command critcl::include for easy + inclusion of headers and other C files.

    4. +
    5. New command critcl::make to generate a local header of + other C files for use by other parts of a package through + inclusion.

    6. +
    7. New utility package critcl::literals for quick and + easy setup of and access to pools of fixed Tcl_Obj* strings. + Built on top of critcl::iassoc.

    8. +
    9. New utility package critcl::bitmap for quick and easy + setup and use of mappings between C bitsets and Tcl lists whose + string elements represent that set. + Built on top of critcl::iassoc.

    10. +
    +
    +

    Changes for version 3.1.10

    +
      +
    1. Fixed code version numbering forgotten with 3.1.9.

    2. +
    3. Fixed issue #35. In package mode (-pkg) the object cache + directory is unique to the process, thus we do not need + content-hashing to generate unique file names. A simple + counter is sufficient and much faster.

      +

      Note that mode "compile & run" is not as blessed and still + uses content-hasing with md5 to ensure unique file names + in its per-user object cache.

    4. +
    5. Fixed issue where the ccommand forgot to use its body as + input for the UUID generation. Thus ignoring changes to it in + mode compile & run, and not rebuilding a library for changed + sources. Bug and fix reported by Peter Spjuth.

    -

    Please see section Advanced Embedded C Code of the -critcl package documentation for details.

    -
  • Extended the critcl package to intercept package -provide and record the file -> package name mapping. Plus other -internal changes now allow the use of namespaced package names while -still using proper path names and init function.

  • -
  • Dropped the unused commands critcl::optimize and -critcl::include.

  • -
  • Dropped -lib mode from the critcl application.

  • -
  • Dropped remnants of support for Tcl 8.3 and before.

  • +
    +

    Changes for version 3.1.9

    +
      +
    1. Fixed issue #27. Added missing platform definitions for + various alternate linux and OS X targets.

    2. +
    3. Fixed issue #28. Added missing -mXX flags for linking at the + linux-{32,64}-* targets.

    4. +
    5. Fixed issue #29. Replaced the use of raw "cheaders" + information in the processing of "cdefines" with the proper + include directives derived from it.

    6. +
    7. Fixed the issue behind rejected pull request #30 by Andrew + Shadura. Dynamically extract the stubs variable declarations + from the Tcl header files and generate matching variable + definitions for use in the package code. The generated code + will now be always consistent with the headers, even when + critcl's own copy of them is replaced by system headers.

    8. +
    9. Fixed issue #31. Accepted patch by Andrew Shadura, with + changes (comments), for easier integration of critcl with + OS package systems, replacing critcl's copies of Tcl headers + with their own.

    10. +
    11. Fixed issue #32. Merged pull request by Andrew Shadura. + Various typos in documentation and comments.

    12. +
    13. Fixed issue #34. Handle files starting with a dot better.

    -

    Changes for version 3

    +

    Changes for version 3.1.8

      -
    1. The command critcl::platform was deprecated in version -2.1, superceded by critcl::targetplatform, yet kept for -compatibility. Now it has been removed.

    2. -
    3. The command critcl::compiled was kept with in version 2.1 -with semantics in contradiction to its, for compatibility. This -contradiction has been removed, changing the visible semantics of the -command to be in line with its name.

    4. -
    5. The change to version 3 became necessary because of the two -incompatible visible changes above.

    6. -
    7. Extended the application package with code handling a new -option -tea. Specifying this option invokes a special mode -where critcl generates a TEA package, i.e. wraps the input into a -directory hierarchy and support files which provide it TEA-lookalike -buildsystem.

      -

      This new option, and -pkg, exclude each other. If -both are specified the last used option takes precedence.

      -

      The generated package directory hierarchy is mostly -self-contained, but not fully. It requires not only a working -installation of Tcl, but also working installations of the packages -md5 and cmdline. Both of these are provided by the -Tcllib bundle. Not required, but recommended to have -installed are any of the packages which can accelerate md5's -operation, i.e. cryptkit, tcllibc, or -Trf.

    8. -
    9. Extended the critcl package with a new command -critcl::scan taking the path to a ".critcl" file, -statically scanning it, and returning license, version, a list of its -companion files, list of imported APIs, and list of -developer-specified custom configuration options. This data is the -foundation for the TEA wrapping described above.

      -

      Note that this is a static scan. While the other build -modes can (must) execute the ".critcl" file and make -platform-specific decisions regarding the assembled C code, companion -files, etc. the TEA wrap mode is not in a position to make -platform-specific decisions. It has to wrap everything which might -conceivably be needed when actually building. Hence the static scan. -This has however its own set of problems, namely the inability to -figure out any dynamic construction of companion file paths, at least -on its own. Thus:

    10. -
    11. Extended the API used by critcl-based packages with the command -critcl::owns. While this command is ignored by the regular build -modes the static scanner described above takes its arguments as the -names of companion files which have to be wrapped into the TEA package -and could not be figured by the scanner otherwise, like because of -dynamic paths to critcl::tsources, critcl::csources, -getting sourced directly, or simply being adjunct datafiles.

    12. -
    13. Extended the API used by critcl-based packages with the command -critcl::api for the management of stubs tables, be it their use, -and/or declaration and export.

      -

      Please see section Stubs Table Management of the -critcl package documentation for details.

    14. -
    15. Extended the API used by critcl-based packages with the command -critcl::userconfig for the management of developer-specified -custom configuration options, be it their use and/or declaration.

      -

      Please see section Custom Build Configuration of the -critcl package documentation for details.

    16. -
    17. Extended the API used by critcl-based packages with the -commands critcl::description, critcl::summary, -critcl::subject, critcl::meta, and -critcl::buildrequirement for the declaration of TEApot meta data -for/about the package.

      -

      Please see section Package Meta Data of the -critcl package documentation for details.

    18. +
    19. Fixed issue with package indices generated for Tcl 8.4. + Join the list of commands with semi-colon, not newline.

    20. +
    21. Fixed issue #26 which brought up use-cases I had forgotten to + consider while fixing bug #21 (see critcl 3.1.6).

    -

    Changes for version 3.0.1

    +

    Changes for version 3.1.7

      -
    1. Bugfixes all around. In detail:

    2. -
    3. Fixed recording of Tcl version requirements. Keep package name -and version together, unbreaking generated meta data and generated -package load command.

    4. -
    5. Fixed the build scripts: When installing, or wrapping for TEA, -generate any missing directories

    6. -
    7. Modified the build scripts to properly exit the application -when the window of their GUI is closed through the (X) button.

    8. -
    9. Removed an 8.5-ism (open wb) which had slipped into the main -build script.

    10. -
    11. Modified the example build scripts to separate the output for -the different examples (and packages) by adding empty lines.

    12. -
    13. stack::c example bugfix: Include API declarations for use in -the companion files.

    14. -
    15. Extended the documentation: Noted the need for a working -installation of a C compiler.

    16. -
    17. Extended the Windows target definitions and code to handle the -manifest files used by modern MS development environments. Note that -this code handles both possibilities, environment using manifests, and -(old(er)) environments without.

    18. -
    19. Extended the Windows 64bit target definitions and code to -auto-detect the need for the helper library "bufferoverflowU.lib" and -reconfigure the compile and link commands appropriately. We assume -that the library must be linked when present. This should be no harm -if the library is present, yet not needed. Just superfluous. We search -for the library in the paths specified by the environment variable -LIB.

    20. +
    21. Fixed issue #24. Extract and unconditionally display compiler + warnings found in the build log. Prevents users from missing + warnings which, while not causing the build to fail, may + still indicate problems.

    22. +
    23. New feature. Output hook. All non-messaging user output is now + routed through the command critcl::print, and users are + allowed to override it when using the critcl application-as-package.

    24. +
    25. New feature, by Ashok P. Nadkarni. Platform configurations can + inherit values from configurations defined before them.

    -

    Changes for version 3.0.2

    +

    Changes for version 3.1.6

      -
    1. Fixed issue in compile-and-run mode where commands put into the -auto_index are not found by Tcl's [unknown] command.

    2. -
    3. Fixed an array key mismatch breaking usage of client data and -delete function for procedure. Reported by Jos DeCoster, with patch.

    4. -
    5. Implemented a command line option -L, an equivalent of -option -I, just for library search paths.

    6. -
    7. Fixed github issues 5 and 8. Working around a missing variable -::errorInfo. It should always be present, however there seem to be -revisions of Tcl around which violate this assumption.

    8. +
    9. Fixed issue #21. While the multi-definition of the stub-table + pointer variables was ok with for all the C linkers seen so far + C++ linkers did not like this at all. Reworked the code to + ensure that this set of variables is generated only once, in + the wrapper around all the pieces to assemble.

    10. +
    11. Fixed issue #22, the handling of the command identifier + arguments of critcl::ccommand, critcl::cproc, and + critcl::cdata. We now properly allow any Tcl identifier + and generate proper internal C identifiers from them.

      +

      As part of this the signature of command critcl::name2c + changed. The command now delivers a list of four values instead + of three. The new value was added at the end.

      +

      Further adapted the implementation of package + critcl::class, a user of critcl::name2c. + This package is now at version 1.0.6 and requires critcl 3.1.6

      +

      Lastly fixed the mis-handling of option -cname in + critcl::ccommand, and critcl::cproc.

    12. +
    13. Fixed issue #23.

    -

    Changes for version 3.0.3

    +

    Changes for version 3.1.5

      -
    1. Fixed github issues 5 and 8, for the example build.tcl -scripts. Working around a missing variable ::errorInfo. It should -always be present, however there seem to be revisions of Tcl around -which violate this assumption.

    2. +
    3. Fixed issue #19. Made the regular expression extracting the + MSVC version number more general to make it work on german + language systems. This may have to be revisited in the future, + for other Windows locales.

    4. +
    5. Fixed issue #20. Made option -tea work on windows, at least in + a unix emulation environment like msys/mingw.

    -

    Changes for version 3.0.4

    +

    Changes for version 3.1.4

      -
    1. Fixed generation of the package's initname when the incoming - code is read from stdin and has no proper path.

    2. -
    3. Fixed github issue 11. Now using /LIBPATH instead of -L - on Windows (libinclude configuration setting).

    4. -
    5. Extended critcl to handle -l:path format of -l options. - GNU ld 2.22+ handles this by searching for the path as - is. Good when specifying static libraries, as plain -l looks - for shared libraries in preference over static. critcl handles - it now, as older GNU ld's do not understand it, nor the - various vendor-specific linkers.

    6. -
    7. Fixed github issue #12. Critcl now determines the version of - MSVC in use and uses it to switch between various link debug - options. Simplified the handling of bufferoverflowU.lib also, - making use of the same mechanism and collapsing the two - configurations sections we had back into one.

    8. -
    9. Reworked the insertion of #line pragmas into the generated C - code to avoid limitations on the line number argument imposed - by various compilers, and be more accurate.

    10. -
    11. Modified argument processing. Option -libdir now also - implies -L for its argument.

    12. -
    13. Extended handling of option -show (critcl::showconfig) - to list the path of the configuration file the data is coming - from. Good for debugging configuration processing.

    14. -
    15. Extended the build script with targets to regenerate the - embedded documentation, and diagrams, and to generate a - release.

    16. +
    17. Bugfix in package critcl::class. Generate a dummy + field in the class structure if the class has no class + variables. Without this change the structure would be empty, + and a number of compilers are not able to handle such a type.

    18. +
    19. Fixed a typo which broke the win64 configuration.

    20. +
    21. Fixed issue #16, a typo in the documentation of command + critcl::class.

    -

    Changes for version 3.0.5

    +

    Changes for version 3.1.3

      -
    1. Fixed bug in the new code for #line pragmas triggered when - specifying C code without leading whitespace.

    2. -
    3. Extended the documentation to have manpages for the license, - source retrieval, installer, and developer's guides.

    4. +
    5. Enhancement. In detail:

    6. +
    7. Added new argument type "pstring", for "Pascal String", a + counted string, i.e. a combination of string pointer and string + length.

    8. +
    9. Added new methods critcl::argtypesupport and + ::critcl::argsupport to define and use additional + supporting code for an argument type, here used by "pstring" + above to define the necessary structure.

    10. +
    11. Semi-bugfixes in the packages critcl::class and + critcl::iassoc. Pragmas for the AS meta data scanner + to ensure that the template files are made part of the package. + Versions bumped to 1.0.4 and 1.0.1 respectively.

    -

    Changes for version 3.0.6

    +

    Changes for version 3.1.2

      -
    1. Fixed github issue 10. The critcl application now delivers a - proper exit code (1) on build failure, instead of always - indicating success (status 0).

    2. -
    3. Fixed github issue 13. Handling of bufferoverflowU.lib for - release builds was inconsistent with handling for debug - builds. It is now identically handled (conditional) by - both cases.

    4. -
    5. Documentation cleanup, mainly in the installation guide, and - the README.md shown by github

    6. +
    7. Enhancement. In detail:

    8. +
    9. Extended critcl::cproc to be able to handle optional + arguments, in a limited way. This is automatically available to + critcl::class cproc-based methods as well.

    10. +
    11. Bugfix in lassign emulation for Tcl 8.4. Properly set + unused variables to the empty string. Bumped version of + emulation package lassign84 to 1.0.1.

    -

    Changes for version 3.0.7

    +

    Changes for version 3.1.1

      -
    1. Fixed the code generated by critcl::c++command. - The emitted code handed a non-static string table to - Tcl_GetIndexFromObj, in violation of the contract, which - requires the table to have a fixed address. This was a memory - smash waiting to happen. Thanks to Brian Griffin for alrerting - us to the general problem.

    2. +
    3. Bugfixes all around. In detail:

    4. +
    5. Fixed the generation of wrong#args errors for +critcl::cproc and derived code (critcl::class +cproc-based methods). Use NULL if there are no arguments, and +take the offset into account.

    6. +
    7. Fixed the handling of package names by +critcl::class. Forgot that they may contain namespace +separators. Bumped to version 1.0.1.

    8. +
    9. Extended a critcl::class generated error message in +instance creation for clarity. Bumped to version 1.0.2.

    -

    Changes for version 3.1

    +

    Changes for version 3.1

    1. Added a new higher-level package critcl::iassoc.

      This package simplifies the creation of code associating data @@ -806,139 +913,287 @@ details of the provided commands.

    -

    Changes for version 3.1.1

    +

    Changes for version 3.0.7

      -
    1. Bugfixes all around. In detail:

    2. -
    3. Fixed the generation of wrong#args errors for -critcl::cproc and derived code (critcl::class -cproc-based methods). Use NULL if there are no arguments, and -take the offset into account.

    4. -
    5. Fixed the handling of package names by -critcl::class. Forgot that they may contain namespace -separators. Bumped to version 1.0.1.

    6. -
    7. Extended a critcl::class generated error message in -instance creation for clarity. Bumped to version 1.0.2.

    8. +
    9. Fixed the code generated by critcl::c++command. + The emitted code handed a non-static string table to + Tcl_GetIndexFromObj, in violation of the contract, which + requires the table to have a fixed address. This was a memory + smash waiting to happen. Thanks to Brian Griffin for alrerting + us to the general problem.

    -

    Changes for version 3.1.2

    +

    Changes for version 3.0.6

      -
    1. Enhancement. In detail:

    2. -
    3. Extended critcl::cproc to be able to handle optional - arguments, in a limited way. This is automatically available to - critcl::class cproc-based methods as well.

    4. -
    5. Bugfix in lassign emulation for Tcl 8.4. Properly set - unused variables to the empty string. Bumped version of - emulation package lassign84 to 1.0.1.

    6. +
    7. Fixed github issue 10. The critcl application now delivers a + proper exit code (1) on build failure, instead of always + indicating success (status 0).

    8. +
    9. Fixed github issue 13. Handling of bufferoverflowU.lib for + release builds was inconsistent with handling for debug + builds. It is now identically handled (conditional) by + both cases.

    10. +
    11. Documentation cleanup, mainly in the installation guide, and + the README.md shown by github

    -

    Changes for version 3.1.3

    +

    Changes for version 3.0.5

      -
    1. Enhancement. In detail:

    2. -
    3. Added new argument type "pstring", for "Pascal String", a - counted string, i.e. a combination of string pointer and string - length.

    4. -
    5. Added new methods critcl::argtypesupport and - ::critcl::argsupport to define and use additional - supporting code for an argument type, here used by "pstring" - above to define the necessary structure.

    6. -
    7. Semi-bugfixes in the packages critcl::class and - critcl::iassoc. Pragmas for the AS meta data scanner - to ensure that the template files are made part of the package. - Versions bumped to 1.0.4 and 1.0.1 respectively.

    8. +
    9. Fixed bug in the new code for #line pragmas triggered when + specifying C code without leading whitespace.

    10. +
    11. Extended the documentation to have manpages for the license, + source retrieval, installer, and developer's guides.

    -

    Changes for version 3.1.4

    +

    Changes for version 3.0.4

      -
    1. Bugfix in package critcl::class. Generate a dummy - field in the class structure if the class has no class - variables. Without this change the structure would be empty, - and a number of compilers are not able to handle such a type.

    2. -
    3. Fixed a typo which broke the win64 configuration.

    4. -
    5. Fixed issue #16, a typo in the documentation of command - critcl::class.

    6. +
    7. Fixed generation of the package's initname when the incoming + code is read from stdin and has no proper path.

    8. +
    9. Fixed github issue 11. Now using /LIBPATH instead of -L + on Windows (libinclude configuration setting).

    10. +
    11. Extended critcl to handle -l:path format of -l options. + GNU ld 2.22+ handles this by searching for the path as + is. Good when specifying static libraries, as plain -l looks + for shared libraries in preference over static. critcl handles + it now, as older GNU ld's do not understand it, nor the + various vendor-specific linkers.

    12. +
    13. Fixed github issue #12. Critcl now determines the version of + MSVC in use and uses it to switch between various link debug + options. Simplified the handling of bufferoverflowU.lib also, + making use of the same mechanism and collapsing the two + configurations sections we had back into one.

    14. +
    15. Reworked the insertion of #line pragmas into the generated C + code to avoid limitations on the line number argument imposed + by various compilers, and be more accurate.

    16. +
    17. Modified argument processing. Option -libdir now also + implies -L for its argument.

    18. +
    19. Extended handling of option -show (critcl::showconfig) + to list the path of the configuration file the data is coming + from. Good for debugging configuration processing.

    20. +
    21. Extended the build script with targets to regenerate the + embedded documentation, and diagrams, and to generate a + release.

    -

    Changes for version 3.1.5

    +

    Changes for version 3.0.3

      -
    1. Fixed issue #19. Made the regular expression extracting the - MSVC version number more general to make it work on german - language systems. This may have to be revisited in the future, - for other Windows locales.

    2. -
    3. Fixed issue #20. Made option -tea work on windows, at least in - a unix emulation environment like msys/mingw.

    4. +
    5. Fixed github issues 5 and 8, for the example build.tcl +scripts. Working around a missing variable ::errorInfo. It should +always be present, however there seem to be revisions of Tcl around +which violate this assumption.

    -

    Changes for version 3.1.6

    +

    Changes for version 3.0.2

      -
    1. Fixed issue #21. While the multi-definition of the stub-table - pointer variables was ok with for all the C linkers seen so far - C++ linkers did not like this at all. Reworked the code to - ensure that this set of variables is generated only once, in - the wrapper around all the pieces to assemble.

    2. -
    3. Fixed issue #22, the handling of the command identifier - arguments of critcl::ccommand, critcl::cproc, and - critcl::cdata. We now properly allow any Tcl identifier - and generate proper internal C identifiers from them.

      -

      As part of this the signature of command critcl::name2c - changed. The command now delivers a list of four values instead - of three. The new value was added at the end.

      -

      Further adapted the implementation of package - critcl::class, a user of critcl::name2c. - This package is now at version 1.0.6 and requires critcl 3.1.6

      -

      Lastly fixed the mis-handling of option -cname in - critcl::ccommand, and critcl::cproc.

    4. -
    5. Fixed issue #23.

    6. +
    7. Fixed issue in compile-and-run mode where commands put into the +auto_index are not found by Tcl's [unknown] command.

    8. +
    9. Fixed an array key mismatch breaking usage of client data and +delete function for procedure. Reported by Jos DeCoster, with patch.

    10. +
    11. Implemented a command line option -L, an equivalent of +option -I, just for library search paths.

    12. +
    13. Fixed github issues 5 and 8. Working around a missing variable +::errorInfo. It should always be present, however there seem to be +revisions of Tcl around which violate this assumption.

    -

    Changes for version 3.1.7

    +

    Changes for version 3.0.1

      -
    1. Fixed issue #24. Extract and unconditionally display compiler - warnings found in the build log. Prevents users from missing - warnings which, while not causing the build to fail, may - still indicate problems.

    2. -
    3. New feature. Output hook. All non-messaging user output is now - routed through the command critcl::print, and users are - allowed to override it when using the critcl application-as-package.

    4. -
    5. New feature, by Ashok P. Nadkarni. Platform configurations can - inherit values from configurations defined before them.

    6. +
    7. Bugfixes all around. In detail:

    8. +
    9. Fixed recording of Tcl version requirements. Keep package name +and version together, unbreaking generated meta data and generated +package load command.

    10. +
    11. Fixed the build scripts: When installing, or wrapping for TEA, +generate any missing directories

    12. +
    13. Modified the build scripts to properly exit the application +when the window of their GUI is closed through the (X) button.

    14. +
    15. Removed an 8.5-ism (open wb) which had slipped into the main +build script.

    16. +
    17. Modified the example build scripts to separate the output for +the different examples (and packages) by adding empty lines.

    18. +
    19. stack::c example bugfix: Include API declarations for use in +the companion files.

    20. +
    21. Extended the documentation: Noted the need for a working +installation of a C compiler.

    22. +
    23. Extended the Windows target definitions and code to handle the +manifest files used by modern MS development environments. Note that +this code handles both possibilities, environment using manifests, and +(old(er)) environments without.

    24. +
    25. Extended the Windows 64bit target definitions and code to +auto-detect the need for the helper library "bufferoverflowU.lib" and +reconfigure the compile and link commands appropriately. We assume +that the library must be linked when present. This should be no harm +if the library is present, yet not needed. Just superfluous. We search +for the library in the paths specified by the environment variable +LIB.

    -

    Changes for version 3.1.8

    +

    Changes for version 3

      -
    1. Fixed issue with package indices generated for Tcl 8.4. - Join the list of commands with semi-colon, not newline.

    2. -
    3. Fixed issue #26 which brought up use-cases I had forgotten to - consider while fixing bug #21 (see critcl 3.1.6).

    4. +
    5. The command critcl::platform was deprecated in version +2.1, superceded by critcl::targetplatform, yet kept for +compatibility. Now it has been removed.

    6. +
    7. The command critcl::compiled was kept with in version 2.1 +with semantics in contradiction to its, for compatibility. This +contradiction has been removed, changing the visible semantics of the +command to be in line with its name.

    8. +
    9. The change to version 3 became necessary because of the two +incompatible visible changes above.

    10. +
    11. Extended the application package with code handling a new +option -tea. Specifying this option invokes a special mode +where critcl generates a TEA package, i.e. wraps the input into a +directory hierarchy and support files which provide it TEA-lookalike +buildsystem.

      +

      This new option, and -pkg, exclude each other. If +both are specified the last used option takes precedence.

      +

      The generated package directory hierarchy is mostly +self-contained, but not fully. It requires not only a working +installation of Tcl, but also working installations of the packages +md5 and cmdline. Both of these are provided by the +Tcllib bundle. Not required, but recommended to have +installed are any of the packages which can accelerate md5's +operation, i.e. cryptkit, tcllibc, or +Trf.

    12. +
    13. Extended the critcl package with a new command +critcl::scan taking the path to a ".critcl" file, +statically scanning it, and returning license, version, a list of its +companion files, list of imported APIs, and list of +developer-specified custom configuration options. This data is the +foundation for the TEA wrapping described above.

      +

      Note that this is a static scan. While the other build +modes can (must) execute the ".critcl" file and make +platform-specific decisions regarding the assembled C code, companion +files, etc. the TEA wrap mode is not in a position to make +platform-specific decisions. It has to wrap everything which might +conceivably be needed when actually building. Hence the static scan. +This has however its own set of problems, namely the inability to +figure out any dynamic construction of companion file paths, at least +on its own. Thus:

    14. +
    15. Extended the API used by critcl-based packages with the command +critcl::owns. While this command is ignored by the regular build +modes the static scanner described above takes its arguments as the +names of companion files which have to be wrapped into the TEA package +and could not be figured by the scanner otherwise, like because of +dynamic paths to critcl::tsources, critcl::csources, +getting sourced directly, or simply being adjunct datafiles.

    16. +
    17. Extended the API used by critcl-based packages with the command +critcl::api for the management of stubs tables, be it their use, +and/or declaration and export.

      +

      Please see section Stubs Table Management of the +critcl package documentation for details.

    18. +
    19. Extended the API used by critcl-based packages with the command +critcl::userconfig for the management of developer-specified +custom configuration options, be it their use and/or declaration.

      +

      Please see section Custom Build Configuration of the +critcl package documentation for details.

    20. +
    21. Extended the API used by critcl-based packages with the +commands critcl::description, critcl::summary, +critcl::subject, critcl::meta, and +critcl::buildrequirement for the declaration of TEApot meta data +for/about the package.

      +

      Please see section Package Meta Data of the +critcl package documentation for details.

    -

    Changes for version 3.1.9

    +

    Changes for version 2.1

      -
    1. Fixed issue #27. Added missing platform definitions for - various alternate linux and OS X targets.

    2. -
    3. Fixed issue #28. Added missing -mXX flags for linking at the - linux-{32,64}-* targets.

    4. -
    5. Fixed issue #29. Replaced the use of raw "cheaders" - information in the processing of "cdefines" with the proper - include directives derived from it.

    6. -
    7. Fixed the issue behind rejected pull request #30 by Andrew - Shadura. Dynamically extract the stubs variable declarations - from the Tcl header files and generate matching variable - definitions for use in the package code. The generated code - will now be always consistent with the headers, even when - critcl's own copy of them is replaced by system headers.

    8. -
    9. Fixed issue #31. Accepted patch by Andrew Shadura, with - changes (comments), for easier integration of critcl with - OS package systems, replacing critcl's copies of Tcl headers - with their own.

    10. -
    11. Fixed issue #32. Merged pull request by Andrew Shadura. - Various typos in documentation and comments.

    12. -
    13. Fixed issue #33. Handle files starting with a dot better.

    14. +
    15. Fixed bug where critcl::tsources interpreted relative +paths as relative to the current working directory instead of +relative to the ".critcl" file using the command, as all other +commands of this type do.

    16. +
    17. Fixed internals, preventing information collected for multiple +".critcl" files to leak between them. Notably, critcl::tk +is not a global configuration option anymore.

    18. +
    19. Fixed the command critcl::license to be a null-operation +in mode "compile & run", instead of throwing an error.

    20. +
    21. Fixed the critcl application's interference with the "compile & +run" result cache in -pkg mode by having it use a wholly +separate (and by default transient) directory for that mode.

    22. +
    23. Fixed bug where changes to a ".critcl" file did not result +in a rebuild for mode "compile & run". All relevant API commands now +ensure UUID changes.

    24. +
    25. Fixed bug in the backend handling of critcl::debug where +the companion c-sources of a ".critcl" file were not compiled +with debug options, although the ".critcl" file was.

    26. +
    27. Fixed bug in critcl::debug which prevented recognition of +mode "all" when it was not the first argument to the command.

    28. +
    29. Fixed bug in "preload.c" preventing its compilation on +non-windows platforms.

    30. +
    31. Fixed long-standing bug in the handling of namespace qualifiers +in the command name argument of critcl::cproc and +critcl::ccommand. It is now possible to specify a fully +qualified command name without issues.

    32. +
    33. Extended/reworked critcl::tsources to be the canonical +way of declaring ".tcl" companion files even for mode "compile & +run".

    34. +
    35. Extended/reworked critcl::tsources to allow the use of a +".critcl" file as its own Tcl companion file.

    36. +
    37. Extended critcl::framework to internally check for OS X +build target, and to ignore the declaration if its not.

    38. +
    39. Extended critcl::failed to be callable more than once in +a ".critcl" file. The first call forces the build, if it was not +done already, to get the result. Further calls return the cached +result of the first call.

    40. +
    41. Extended the handling of environment variable CC in the code +determining the compiler to use to deal with (i.e. remove) paths to +the compiler, compiler file extensions, and compiler options specified +after the compiler itself, leaving only the bare name of the compiler.

    42. +
    43. Extended the code handling the search for preloaded libraries +to print the paths it searched, making debugging of a search failure +easier.

    44. +
    45. A new command critcl::tcl can be used to declare the +version of Tcl minimally needed to build and run the ".critcl" +file and package. Defaults to 8.4 if not declared. Extended critcl to +have the stubs and headers for all of Tcl 8.4, 8.5, and 8.6.

    46. +
    47. A new command critcl::load forces the build and load of a +".critcl" file. This is the official way for overriding critcl's +default lazy-build-&-load-on-demand scheme for mode "compile & run".

      +

      Note that after using critcl::load / +critcl::failed in a ".critcl" file it is not possible to +use critcl commands in that file anymore. Doing so will throw an +error.

    48. +
    49. Extended the generation of '#line' pragmas to use +info frame (if available) to provide the C compiler with exact +line numbers into the ".critcl" file for the reporting of +warnings and errors.

    50. +
    51. Extended critcl::check with logging to help with +debugging build-time checks of the environment, plus an additional +optional argument to provide labeling.

    52. +
    53. Added a new command critcl::checklink which not only +tries to check the environment via compiling the code, but also +its linkability.

    54. +
    55. Added a new command critcl::msg for messaging, like +command critcl::error is for error reporting. Likewise this is a +hook a user of the package is allowed to override. The default +implementation, used by mode compile & run does nothing. The +implementation for mode generate package prints the message +to stdout.

      +

      Envisioned use is for the reporting of results determined by +critcl::check and critcl::checklink during building, to +help with debugging when something goes wrong with a check.

    56. +
    57. Exposed the argument processing internals of critcl::proc +for use by advanced users. The new commands are

      +
        +
      1. critcl::argnames

      2. +
      3. critcl::argcnames

      4. +
      5. critcl::argcsignature

      6. +
      7. critcl::argvardecls

      8. +
      9. critcl::argconversion

      10. +
      +

      Please see section Advanced Embedded C Code of the +critcl package documentation for details.

    58. +
    59. Extended the critcl package to intercept package +provide and record the file -> package name mapping. Plus other +internal changes now allow the use of namespaced package names while +still using proper path names and init function.

    60. +
    61. Dropped the unused commands critcl::optimize and +critcl::include.

    62. +
    63. Dropped -lib mode from the critcl application.

    64. +
    65. Dropped remnants of support for Tcl 8.3 and before.

    -

    Authors

    +

    Authors

    Jean Claude Wippler, Steve Landers, Andreas Kupries

    -

    Bugs, Ideas, Feedback

    +

    Bugs, Ideas, Feedback

    This document, and the package it describes, will undoubtedly contain bugs and other problems. Please report them at https://github.com/andreas-kupries/critcl/issues. @@ -955,6 +1210,6 @@

    diff -Nru critcl-3.1.9/embedded/www/files/critcl_apppkg.html critcl-3.1.17+dfsg/embedded/www/files/critcl_apppkg.html --- critcl-3.1.9/embedded/www/files/critcl_apppkg.html 2013-05-10 05:57:04.000000000 +0000 +++ critcl-3.1.17+dfsg/embedded/www/files/critcl_apppkg.html 2017-10-14 02:48:11.000000000 +0000 @@ -92,18 +92,18 @@ } --> - -

    [ - Table Of Contents + Table Of Contents | Keyword Index -]
    -

    critcl::app(n) 3.1.8 doc "C Runtime In Tcl (CriTcl)"

    + ]
    +

    critcl::app(n) 3.1.17 doc "C Runtime In Tcl (CriTcl)"

    Name

    critcl::app - Critcl - Application Package Reference

    @@ -116,27 +116,35 @@
  • Options
  • Modes Of Operation/Use
  • Package Structure
  • -
  • Changes for version 2.1
  • -
  • Changes for version 3
  • -
  • Changes for version 3.0.1
  • -
  • Changes for version 3.0.2
  • -
  • Changes for version 3.0.3
  • -
  • Changes for version 3.0.4
  • -
  • Changes for version 3.0.5
  • -
  • Changes for version 3.0.6
  • -
  • Changes for version 3.0.7
  • -
  • Changes for version 3.1
  • -
  • Changes for version 3.1.1
  • -
  • Changes for version 3.1.2
  • -
  • Changes for version 3.1.3
  • +
  • Changes for version 3.1.17
  • +
  • Changes for version 3.1.16
  • +
  • Changes for version 3.1.15
  • +
  • Changes for version 3.1.14
  • +
  • Changes for version 3.1.13
  • +
  • Changes for version 3.1.12
  • +
  • Changes for version 3.1.11
  • +
  • Changes for version 3.1.10
  • +
  • Changes for version 3.1.9
  • +
  • Changes for version 3.1.8
  • +
  • Changes for version 3.1.7
  • +
  • Changes for version 3.1.6
  • +
  • Changes for version 3.1.5
  • Changes for version 3.1.4
  • -
  • Changes for version 3.1.5
  • -
  • Changes for version 3.1.6
  • -
  • Changes for version 3.1.7
  • -
  • Changes for version 3.1.8
  • -
  • Changes for version 3.1.9
  • -
  • Authors
  • -
  • Bugs, Ideas, Feedback
  • +
  • Changes for version 3.1.3
  • +
  • Changes for version 3.1.2
  • +
  • Changes for version 3.1.1
  • +
  • Changes for version 3.1
  • +
  • Changes for version 3.0.7
  • +
  • Changes for version 3.0.6
  • +
  • Changes for version 3.0.5
  • +
  • Changes for version 3.0.4
  • +
  • Changes for version 3.0.3
  • +
  • Changes for version 3.0.2
  • +
  • Changes for version 3.0.1
  • +
  • Changes for version 3
  • +
  • Changes for version 2.1
  • +
  • Authors
  • +
  • Bugs, Ideas, Feedback
  • Keywords
  • Category
  • Copyright
  • @@ -146,7 +154,7 @@
    • package require Tcl 8.4
    • -
    • package require critcl::app ?3.1.8?
    • +
    • package require critcl::app ?3.1.17?
    • package require critcl ?2?
    • package require platform ?1.0.2?
    • package require cmdline
    • @@ -514,285 +522,384 @@ +- <platformN> +- <shared libraryN> +

      The latest changes are found at the top.

    -

    Changes for version 2.1

    +

    Changes for version 3.1.17

      -
    1. Fixed bug where critcl::tsources interpreted relative -paths as relative to the current working directory instead of -relative to the ".critcl" file using the command, as all other -commands of this type do.

    2. -
    3. Fixed internals, preventing information collected for multiple -".critcl" files to leak between them. Notably, critcl::tk -is not a global configuration option anymore.

    4. -
    5. Fixed the command critcl::license to be a null-operation -in mode "compile & run", instead of throwing an error.

    6. -
    7. Fixed the critcl application's interference with the "compile & -run" result cache in -pkg mode by having it use a wholly -separate (and by default transient) directory for that mode.

    8. -
    9. Fixed bug where changes to a ".critcl" file did not result -in a rebuild for mode "compile & run". All relevant API commands now -ensure UUID changes.

    10. -
    11. Fixed bug in the backend handling of critcl::debug where -the companion c-sources of a ".critcl" file were not compiled -with debug options, although the ".critcl" file was.

    12. -
    13. Fixed bug in critcl::debug which prevented recognition of -mode "all" when it was not the first argument to the command.

    14. -
    15. Fixed bug in "preload.c" preventing its compilation on -non-windows platforms.

    16. -
    17. Fixed long-standing bug in the handling of namespace qualifiers -in the command name argument of critcl::cproc and -critcl::ccommand. It is now possible to specify a fully -qualified command name without issues.

    18. -
    19. Extended/reworked critcl::tsources to be the canonical -way of declaring ".tcl" companion files even for mode "compile & -run".

    20. -
    21. Extended/reworked critcl::tsources to allow the use of a -".critcl" file as its own Tcl companion file.

    22. -
    23. Extended critcl::framework to internally check for OS X -build target, and to ignore the declaration if its not.

    24. -
    25. Extended critcl::failed to be callable more than once in -a ".critcl" file. The first call forces the build, if it was not -done already, to get the result. Further calls return the cached -result of the first call.

    26. -
    27. Extended the handling of environment variable CC in the code -determining the compiler to use to deal with (i.e. remove) paths to -the compiler, compiler file extensions, and compiler options specified -after the compiler itself, leaving only the bare name of the compiler.

    28. -
    29. Extended the code handling the search for preloaded libraries -to print the paths it searched, making debugging of a search failure -easier.

    30. -
    31. A new command critcl::tcl can be used to declare the -version of Tcl minimally needed to build and run the ".critcl" -file and package. Defaults to 8.4 if not declared. Extended critcl to -have the stubs and headers for all of Tcl 8.4, 8.5, and 8.6.

    32. -
    33. A new command critcl::load forces the build and load of a -".critcl" file. This is the official way for overriding critcl's -default lazy-build-&-load-on-demand scheme for mode "compile & run".

      -

      Note that after using critcl::load / -critcl::failed in a ".critcl" file it is not possible to -use critcl commands in that file anymore. Doing so will throw an -error.

    34. -
    35. Extended the generation of '#line' pragmas to use -info frame (if available) to provide the C compiler with exact -line numbers into the ".critcl" file for the reporting of -warnings and errors.

    36. -
    37. Extended critcl::check with logging to help with -debugging build-time checks of the environment, plus an additional -optional argument to provide labeling.

    38. -
    39. Added a new command critcl::checklink which not only -tries to check the environment via compiling the code, but also -its linkability.

    40. -
    41. Added a new command critcl::msg for messaging, like -command critcl::error is for error reporting. Likewise this is a -hook a user of the package is allowed to override. The default -implementation, used by mode compile & run does nothing. The -implementation for mode generate package prints the message -to stdout.

      -

      Envisioned use is for the reporting of results determined by -critcl::check and critcl::checklink during building, to -help with debugging when something goes wrong with a check.

    42. -
    43. Exposed the argument processing internals of critcl::proc -for use by advanced users. The new commands are

      -
        -
      1. critcl::argnames

      2. -
      3. critcl::argcnames

      4. -
      5. critcl::argcsignature

      6. -
      7. critcl::argvardecls

      8. -
      9. critcl::argconversion

      10. +
      11. Extension: Allow duplicate arg- and result-type definitions if + they are fully identical.

      12. +
      13. Bugfix. The application mishandled the possibility of + identical-named critcl::tsources. Possible because + critcl::tsources can be in subdirectories, a structure + which is not retained in the assembled package, causing + such files to overwrite each other and at least one lost. Fixed + by adding a serial number to the file names in the assembled + package.

      14. +
      15. Bugfix in the static scanner which made it loose requirement + information. Further added code to generally cleanup results at + the end (removal of duplicates, mainly).

      16. +
      17. Bugfix: Fixed issue #76. + Support installation directories which are not in the auto_path. + Without the patch the installed critcl will not find its + own packages and fail. Thank you to + Simon Bachmann for the + report and patch, and then his patience with me to getting to + actually apply it.

      18. +
      19. Bugfix: Fixed issue #75. + Extended critcl::include to now take multiple paths.

      20. +
      21. Added new compatibility package lmap84.

      22. +
      23. Fixed typos in various documentation files.

      24. +
      25. Fixed bug introduced by commit 86f415dd30 (3.1.16 release). The + separation of critcl::ccode into user and work layers + means that location retrieval has to go one more level up to + find the user location.

      26. +
      27. New supporting package critcl::cutil. Provides common + C level facilities useful to packages (assertions, tracing, + memory allocation shorthands).

      28. +
      29. Modified package critcl to make use of the new + tracing facilities to provide tracing of arguments and results + for critcl::ccommand and critcl::cproc invokations.

      30. +
      31. Modified packages critcl and critcl::class + to provide better function names for (class) method tracing. + Bumped package critcl::class to version 1.0.7.

      32. +
      33. Extended the support package critcl::literals with + limited configurability. It is now able to generate code for + C-level access to the pool without Tcl types (Mode c). + The previously existing functionality is accesssible under mode + tcl, which also is the default. Both modes can be used + together.

      34. +
      35. Extended the support package critcl::emap with + limited configurability. It is now able to generate code for + C-level access to the mapping without Tcl types + (Mode c). The previously existing functionality is + accessible under mode tcl, which also is the + default. Both modes can be used together.

      36. +
      +
    +

    Changes for version 3.1.16

    +
      +
    1. New feature. Extended critcl::cproc's argument handling + to allow arbitrary mixing of required and optional arguments.

    2. +
    3. New feature. + Potential Incompatibility.

      +

      Extended critcl::cproc's argument handling to treat an + argument args as variadic if it is the last argument of + the procedure.

    4. +
    5. New feature. Added two introspection commands, + critcl::has-argtype and critcl::has-resulttype. + These enable a user to test if a specific (named) type + conversion is implemented or not.

    6. +
    7. Added new result type Tcl_Obj*0, with alias + object0. The difference to Tcl_Obj* is in + the reference counting.

    8. +
    9. Extended the command critcl::argtypesupport with new + optional argument through which to explicitly specify the + identifier for guarding against multiple definitions.

    10. +
    11. Bugfix: Fixed problem with the implementation of issue #54 (See + 3.1.14). Always create the secondary log file. Otherwise + end-of-log handling may break, unconditionally assuming its + existence.

    12. +
    13. Bugfix: Fixed problem with the internal change to the hook + HandleDeclAfterBuild. Corrected the forgotten + critcl::cconst.

    14. +
    15. Debugging aid: Added comment holding the name of the result + type when emitting result conversions.

    16. +
    17. Bugfix: Fixed issue #60. Unbundled the package directories + containing multiple packages. All directories under "lib/" + now contain exactly one package.

    18. +
    19. Bugfix: Fixed issue #62, a few dict exists commands + operating on a fixed string instead of a variable.

    20. +
    21. Bugfix: Fixed issue #56. Release builders are reminded to run + the tests.

    22. +
    23. Bugfix: Fixed issue #55. For FreeBSD critcl's platform package + now identifies the Kernel ABI version. Initialization of the + cache directory now also uses platform::identify for the + default path, instead of platform::generic.

    24. +
    25. Bugfix: Fixed issue #58. Simplified the setup and use of + md5. Critcl now makes use of its own package for md5, using + itself to built it. There is no chicken/egg problem with this + as the -pkg mode used for this does not use md5. That + is limited to mode compile & run.

    26. +
    +
    +

    Changes for version 3.1.15

    +
      +
    1. Fixed version number bogosity with 3.1.14.

    2. +
    +
    +

    Changes for version 3.1.14

    +
      +
    1. Fixed issue #36. Added message to target all of the + Makefile generated for TEA mode. Additionally tweaked other + parts of the output to be less noisy.

    2. +
    3. Accepted request implied in issue #54. Unconditionally save + the compiler/linker build log into key log of the + dictionary returned by cresults, and save a copy of only + the execution output in the new key exl ("execution + log").

    4. +
    5. Fixed issue #53. Clarified the documentation of commands + critcl::load and critcl::failed with regard + to their results and the throwing of errors (does not happen).

    6. +
    7. Fixed issue #48. Modified mode "compile & run" to allow new + declarations in a file, after it was build, instead of + erroring out. The new decls are build when needed. Mode + "precompile" is unchanged and will continue to trap the + situation.

    8. +
    9. Fixed issue #52. Updated the local Tcl/Tk headers to + 8.4.20, 8.5.13, and 8.6.4.

    10. +
    11. Fixed issue #45. New feature command critcl::cconst.

    12. +
    13. critcl::util: New command locate to find a + file across a set of paths, and report an error when not + found. This is for use in autoconf-like header-searches and + similar configuration tests.

    14. +
    15. Modified 'AbortWhenCalledAfterBuild' to dump the entire stack + (info frame!). This should make it easier to determine the + location of the troubling declaration.

    16. +
    +
    +

    Changes for version 3.1.13

    +
      +
    1. Merged PR #43. Fixed bug loading adjunct Tcl sources.

    2. +
    3. Fixes in documentation and generated code of package + "critcl::enum". Bumped to version 1.0.1.

    4. +
    5. Fixes in documentation of package "critcl::bitmap".

    6. +
    7. New package "critcl::emap". In essence a variant or cross of + "critcl::bitmap" with behaviour like "critcl::enum".

    8. +
    9. Merged PR #49. Fixed documentation typo.

    10. +
    11. Merged PR #46. Fixed documentation typo.

    12. +
    13. Merged PR #47. Fixes to test results to match the accumulated + code changes. Also made portable across Tcl versions (varying + error syntax).

    14. +
    15. New predefined argument- and result-type "wideint" mapping to + Tcl_WideInt.

    16. +
    17. New predefined argument-type "bytes" mapping to tuple of + byte-array data and length. Note: The existing "bytearray" + type (and its aliases) was left untouched, to keep backward + compatibility.

    18. +
    19. Modified the internal interface between the Tcl shim and C + function underneath "critcl::cproc" with respect to the + handling of optional arguments. + An optional argument "X" now induces the use of two C + arguments, "X" and "has_X". The new argument "has_X" is of + boolean (int) type. It is set to true when X is set, and set + to false when X has the default value. C code which cares + about knowing if the argument is default or not is now able to + check that quickly, without having to code the default value + inside. + + NOTE: This change is visible in the output of the advanced + commands "argcnames", "argcsignature", "argvardecls", + and "argconversion".

    20. +
    21. Fixed issue #50 and documented the availability of variable + "interp" (type Tcl_Interp*) within "critcl::cinit" C code + fragments. + Note that while the old, undocumented name of the variable, + "ip", is still usable, it is deprecated. It will be fully + removed in two releases, i.e. for release 3.1.15. + The variable name was changed to be consistent with other code + environments.

    22. +
    23. Fixed issue #51. Disabled the generation of #line directives + for "critcl::config lines 0" coming from template files, or + code generated with them before the final value of this + setting was known.

    24. +
    25. Fixed issue with handling of namespaced package names in + "critcl::iassoc". Equivalent to a bug in "critcl::class" fixed + for critcl 3.1.1, critcl::class 1.0.1. + Note: "literals", "enum", "emap", and "bitmap" do not require + a fix as they are all built on top of "iassoc".

    26. +
    +
    +

    Changes for version 3.1.12

    +
      +
    1. Fixed issue 42. Clear ::errorInfo immediately after startup to + prevent leakage of irrelevant (caught) errors into our script + and confusing the usage code.

    2. +
    3. Fixed issue 40. Keep the order of libraries, and allow + duplicates. Both are things which are occasionally required for + proper linking.

    4. +
    5. Extended the utility package critcl::literals to + declare a cproc result-type for a pool.

      +

      Further fixed the generated header to handle multiple inclusion.

      +

      Bumped version to 1.1.

    6. +
    7. Fixed issue with utility package critcl::bitmap.

      +

      Fixed the generated header to handle multiple inclusion.

      +

      Bumped version to 1.0.1.

    8. +
    9. Created new utility package critcl::enum for the + quick and easy setup and use of mappings between C values + and Tcl strings. + Built on top of critcl::literals.

    10. +
    11. Added examples demonstrating the use of the utility packages + critcl::literals, + critcl::bitmap, and + critcl::enum

    12. +
    +
    +

    Changes for version 3.1.11

    +
      +
    1. Fixed issue #37, via pull request #38, with thanks to + Jos DeCoster. Information was stored into the v::delproc + and v::clientdata arrays using a different key than when + retrieving the same information, thus failing the latter.

    2. +
    3. New convenience command critcl::include for easy + inclusion of headers and other C files.

    4. +
    5. New command critcl::make to generate a local header of + other C files for use by other parts of a package through + inclusion.

    6. +
    7. New utility package critcl::literals for quick and + easy setup of and access to pools of fixed Tcl_Obj* strings. + Built on top of critcl::iassoc.

    8. +
    9. New utility package critcl::bitmap for quick and easy + setup and use of mappings between C bitsets and Tcl lists whose + string elements represent that set. + Built on top of critcl::iassoc.

    10. +
    +
    +

    Changes for version 3.1.10

    +
      +
    1. Fixed code version numbering forgotten with 3.1.9.

    2. +
    3. Fixed issue #35. In package mode (-pkg) the object cache + directory is unique to the process, thus we do not need + content-hashing to generate unique file names. A simple + counter is sufficient and much faster.

      +

      Note that mode "compile & run" is not as blessed and still + uses content-hasing with md5 to ensure unique file names + in its per-user object cache.

    4. +
    5. Fixed issue where the ccommand forgot to use its body as + input for the UUID generation. Thus ignoring changes to it in + mode compile & run, and not rebuilding a library for changed + sources. Bug and fix reported by Peter Spjuth.

    -

    Please see section Advanced Embedded C Code of the -critcl package documentation for details.

    -
  • Extended the critcl package to intercept package -provide and record the file -> package name mapping. Plus other -internal changes now allow the use of namespaced package names while -still using proper path names and init function.

  • -
  • Dropped the unused commands critcl::optimize and -critcl::include.

  • -
  • Dropped -lib mode from the critcl application.

  • -
  • Dropped remnants of support for Tcl 8.3 and before.

  • +
    +

    Changes for version 3.1.9

    +
      +
    1. Fixed issue #27. Added missing platform definitions for + various alternate linux and OS X targets.

    2. +
    3. Fixed issue #28. Added missing -mXX flags for linking at the + linux-{32,64}-* targets.

    4. +
    5. Fixed issue #29. Replaced the use of raw "cheaders" + information in the processing of "cdefines" with the proper + include directives derived from it.

    6. +
    7. Fixed the issue behind rejected pull request #30 by Andrew + Shadura. Dynamically extract the stubs variable declarations + from the Tcl header files and generate matching variable + definitions for use in the package code. The generated code + will now be always consistent with the headers, even when + critcl's own copy of them is replaced by system headers.

    8. +
    9. Fixed issue #31. Accepted patch by Andrew Shadura, with + changes (comments), for easier integration of critcl with + OS package systems, replacing critcl's copies of Tcl headers + with their own.

    10. +
    11. Fixed issue #32. Merged pull request by Andrew Shadura. + Various typos in documentation and comments.

    12. +
    13. Fixed issue #34. Handle files starting with a dot better.

    -

    Changes for version 3

    +

    Changes for version 3.1.8

      -
    1. The command critcl::platform was deprecated in version -2.1, superceded by critcl::targetplatform, yet kept for -compatibility. Now it has been removed.

    2. -
    3. The command critcl::compiled was kept with in version 2.1 -with semantics in contradiction to its, for compatibility. This -contradiction has been removed, changing the visible semantics of the -command to be in line with its name.

    4. -
    5. The change to version 3 became necessary because of the two -incompatible visible changes above.

    6. -
    7. Extended the application package with code handling a new -option -tea. Specifying this option invokes a special mode -where critcl generates a TEA package, i.e. wraps the input into a -directory hierarchy and support files which provide it TEA-lookalike -buildsystem.

      -

      This new option, and -pkg, exclude each other. If -both are specified the last used option takes precedence.

      -

      The generated package directory hierarchy is mostly -self-contained, but not fully. It requires not only a working -installation of Tcl, but also working installations of the packages -md5 and cmdline. Both of these are provided by the -Tcllib bundle. Not required, but recommended to have -installed are any of the packages which can accelerate md5's -operation, i.e. cryptkit, tcllibc, or -Trf.

    8. -
    9. Extended the critcl package with a new command -critcl::scan taking the path to a ".critcl" file, -statically scanning it, and returning license, version, a list of its -companion files, list of imported APIs, and list of -developer-specified custom configuration options. This data is the -foundation for the TEA wrapping described above.

      -

      Note that this is a static scan. While the other build -modes can (must) execute the ".critcl" file and make -platform-specific decisions regarding the assembled C code, companion -files, etc. the TEA wrap mode is not in a position to make -platform-specific decisions. It has to wrap everything which might -conceivably be needed when actually building. Hence the static scan. -This has however its own set of problems, namely the inability to -figure out any dynamic construction of companion file paths, at least -on its own. Thus:

    10. -
    11. Extended the API used by critcl-based packages with the command -critcl::owns. While this command is ignored by the regular build -modes the static scanner described above takes its arguments as the -names of companion files which have to be wrapped into the TEA package -and could not be figured by the scanner otherwise, like because of -dynamic paths to critcl::tsources, critcl::csources, -getting sourced directly, or simply being adjunct datafiles.

    12. -
    13. Extended the API used by critcl-based packages with the command -critcl::api for the management of stubs tables, be it their use, -and/or declaration and export.

      -

      Please see section Stubs Table Management of the -critcl package documentation for details.

    14. -
    15. Extended the API used by critcl-based packages with the command -critcl::userconfig for the management of developer-specified -custom configuration options, be it their use and/or declaration.

      -

      Please see section Custom Build Configuration of the -critcl package documentation for details.

    16. -
    17. Extended the API used by critcl-based packages with the -commands critcl::description, critcl::summary, -critcl::subject, critcl::meta, and -critcl::buildrequirement for the declaration of TEApot meta data -for/about the package.

      -

      Please see section Package Meta Data of the -critcl package documentation for details.

    18. +
    19. Fixed issue with package indices generated for Tcl 8.4. + Join the list of commands with semi-colon, not newline.

    20. +
    21. Fixed issue #26 which brought up use-cases I had forgotten to + consider while fixing bug #21 (see critcl 3.1.6).

    -

    Changes for version 3.0.1

    +

    Changes for version 3.1.7

      -
    1. Bugfixes all around. In detail:

    2. -
    3. Fixed recording of Tcl version requirements. Keep package name -and version together, unbreaking generated meta data and generated -package load command.

    4. -
    5. Fixed the build scripts: When installing, or wrapping for TEA, -generate any missing directories

    6. -
    7. Modified the build scripts to properly exit the application -when the window of their GUI is closed through the (X) button.

    8. -
    9. Removed an 8.5-ism (open wb) which had slipped into the main -build script.

    10. -
    11. Modified the example build scripts to separate the output for -the different examples (and packages) by adding empty lines.

    12. -
    13. stack::c example bugfix: Include API declarations for use in -the companion files.

    14. -
    15. Extended the documentation: Noted the need for a working -installation of a C compiler.

    16. -
    17. Extended the Windows target definitions and code to handle the -manifest files used by modern MS development environments. Note that -this code handles both possibilities, environment using manifests, and -(old(er)) environments without.

    18. -
    19. Extended the Windows 64bit target definitions and code to -auto-detect the need for the helper library "bufferoverflowU.lib" and -reconfigure the compile and link commands appropriately. We assume -that the library must be linked when present. This should be no harm -if the library is present, yet not needed. Just superfluous. We search -for the library in the paths specified by the environment variable -LIB.

    20. +
    21. Fixed issue #24. Extract and unconditionally display compiler + warnings found in the build log. Prevents users from missing + warnings which, while not causing the build to fail, may + still indicate problems.

    22. +
    23. New feature. Output hook. All non-messaging user output is now + routed through the command critcl::print, and users are + allowed to override it when using the critcl application-as-package.

    24. +
    25. New feature, by Ashok P. Nadkarni. Platform configurations can + inherit values from configurations defined before them.

    -

    Changes for version 3.0.2

    +

    Changes for version 3.1.6

      -
    1. Fixed issue in compile-and-run mode where commands put into the -auto_index are not found by Tcl's [unknown] command.

    2. -
    3. Fixed an array key mismatch breaking usage of client data and -delete function for procedure. Reported by Jos DeCoster, with patch.

    4. -
    5. Implemented a command line option -L, an equivalent of -option -I, just for library search paths.

    6. -
    7. Fixed github issues 5 and 8. Working around a missing variable -::errorInfo. It should always be present, however there seem to be -revisions of Tcl around which violate this assumption.

    8. +
    9. Fixed issue #21. While the multi-definition of the stub-table + pointer variables was ok with for all the C linkers seen so far + C++ linkers did not like this at all. Reworked the code to + ensure that this set of variables is generated only once, in + the wrapper around all the pieces to assemble.

    10. +
    11. Fixed issue #22, the handling of the command identifier + arguments of critcl::ccommand, critcl::cproc, and + critcl::cdata. We now properly allow any Tcl identifier + and generate proper internal C identifiers from them.

      +

      As part of this the signature of command critcl::name2c + changed. The command now delivers a list of four values instead + of three. The new value was added at the end.

      +

      Further adapted the implementation of package + critcl::class, a user of critcl::name2c. + This package is now at version 1.0.6 and requires critcl 3.1.6

      +

      Lastly fixed the mis-handling of option -cname in + critcl::ccommand, and critcl::cproc.

    12. +
    13. Fixed issue #23.

    -

    Changes for version 3.0.3

    +

    Changes for version 3.1.5

      -
    1. Fixed github issues 5 and 8, for the example build.tcl -scripts. Working around a missing variable ::errorInfo. It should -always be present, however there seem to be revisions of Tcl around -which violate this assumption.

    2. +
    3. Fixed issue #19. Made the regular expression extracting the + MSVC version number more general to make it work on german + language systems. This may have to be revisited in the future, + for other Windows locales.

    4. +
    5. Fixed issue #20. Made option -tea work on windows, at least in + a unix emulation environment like msys/mingw.

    -

    Changes for version 3.0.4

    +

    Changes for version 3.1.4

      -
    1. Fixed generation of the package's initname when the incoming - code is read from stdin and has no proper path.

    2. -
    3. Fixed github issue 11. Now using /LIBPATH instead of -L - on Windows (libinclude configuration setting).

    4. -
    5. Extended critcl to handle -l:path format of -l options. - GNU ld 2.22+ handles this by searching for the path as - is. Good when specifying static libraries, as plain -l looks - for shared libraries in preference over static. critcl handles - it now, as older GNU ld's do not understand it, nor the - various vendor-specific linkers.

    6. -
    7. Fixed github issue #12. Critcl now determines the version of - MSVC in use and uses it to switch between various link debug - options. Simplified the handling of bufferoverflowU.lib also, - making use of the same mechanism and collapsing the two - configurations sections we had back into one.

    8. -
    9. Reworked the insertion of #line pragmas into the generated C - code to avoid limitations on the line number argument imposed - by various compilers, and be more accurate.

    10. -
    11. Modified argument processing. Option -libdir now also - implies -L for its argument.

    12. -
    13. Extended handling of option -show (critcl::showconfig) - to list the path of the configuration file the data is coming - from. Good for debugging configuration processing.

    14. -
    15. Extended the build script with targets to regenerate the - embedded documentation, and diagrams, and to generate a - release.

    16. +
    17. Bugfix in package critcl::class. Generate a dummy + field in the class structure if the class has no class + variables. Without this change the structure would be empty, + and a number of compilers are not able to handle such a type.

    18. +
    19. Fixed a typo which broke the win64 configuration.

    20. +
    21. Fixed issue #16, a typo in the documentation of command + critcl::class.

    -

    Changes for version 3.0.5

    +

    Changes for version 3.1.3

      -
    1. Fixed bug in the new code for #line pragmas triggered when - specifying C code without leading whitespace.

    2. -
    3. Extended the documentation to have manpages for the license, - source retrieval, installer, and developer's guides.

    4. +
    5. Enhancement. In detail:

    6. +
    7. Added new argument type "pstring", for "Pascal String", a + counted string, i.e. a combination of string pointer and string + length.

    8. +
    9. Added new methods critcl::argtypesupport and + ::critcl::argsupport to define and use additional + supporting code for an argument type, here used by "pstring" + above to define the necessary structure.

    10. +
    11. Semi-bugfixes in the packages critcl::class and + critcl::iassoc. Pragmas for the AS meta data scanner + to ensure that the template files are made part of the package. + Versions bumped to 1.0.4 and 1.0.1 respectively.

    -

    Changes for version 3.0.6

    +

    Changes for version 3.1.2

      -
    1. Fixed github issue 10. The critcl application now delivers a - proper exit code (1) on build failure, instead of always - indicating success (status 0).

    2. -
    3. Fixed github issue 13. Handling of bufferoverflowU.lib for - release builds was inconsistent with handling for debug - builds. It is now identically handled (conditional) by - both cases.

    4. -
    5. Documentation cleanup, mainly in the installation guide, and - the README.md shown by github

    6. +
    7. Enhancement. In detail:

    8. +
    9. Extended critcl::cproc to be able to handle optional + arguments, in a limited way. This is automatically available to + critcl::class cproc-based methods as well.

    10. +
    11. Bugfix in lassign emulation for Tcl 8.4. Properly set + unused variables to the empty string. Bumped version of + emulation package lassign84 to 1.0.1.

    -

    Changes for version 3.0.7

    +

    Changes for version 3.1.1

      -
    1. Fixed the code generated by critcl::c++command. - The emitted code handed a non-static string table to - Tcl_GetIndexFromObj, in violation of the contract, which - requires the table to have a fixed address. This was a memory - smash waiting to happen. Thanks to Brian Griffin for alrerting - us to the general problem.

    2. +
    3. Bugfixes all around. In detail:

    4. +
    5. Fixed the generation of wrong#args errors for +critcl::cproc and derived code (critcl::class +cproc-based methods). Use NULL if there are no arguments, and +take the offset into account.

    6. +
    7. Fixed the handling of package names by +critcl::class. Forgot that they may contain namespace +separators. Bumped to version 1.0.1.

    8. +
    9. Extended a critcl::class generated error message in +instance creation for clarity. Bumped to version 1.0.2.

    -

    Changes for version 3.1

    +

    Changes for version 3.1

    1. Added a new higher-level package critcl::iassoc.

      This package simplifies the creation of code associating data @@ -851,139 +958,287 @@ details of the provided commands.

    -

    Changes for version 3.1.1

    +

    Changes for version 3.0.7

      -
    1. Bugfixes all around. In detail:

    2. -
    3. Fixed the generation of wrong#args errors for -critcl::cproc and derived code (critcl::class -cproc-based methods). Use NULL if there are no arguments, and -take the offset into account.

    4. -
    5. Fixed the handling of package names by -critcl::class. Forgot that they may contain namespace -separators. Bumped to version 1.0.1.

    6. -
    7. Extended a critcl::class generated error message in -instance creation for clarity. Bumped to version 1.0.2.

    8. +
    9. Fixed the code generated by critcl::c++command. + The emitted code handed a non-static string table to + Tcl_GetIndexFromObj, in violation of the contract, which + requires the table to have a fixed address. This was a memory + smash waiting to happen. Thanks to Brian Griffin for alrerting + us to the general problem.

    -

    Changes for version 3.1.2

    +

    Changes for version 3.0.6

      -
    1. Enhancement. In detail:

    2. -
    3. Extended critcl::cproc to be able to handle optional - arguments, in a limited way. This is automatically available to - critcl::class cproc-based methods as well.

    4. -
    5. Bugfix in lassign emulation for Tcl 8.4. Properly set - unused variables to the empty string. Bumped version of - emulation package lassign84 to 1.0.1.

    6. +
    7. Fixed github issue 10. The critcl application now delivers a + proper exit code (1) on build failure, instead of always + indicating success (status 0).

    8. +
    9. Fixed github issue 13. Handling of bufferoverflowU.lib for + release builds was inconsistent with handling for debug + builds. It is now identically handled (conditional) by + both cases.

    10. +
    11. Documentation cleanup, mainly in the installation guide, and + the README.md shown by github

    -

    Changes for version 3.1.3

    +

    Changes for version 3.0.5

      -
    1. Enhancement. In detail:

    2. -
    3. Added new argument type "pstring", for "Pascal String", a - counted string, i.e. a combination of string pointer and string - length.

    4. -
    5. Added new methods critcl::argtypesupport and - ::critcl::argsupport to define and use additional - supporting code for an argument type, here used by "pstring" - above to define the necessary structure.

    6. -
    7. Semi-bugfixes in the packages critcl::class and - critcl::iassoc. Pragmas for the AS meta data scanner - to ensure that the template files are made part of the package. - Versions bumped to 1.0.4 and 1.0.1 respectively.

    8. +
    9. Fixed bug in the new code for #line pragmas triggered when + specifying C code without leading whitespace.

    10. +
    11. Extended the documentation to have manpages for the license, + source retrieval, installer, and developer's guides.

    -

    Changes for version 3.1.4

    +

    Changes for version 3.0.4

      -
    1. Bugfix in package critcl::class. Generate a dummy - field in the class structure if the class has no class - variables. Without this change the structure would be empty, - and a number of compilers are not able to handle such a type.

    2. -
    3. Fixed a typo which broke the win64 configuration.

    4. -
    5. Fixed issue #16, a typo in the documentation of command - critcl::class.

    6. +
    7. Fixed generation of the package's initname when the incoming + code is read from stdin and has no proper path.

    8. +
    9. Fixed github issue 11. Now using /LIBPATH instead of -L + on Windows (libinclude configuration setting).

    10. +
    11. Extended critcl to handle -l:path format of -l options. + GNU ld 2.22+ handles this by searching for the path as + is. Good when specifying static libraries, as plain -l looks + for shared libraries in preference over static. critcl handles + it now, as older GNU ld's do not understand it, nor the + various vendor-specific linkers.

    12. +
    13. Fixed github issue #12. Critcl now determines the version of + MSVC in use and uses it to switch between various link debug + options. Simplified the handling of bufferoverflowU.lib also, + making use of the same mechanism and collapsing the two + configurations sections we had back into one.

    14. +
    15. Reworked the insertion of #line pragmas into the generated C + code to avoid limitations on the line number argument imposed + by various compilers, and be more accurate.

    16. +
    17. Modified argument processing. Option -libdir now also + implies -L for its argument.

    18. +
    19. Extended handling of option -show (critcl::showconfig) + to list the path of the configuration file the data is coming + from. Good for debugging configuration processing.

    20. +
    21. Extended the build script with targets to regenerate the + embedded documentation, and diagrams, and to generate a + release.

    -

    Changes for version 3.1.5

    +

    Changes for version 3.0.3

      -
    1. Fixed issue #19. Made the regular expression extracting the - MSVC version number more general to make it work on german - language systems. This may have to be revisited in the future, - for other Windows locales.

    2. -
    3. Fixed issue #20. Made option -tea work on windows, at least in - a unix emulation environment like msys/mingw.

    4. +
    5. Fixed github issues 5 and 8, for the example build.tcl +scripts. Working around a missing variable ::errorInfo. It should +always be present, however there seem to be revisions of Tcl around +which violate this assumption.

    -

    Changes for version 3.1.6

    +

    Changes for version 3.0.2

      -
    1. Fixed issue #21. While the multi-definition of the stub-table - pointer variables was ok with for all the C linkers seen so far - C++ linkers did not like this at all. Reworked the code to - ensure that this set of variables is generated only once, in - the wrapper around all the pieces to assemble.

    2. -
    3. Fixed issue #22, the handling of the command identifier - arguments of critcl::ccommand, critcl::cproc, and - critcl::cdata. We now properly allow any Tcl identifier - and generate proper internal C identifiers from them.

      -

      As part of this the signature of command critcl::name2c - changed. The command now delivers a list of four values instead - of three. The new value was added at the end.

      -

      Further adapted the implementation of package - critcl::class, a user of critcl::name2c. - This package is now at version 1.0.6 and requires critcl 3.1.6

      -

      Lastly fixed the mis-handling of option -cname in - critcl::ccommand, and critcl::cproc.

    4. -
    5. Fixed issue #23.

    6. +
    7. Fixed issue in compile-and-run mode where commands put into the +auto_index are not found by Tcl's [unknown] command.

    8. +
    9. Fixed an array key mismatch breaking usage of client data and +delete function for procedure. Reported by Jos DeCoster, with patch.

    10. +
    11. Implemented a command line option -L, an equivalent of +option -I, just for library search paths.

    12. +
    13. Fixed github issues 5 and 8. Working around a missing variable +::errorInfo. It should always be present, however there seem to be +revisions of Tcl around which violate this assumption.

    -

    Changes for version 3.1.7

    +

    Changes for version 3.0.1

      -
    1. Fixed issue #24. Extract and unconditionally display compiler - warnings found in the build log. Prevents users from missing - warnings which, while not causing the build to fail, may - still indicate problems.

    2. -
    3. New feature. Output hook. All non-messaging user output is now - routed through the command critcl::print, and users are - allowed to override it when using the critcl application-as-package.

    4. -
    5. New feature, by Ashok P. Nadkarni. Platform configurations can - inherit values from configurations defined before them.

    6. +
    7. Bugfixes all around. In detail:

    8. +
    9. Fixed recording of Tcl version requirements. Keep package name +and version together, unbreaking generated meta data and generated +package load command.

    10. +
    11. Fixed the build scripts: When installing, or wrapping for TEA, +generate any missing directories

    12. +
    13. Modified the build scripts to properly exit the application +when the window of their GUI is closed through the (X) button.

    14. +
    15. Removed an 8.5-ism (open wb) which had slipped into the main +build script.

    16. +
    17. Modified the example build scripts to separate the output for +the different examples (and packages) by adding empty lines.

    18. +
    19. stack::c example bugfix: Include API declarations for use in +the companion files.

    20. +
    21. Extended the documentation: Noted the need for a working +installation of a C compiler.

    22. +
    23. Extended the Windows target definitions and code to handle the +manifest files used by modern MS development environments. Note that +this code handles both possibilities, environment using manifests, and +(old(er)) environments without.

    24. +
    25. Extended the Windows 64bit target definitions and code to +auto-detect the need for the helper library "bufferoverflowU.lib" and +reconfigure the compile and link commands appropriately. We assume +that the library must be linked when present. This should be no harm +if the library is present, yet not needed. Just superfluous. We search +for the library in the paths specified by the environment variable +LIB.

    -

    Changes for version 3.1.8

    +

    Changes for version 3

      -
    1. Fixed issue with package indices generated for Tcl 8.4. - Join the list of commands with semi-colon, not newline.

    2. -
    3. Fixed issue #26 which brought up use-cases I had forgotten to - consider while fixing bug #21 (see critcl 3.1.6).

    4. +
    5. The command critcl::platform was deprecated in version +2.1, superceded by critcl::targetplatform, yet kept for +compatibility. Now it has been removed.

    6. +
    7. The command critcl::compiled was kept with in version 2.1 +with semantics in contradiction to its, for compatibility. This +contradiction has been removed, changing the visible semantics of the +command to be in line with its name.

    8. +
    9. The change to version 3 became necessary because of the two +incompatible visible changes above.

    10. +
    11. Extended the application package with code handling a new +option -tea. Specifying this option invokes a special mode +where critcl generates a TEA package, i.e. wraps the input into a +directory hierarchy and support files which provide it TEA-lookalike +buildsystem.

      +

      This new option, and -pkg, exclude each other. If +both are specified the last used option takes precedence.

      +

      The generated package directory hierarchy is mostly +self-contained, but not fully. It requires not only a working +installation of Tcl, but also working installations of the packages +md5 and cmdline. Both of these are provided by the +Tcllib bundle. Not required, but recommended to have +installed are any of the packages which can accelerate md5's +operation, i.e. cryptkit, tcllibc, or +Trf.

    12. +
    13. Extended the critcl package with a new command +critcl::scan taking the path to a ".critcl" file, +statically scanning it, and returning license, version, a list of its +companion files, list of imported APIs, and list of +developer-specified custom configuration options. This data is the +foundation for the TEA wrapping described above.

      +

      Note that this is a static scan. While the other build +modes can (must) execute the ".critcl" file and make +platform-specific decisions regarding the assembled C code, companion +files, etc. the TEA wrap mode is not in a position to make +platform-specific decisions. It has to wrap everything which might +conceivably be needed when actually building. Hence the static scan. +This has however its own set of problems, namely the inability to +figure out any dynamic construction of companion file paths, at least +on its own. Thus:

    14. +
    15. Extended the API used by critcl-based packages with the command +critcl::owns. While this command is ignored by the regular build +modes the static scanner described above takes its arguments as the +names of companion files which have to be wrapped into the TEA package +and could not be figured by the scanner otherwise, like because of +dynamic paths to critcl::tsources, critcl::csources, +getting sourced directly, or simply being adjunct datafiles.

    16. +
    17. Extended the API used by critcl-based packages with the command +critcl::api for the management of stubs tables, be it their use, +and/or declaration and export.

      +

      Please see section Stubs Table Management of the +critcl package documentation for details.

    18. +
    19. Extended the API used by critcl-based packages with the command +critcl::userconfig for the management of developer-specified +custom configuration options, be it their use and/or declaration.

      +

      Please see section Custom Build Configuration of the +critcl package documentation for details.

    20. +
    21. Extended the API used by critcl-based packages with the +commands critcl::description, critcl::summary, +critcl::subject, critcl::meta, and +critcl::buildrequirement for the declaration of TEApot meta data +for/about the package.

      +

      Please see section Package Meta Data of the +critcl package documentation for details.

    -

    Changes for version 3.1.9

    +

    Changes for version 2.1

      -
    1. Fixed issue #27. Added missing platform definitions for - various alternate linux and OS X targets.

    2. -
    3. Fixed issue #28. Added missing -mXX flags for linking at the - linux-{32,64}-* targets.

    4. -
    5. Fixed issue #29. Replaced the use of raw "cheaders" - information in the processing of "cdefines" with the proper - include directives derived from it.

    6. -
    7. Fixed the issue behind rejected pull request #30 by Andrew - Shadura. Dynamically extract the stubs variable declarations - from the Tcl header files and generate matching variable - definitions for use in the package code. The generated code - will now be always consistent with the headers, even when - critcl's own copy of them is replaced by system headers.

    8. -
    9. Fixed issue #31. Accepted patch by Andrew Shadura, with - changes (comments), for easier integration of critcl with - OS package systems, replacing critcl's copies of Tcl headers - with their own.

    10. -
    11. Fixed issue #32. Merged pull request by Andrew Shadura. - Various typos in documentation and comments.

    12. -
    13. Fixed issue #33. Handle files starting with a dot better.

    14. +
    15. Fixed bug where critcl::tsources interpreted relative +paths as relative to the current working directory instead of +relative to the ".critcl" file using the command, as all other +commands of this type do.

    16. +
    17. Fixed internals, preventing information collected for multiple +".critcl" files to leak between them. Notably, critcl::tk +is not a global configuration option anymore.

    18. +
    19. Fixed the command critcl::license to be a null-operation +in mode "compile & run", instead of throwing an error.

    20. +
    21. Fixed the critcl application's interference with the "compile & +run" result cache in -pkg mode by having it use a wholly +separate (and by default transient) directory for that mode.

    22. +
    23. Fixed bug where changes to a ".critcl" file did not result +in a rebuild for mode "compile & run". All relevant API commands now +ensure UUID changes.

    24. +
    25. Fixed bug in the backend handling of critcl::debug where +the companion c-sources of a ".critcl" file were not compiled +with debug options, although the ".critcl" file was.

    26. +
    27. Fixed bug in critcl::debug which prevented recognition of +mode "all" when it was not the first argument to the command.

    28. +
    29. Fixed bug in "preload.c" preventing its compilation on +non-windows platforms.

    30. +
    31. Fixed long-standing bug in the handling of namespace qualifiers +in the command name argument of critcl::cproc and +critcl::ccommand. It is now possible to specify a fully +qualified command name without issues.

    32. +
    33. Extended/reworked critcl::tsources to be the canonical +way of declaring ".tcl" companion files even for mode "compile & +run".

    34. +
    35. Extended/reworked critcl::tsources to allow the use of a +".critcl" file as its own Tcl companion file.

    36. +
    37. Extended critcl::framework to internally check for OS X +build target, and to ignore the declaration if its not.

    38. +
    39. Extended critcl::failed to be callable more than once in +a ".critcl" file. The first call forces the build, if it was not +done already, to get the result. Further calls return the cached +result of the first call.

    40. +
    41. Extended the handling of environment variable CC in the code +determining the compiler to use to deal with (i.e. remove) paths to +the compiler, compiler file extensions, and compiler options specified +after the compiler itself, leaving only the bare name of the compiler.

    42. +
    43. Extended the code handling the search for preloaded libraries +to print the paths it searched, making debugging of a search failure +easier.

    44. +
    45. A new command critcl::tcl can be used to declare the +version of Tcl minimally needed to build and run the ".critcl" +file and package. Defaults to 8.4 if not declared. Extended critcl to +have the stubs and headers for all of Tcl 8.4, 8.5, and 8.6.

    46. +
    47. A new command critcl::load forces the build and load of a +".critcl" file. This is the official way for overriding critcl's +default lazy-build-&-load-on-demand scheme for mode "compile & run".

      +

      Note that after using critcl::load / +critcl::failed in a ".critcl" file it is not possible to +use critcl commands in that file anymore. Doing so will throw an +error.

    48. +
    49. Extended the generation of '#line' pragmas to use +info frame (if available) to provide the C compiler with exact +line numbers into the ".critcl" file for the reporting of +warnings and errors.

    50. +
    51. Extended critcl::check with logging to help with +debugging build-time checks of the environment, plus an additional +optional argument to provide labeling.

    52. +
    53. Added a new command critcl::checklink which not only +tries to check the environment via compiling the code, but also +its linkability.

    54. +
    55. Added a new command critcl::msg for messaging, like +command critcl::error is for error reporting. Likewise this is a +hook a user of the package is allowed to override. The default +implementation, used by mode compile & run does nothing. The +implementation for mode generate package prints the message +to stdout.

      +

      Envisioned use is for the reporting of results determined by +critcl::check and critcl::checklink during building, to +help with debugging when something goes wrong with a check.

    56. +
    57. Exposed the argument processing internals of critcl::proc +for use by advanced users. The new commands are

      +
        +
      1. critcl::argnames

      2. +
      3. critcl::argcnames

      4. +
      5. critcl::argcsignature

      6. +
      7. critcl::argvardecls

      8. +
      9. critcl::argconversion

      10. +
      +

      Please see section Advanced Embedded C Code of the +critcl package documentation for details.

    58. +
    59. Extended the critcl package to intercept package +provide and record the file -> package name mapping. Plus other +internal changes now allow the use of namespaced package names while +still using proper path names and init function.

    60. +
    61. Dropped the unused commands critcl::optimize and +critcl::include.

    62. +
    63. Dropped -lib mode from the critcl application.

    64. +
    65. Dropped remnants of support for Tcl 8.3 and before.

    -

    Authors

    +

    Authors

    Jean Claude Wippler, Steve Landers, Andreas Kupries

    -

    Bugs, Ideas, Feedback

    +

    Bugs, Ideas, Feedback

    This document, and the package it describes, will undoubtedly contain bugs and other problems. Please report them at https://github.com/andreas-kupries/critcl/issues. @@ -1000,6 +1255,6 @@

    diff -Nru critcl-3.1.9/embedded/www/files/critcl_bitmap.html critcl-3.1.17+dfsg/embedded/www/files/critcl_bitmap.html --- critcl-3.1.9/embedded/www/files/critcl_bitmap.html 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/embedded/www/files/critcl_bitmap.html 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,274 @@ + + +critcl::bitmap - C Runtime In Tcl (CriTcl) + + + + + +
    +
    [ + Table Of Contents +| Keyword Index + ]
    +

    critcl::bitmap(n) 1.0.1 doc "C Runtime In Tcl (CriTcl)"

    +

    Name

    +

    critcl::bitmap - CriTcl Utilities: Bitset en- and decoding

    +
    + +

    Synopsis

    +
    +
      +
    • package require Tcl 8.4
    • +
    • package require critcl ?3.1.11?
    • +
    • package require critcl::bitmap ?1.0.1?
    • +
    + +
    +
    +

    Description

    +

    Welcome to the C Runtime In Tcl, CriTcl for short, a +system to build C extension packages for Tcl on the fly, from C code +embedded within Tcl scripts, for all who wish to make their code go +faster.

    +

    This document is the reference manpage for the +critcl::bitmap package. This package provides convenience +commands for advanced functionality built on top of both critcl core +and package critcl::iassoc.

    +

    C level libraries often use bit-sets to encode many flags into a +single value. Tcl bindings to such libraries now have the task of +converting a Tcl representation of such flags (like a list of strings) +into such bit-sets, and back. +Note here that the C-level information has to be something which +already exists. The package does not create these values. This is +in contrast to the package critcl::enum which creates an +enumeration based on the specified symbolic names.

    +

    This package was written to make the declaration and management +of such bit-sets and their associated conversions functions easy, +hiding all attendant complexity from the user.

    +

    Its intended audience are mainly developers wishing to write +Tcl packages with embedded C code.

    +

    This package resides in the Core Package Layer of CriTcl.

    +

    arch_core

    +
    +

    API

    +
    +
    ::critcl::bitmap::def name definition ?exclusions?
    +

    This command defines two C functions for the conversion of the +named bit-set into Tcl lists, and vice versa. +The underlying mapping tables are automatically initialized on first +access, and finalized on interpreter destruction.

    +

    The definition dictionary provides the mapping from the +Tcl-level symbolic names of the flags to their C expressions (often +the name of the macro specifying the actual value). +Note here that the C-level information has to be something which +already exists. The package does not create these values. This is +in contrast to the package critcl::enum which creates an +enumeration based on the specified symbolic names.

    +

    The optional exlusion list is for the flags/bit-sets for +which conversion from bit-set to flag, i.e. decoding makes no +sense. One case for such, for example, are flags representing a +combination of other flags.

    +

    The package generates multiple things (declarations and +definitions) with names derived from name, which has to be a +proper C identifier.

    +
    +
    name_encode
    +

    The function for encoding a Tcl list of strings into the equivalent +bit-set. +Its signature is

    +
    +int name_encode (Tcl_Interp* interp, Tcl_Obj* flags, int* result);
    +
    +

    The return value of the function is a Tcl error code, +i.e. TCL_OK, TCL_ERROR, etc.

    +
    name_decode
    +

    The function for decoding a bit-set into the equivalent Tcl list of +strings. +Its signature is

    +
    +Tcl_Obj* name_decode (Tcl_Interp* interp, int flags);
    +
    +
    +
    name.h
    +

    A header file containing the declarations for the two conversion +functions, for use by other parts of the system, if necessary.

    +

    The generated file is stored in a place where it will not +interfere with the overall system outside of the package, yet also be +available for easy inclusion by package files (csources).

    +
    name
    +

    The name of a critcl argument type encapsulating the encoder function +for use by critcl::cproc.

    +
    name
    +

    The name of a critcl result type encapsulating the decoder function +for use by critcl::cproc.

    +
    +
    +
    +

    Example

    +

    The example shown below is the specification of the event flags pulled +from the draft work on a Tcl binding to Linux's inotify APIs.

    +
    +package require Tcl 8.5
    +package require critcl 3.1.11
    +critcl::buildrequirement {
    +    package require critcl::bitmap
    +}
    +critcl::bitmap::def tcl_inotify_events {
    +    accessed       IN_ACCESS
    +    all            IN_ALL_EVENTS
    +    attribute      IN_ATTRIB
    +    closed         IN_CLOSE
    +    closed-nowrite IN_CLOSE_NOWRITE
    +    closed-write   IN_CLOSE_WRITE
    +    created        IN_CREATE
    +    deleted        IN_DELETE
    +    deleted-self   IN_DELETE_SELF
    +    dir-only       IN_ONLYDIR
    +    dont-follow    IN_DONT_FOLLOW
    +    modified       IN_MODIFY
    +    move           IN_MOVE
    +    moved-from     IN_MOVED_FROM
    +    moved-self     IN_MOVE_SELF
    +    moved-to       IN_MOVED_TO
    +    oneshot        IN_ONESHOT
    +    open           IN_OPEN
    +    overflow       IN_Q_OVERFLOW
    +    unmount        IN_UNMOUNT
    +} {
    +    all closed move oneshot
    +}
    +# Declarations:          tcl_inotify_events.h
    +# Encoder:      int      tcl_inotify_events_encode (Tcl_Interp* interp, Tcl_Obj* flags, int* result);
    +# Decoder:      Tcl_Obj* tcl_inotify_events_decode (Tcl_Interp* interp, int flags);
    +# crit arg-type          tcl_inotify_events
    +# crit res-type          tcl_inotify_events
    +
    +
    +

    Authors

    +

    Andreas Kupries

    +
    +

    Bugs, Ideas, Feedback

    +

    This document, and the package it describes, will undoubtedly contain +bugs and other problems. +Please report such at https://github.com/andreas-kupries/critcl. +Please also report any ideas for enhancements you may have for either +package and/or documentation.

    +
    + +

    Category

    +

    Glueing/Embedded C code

    +
    + +
    diff -Nru critcl-3.1.9/embedded/www/files/critcl_class.html critcl-3.1.17+dfsg/embedded/www/files/critcl_class.html --- critcl-3.1.9/embedded/www/files/critcl_class.html 2013-05-10 05:57:04.000000000 +0000 +++ critcl-3.1.17+dfsg/embedded/www/files/critcl_class.html 2017-10-14 02:48:11.000000000 +0000 @@ -92,17 +92,17 @@ } --> - -

    [ - Table Of Contents + Table Of Contents | Keyword Index -]
    + ]

    critcl::class(n) 1.0.6 doc "C Runtime In Tcl (CriTcl)"

    Name

    critcl::class - CriTcl Utilities: C Classes

    @@ -211,7 +211,7 @@ outside of any function or other definition.

    The command can be used multiple times, each adding another segment of C code to insert. It is of course possible to not use this -command at all, for classes not requiring swupporting code.

    +command at all, for classes not requiring supporting code.

    The result of the command is the empty string.

    type name

    This command specifies the name of an external C type to be used as @@ -675,12 +675,12 @@ package and/or documentation.

    Category

    Glueing/Embedded C code

    diff -Nru critcl-3.1.9/embedded/www/files/critcl_cproc.html critcl-3.1.17+dfsg/embedded/www/files/critcl_cproc.html --- critcl-3.1.9/embedded/www/files/critcl_cproc.html 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/embedded/www/files/critcl_cproc.html 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,784 @@ + + +critcl-cproc-types - C Runtime In Tcl (CriTcl) + + + + + +
    +
    [ + Table Of Contents +| Keyword Index + ]
    +

    critcl-cproc-types(n) 3.1.17 doc "C Runtime In Tcl (CriTcl)"

    +

    Name

    +

    critcl-cproc-types - Critcl - cproc Type Reference

    +
    + + +

    Description

    +

    Welcome to the C Runtime In Tcl, CriTcl for short, a +system to build C extension packages for Tcl on the fly, from C code +embedded within Tcl scripts, for all who wish to make their code go +faster.

    +

    This document is a breakout of the descriptions for the predefined +argument- and result-types usable with the critcl::cproc +command, as detailed in the reference manpage for the critcl +package, plus the information on how to extend the predefined set with +custom types. The breakout was made to make this information easier to +find (toplevel document vs. having to search the large main reference).

    +

    Its intended audience are developers wishing to write Tcl +packages with embedded C code.

    +
    +

    Standard argument types

    +
    +
    Tcl_Obj*
    +
    +
    object
    +

    The function takes an argument of type Tcl_Obj*. +No argument checking is done. +The Tcl level word is passed to the argument as-is.

    +
    pstring
    +

    The function takes an argument of type critcl_pstring +containing the original Tcl_Obj* reference of the Tcl argument, +plus the length of the string and a pointer to the character array.

    +
    +typedef struct critcl_pstring {
    +    Tcl_Obj* o;
    +    char*    s;
    +    int      len;
    +} critcl_pstring;
    +
    +
    +
    list
    +

    The function takes an argument of type critcl_list containing +the original Tcl_Obj* reference of the Tcl argument, plus the +length of the Tcl list and a pointer to the array of the list +elements.

    +
    +typedef struct critcl_list {
    +    Tcl_Obj*  o;
    +    Tcl_Obj** v;
    +    int       c;
    +} critcl_list;
    +
    +

    The Tcl argument must be convertible to List, an error is +thrown otherwise.

    +
    bytearray
    +
    +
    rawchar*
    +
    +
    rawchar
    +

    The function takes an argument of type char*. +The Tcl argument must be convertible to ByteArray, an error is +thrown otherwise. +Note that the length of the ByteArray is not +passed to the function, making this type not very usable.

    +
    bytes
    +

    This is the new and usable ByteArray type.

    +

    The function takes an argument of type critcl_bytes +containing the original Tcl_Obj* reference of the Tcl argument, +plus the length of the byte array and a pointer to the byte data.

    +
    +typedef struct critcl_bytes {
    +    Tcl_Obj* o;
    +    char*    s;
    +    int      len;
    +} critcl_list;
    +
    +

    The Tcl argument must be convertible to ByteArray, an error is +thrown otherwise.

    +
    char*
    +

    The function takes an argument of type char*. +The string representation of the Tcl argument is passed in.

    +
    double
    +

    The function takes an argument of type double. +The Tcl argument must be convertible to Double, an error is +thrown otherwise.

    +
    float
    +

    The function takes an argument of type float. +The Tcl argument must be convertible to Double, an error is +thrown otherwise.

    +
    boolean
    +
    +
    bool
    +

    The function takes an argument of type int. +The Tcl argument must be convertible to Boolean, an error is +thrown otherwise.

    +
    int
    +

    The function takes an argument of type int. +The Tcl argument must be convertible to Int, an error is thrown +otherwise.

    +
    long
    +

    The function takes an argument of type long int. +The Tcl argument must be convertible to Long, an error is +thrown otherwise.

    +
    wideint
    +

    The function takes an argument of type Tcl_WideInt. +The Tcl argument must be convertible to WideInt, an error is +thrown otherwise.

    +
    void*
    +
    +
    double*
    +
    +
    float*
    +
    +
    int*
    +

    The function takes an argument of the same-named C type. +The Tcl argument must be convertible to ByteArray, an error is thrown +otherwise. +The bytes in the ByteArray are then re-interpreted as the raw +representation of a single C pointer of the given type which is then +passed as argument to the function. +In other words, this is for Tcl values somehow holding raw C pointers, +i.e. memory addresses.

    +

    Attention: These types are considered DEPRECATED. +It is planned to remove their documentation in release 3.2, and their +implementation in release 3.3. Their deprecation can be undone if +good use cases are shown.

    +
    +
    +

    Standard result types

    +
    +
    Tcl_Obj*
    +
    +
    object
    +

    The function returns a value of type Tcl_Obj*. +This value becomes the interpreter result, if not 0. The Tcl +status is TCL_ERROR when a 0 is returned, and +TCL_OK otherwise.

    +

    Note how it is the responsibility of the function to set +the interpreter result to an appropriate error message when returning +0.

    +

    Attention: The conversion assumes that the value belonged +to the function, with an associated reference count, and decrements +the reference count to indicate the loss of ownership by the +function. This means that it is an error to return a value whose +reference count is zero. The system will crash at some point after the +return due to reuse of the freed memory.

    +
    Tcl_Obj*0
    +
    +
    object0
    +

    The function returns a value of type Tcl_Obj*. +This value becomes the interpreter result, if not 0. The Tcl +status is TCL_ERROR when a 0 is returned, and +TCL_OK otherwise.

    +

    Note how it is the responsibility of the function to set +the interpreter result to an appropriate error message when returning +0.

    +

    Attention: Contrary to Tcl_Obj* above this +conversion assumes that the returned value has a reference count of +0 and performs no decrement. Returning a value whose +reference count is greater than zero will likely cause a memory leak.

    +
    char*
    +
    +
    vstring
    +

    The function returns a value of type char*. +This value becomes the interpreter result, wrapped in a String. +It is assumed that the string is volatile in some way, with the +wrapping in a String duplicating it before making it the +result, ensuring that we will not access a dangling pointer in the +future. +The Tcl status is always TCL_OK.

    +
    const char*
    +

    Like type char* above, except that the returned string is +const-qualified.

    +
    string
    +
    +
    dstring
    +

    The function returns a value of type char*. +Contrary to the previous string types here it is assumed that the +value is dynamically allocated, via Tcl_Alloc. +This value becomes the interpreter result, as usual, but is not +copied. +The Tcl status is always TCL_OK.

    +
    double
    +

    The function returns a value of type double. +This value becomes the interpreter result, properly wrapped as a +Double. +The Tcl status is always TCL_OK.

    +
    float
    +

    The function returns a value of type float. +This value becomes the interpreter result, properly wrapped as a +Double. +The Tcl status is always TCL_OK.

    +
    boolean
    +
    +
    bool
    +

    The function returns a value of type int, interpreted as boolean. +This value becomes the interpreter result, properly wrapped as a +Int. +The Tcl status is always TCL_OK.

    +
    int
    +

    The function returns a value of type int. +This value becomes the interpreter result, properly wrapped as a +Int. +The Tcl status is always TCL_OK.

    +
    long
    +

    The function returns a value of type long int. +This value becomes the interpreter result, properly wrapped as a +Long. +The Tcl status is always TCL_OK.

    +
    wideint
    +

    The function returns a value of type Tcl_WideInt. +This value becomes the interpreter result, properly wrapped as a +WideInt. +The Tcl status is always TCL_OK.

    +
    ok
    +

    The function returns a value of type int. +It is interpreted as the Tcl status code. +The interpreter result is left untouched (empty). For a different +outcome the function has to set the interpreter result by itself.

    +
    void
    +

    The function does not return a value. +The interpreter result is left untouched (empty). For a different +outcome the function has to set the interpreter result by itself. +The Tcl status is always TCL_OK.

    +
    +
    +

    Advanced: Adding types

    +

    While the critcl::cproc command understands the most common C +types (as per the previous 2 sections), sometimes this is not enough.

    +

    To get around this limitation the commands in this section +enable users of critcl to extend the set of argument and +result types understood by critcl::cproc. In other words, they +allow them to define their own, custom, types.

    +
    +
    ::critcl::has-resulttype name
    +

    This command tests if the named result-type is known or not. +It returns a boolean value, true if the type is known and +false otherwise.

    +
    ::critcl::resulttype name body ?ctype?
    +

    This command defines the result type name, and associates it +with the C code doing the conversion (body) from C to Tcl. +The C return type of the associated function, also the C type of the +result variable, is ctype. This type defaults to name if +it is not specified.

    +

    If name is declared already an error will be thrown. +Attention! The standard result type void is special as +it has no accompanying result variable. This cannot be expressed +by this extension command.

    +

    The body's responsibility is the conversion of the +functions result into a Tcl result and a Tcl status. The first has to +be set into the interpreter we are in, and the second has to be +returned.

    +

    The C code of body is guaranteed to be called last in the +wrapper around the actual implementation of the cproc in +question and has access to the following environment:

    +
    +
    interp
    +

    A Tcl_Interp* typed C variable referencing the + interpreter the result has to be stored into.

    +
    rv
    +

    The C variable holding the result to convert, of type + ctype.

    +
    +

    As examples here are the definitions of two standard result types:

    +
    +    resulttype int {
    +	Tcl_SetObjResult(interp, Tcl_NewIntObj(rv));
    +	return TCL_OK;
    +    }
    +    resulttype ok {
    +	/* interp result must be set by cproc body */
    +	return rv;
    +    } int
    +
    +
    +
    ::critcl::resulttype name = origname
    +

    This form of the resulttype command declares name as an +alias of result type origname, which has to be defined +already. If this is not the case an error is thrown.

    +
    ::critcl::has-argtype name
    +

    This command tests if the named argument-type is known or not. +It returns a boolean value, true if the type is known and +false otherwise.

    +
    ::critcl::argtype name body ?ctype? ?ctypefun?
    +

    This command defines the argument type name, and associates it +with the C code doing the conversion (body) from Tcl to C +The C type of the variable to hold the conversion result is +ctype and the type of the function argument itself is +ctypefun. Both types default to name if they are not +specified (or the empty string).

    +

    If name is declared already an error will be thrown.

    +

    The body's responsibility is the conversion of a +command's Tcl_Obj* argument into a C value for the underlying +function and its storage in a helper variable.

    +

    The C code of body is guaranteed to be called inside of a +separate C code block (thus allowing the use of local variables) which +has access to the following environment:

    +
    +
    interp
    +

    A Tcl_Interp* typed C variable referencing the + interpreter the code is running in.

    +
    @@
    +

    A placeholder for the Tcl_Obj*-valued C expression + providing the value of the argument to convert.

    +
    @A
    +

    A placeholder for the name of the C variable to store the + converted argument into.

    +
    +

    As examples here are the definitions of two standard argument types:

    +
    +    argtype int {
    +	if (Tcl_GetIntFromObj(interp, @@, &@A) != TCL_OK) return TCL_ERROR;
    +    }
    +    argtype float {
    +	double t;
    +	if (Tcl_GetDoubleFromObj(interp, @@, &t) != TCL_OK) return TCL_ERROR;
    +	@A = (float) t;
    +    }
    +
    +
    +
    ::critcl::argtype name = origname
    +

    This form of the argtype command declares name as an alias +of argument type origname, which has to be defined already. If +this is not the case an error is thrown.

    +
    ::critcl::argtypesupport name code ?guard?
    +

    This command defines a C code fragment for the already defined +argument type name which will be inserted before all functions +using that type. Its purpose is the definition of any supporting C +types needed by the argument type. +If the type is used by many functions the system ensures that only the +first of the multiple insertions of the code fragment is active, and +the others disabled. +The guard identifier is normally derived from name, but can also +be set explicitly, via guard. This latter allows different +custom types to share a common support structure without having to +perform their own guarding.

    +
    ::critcl::argtyperelease name code
    +

    This command defines a C code fragment for the already defined +argument type name which will be inserted whenever the worker +function of a critcl::cproc returns to the shim. It is the +responsibility of this fragment to unconditionally release any +resources the critcl::argtype conversion code allocated. +An example of this are the variadic types for the support of +the special, variadic args argument to critcl::cproc's. +They allocate a C array for the collected arguments which has to be +released when the worker returns. This command defines the C code +for doing that.

    +
    +
    +

    Examples

    +

    The examples shown here have been drawn from section "Embedding C" in +the document about Using CriTcl. Please see that document +for many more examples.

    +

    A Simple Procedure

    +

    Starting simple, let us assume that the Tcl code in question is +something like

    +
    +    proc math {x y z} {
    +        return [expr {(sin($x)*rand())/$y**log($z)}]
    +    }
    +
    +

    with the expression pretending to be something very complex and +slow. Converting this to C we get:

    +
    +    critcl::cproc math {double x double y double z} double {
    +        double up   = rand () * sin (x);
    +        double down = pow(y, log (z));
    +        return up/down;
    +    }
    +
    +

    Notable about this translation:

    +
      +
    1. All the arguments got type information added to them, here + "double". Like in C the type precedes the argument name. Other + than that it is pretty much a Tcl dictionary, with keys and + values swapped.

    2. +
    3. We now also have to declare the type of the result, here + "double", again.

    4. +
    5. The reference manpage lists all the legal C types supported as + arguments and results.

    6. +
    +
    +

    Custom Types, Introduction

    +

    When writing bindings to external libraries critcl::cproc is +usually the most convenient way of writing the lower layers. This is +however hampered by the fact that critcl on its own only supports a +few standard (arguably the most import) standard types, whereas the +functions we wish to bind most certainly will use much more, specific +to the library's function.

    +

    The critcl commands argtype, resulttype and their +adjuncts are provided to help here, by allowing a developer to extend +critcl's type system with custom conversions.

    +

    This and the three following sections will demonstrate this, +from trivial to complex.

    +

    The most trivial use is to create types which are aliases of +existing types, standard or other. As an alias it simply copies and +uses the conversion code from the referenced types.

    +

    Our example is pulled from an incomplete project of mine, a +binding to Jeffrey Kegler's libmarpa library managing +Earley parsers. Several custom types simply reflect the typedef's done +by the library, to make the critcl::cprocs as self-documenting +as the underlying library functions themselves.

    +
    +    critcl::argtype Marpa_Symbol_ID     = int
    +    critcl::argtype Marpa_Rule_ID       = int
    +    critcl::argtype Marpa_Rule_Int      = int
    +    critcl::argtype Marpa_Rank          = int
    +    critcl::argtype Marpa_Earleme       = int
    +    critcl::argtype Marpa_Earley_Set_ID = int
    +    ...
    +    method sym-rank: proc {
    +        Marpa_Symbol_ID sym
    +        Marpa_Rank      rank
    +    } Marpa_Rank {
    +        return marpa_g_symbol_rank_set (instance->grammar, sym, rank);
    +    }
    +    ...
    +
    +
    +

    Custom Types, Semi-trivial

    +

    A more involved custom argument type would be to map from Tcl strings +to some internal representation, like an integer code.

    +

    The first example is taken from the tclyaml package, +a binding to the libyaml library. In a few places we have to +map readable names for block styles, scalar styles, etc. to the +internal enumeration.

    +
    +    critcl::argtype yaml_sequence_style_t {
    +        if (!encode_sequence_style (interp, @@, &@A)) return TCL_ERROR;
    +    }
    +    ...
    +    critcl::ccode {
    +        static const char* ty_block_style_names [] = {
    +            "any", "block", "flow", NULL
    +        };
    +        static int
    +        encode_sequence_style (Tcl_Interp* interp, Tcl_Obj* style,
    +                               yaml_sequence_style_t* estyle)
    +        {
    +            int value;
    +            if (Tcl_GetIndexFromObj (interp, style, ty_block_style_names,
    +                                     "sequence style", 0, &value) != TCL_OK) {
    +                return 0;
    +            }
    +            *estyle = value;
    +            return 1;
    +        }
    +    }
    +    ...
    +    method sequence_start proc {
    +        pstring anchor
    +        pstring tag
    +        int implicit
    +        yaml_sequence_style_t style
    +    } ok {
    +        /* Syntax: <instance> seq_start <anchor> <tag> <implicit> <style> */
    +        ...
    +    }
    +    ...
    +
    +

    It should be noted that this code precedes the advent of the +supporting generator package critcl::emap. using the +generator the definition of the mapping becomes much simpler:

    +
    +    critcl::emap::def yaml_sequence_style_t {
    +        any   0
    +        block 1
    +        flow  2
    +    }
    +
    +

    Note that the generator will not only provide the conversions, but +also define the argument and result types needed for their use by +critcl::cproc. +Another example of such a semi-trivial argument type can be found in +the CRIMP package, which defines a Tcl_ObjType for +image values. This not only provides a basic argument type for +any image, but also derived types which check that the image has a +specific format. Here we see for the first time non-integer arguments, +and the need to define the C types used for variables holding the C +level value, and the type of function parameters (Due to C promotion +rules we may need different types).

    +
    +    critcl::argtype image {
    +        if (crimp_get_image_from_obj (interp, @@, &@A) != TCL_OK) {
    +            return TCL_ERROR;
    +        }
    +    } crimp_image* crimp_image*
    +    ...
    +        set map [list <<type>> $type]
    +        critcl::argtype image_$type [string map $map {
    +            if (crimp_get_image_from_obj (interp, @@, &@A) != TCL_OK) {
    +                return TCL_ERROR;
    +            }
    +            if (@A->itype != crimp_imagetype_find ("crimp::image::<<type>>")) {
    +                Tcl_SetObjResult (interp,
    +                                  Tcl_NewStringObj ("expected image type <<type>>",
    +                                                    -1));
    +                return TCL_ERROR;
    +            }
    +        }] crimp_image* crimp_image*
    +    ...
    +
    +
    +

    Custom Types, Support structures

    +

    The adjunct command critcl::argtypesupport is for when the +conversion needs additional definitions, for example a helper +structure.

    +

    An example of this can be found among the standard types of +critcl itself, the pstring type. This type provides the C +function with not only the string pointer, but also the string length, +and the Tcl_Obj* this data came from. As critcl::cproc's +calling conventions allow us only one argument for the data of the +parameter a structure is needed to convey these three pieces of +information.

    +

    Thus the argument type is defined as

    +
    +    critcl::argtype pstring {
    +        @A.s = Tcl_GetStringFromObj(@@, &(@A.len));
    +        @A.o = @@;
    +    } critcl_pstring critcl_pstring
    +    critcl::argtypesupport pstring {
    +        typedef struct critcl_pstring {
    +            Tcl_Obj* o;
    +            char*    s;
    +            int      len;
    +        } critcl_pstring;
    +    }
    +
    +

    In the case of such a structure being large we may wish to +allocate it on the heap instead of having it taking space on the +stack. If we do that we need another adjunct command, +critcl::argtyperelease. This command specifies the code required +to release dynamically allocated resources when the worker function +returns, before the shim returns to the caller in Tcl. +To keep things simple our example is synthetic, a modification of +pstring above, to demonstrate the technique. An actual, but +more complex example is the code to support the variadic args +argument of critcl::cproc.

    +
    +    critcl::argtype pstring {
    +        @A = (critcl_pstring*) ckalloc(sizeof(critcl_pstring));
    +        @A->s = Tcl_GetStringFromObj(@@, &(@A->len));
    +        @A->o = @@;
    +    } critcl_pstring* critcl_pstring*
    +    critcl::argtypesupport pstring {
    +        typedef struct critcl_pstring {
    +            Tcl_Obj* o;
    +            char*    s;
    +            int      len;
    +        } critcl_pstring;
    +    }
    +    critcl::argtyperelease pstring {
    +        ckfree ((char*)) @A);
    +    }
    +
    +

    Note, the above example shows only the most simple case of an +allocated argument, with a conversion that cannot fail (namely, string +retrieval). If the conversion can fail then either allocation has to +be defered to happen only on successful conversion, or the conversion +code has to release the allocated memory itself in the failure path, +because it will never reach the code defined via +critcl::argtyperelease in that case.

    +
    +

    Custom Types, Results

    +

    All of the previous sections dealt with argument conversions, +i.e. going from Tcl into C. +Custom result types are for the reverse direction, from C to Tcl. +This is usually easier, as most of the time errors should not be +possible. Supporting structures, or allocating them on the heap are +not really required and therefore not supported.

    +

    The example of a result type shown below was pulled from +KineTcl. It is a variant of the builtin result type +Tcl_Obj*, aka object. The builtin conversion assumes +that the object returned by the function has a refcount of 1 (or +higher), with the function having held the reference, and releases +that reference after placing the value into the interp result. The +conversion below on the other hand assumes that the value has a +refcount of 0 and thus that decrementing it is forbidden, lest it be +released much to early, and crashing the system.

    +
    +    critcl::resulttype KTcl_Obj* {
    +        if (rv == NULL) { return TCL_ERROR; }
    +        Tcl_SetObjResult(interp, rv);
    +        /* No refcount adjustment */
    +        return TCL_OK;
    +    } Tcl_Obj*
    +
    +

    This type of definition is also found in Marpa and recent +hacking hacking on CRIMP introduced it there as well. Which +is why this definition became a builtin type starting with version +3.1.16, under the names Tcl_Obj*0 and object0.

    +

    Going back to errors and their handling, of course, if a +function we are wrapping signals them in-band, then the conversion of +such results has to deal with that. This happens for example in +KineTcl, where we find

    +
    +    critcl::resulttype XnStatus {
    +        if (rv != XN_STATUS_OK) {
    +            Tcl_AppendResult (interp, xnGetStatusString (rv), NULL);
    +            return TCL_ERROR;
    +        }
    +        return TCL_OK;
    +    }
    +    critcl::resulttype XnDepthPixel {
    +        if (rv == ((XnDepthPixel) -1)) {
    +            Tcl_AppendResult (interp,
    +                              "Inheritance error: Not a depth generator",
    +                              NULL);
    +            return TCL_ERROR;
    +        }
    +        Tcl_SetObjResult (interp, Tcl_NewIntObj (rv));
    +        return TCL_OK;
    +    }
    +
    +
    +
    +

    Authors

    +

    Jean Claude Wippler, Steve Landers, Andreas Kupries

    +
    +

    Bugs, Ideas, Feedback

    +

    This document, and the package it describes, will undoubtedly contain +bugs and other problems. +Please report them at https://github.com/andreas-kupries/critcl/issues. +Ideas for enhancements you may have for either package, application, +and/or the documentation are also very welcome and should be reported +at https://github.com/andreas-kupries/critcl/issues as well.

    +
    + +

    Category

    +

    Glueing/Embedded C code

    +
    + +
    diff -Nru critcl-3.1.9/embedded/www/files/critcl_cutil.html critcl-3.1.17+dfsg/embedded/www/files/critcl_cutil.html --- critcl-3.1.9/embedded/www/files/critcl_cutil.html 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/embedded/www/files/critcl_cutil.html 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,470 @@ + + +critcl::cutil - C Runtime In Tcl (CriTcl) + + + + + +
    +
    [ + Table Of Contents +| Keyword Index + ]
    +

    critcl::cutil(n) 0.1 doc "C Runtime In Tcl (CriTcl)"

    +

    Name

    +

    critcl::cutil - CriTcl C-level Utilities

    +
    + + +

    Description

    +

    Welcome to the C Runtime In Tcl, CriTcl for short, a +system to build C extension packages for Tcl on the fly, from C code +embedded within Tcl scripts, for all who wish to make their code go +faster.

    +

    This document is the reference manpage for the critcl::cutil +package. This package encapsulates a number of C-level utilites for +easier writing of memory allocations, assertions, and narrative tracing +and provides convenience commands to make these utilities accessible +to critcl projects. +Its intended audience are mainly developers wishing to write Tcl +packages with embedded C code.

    +

    This package resides in the Core Package Layer of CriTcl.

    +

    arch_core

    +

    The reason for this is that the main critcl package makes +use of the facilities for narrative tracing when +critcl::config trace is set, to instrument commands and +procedures.

    +
    +

    API

    +
    +
    ::critcl::cutil::alloc
    +

    This command provides a number C-preprocessor macros which make the +writing of memory allocations for structures and arrays of structures +easier.

    +

    When run the header file "critcl_alloc.h" is directly made +available to the ".critcl" file containing the command, and +becomes available for use in #include directives of companion +C code declared via critcl::csources.

    +

    The macros definitions and their signatures are:

    +
    +    type* ALLOC (type)
    +    type* NALLOC (type, int n)
    +    type* REALLOC (type* var, type, int n)
    +    void  FREE (type* var)
    +
    +

    The details of the semantics are explained in section +Allocation.

    +

    The result of the command is an empty string.

    +
    ::critcl::cutil::assertions ?enable?
    +

    This command provides a number C-preprocessor macros for the writing +of assertions in C code.

    +

    When invoked the header file "critcl_assert.h" is directly +made available to the ".critcl" file containing the command, and +becomes available for use in #include directives of companion +C code declared via critcl::csources.

    +

    The macro definitions and their signatures are

    +
    +    void ASSERT (expression, char* message);
    +    void ASSERT_BOUNDS (int index, int size);
    +    void STOPAFTER (int n);
    +    void STREP (Tcl_Obj* o, char* s, int len);
    +    void STREP_DS (Tcl_Obj* o, Tcl_DString* ds);
    +
    +

    Note that these definitions are conditional on the existence of +the macro CRITCL_ASSERT. +Without a critcl::cflags -DCRITCL_ASSERT all assertions in the +C code are quiescent and not compiled into the object file. In other +words, assertions can be (de)activated at will during build time, as +needed by the user.

    +

    For convenience this is controlled by enable. By default +(false) the facility available, but not active. +Using true not only makes it available, but activates it as +well.

    +

    The details of the semantics are explained in section +Assertions.

    +

    The result of the command is an empty string.

    +
    ::critcl::cutil::tracer ?enable?
    +

    This command provides a number C-preprocessor macros for tracing +C-level internals.

    +

    When invoked the header file "critcl_trace.h" is directly +made available to the ".critcl" file containing the command, and +becomes available for use in #include directives of companion +C code declared via critcl::csources. Furthermore the ".c" +file containing the runtime support is added to the set of C companion +files

    +

    The macro definitions and their signatures are

    +
    +    /* (de)activation of named logical streams.
    +     * These are declarators, not statements.
    +     */
    +    TRACE_ON;
    +    TRACE_OFF;
    +    TRACE_TAG_ON  (tag_identifier);
    +    TRACE_TAG_OFF (tag_identifier);
    +    /*
    +     * Higher level trace statements (convenience commands)
    +     */
    +    void TRACE_FUNC   (const char* format, ...);
    +    void TRACE_FUNC_VOID;
    +    any  TRACE_RETURN (const char* format, any x);
    +    void TRACE_RETURN_VOID;
    +    void TRACE (const char* format, ...);
    +    /*
    +     * Low-level trace statements the higher level ones above
    +     * are composed from. Scope management and output management.
    +     */
    +    void TRACE_PUSH_SCOPE (const char* scope);
    +    void TRACE_PUSH_FUNC;
    +    void TRACE_POP;
    +    void TRACE_HEADER (int indent);
    +    void TRACE_ADD (const char* format, ...);
    +    void TRACE_CLOSER;
    +    /*
    +     * Convert tag to the underlying status variable.
    +     */
    +    TRACE_TAG_VAR (tag)
    +    /*
    +     * Conditional use of arbitrary code.
    +     */
    +    TRACE_RUN (code);
    +    TRACE_DO (code);
    +    TRACE_TAG_DO (code);
    +
    +

    Note that these definitions are conditional on the existence of +the macro CRITCL_TRACER. +Without a critcl::cflags -DCRITCL_TRACER all trace +functionality in the C code is quiescent and not compiled into the +object file. In other words, tracing can be (de)activated at will +during build time, as needed by the user.

    +

    For convenience this is controlled by enable. By default +(false) the facility available, but not active. +Using true not only makes it available, but activates it as +well. +Further note that the command critcl::config now accepts a +boolean option trace. Setting it activates enter/exit tracing +in all commands based on critcl::cproc, with proper printing of +arguments and results. This implicitly activates the tracing facility +in general.

    +

    The details of the semantics are explained in section +Tracing

    +

    The result of the command is an empty string.

    +
    +
    +

    Allocation

    +
    +
    type* ALLOC (type)
    +

    This macro allocates a single element of the given type and +returns a pointer to that memory.

    +
    type* NALLOC (type, int n)
    +

    This macro allocates n elements of the given type and +returns a pointer to that memory.

    +
    type* REALLOC (type* var, type, int n)
    +

    This macro expands or shrinks the memory associated with the C +variable var of type type to hold n elements of the +type. It returns a pointer to that memory. +Remember, a reallocation may move the data to a new location in memory +to satisfy the request. Returning a pointer instead of immediately +assigning it to the var allows the user to validate the new +pointer before trying to use it.

    +
    void FREE (type* var)
    +

    This macro releases the memory referenced by the pointer variable +var.

    +
    +
    +

    Assertions

    +
    +
    void ASSERT (expression, char* message
    +

    This macro tests the expression and panics if it does not hold. +The specified message is used as part of the panic. +The message has to be a static string, it cannot be a variable.

    +
    void ASSERT_BOUNDS (int index, int size)
    +

    This macro ensures that the index is in the +range 0 to size-1.

    +
    void STOPAFTER(n)
    +

    This macro throws a panic after it is called n times. +Note, each separate instance of the macro has its own counter.

    +
    void STREP (Tcl_Obj* o, char* s, int len)
    +

    This macro properly sets the string representation of the Tcl object +o to a copy of the string s, expected to be of length +len.

    +
    void STREP_DS (Tcl_Obj* o, Tcl_DString* ds)
    +

    This macro properly sets the string representation of the Tcl object +o to a copy of the string held by the DString ds.

    +
    +
    +

    Tracing

    +

    All output is printed to stdout.

    +
    +
    TRACE_ON
    +
    +
    TRACE_OFF
    +
    +
    TRACE_TAG_ON (identifier)
    +
    +
    TRACE_TAG_OFF (identifier)
    +

    These "commands" are actually declarators, for use outside of +functions. They (de)activate specific logical streams, named either +explicitly by the user, or implicitly, refering to the current file.

    +

    For example:

    +
    +    TRACE_TAG_ON (lexer_in);
    +
    +

    All high- and low-level trace commands producing output have +the controlling tag as an implicit argument. The scope management +commands do not take tags.

    +
    void TRACE_FUNC
    +
    +
    void TRACE_TAG_FUNC (tag)
    +
    +
    void TRACE_FUNC_VOID
    +
    +
    void TRACE_TAG_FUNC_VOID (tag)
    +

    Use these macros at the beginning of a C function to record entry into +it. The name of the entered function is an implicit argument +(__func__), forcing users to have a C99 compiler..

    +

    The tracer's runtime maintains a stack of active functions and +expects that function return is signaled by either TRACE_RETURN, +TRACE_RETURN_VOID, or the equivalent forms taking a tag.

    +
    void TRACE_RETURN_VOID
    +
    +
    void TRACE_TAG_RETURN_VOID (tag)
    +

    Use these macros instead of

    +
    return
    +

    to return from a void +function. Beyond returning from the function this also signals the +same to the tracer's runtime, popping the last entered function from +its stack of active functions.

    +
    any TRACE_RETURN ( char* format, any x)
    +
    +
    any TRACE_TAG_RETURN (tag, char* format, any x)
    +

    Use this macro instead of

    +
    return x
    +

    to return from a +non-void function. +Beyond returning from the function with value x this also +signals the same to the tracer's runtime, popping the last entered +function from its stack of active functions. +The format is expected to be a proper formatting string for +printf and analogues, able to stringify x.

    +
    void TRACE ( char* format, ...)
    +
    +
    void TRACE_TAG (tag, char* format, ...)
    +

    This macro is the trace facilities' equivalent of printf, +printing arbitrary data under the control of the format.

    +

    The printed text is closed with a newline, and indented as per +the stack of active functions.

    +
    void TRACE_HEADER (int indent)
    +
    +
    void TRACE_TAG_HEADER (tag, int indent)
    +

    This is the low-level macro which prints the beginning of a trace +line. This prefix consists of physical location (file name and line +number), if available, indentation as per the stack of active scopes +(if activated), and the name of the active scope.

    +
    void TRACE_CLOSER
    +
    +
    void TRACE_TAG_CLOSER (tag)
    +

    This is the low-level macro which prints the end of a trace +line.

    +
    void TRACE_ADD (const char* format, ...)
    +
    +
    void TRACE_TAG_ADD (tag, const char* format, ...)
    +

    This is the low-level macro which adds formatted data to the line.

    +
    void TRACE_PUSH_SCOPE (const char* name)
    +
    +
    void TRACE_PUSH_FUNC
    +
    +
    void TRACE_PUSH_POP
    +

    These are the low-level macros for scope management. The first two +forms push a new scope on the stack of active scopes, and the last +forms pops the last scope pushed.

    +
    TRACE_TAG_VAR (tag)
    +

    Helper macro converting from a tag identifier to the name of the +underlying status variable.

    +
    TRACE_RUN (code);
    +

    Conditionally insert the code at compile time when the tracing +facility is activated.

    +
    TRACE_DO (code);
    +
    +
    TRACE_TAG_DO (tag, code);
    +

    Insert the code at compile time when the tracing facility is +activated, and execute the same when either the implicit tag for the +file or the user-specified tag is active.

    +
    +
    +

    Authors

    +

    Andreas Kupries

    +
    +

    Bugs, Ideas, Feedback

    +

    This document, and the package it describes, will undoubtedly contain +bugs and other problems. +Please report such at https://github.com/andreas-kupries/critcl. +Please also report any ideas for enhancements you may have for either +package and/or documentation.

    +
    + +

    Category

    +

    Glueing/Embedded C code

    +
    + +
    diff -Nru critcl-3.1.9/embedded/www/files/critcl_devguide.html critcl-3.1.17+dfsg/embedded/www/files/critcl_devguide.html --- critcl-3.1.9/embedded/www/files/critcl_devguide.html 2013-05-10 05:57:04.000000000 +0000 +++ critcl-3.1.17+dfsg/embedded/www/files/critcl_devguide.html 2017-10-14 02:48:11.000000000 +0000 @@ -92,18 +92,18 @@ } --> - -

    [ - Table Of Contents + Table Of Contents | Keyword Index -]
    -

    critcl_devguide(n) 3.1.8 doc "C Runtime In Tcl (CriTcl)"

    + ]
    +

    critcl_devguide(n) 3.1.17 doc "C Runtime In Tcl (CriTcl)"

    Name

    critcl_devguide - Critcl - The Developer's Guide

    @@ -407,6 +407,6 @@
    diff -Nru critcl-3.1.9/embedded/www/files/critcl_emap.html critcl-3.1.17+dfsg/embedded/www/files/critcl_emap.html --- critcl-3.1.9/embedded/www/files/critcl_emap.html 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/embedded/www/files/critcl_emap.html 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,287 @@ + + +critcl::emap - C Runtime In Tcl (CriTcl) + + + + + +
    +
    [ + Table Of Contents +| Keyword Index + ]
    +

    critcl::emap(n) 1 doc "C Runtime In Tcl (CriTcl)"

    +

    Name

    +

    critcl::emap - CriTcl Utilities: Enum en- and decoding

    +
    + +

    Synopsis

    +
    +
      +
    • package require Tcl 8.4
    • +
    • package require critcl ?3.1.11?
    • +
    • package require critcl::emap ?1?
    • +
    + +
    +
    +

    Description

    +

    Welcome to the C Runtime In Tcl, CriTcl for short, a +system to build C extension packages for Tcl on the fly, from C code +embedded within Tcl scripts, for all who wish to make their code go +faster.

    +

    This document is the reference manpage for the +critcl::emap package. This package provides convenience +commands for advanced functionality built on top of both critcl core +and package critcl::iassoc.

    +

    C level libraries often use enumerations or integer values to encode +information, like the state of a system. Tcl bindings to such libraries now +have the task of converting a Tcl representation, i.e. a string into such +state, and back. +Note here that the C-level information has to be something which +already exists. The package does not create these values. This is +in contrast to the package critcl::enum which creates an +enumeration based on the specified symbolic names.

    +

    This package was written to make the declaration and management +of such enumerations and their associated conversions functions easy, +hiding all attendant complexity from the user.

    +

    Its intended audience are mainly developers wishing to write +Tcl packages with embedded C code.

    +

    This package resides in the Core Package Layer of CriTcl.

    +

    arch_core

    +
    +

    API

    +
    +
    ::critcl::emap::def name definition ?-nocase? ?-mode mode?
    +

    This command defines C functions for the conversion of the named +state code into a Tcl string, and vice versa. +The underlying mapping tables are automatically initialized on first +access (if not fully constant), and finalized on interpreter +destruction.

    +

    The definition dictionary provides the mapping from the +Tcl-level symbolic names of the state to their C expressions (often +the name of the macro specifying the actual value). +Note here that the C-level information has to be something which +already exists. The package does not create these values. This is +in contrast to the package critcl::enum which creates an +enumeration based on the specified symbolic names.

    +

    Further note that multiple strings can be mapped to the same C +expression. When converting to Tcl the first string for the mapping is +returned. An important thing to know: If all C expressions are +recognizable as integer numbers and their covered range is not too +large (at most 50) the package will generate code using direct and +fast mapping tables instead of using a linear search.

    +

    If the option -nocase is specified then the encoder +will match strings case-insensitively, and the decoder will always +return a lower-case string, regardless of the string's case in the +definition.

    +

    If the option -mode is specified its contents will +interpreted as a list of access modes to support. The two allowed +modes are c and tcl. Both modes can be used +together. The default mode is tcl.

    +

    The package generates multiple things (declarations and +definitions) with names derived from name, which has to be a +proper C identifier. Some of the things are generated conditional on +the chosen modes.

    +
    +
    name_encode
    +

    The tcl-mode function for encoding a Tcl string into the +equivalent state code. +Its signature is

    +
    +int name_encode (Tcl_Interp* interp, Tcl_Obj* state, int* result);
    +
    +

    The return value of the function is a Tcl error code, +i.e. TCL_OK, TCL_ERROR, etc.

    +
    name_encode_cstr
    +

    The c-mode function for encoding a C string into the +equivalent state code. +Its signature is

    +
    +int name_encode_cstr (const char* state);
    +
    +

    The return value of the function is the encoded state, or -1 if +the argument is not a vlaid state.

    +
    name_decode
    +

    The tcl-mode function for decoding a state code into the +equivalent Tcl string. +Its signature is

    +
    +Tcl_Obj* name_decode (Tcl_Interp* interp, int state);
    +
    +
    +
    name_decode_cstr
    +

    The c-mode function for decoding a state code into the +equivalent C string. +Its signature is

    +
    +const char* name_decode_cstr (int state);
    +
    +

    The return value of the function is the C string for the state, +or NULL if the state argument does not contain a valid +state value.

    +
    name.h
    +

    A header file containing the declarations for the conversion +functions, for use by other parts of the system, if necessary.

    +

    The generated file is stored in a place where it will not +interfere with the overall system outside of the package, yet also be +available for easy inclusion by package files (csources).

    +
    name
    +

    For mode tcl the command registers a new argument-type for +critcl::cproc with critcl, encapsulating the encoder function.

    +
    name
    +

    For mode tcl the command registers a new result-type for +critcl::cproc with critcl, encapsulating the decoder function.

    +
    +
    +
    +

    Example

    +

    The example shown below is the specification for the possible modes of +entry (normal, no feedback, stars) used by the Tcl binding to the +linenoise library.

    +
    +package require Tcl 8.5
    +package require critcl 3.1.11
    +critcl::buildrequirement {
    +    package require critcl::emap
    +}
    +critcl::emap::def hiddenmode {
    +            no  0 n 0 off 0 false 0 0 0
    +    all   1 yes 1 y 1 on  1 true  1 1 1
    +    stars 2
    +} -nocase
    +# Declarations: hiddenmode.h
    +# Encoder:      int      hiddenmode_encode (Tcl_Interp* interp, Tcl_Obj* state, int* result);
    +# Decoder:      Tcl_Obj* hiddenmode_decode (Tcl_Interp* interp, int state);
    +# ResultType:   hiddenmode
    +# ArgumentType: hiddenmode
    +
    +
    +

    Authors

    +

    Andreas Kupries

    +
    +

    Bugs, Ideas, Feedback

    +

    This document, and the package it describes, will undoubtedly contain +bugs and other problems. +Please report such at https://github.com/andreas-kupries/critcl. +Please also report any ideas for enhancements you may have for either +package and/or documentation.

    +
    + +

    Category

    +

    Glueing/Embedded C code

    +
    + +
    diff -Nru critcl-3.1.9/embedded/www/files/critcl_enum.html critcl-3.1.17+dfsg/embedded/www/files/critcl_enum.html --- critcl-3.1.9/embedded/www/files/critcl_enum.html 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/embedded/www/files/critcl_enum.html 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,249 @@ + + +critcl::enum - C Runtime In Tcl (CriTcl) + + + + + +
    +
    [ + Table Of Contents +| Keyword Index + ]
    +

    critcl::enum(n) 1.0.1 doc "C Runtime In Tcl (CriTcl)"

    +

    Name

    +

    critcl::enum - CriTcl Utilities: String/Integer mapping

    +
    + +

    Synopsis

    +
    +
      +
    • package require Tcl 8.4
    • +
    • package require critcl ?3.1.11?
    • +
    • package require critcl::enum ?1.0.1?
    • +
    + +
    +
    +

    Description

    +

    Welcome to the C Runtime In Tcl, CriTcl for short, a +system to build C extension packages for Tcl on the fly, from C code +embedded within Tcl scripts, for all who wish to make their code go +faster.

    +

    This document is the reference manpage for the +critcl::enum package. This package provides convenience +commands for advanced functionality built on top of both critcl core +and package critcl::literals.

    +

    It is an extended form of string pool which not only converts +integer values into Tcl-level strings, but also handles the reverse +direction, converting from strings to the associated integer values.

    +

    It essentially provides a bi-directional mapping between a C +enumeration type and a set of strings, one per enumeration value. +Note that the C enumeration in question is created by the +definition. It is not possible to use the symbols of an existing +enumeration type.

    +

    This package was written to make the declaration and management +of such mappings easy. It uses a string pool for one of the directions, +using its ability to return shared literals and conserve memory.

    +

    Its intended audience are mainly developers wishing to write +Tcl packages with embedded C code.

    +

    This package resides in the Core Package Layer of CriTcl.

    +

    arch_core

    +
    +

    API

    +
    +
    ::critcl::enum::def name definition
    +

    This command defines two C functions for the conversion between +C values and Tcl_Obj'ects, with named derived from name.

    +

    The definition dictionary provides the mapping from the +specified C-level symbolic names to the strings themselves.

    +

    The package generates multiple things (declarations and +definitions) with names derived from name, which has to be a +proper C identifier.

    +
    +
    name_pool_names
    +

    The C enumeration type containing the specified symbolic names.

    +
    name_ToObj
    +

    The function converting from integer value to Tcl string. +Its signature is

    +
    +Tcl_Obj* name_ToObj (Tcl_Interp* interp, name_names literal);
    +
    +
    +
    name_GetFromObj
    +

    The function converting from Tcl string to integer value. +Its signature is

    +
    +int name_GetFromObj (Tcl_Interp* interp, Tcl_Obj* obj, int flags, int* literal);
    +
    +

    The flags are like for Tcl_GetIndexFromObj.

    +
    name.h
    +

    A header file containing the declarations for the converter functions, +for use by other parts of the system, if necessary.

    +

    The generated file is stored in a place where it will not +interfere with the overall system outside of the package, yet also be +available for easy inclusion by package files (csources).

    +
    name
    +

    At the level of critcl itself the command registers a new result-type +for critcl::cproc, which takes an integer result from the function +and converts it to the equivalent string in the pool for the script.

    +
    name
    +

    At the level of critcl itself the command registers a new argument-type +for critcl::cproc, which takes a Tcl string and converts it to the +equivalent integer for delivery to the function.

    +
    +
    +
    +

    Example

    +

    The example shown below is the specification for a set of actions, methods, +and the like, a function may take as argument.

    +
    +package require Tcl 8.5
    +package require critcl 3.1.11
    +critcl::buildrequirement {
    +    package require critcl::enum
    +}
    +critcl::enum::def action {
    +    w_create	"create"
    +    w_directory	"directory"
    +    w_events	"events"
    +    w_file	"file"
    +    w_handler	"handler"
    +    w_remove	"remove"
    +}
    +# Declarations: action.h
    +# Type:         action_names
    +# Accessor:     Tcl_Obj* action_ToObj (Tcl_Interp* interp, int literal);
    +# Accessor:     int action_GetFromObj (Tcl_Interp* interp, Tcl_Obj* o, int flags, int* literal);
    +# ResultType:   action
    +# ArgType:      action
    +
    +
    +

    Authors

    +

    Andreas Kupries

    +
    +

    Bugs, Ideas, Feedback

    +

    This document, and the package it describes, will undoubtedly contain +bugs and other problems. +Please report such at https://github.com/andreas-kupries/critcl. +Please also report any ideas for enhancements you may have for either +package and/or documentation.

    +
    + +

    Category

    +

    Glueing/Embedded C code

    +
    + +
    diff -Nru critcl-3.1.9/embedded/www/files/critcl_iassoc.html critcl-3.1.17+dfsg/embedded/www/files/critcl_iassoc.html --- critcl-3.1.9/embedded/www/files/critcl_iassoc.html 2013-05-10 05:57:04.000000000 +0000 +++ critcl-3.1.17+dfsg/embedded/www/files/critcl_iassoc.html 2017-10-14 02:48:11.000000000 +0000 @@ -92,17 +92,17 @@ } --> - -

    [ - Table Of Contents + Table Of Contents | Keyword Index -]
    + ]

    critcl::iassoc(n) 1 doc "C Runtime In Tcl (CriTcl)"

    Name

    critcl::iassoc - CriTcl Utilities: Tcl Interp Associations

    @@ -243,12 +243,12 @@ package and/or documentation.

    Category

    Glueing/Embedded C code

    diff -Nru critcl-3.1.9/embedded/www/files/critcl_installer.html critcl-3.1.17+dfsg/embedded/www/files/critcl_installer.html --- critcl-3.1.9/embedded/www/files/critcl_installer.html 2013-05-10 05:57:04.000000000 +0000 +++ critcl-3.1.17+dfsg/embedded/www/files/critcl_installer.html 2017-10-14 02:48:11.000000000 +0000 @@ -92,18 +92,18 @@ } --> - -

    [ - Table Of Contents + Table Of Contents | Keyword Index -]
    -

    critcl_install_guide(n) 3.1.8 doc "C Runtime In Tcl (CriTcl)"

    + ]
    +

    critcl_install_guide(n) 3.1.17 doc "C Runtime In Tcl (CriTcl)"

    Name

    critcl_install_guide - Critcl - The Installer's Guide

    @@ -115,12 +115,18 @@ -
  • Build & Installation
  • -
  • First Use, Testing the Installation
  • -
  • Authors
  • -
  • Bugs, Ideas, Feedback
  • +
  • Build & Installation Instructions + +
  • +
  • Authors
  • +
  • Bugs, Ideas, Feedback
  • Keywords
  • Category
  • Copyright
  • @@ -150,6 +156,7 @@ For details see Tcl.

  • Various packages from the Tcllib bundle for Tcl. For details see Tcllib.

  • +
  • A working C compiler and development environment.

  • This list assumes that the machine where Critcl is to be installed is essentially clean. Of course, if parts of the dependencies listed @@ -236,18 +243,80 @@

    to make this happen.

    Now, for those wishing to install the packages from source, -the CVS repository for the two bundles can be found at -https://sourceforge.net/projects/tcllib.

    -

    Releases of Tcllib can be found in the associated Files -section, or CVS can be used to check out the sub-project tcllib.

    -

    Tcllib comes with its own installation instructions. These will -not be repeated here. If there are problems with its directions please -file a bug against the Tcllib project at the above url, and not -Critcl.

    +the fossil repository for the two bundles can be found at +https://core.tcl.tk/tcllib and https://core.tcl.tk/tklib.

    +

    Releases of Tcllib and Tklib can be found there as well, or +fossil can be used to check out specific revisions.

    +

    Tcl- and Tklib come with their own installation instructions. +These will not be repeated here. If there are problems with their +directions please file a bug against the Tcllib project at the above +url, and not CriTcl.

    +
    +

    C compiler

    +

    To actually build packages based on critcl we need a working C +compiler.

    +

    How to install such and all the associated header files, +libraries, etc. is heavily platform- and system-dependent, and thus +outside of the scope of this document. +Note that I am willing to extend this section with links of interest +to tutorials, howtos and references for the various platforms.

    +

    The important pieces of information are this:

    +
      +
    1. The path to the C compiler binary must be found in the + environment variable PATH, for critcl to find it.

    2. +
    3. On Windows(tm) the environment variable LIB must be + present and contain the paths of the directories holding + Microsoft's libraries. The standard critcl configuration + for this platform searches these paths to fine-tune its + settings based on available libraries and compiler version.

    4. +
    +

    Links of interest:

    +
    +
    http://www.tldp.org/HOWTO/HOWTO-INDEX/programming.html
    +
    +
    -

    Build & Installation

    -

    To install Critcl simply run

    +

    Build & Installation Instructions

    +

    Build & Installation (Unix)

    +

    This section describes the actions required to install CriTcl on Unix +systems (Linux, BSD, and related, including OS X). +If you have to install CriTcl on a Windows machine see section +Build & Installation (Windows) instead. +To install Critcl simply run

    +
    +    /path/to/tclsh /path/to/critcl/build.tcl install
    +
    +

    where "/path/to/tclsh" is the tclsh of your Tcl installation, and +"/path/to/critcl" the location of the Critcl sources on your system.

    +

    This builds all packages and then places them in a directory where the +tclsh will find them.

    +

    It further creates a "critcl" application script and places it +into the directory tclsh resides in, making it a sibling of that +executable. +Note that the installed critcl application is modified to use the +chosen tclsh instead of searching for one on the PATH.

    +

    On Windows you can invoke the file "build.tcl" with a +double-click. This will pop up a small graphical interface for +entering the destination and performing the installation. This +handling of a double-click is restricted to Windows only however.

    +

    The build system provides a small GUI for those not comfortable with +the command line. +This GUI is accessible by invoking "build.tcl" without any +arguments.

    +

    To get help about the methods of "build.tcl", and their complete +syntax, invoke "build.tcl" with argument help, i.e., like

    +
    +    /path/to/tclsh /path/to/critcl/build.tcl help
    +
    +
    +

    Build & Installation (Windows)

    +

    This section describes the actions required to install CriTcl on +Windows(tm) systems. +If you have to install CriTcl on a Unix machine (Linux, BSD, and +related, including OS X) see section +Build & Installation (Unix) instead. +To install Critcl simply run

         /path/to/tclsh /path/to/critcl/build.tcl install
     
    @@ -257,21 +326,30 @@ tclsh will find them.

    It further creates a "critcl" application script and places it into the directory tclsh resides in, making it a sibling of that -executable. The critcl application is written to use that executable -as well, and not search for it in the PATH.

    +executable.

    +

    Attention! Note that while the installed critcl +application is modified to use the chosen tclsh instead of searching +for one on the PATH this is useless for Windows, which +associates executables with files through their extension.

    +

    Attention! The current installer does not put an +extension on the critcl application, forcing users to either +explicitly choose the tclsh to run the application, or +manually rename the installed file to "critcl.tcl", if an +association for ".tcl" is available, to either tclsh, or +wish.

    On Windows you can invoke the file "build.tcl" with a double-click. This will pop up a small graphical interface for entering the destination and performing the installation. This handling of a double-click is restricted to Windows only however.

    -

    On unix the same GUI is acessible by invoking "build.tcl" without -any arguments.

    +

    This GUI is also accessible by invoking "build.tcl" without any +arguments.

    To get help about the methods of "build.tcl", and their complete syntax, invoke "build.tcl" with argument help, i.e., like

         /path/to/tclsh /path/to/critcl/build.tcl help
     
    -

    First Use, Testing the Installation

    +

    First Use, Testing the Installation

    With critcl installed it is now the time to try at least one of the examples distributed with it. This will also test if the installation was successful.

    @@ -279,6 +357,34 @@ high-level stack example packages. I am intentionally bypassing the "build.tcl" file the example is coming with, to show the use of critcl itself.

    +

    Some more explanations before running the example:

    +
      +
    • Here "path/to/critcl" is the path to the installed + critcl application, not the critcl source directory.

      +

      Also, on Windows(tm) this part of the example must be + replaced with

      +
       /path/to/tclsh /path/to/critcl 
      +

      as the installed application has no extension and + thus Windows will not know how to execute the script.

      +

      Only if the installed application was manually renamed to + "critcl.tcl" and the machine has an association for + ".tcl" to either tclsh or wish then + the "/path/to/tclsh" can be left out.

    • +
    • The example shows only the commands entered on the shell (and + tclsh) command line. Their responses are left out.

      +

      If any command throws an error, i.e. has a problem, then all + following commands will run into some other error as well, + as a consequence of the first problem.

    • +
    • Use of option -keep causes critcl to leave the + generated .c files behind, for edification. Normally this + happens only in case of trouble.

    • +
    • Use of option -cache redirects the location of the + directory to hold generated and build files to a local + directory with a known name, for an easy look after.

    • +
    • Both cstack and stackc have to use the + same -cache so that stackc will + find the stub table headers exported by cstack.

    • +
         > cd examples/stack
         > /path/to/critcl -keep -cache B -pkg cstack.tcl
    @@ -294,25 +400,12 @@
         % exit
         >
     
    -

    Some explanations:

    -
      -
    • The example shows only the commands entered on the shell (and - tclsh) command line. Their responses are left out.

    • -
    • Use of option -keep causes critcl to leave the - generated .c files behind, for edification. Normally this - happens only in case of trouble.

    • -
    • Use of option -cache redirects the location of the - directory to hold generated and build files to a local - directory with a known name, for an easy look after.

    • -
    • Both cstack and stackc have to use the - same -cache so that stackc will - find the stub table headers exported by cstack.

    • -
    - +

    Authors

    Jean Claude Wippler, Steve Landers, Andreas Kupries

    -

    Bugs, Ideas, Feedback

    +

    Bugs, Ideas, Feedback

    This document, and the package it describes, will undoubtedly contain bugs and other problems. Please report them at https://github.com/andreas-kupries/critcl/issues. @@ -329,6 +422,6 @@

    diff -Nru critcl-3.1.9/embedded/www/files/critcl_introduction.html critcl-3.1.17+dfsg/embedded/www/files/critcl_introduction.html --- critcl-3.1.9/embedded/www/files/critcl_introduction.html 2013-05-10 05:57:04.000000000 +0000 +++ critcl-3.1.17+dfsg/embedded/www/files/critcl_introduction.html 2017-10-14 02:48:11.000000000 +0000 @@ -92,18 +92,18 @@ } --> - -

    [ - Table Of Contents + Table Of Contents | Keyword Index -]
    -

    critcl_introduction(n) 3.1.8 doc "C Runtime In Tcl (CriTcl)"

    + ]
    +

    critcl_introduction(n) 3.1.17 doc "C Runtime In Tcl (CriTcl)"

    Name

    critcl_introduction - Introduction To CriTcl

    @@ -115,27 +115,35 @@
  • Modes Of Operation/Use
  • System Architecture
  • Examples
  • -
  • Changes for version 2.1
  • -
  • Changes for version 3
  • -
  • Changes for version 3.0.1
  • -
  • Changes for version 3.0.2
  • -
  • Changes for version 3.0.3
  • -
  • Changes for version 3.0.4
  • -
  • Changes for version 3.0.5
  • -
  • Changes for version 3.0.6
  • -
  • Changes for version 3.0.7
  • -
  • Changes for version 3.1
  • -
  • Changes for version 3.1.1
  • -
  • Changes for version 3.1.2
  • -
  • Changes for version 3.1.3
  • +
  • Changes for version 3.1.17
  • +
  • Changes for version 3.1.16
  • +
  • Changes for version 3.1.15
  • +
  • Changes for version 3.1.14
  • +
  • Changes for version 3.1.13
  • +
  • Changes for version 3.1.12
  • +
  • Changes for version 3.1.11
  • +
  • Changes for version 3.1.10
  • +
  • Changes for version 3.1.9
  • +
  • Changes for version 3.1.8
  • +
  • Changes for version 3.1.7
  • +
  • Changes for version 3.1.6
  • +
  • Changes for version 3.1.5
  • Changes for version 3.1.4
  • -
  • Changes for version 3.1.5
  • -
  • Changes for version 3.1.6
  • -
  • Changes for version 3.1.7
  • -
  • Changes for version 3.1.8
  • -
  • Changes for version 3.1.9
  • -
  • Authors
  • -
  • Bugs, Ideas, Feedback
  • +
  • Changes for version 3.1.3
  • +
  • Changes for version 3.1.2
  • +
  • Changes for version 3.1.1
  • +
  • Changes for version 3.1
  • +
  • Changes for version 3.0.7
  • +
  • Changes for version 3.0.6
  • +
  • Changes for version 3.0.5
  • +
  • Changes for version 3.0.4
  • +
  • Changes for version 3.0.3
  • +
  • Changes for version 3.0.2
  • +
  • Changes for version 3.0.1
  • +
  • Changes for version 3
  • +
  • Changes for version 2.1
  • +
  • Authors
  • +
  • Bugs, Ideas, Feedback
  • Keywords
  • Category
  • Copyright
  • @@ -279,285 +287,384 @@ examples. These focus more on specific critcl commands than the overall picture shown by the large examples mentioned in the previous paragraph.

    +

    The latest changes are found at the top.

    -

    Changes for version 2.1

    +

    Changes for version 3.1.17

      -
    1. Fixed bug where critcl::tsources interpreted relative -paths as relative to the current working directory instead of -relative to the ".critcl" file using the command, as all other -commands of this type do.

    2. -
    3. Fixed internals, preventing information collected for multiple -".critcl" files to leak between them. Notably, critcl::tk -is not a global configuration option anymore.

    4. -
    5. Fixed the command critcl::license to be a null-operation -in mode "compile & run", instead of throwing an error.

    6. -
    7. Fixed the critcl application's interference with the "compile & -run" result cache in -pkg mode by having it use a wholly -separate (and by default transient) directory for that mode.

    8. -
    9. Fixed bug where changes to a ".critcl" file did not result -in a rebuild for mode "compile & run". All relevant API commands now -ensure UUID changes.

    10. -
    11. Fixed bug in the backend handling of critcl::debug where -the companion c-sources of a ".critcl" file were not compiled -with debug options, although the ".critcl" file was.

    12. -
    13. Fixed bug in critcl::debug which prevented recognition of -mode "all" when it was not the first argument to the command.

    14. -
    15. Fixed bug in "preload.c" preventing its compilation on -non-windows platforms.

    16. -
    17. Fixed long-standing bug in the handling of namespace qualifiers -in the command name argument of critcl::cproc and -critcl::ccommand. It is now possible to specify a fully -qualified command name without issues.

    18. -
    19. Extended/reworked critcl::tsources to be the canonical -way of declaring ".tcl" companion files even for mode "compile & -run".

    20. -
    21. Extended/reworked critcl::tsources to allow the use of a -".critcl" file as its own Tcl companion file.

    22. -
    23. Extended critcl::framework to internally check for OS X -build target, and to ignore the declaration if its not.

    24. -
    25. Extended critcl::failed to be callable more than once in -a ".critcl" file. The first call forces the build, if it was not -done already, to get the result. Further calls return the cached -result of the first call.

    26. -
    27. Extended the handling of environment variable CC in the code -determining the compiler to use to deal with (i.e. remove) paths to -the compiler, compiler file extensions, and compiler options specified -after the compiler itself, leaving only the bare name of the compiler.

    28. -
    29. Extended the code handling the search for preloaded libraries -to print the paths it searched, making debugging of a search failure -easier.

    30. -
    31. A new command critcl::tcl can be used to declare the -version of Tcl minimally needed to build and run the ".critcl" -file and package. Defaults to 8.4 if not declared. Extended critcl to -have the stubs and headers for all of Tcl 8.4, 8.5, and 8.6.

    32. -
    33. A new command critcl::load forces the build and load of a -".critcl" file. This is the official way for overriding critcl's -default lazy-build-&-load-on-demand scheme for mode "compile & run".

      -

      Note that after using critcl::load / -critcl::failed in a ".critcl" file it is not possible to -use critcl commands in that file anymore. Doing so will throw an -error.

    34. -
    35. Extended the generation of '#line' pragmas to use -info frame (if available) to provide the C compiler with exact -line numbers into the ".critcl" file for the reporting of -warnings and errors.

    36. -
    37. Extended critcl::check with logging to help with -debugging build-time checks of the environment, plus an additional -optional argument to provide labeling.

    38. -
    39. Added a new command critcl::checklink which not only -tries to check the environment via compiling the code, but also -its linkability.

    40. -
    41. Added a new command critcl::msg for messaging, like -command critcl::error is for error reporting. Likewise this is a -hook a user of the package is allowed to override. The default -implementation, used by mode compile & run does nothing. The -implementation for mode generate package prints the message -to stdout.

      -

      Envisioned use is for the reporting of results determined by -critcl::check and critcl::checklink during building, to -help with debugging when something goes wrong with a check.

    42. -
    43. Exposed the argument processing internals of critcl::proc -for use by advanced users. The new commands are

      -
        -
      1. critcl::argnames

      2. -
      3. critcl::argcnames

      4. -
      5. critcl::argcsignature

      6. -
      7. critcl::argvardecls

      8. -
      9. critcl::argconversion

      10. +
      11. Extension: Allow duplicate arg- and result-type definitions if + they are fully identical.

      12. +
      13. Bugfix. The application mishandled the possibility of + identical-named critcl::tsources. Possible because + critcl::tsources can be in subdirectories, a structure + which is not retained in the assembled package, causing + such files to overwrite each other and at least one lost. Fixed + by adding a serial number to the file names in the assembled + package.

      14. +
      15. Bugfix in the static scanner which made it loose requirement + information. Further added code to generally cleanup results at + the end (removal of duplicates, mainly).

      16. +
      17. Bugfix: Fixed issue #76. + Support installation directories which are not in the auto_path. + Without the patch the installed critcl will not find its + own packages and fail. Thank you to + Simon Bachmann for the + report and patch, and then his patience with me to getting to + actually apply it.

      18. +
      19. Bugfix: Fixed issue #75. + Extended critcl::include to now take multiple paths.

      20. +
      21. Added new compatibility package lmap84.

      22. +
      23. Fixed typos in various documentation files.

      24. +
      25. Fixed bug introduced by commit 86f415dd30 (3.1.16 release). The + separation of critcl::ccode into user and work layers + means that location retrieval has to go one more level up to + find the user location.

      26. +
      27. New supporting package critcl::cutil. Provides common + C level facilities useful to packages (assertions, tracing, + memory allocation shorthands).

      28. +
      29. Modified package critcl to make use of the new + tracing facilities to provide tracing of arguments and results + for critcl::ccommand and critcl::cproc invokations.

      30. +
      31. Modified packages critcl and critcl::class + to provide better function names for (class) method tracing. + Bumped package critcl::class to version 1.0.7.

      32. +
      33. Extended the support package critcl::literals with + limited configurability. It is now able to generate code for + C-level access to the pool without Tcl types (Mode c). + The previously existing functionality is accesssible under mode + tcl, which also is the default. Both modes can be used + together.

      34. +
      35. Extended the support package critcl::emap with + limited configurability. It is now able to generate code for + C-level access to the mapping without Tcl types + (Mode c). The previously existing functionality is + accessible under mode tcl, which also is the + default. Both modes can be used together.

      36. +
      +
    +

    Changes for version 3.1.16

    +
      +
    1. New feature. Extended critcl::cproc's argument handling + to allow arbitrary mixing of required and optional arguments.

    2. +
    3. New feature. + Potential Incompatibility.

      +

      Extended critcl::cproc's argument handling to treat an + argument args as variadic if it is the last argument of + the procedure.

    4. +
    5. New feature. Added two introspection commands, + critcl::has-argtype and critcl::has-resulttype. + These enable a user to test if a specific (named) type + conversion is implemented or not.

    6. +
    7. Added new result type Tcl_Obj*0, with alias + object0. The difference to Tcl_Obj* is in + the reference counting.

    8. +
    9. Extended the command critcl::argtypesupport with new + optional argument through which to explicitly specify the + identifier for guarding against multiple definitions.

    10. +
    11. Bugfix: Fixed problem with the implementation of issue #54 (See + 3.1.14). Always create the secondary log file. Otherwise + end-of-log handling may break, unconditionally assuming its + existence.

    12. +
    13. Bugfix: Fixed problem with the internal change to the hook + HandleDeclAfterBuild. Corrected the forgotten + critcl::cconst.

    14. +
    15. Debugging aid: Added comment holding the name of the result + type when emitting result conversions.

    16. +
    17. Bugfix: Fixed issue #60. Unbundled the package directories + containing multiple packages. All directories under "lib/" + now contain exactly one package.

    18. +
    19. Bugfix: Fixed issue #62, a few dict exists commands + operating on a fixed string instead of a variable.

    20. +
    21. Bugfix: Fixed issue #56. Release builders are reminded to run + the tests.

    22. +
    23. Bugfix: Fixed issue #55. For FreeBSD critcl's platform package + now identifies the Kernel ABI version. Initialization of the + cache directory now also uses platform::identify for the + default path, instead of platform::generic.

    24. +
    25. Bugfix: Fixed issue #58. Simplified the setup and use of + md5. Critcl now makes use of its own package for md5, using + itself to built it. There is no chicken/egg problem with this + as the -pkg mode used for this does not use md5. That + is limited to mode compile & run.

    26. +
    +
    +

    Changes for version 3.1.15

    +
      +
    1. Fixed version number bogosity with 3.1.14.

    2. +
    +
    +

    Changes for version 3.1.14

    +
      +
    1. Fixed issue #36. Added message to target all of the + Makefile generated for TEA mode. Additionally tweaked other + parts of the output to be less noisy.

    2. +
    3. Accepted request implied in issue #54. Unconditionally save + the compiler/linker build log into key log of the + dictionary returned by cresults, and save a copy of only + the execution output in the new key exl ("execution + log").

    4. +
    5. Fixed issue #53. Clarified the documentation of commands + critcl::load and critcl::failed with regard + to their results and the throwing of errors (does not happen).

    6. +
    7. Fixed issue #48. Modified mode "compile & run" to allow new + declarations in a file, after it was build, instead of + erroring out. The new decls are build when needed. Mode + "precompile" is unchanged and will continue to trap the + situation.

    8. +
    9. Fixed issue #52. Updated the local Tcl/Tk headers to + 8.4.20, 8.5.13, and 8.6.4.

    10. +
    11. Fixed issue #45. New feature command critcl::cconst.

    12. +
    13. critcl::util: New command locate to find a + file across a set of paths, and report an error when not + found. This is for use in autoconf-like header-searches and + similar configuration tests.

    14. +
    15. Modified 'AbortWhenCalledAfterBuild' to dump the entire stack + (info frame!). This should make it easier to determine the + location of the troubling declaration.

    16. +
    +
    +

    Changes for version 3.1.13

    +
      +
    1. Merged PR #43. Fixed bug loading adjunct Tcl sources.

    2. +
    3. Fixes in documentation and generated code of package + "critcl::enum". Bumped to version 1.0.1.

    4. +
    5. Fixes in documentation of package "critcl::bitmap".

    6. +
    7. New package "critcl::emap". In essence a variant or cross of + "critcl::bitmap" with behaviour like "critcl::enum".

    8. +
    9. Merged PR #49. Fixed documentation typo.

    10. +
    11. Merged PR #46. Fixed documentation typo.

    12. +
    13. Merged PR #47. Fixes to test results to match the accumulated + code changes. Also made portable across Tcl versions (varying + error syntax).

    14. +
    15. New predefined argument- and result-type "wideint" mapping to + Tcl_WideInt.

    16. +
    17. New predefined argument-type "bytes" mapping to tuple of + byte-array data and length. Note: The existing "bytearray" + type (and its aliases) was left untouched, to keep backward + compatibility.

    18. +
    19. Modified the internal interface between the Tcl shim and C + function underneath "critcl::cproc" with respect to the + handling of optional arguments. + An optional argument "X" now induces the use of two C + arguments, "X" and "has_X". The new argument "has_X" is of + boolean (int) type. It is set to true when X is set, and set + to false when X has the default value. C code which cares + about knowing if the argument is default or not is now able to + check that quickly, without having to code the default value + inside. + + NOTE: This change is visible in the output of the advanced + commands "argcnames", "argcsignature", "argvardecls", + and "argconversion".

    20. +
    21. Fixed issue #50 and documented the availability of variable + "interp" (type Tcl_Interp*) within "critcl::cinit" C code + fragments. + Note that while the old, undocumented name of the variable, + "ip", is still usable, it is deprecated. It will be fully + removed in two releases, i.e. for release 3.1.15. + The variable name was changed to be consistent with other code + environments.

    22. +
    23. Fixed issue #51. Disabled the generation of #line directives + for "critcl::config lines 0" coming from template files, or + code generated with them before the final value of this + setting was known.

    24. +
    25. Fixed issue with handling of namespaced package names in + "critcl::iassoc". Equivalent to a bug in "critcl::class" fixed + for critcl 3.1.1, critcl::class 1.0.1. + Note: "literals", "enum", "emap", and "bitmap" do not require + a fix as they are all built on top of "iassoc".

    26. +
    +
    +

    Changes for version 3.1.12

    +
      +
    1. Fixed issue 42. Clear ::errorInfo immediately after startup to + prevent leakage of irrelevant (caught) errors into our script + and confusing the usage code.

    2. +
    3. Fixed issue 40. Keep the order of libraries, and allow + duplicates. Both are things which are occasionally required for + proper linking.

    4. +
    5. Extended the utility package critcl::literals to + declare a cproc result-type for a pool.

      +

      Further fixed the generated header to handle multiple inclusion.

      +

      Bumped version to 1.1.

    6. +
    7. Fixed issue with utility package critcl::bitmap.

      +

      Fixed the generated header to handle multiple inclusion.

      +

      Bumped version to 1.0.1.

    8. +
    9. Created new utility package critcl::enum for the + quick and easy setup and use of mappings between C values + and Tcl strings. + Built on top of critcl::literals.

    10. +
    11. Added examples demonstrating the use of the utility packages + critcl::literals, + critcl::bitmap, and + critcl::enum

    12. +
    +
    +

    Changes for version 3.1.11

    +
      +
    1. Fixed issue #37, via pull request #38, with thanks to + Jos DeCoster. Information was stored into the v::delproc + and v::clientdata arrays using a different key than when + retrieving the same information, thus failing the latter.

    2. +
    3. New convenience command critcl::include for easy + inclusion of headers and other C files.

    4. +
    5. New command critcl::make to generate a local header of + other C files for use by other parts of a package through + inclusion.

    6. +
    7. New utility package critcl::literals for quick and + easy setup of and access to pools of fixed Tcl_Obj* strings. + Built on top of critcl::iassoc.

    8. +
    9. New utility package critcl::bitmap for quick and easy + setup and use of mappings between C bitsets and Tcl lists whose + string elements represent that set. + Built on top of critcl::iassoc.

    10. +
    +
    +

    Changes for version 3.1.10

    +
      +
    1. Fixed code version numbering forgotten with 3.1.9.

    2. +
    3. Fixed issue #35. In package mode (-pkg) the object cache + directory is unique to the process, thus we do not need + content-hashing to generate unique file names. A simple + counter is sufficient and much faster.

      +

      Note that mode "compile & run" is not as blessed and still + uses content-hasing with md5 to ensure unique file names + in its per-user object cache.

    4. +
    5. Fixed issue where the ccommand forgot to use its body as + input for the UUID generation. Thus ignoring changes to it in + mode compile & run, and not rebuilding a library for changed + sources. Bug and fix reported by Peter Spjuth.

    -

    Please see section Advanced Embedded C Code of the -critcl package documentation for details.

    -
  • Extended the critcl package to intercept package -provide and record the file -> package name mapping. Plus other -internal changes now allow the use of namespaced package names while -still using proper path names and init function.

  • -
  • Dropped the unused commands critcl::optimize and -critcl::include.

  • -
  • Dropped -lib mode from the critcl application.

  • -
  • Dropped remnants of support for Tcl 8.3 and before.

  • +
    +

    Changes for version 3.1.9

    +
      +
    1. Fixed issue #27. Added missing platform definitions for + various alternate linux and OS X targets.

    2. +
    3. Fixed issue #28. Added missing -mXX flags for linking at the + linux-{32,64}-* targets.

    4. +
    5. Fixed issue #29. Replaced the use of raw "cheaders" + information in the processing of "cdefines" with the proper + include directives derived from it.

    6. +
    7. Fixed the issue behind rejected pull request #30 by Andrew + Shadura. Dynamically extract the stubs variable declarations + from the Tcl header files and generate matching variable + definitions for use in the package code. The generated code + will now be always consistent with the headers, even when + critcl's own copy of them is replaced by system headers.

    8. +
    9. Fixed issue #31. Accepted patch by Andrew Shadura, with + changes (comments), for easier integration of critcl with + OS package systems, replacing critcl's copies of Tcl headers + with their own.

    10. +
    11. Fixed issue #32. Merged pull request by Andrew Shadura. + Various typos in documentation and comments.

    12. +
    13. Fixed issue #34. Handle files starting with a dot better.

    -

    Changes for version 3

    +

    Changes for version 3.1.8

      -
    1. The command critcl::platform was deprecated in version -2.1, superceded by critcl::targetplatform, yet kept for -compatibility. Now it has been removed.

    2. -
    3. The command critcl::compiled was kept with in version 2.1 -with semantics in contradiction to its, for compatibility. This -contradiction has been removed, changing the visible semantics of the -command to be in line with its name.

    4. -
    5. The change to version 3 became necessary because of the two -incompatible visible changes above.

    6. -
    7. Extended the application package with code handling a new -option -tea. Specifying this option invokes a special mode -where critcl generates a TEA package, i.e. wraps the input into a -directory hierarchy and support files which provide it TEA-lookalike -buildsystem.

      -

      This new option, and -pkg, exclude each other. If -both are specified the last used option takes precedence.

      -

      The generated package directory hierarchy is mostly -self-contained, but not fully. It requires not only a working -installation of Tcl, but also working installations of the packages -md5 and cmdline. Both of these are provided by the -Tcllib bundle. Not required, but recommended to have -installed are any of the packages which can accelerate md5's -operation, i.e. cryptkit, tcllibc, or -Trf.

    8. -
    9. Extended the critcl package with a new command -critcl::scan taking the path to a ".critcl" file, -statically scanning it, and returning license, version, a list of its -companion files, list of imported APIs, and list of -developer-specified custom configuration options. This data is the -foundation for the TEA wrapping described above.

      -

      Note that this is a static scan. While the other build -modes can (must) execute the ".critcl" file and make -platform-specific decisions regarding the assembled C code, companion -files, etc. the TEA wrap mode is not in a position to make -platform-specific decisions. It has to wrap everything which might -conceivably be needed when actually building. Hence the static scan. -This has however its own set of problems, namely the inability to -figure out any dynamic construction of companion file paths, at least -on its own. Thus:

    10. -
    11. Extended the API used by critcl-based packages with the command -critcl::owns. While this command is ignored by the regular build -modes the static scanner described above takes its arguments as the -names of companion files which have to be wrapped into the TEA package -and could not be figured by the scanner otherwise, like because of -dynamic paths to critcl::tsources, critcl::csources, -getting sourced directly, or simply being adjunct datafiles.

    12. -
    13. Extended the API used by critcl-based packages with the command -critcl::api for the management of stubs tables, be it their use, -and/or declaration and export.

      -

      Please see section Stubs Table Management of the -critcl package documentation for details.

    14. -
    15. Extended the API used by critcl-based packages with the command -critcl::userconfig for the management of developer-specified -custom configuration options, be it their use and/or declaration.

      -

      Please see section Custom Build Configuration of the -critcl package documentation for details.

    16. -
    17. Extended the API used by critcl-based packages with the -commands critcl::description, critcl::summary, -critcl::subject, critcl::meta, and -critcl::buildrequirement for the declaration of TEApot meta data -for/about the package.

      -

      Please see section Package Meta Data of the -critcl package documentation for details.

    18. +
    19. Fixed issue with package indices generated for Tcl 8.4. + Join the list of commands with semi-colon, not newline.

    20. +
    21. Fixed issue #26 which brought up use-cases I had forgotten to + consider while fixing bug #21 (see critcl 3.1.6).

    -

    Changes for version 3.0.1

    +

    Changes for version 3.1.7

      -
    1. Bugfixes all around. In detail:

    2. -
    3. Fixed recording of Tcl version requirements. Keep package name -and version together, unbreaking generated meta data and generated -package load command.

    4. -
    5. Fixed the build scripts: When installing, or wrapping for TEA, -generate any missing directories

    6. -
    7. Modified the build scripts to properly exit the application -when the window of their GUI is closed through the (X) button.

    8. -
    9. Removed an 8.5-ism (open wb) which had slipped into the main -build script.

    10. -
    11. Modified the example build scripts to separate the output for -the different examples (and packages) by adding empty lines.

    12. -
    13. stack::c example bugfix: Include API declarations for use in -the companion files.

    14. -
    15. Extended the documentation: Noted the need for a working -installation of a C compiler.

    16. -
    17. Extended the Windows target definitions and code to handle the -manifest files used by modern MS development environments. Note that -this code handles both possibilities, environment using manifests, and -(old(er)) environments without.

    18. -
    19. Extended the Windows 64bit target definitions and code to -auto-detect the need for the helper library "bufferoverflowU.lib" and -reconfigure the compile and link commands appropriately. We assume -that the library must be linked when present. This should be no harm -if the library is present, yet not needed. Just superfluous. We search -for the library in the paths specified by the environment variable -LIB.

    20. +
    21. Fixed issue #24. Extract and unconditionally display compiler + warnings found in the build log. Prevents users from missing + warnings which, while not causing the build to fail, may + still indicate problems.

    22. +
    23. New feature. Output hook. All non-messaging user output is now + routed through the command critcl::print, and users are + allowed to override it when using the critcl application-as-package.

    24. +
    25. New feature, by Ashok P. Nadkarni. Platform configurations can + inherit values from configurations defined before them.

    -

    Changes for version 3.0.2

    +

    Changes for version 3.1.6

      -
    1. Fixed issue in compile-and-run mode where commands put into the -auto_index are not found by Tcl's [unknown] command.

    2. -
    3. Fixed an array key mismatch breaking usage of client data and -delete function for procedure. Reported by Jos DeCoster, with patch.

    4. -
    5. Implemented a command line option -L, an equivalent of -option -I, just for library search paths.

    6. -
    7. Fixed github issues 5 and 8. Working around a missing variable -::errorInfo. It should always be present, however there seem to be -revisions of Tcl around which violate this assumption.

    8. +
    9. Fixed issue #21. While the multi-definition of the stub-table + pointer variables was ok with for all the C linkers seen so far + C++ linkers did not like this at all. Reworked the code to + ensure that this set of variables is generated only once, in + the wrapper around all the pieces to assemble.

    10. +
    11. Fixed issue #22, the handling of the command identifier + arguments of critcl::ccommand, critcl::cproc, and + critcl::cdata. We now properly allow any Tcl identifier + and generate proper internal C identifiers from them.

      +

      As part of this the signature of command critcl::name2c + changed. The command now delivers a list of four values instead + of three. The new value was added at the end.

      +

      Further adapted the implementation of package + critcl::class, a user of critcl::name2c. + This package is now at version 1.0.6 and requires critcl 3.1.6

      +

      Lastly fixed the mis-handling of option -cname in + critcl::ccommand, and critcl::cproc.

    12. +
    13. Fixed issue #23.

    -

    Changes for version 3.0.3

    +

    Changes for version 3.1.5

      -
    1. Fixed github issues 5 and 8, for the example build.tcl -scripts. Working around a missing variable ::errorInfo. It should -always be present, however there seem to be revisions of Tcl around -which violate this assumption.

    2. +
    3. Fixed issue #19. Made the regular expression extracting the + MSVC version number more general to make it work on german + language systems. This may have to be revisited in the future, + for other Windows locales.

    4. +
    5. Fixed issue #20. Made option -tea work on windows, at least in + a unix emulation environment like msys/mingw.

    -

    Changes for version 3.0.4

    +

    Changes for version 3.1.4

      -
    1. Fixed generation of the package's initname when the incoming - code is read from stdin and has no proper path.

    2. -
    3. Fixed github issue 11. Now using /LIBPATH instead of -L - on Windows (libinclude configuration setting).

    4. -
    5. Extended critcl to handle -l:path format of -l options. - GNU ld 2.22+ handles this by searching for the path as - is. Good when specifying static libraries, as plain -l looks - for shared libraries in preference over static. critcl handles - it now, as older GNU ld's do not understand it, nor the - various vendor-specific linkers.

    6. -
    7. Fixed github issue #12. Critcl now determines the version of - MSVC in use and uses it to switch between various link debug - options. Simplified the handling of bufferoverflowU.lib also, - making use of the same mechanism and collapsing the two - configurations sections we had back into one.

    8. -
    9. Reworked the insertion of #line pragmas into the generated C - code to avoid limitations on the line number argument imposed - by various compilers, and be more accurate.

    10. -
    11. Modified argument processing. Option -libdir now also - implies -L for its argument.

    12. -
    13. Extended handling of option -show (critcl::showconfig) - to list the path of the configuration file the data is coming - from. Good for debugging configuration processing.

    14. -
    15. Extended the build script with targets to regenerate the - embedded documentation, and diagrams, and to generate a - release.

    16. +
    17. Bugfix in package critcl::class. Generate a dummy + field in the class structure if the class has no class + variables. Without this change the structure would be empty, + and a number of compilers are not able to handle such a type.

    18. +
    19. Fixed a typo which broke the win64 configuration.

    20. +
    21. Fixed issue #16, a typo in the documentation of command + critcl::class.

    -

    Changes for version 3.0.5

    +

    Changes for version 3.1.3

      -
    1. Fixed bug in the new code for #line pragmas triggered when - specifying C code without leading whitespace.

    2. -
    3. Extended the documentation to have manpages for the license, - source retrieval, installer, and developer's guides.

    4. +
    5. Enhancement. In detail:

    6. +
    7. Added new argument type "pstring", for "Pascal String", a + counted string, i.e. a combination of string pointer and string + length.

    8. +
    9. Added new methods critcl::argtypesupport and + ::critcl::argsupport to define and use additional + supporting code for an argument type, here used by "pstring" + above to define the necessary structure.

    10. +
    11. Semi-bugfixes in the packages critcl::class and + critcl::iassoc. Pragmas for the AS meta data scanner + to ensure that the template files are made part of the package. + Versions bumped to 1.0.4 and 1.0.1 respectively.

    -

    Changes for version 3.0.6

    +

    Changes for version 3.1.2

      -
    1. Fixed github issue 10. The critcl application now delivers a - proper exit code (1) on build failure, instead of always - indicating success (status 0).

    2. -
    3. Fixed github issue 13. Handling of bufferoverflowU.lib for - release builds was inconsistent with handling for debug - builds. It is now identically handled (conditional) by - both cases.

    4. -
    5. Documentation cleanup, mainly in the installation guide, and - the README.md shown by github

    6. +
    7. Enhancement. In detail:

    8. +
    9. Extended critcl::cproc to be able to handle optional + arguments, in a limited way. This is automatically available to + critcl::class cproc-based methods as well.

    10. +
    11. Bugfix in lassign emulation for Tcl 8.4. Properly set + unused variables to the empty string. Bumped version of + emulation package lassign84 to 1.0.1.

    -

    Changes for version 3.0.7

    +

    Changes for version 3.1.1

      -
    1. Fixed the code generated by critcl::c++command. - The emitted code handed a non-static string table to - Tcl_GetIndexFromObj, in violation of the contract, which - requires the table to have a fixed address. This was a memory - smash waiting to happen. Thanks to Brian Griffin for alrerting - us to the general problem.

    2. +
    3. Bugfixes all around. In detail:

    4. +
    5. Fixed the generation of wrong#args errors for +critcl::cproc and derived code (critcl::class +cproc-based methods). Use NULL if there are no arguments, and +take the offset into account.

    6. +
    7. Fixed the handling of package names by +critcl::class. Forgot that they may contain namespace +separators. Bumped to version 1.0.1.

    8. +
    9. Extended a critcl::class generated error message in +instance creation for clarity. Bumped to version 1.0.2.

    -

    Changes for version 3.1

    +

    Changes for version 3.1

    1. Added a new higher-level package critcl::iassoc.

      This package simplifies the creation of code associating data @@ -616,139 +723,287 @@ details of the provided commands.

    -

    Changes for version 3.1.1

    +

    Changes for version 3.0.7

      -
    1. Bugfixes all around. In detail:

    2. -
    3. Fixed the generation of wrong#args errors for -critcl::cproc and derived code (critcl::class -cproc-based methods). Use NULL if there are no arguments, and -take the offset into account.

    4. -
    5. Fixed the handling of package names by -critcl::class. Forgot that they may contain namespace -separators. Bumped to version 1.0.1.

    6. -
    7. Extended a critcl::class generated error message in -instance creation for clarity. Bumped to version 1.0.2.

    8. +
    9. Fixed the code generated by critcl::c++command. + The emitted code handed a non-static string table to + Tcl_GetIndexFromObj, in violation of the contract, which + requires the table to have a fixed address. This was a memory + smash waiting to happen. Thanks to Brian Griffin for alrerting + us to the general problem.

    -

    Changes for version 3.1.2

    +

    Changes for version 3.0.6

      -
    1. Enhancement. In detail:

    2. -
    3. Extended critcl::cproc to be able to handle optional - arguments, in a limited way. This is automatically available to - critcl::class cproc-based methods as well.

    4. -
    5. Bugfix in lassign emulation for Tcl 8.4. Properly set - unused variables to the empty string. Bumped version of - emulation package lassign84 to 1.0.1.

    6. +
    7. Fixed github issue 10. The critcl application now delivers a + proper exit code (1) on build failure, instead of always + indicating success (status 0).

    8. +
    9. Fixed github issue 13. Handling of bufferoverflowU.lib for + release builds was inconsistent with handling for debug + builds. It is now identically handled (conditional) by + both cases.

    10. +
    11. Documentation cleanup, mainly in the installation guide, and + the README.md shown by github

    -

    Changes for version 3.1.3

    +

    Changes for version 3.0.5

      -
    1. Enhancement. In detail:

    2. -
    3. Added new argument type "pstring", for "Pascal String", a - counted string, i.e. a combination of string pointer and string - length.

    4. -
    5. Added new methods critcl::argtypesupport and - ::critcl::argsupport to define and use additional - supporting code for an argument type, here used by "pstring" - above to define the necessary structure.

    6. -
    7. Semi-bugfixes in the packages critcl::class and - critcl::iassoc. Pragmas for the AS meta data scanner - to ensure that the template files are made part of the package. - Versions bumped to 1.0.4 and 1.0.1 respectively.

    8. +
    9. Fixed bug in the new code for #line pragmas triggered when + specifying C code without leading whitespace.

    10. +
    11. Extended the documentation to have manpages for the license, + source retrieval, installer, and developer's guides.

    -

    Changes for version 3.1.4

    +

    Changes for version 3.0.4

      -
    1. Bugfix in package critcl::class. Generate a dummy - field in the class structure if the class has no class - variables. Without this change the structure would be empty, - and a number of compilers are not able to handle such a type.

    2. -
    3. Fixed a typo which broke the win64 configuration.

    4. -
    5. Fixed issue #16, a typo in the documentation of command - critcl::class.

    6. +
    7. Fixed generation of the package's initname when the incoming + code is read from stdin and has no proper path.

    8. +
    9. Fixed github issue 11. Now using /LIBPATH instead of -L + on Windows (libinclude configuration setting).

    10. +
    11. Extended critcl to handle -l:path format of -l options. + GNU ld 2.22+ handles this by searching for the path as + is. Good when specifying static libraries, as plain -l looks + for shared libraries in preference over static. critcl handles + it now, as older GNU ld's do not understand it, nor the + various vendor-specific linkers.

    12. +
    13. Fixed github issue #12. Critcl now determines the version of + MSVC in use and uses it to switch between various link debug + options. Simplified the handling of bufferoverflowU.lib also, + making use of the same mechanism and collapsing the two + configurations sections we had back into one.

    14. +
    15. Reworked the insertion of #line pragmas into the generated C + code to avoid limitations on the line number argument imposed + by various compilers, and be more accurate.

    16. +
    17. Modified argument processing. Option -libdir now also + implies -L for its argument.

    18. +
    19. Extended handling of option -show (critcl::showconfig) + to list the path of the configuration file the data is coming + from. Good for debugging configuration processing.

    20. +
    21. Extended the build script with targets to regenerate the + embedded documentation, and diagrams, and to generate a + release.

    -

    Changes for version 3.1.5

    +

    Changes for version 3.0.3

      -
    1. Fixed issue #19. Made the regular expression extracting the - MSVC version number more general to make it work on german - language systems. This may have to be revisited in the future, - for other Windows locales.

    2. -
    3. Fixed issue #20. Made option -tea work on windows, at least in - a unix emulation environment like msys/mingw.

    4. +
    5. Fixed github issues 5 and 8, for the example build.tcl +scripts. Working around a missing variable ::errorInfo. It should +always be present, however there seem to be revisions of Tcl around +which violate this assumption.

    -

    Changes for version 3.1.6

    +

    Changes for version 3.0.2

      -
    1. Fixed issue #21. While the multi-definition of the stub-table - pointer variables was ok with for all the C linkers seen so far - C++ linkers did not like this at all. Reworked the code to - ensure that this set of variables is generated only once, in - the wrapper around all the pieces to assemble.

    2. -
    3. Fixed issue #22, the handling of the command identifier - arguments of critcl::ccommand, critcl::cproc, and - critcl::cdata. We now properly allow any Tcl identifier - and generate proper internal C identifiers from them.

      -

      As part of this the signature of command critcl::name2c - changed. The command now delivers a list of four values instead - of three. The new value was added at the end.

      -

      Further adapted the implementation of package - critcl::class, a user of critcl::name2c. - This package is now at version 1.0.6 and requires critcl 3.1.6

      -

      Lastly fixed the mis-handling of option -cname in - critcl::ccommand, and critcl::cproc.

    4. -
    5. Fixed issue #23.

    6. +
    7. Fixed issue in compile-and-run mode where commands put into the +auto_index are not found by Tcl's [unknown] command.

    8. +
    9. Fixed an array key mismatch breaking usage of client data and +delete function for procedure. Reported by Jos DeCoster, with patch.

    10. +
    11. Implemented a command line option -L, an equivalent of +option -I, just for library search paths.

    12. +
    13. Fixed github issues 5 and 8. Working around a missing variable +::errorInfo. It should always be present, however there seem to be +revisions of Tcl around which violate this assumption.

    -

    Changes for version 3.1.7

    +

    Changes for version 3.0.1

      -
    1. Fixed issue #24. Extract and unconditionally display compiler - warnings found in the build log. Prevents users from missing - warnings which, while not causing the build to fail, may - still indicate problems.

    2. -
    3. New feature. Output hook. All non-messaging user output is now - routed through the command critcl::print, and users are - allowed to override it when using the critcl application-as-package.

    4. -
    5. New feature, by Ashok P. Nadkarni. Platform configurations can - inherit values from configurations defined before them.

    6. +
    7. Bugfixes all around. In detail:

    8. +
    9. Fixed recording of Tcl version requirements. Keep package name +and version together, unbreaking generated meta data and generated +package load command.

    10. +
    11. Fixed the build scripts: When installing, or wrapping for TEA, +generate any missing directories

    12. +
    13. Modified the build scripts to properly exit the application +when the window of their GUI is closed through the (X) button.

    14. +
    15. Removed an 8.5-ism (open wb) which had slipped into the main +build script.

    16. +
    17. Modified the example build scripts to separate the output for +the different examples (and packages) by adding empty lines.

    18. +
    19. stack::c example bugfix: Include API declarations for use in +the companion files.

    20. +
    21. Extended the documentation: Noted the need for a working +installation of a C compiler.

    22. +
    23. Extended the Windows target definitions and code to handle the +manifest files used by modern MS development environments. Note that +this code handles both possibilities, environment using manifests, and +(old(er)) environments without.

    24. +
    25. Extended the Windows 64bit target definitions and code to +auto-detect the need for the helper library "bufferoverflowU.lib" and +reconfigure the compile and link commands appropriately. We assume +that the library must be linked when present. This should be no harm +if the library is present, yet not needed. Just superfluous. We search +for the library in the paths specified by the environment variable +LIB.

    -

    Changes for version 3.1.8

    +

    Changes for version 3

      -
    1. Fixed issue with package indices generated for Tcl 8.4. - Join the list of commands with semi-colon, not newline.

    2. -
    3. Fixed issue #26 which brought up use-cases I had forgotten to - consider while fixing bug #21 (see critcl 3.1.6).

    4. +
    5. The command critcl::platform was deprecated in version +2.1, superceded by critcl::targetplatform, yet kept for +compatibility. Now it has been removed.

    6. +
    7. The command critcl::compiled was kept with in version 2.1 +with semantics in contradiction to its, for compatibility. This +contradiction has been removed, changing the visible semantics of the +command to be in line with its name.

    8. +
    9. The change to version 3 became necessary because of the two +incompatible visible changes above.

    10. +
    11. Extended the application package with code handling a new +option -tea. Specifying this option invokes a special mode +where critcl generates a TEA package, i.e. wraps the input into a +directory hierarchy and support files which provide it TEA-lookalike +buildsystem.

      +

      This new option, and -pkg, exclude each other. If +both are specified the last used option takes precedence.

      +

      The generated package directory hierarchy is mostly +self-contained, but not fully. It requires not only a working +installation of Tcl, but also working installations of the packages +md5 and cmdline. Both of these are provided by the +Tcllib bundle. Not required, but recommended to have +installed are any of the packages which can accelerate md5's +operation, i.e. cryptkit, tcllibc, or +Trf.

    12. +
    13. Extended the critcl package with a new command +critcl::scan taking the path to a ".critcl" file, +statically scanning it, and returning license, version, a list of its +companion files, list of imported APIs, and list of +developer-specified custom configuration options. This data is the +foundation for the TEA wrapping described above.

      +

      Note that this is a static scan. While the other build +modes can (must) execute the ".critcl" file and make +platform-specific decisions regarding the assembled C code, companion +files, etc. the TEA wrap mode is not in a position to make +platform-specific decisions. It has to wrap everything which might +conceivably be needed when actually building. Hence the static scan. +This has however its own set of problems, namely the inability to +figure out any dynamic construction of companion file paths, at least +on its own. Thus:

    14. +
    15. Extended the API used by critcl-based packages with the command +critcl::owns. While this command is ignored by the regular build +modes the static scanner described above takes its arguments as the +names of companion files which have to be wrapped into the TEA package +and could not be figured by the scanner otherwise, like because of +dynamic paths to critcl::tsources, critcl::csources, +getting sourced directly, or simply being adjunct datafiles.

    16. +
    17. Extended the API used by critcl-based packages with the command +critcl::api for the management of stubs tables, be it their use, +and/or declaration and export.

      +

      Please see section Stubs Table Management of the +critcl package documentation for details.

    18. +
    19. Extended the API used by critcl-based packages with the command +critcl::userconfig for the management of developer-specified +custom configuration options, be it their use and/or declaration.

      +

      Please see section Custom Build Configuration of the +critcl package documentation for details.

    20. +
    21. Extended the API used by critcl-based packages with the +commands critcl::description, critcl::summary, +critcl::subject, critcl::meta, and +critcl::buildrequirement for the declaration of TEApot meta data +for/about the package.

      +

      Please see section Package Meta Data of the +critcl package documentation for details.

    -

    Changes for version 3.1.9

    +

    Changes for version 2.1

      -
    1. Fixed issue #27. Added missing platform definitions for - various alternate linux and OS X targets.

    2. -
    3. Fixed issue #28. Added missing -mXX flags for linking at the - linux-{32,64}-* targets.

    4. -
    5. Fixed issue #29. Replaced the use of raw "cheaders" - information in the processing of "cdefines" with the proper - include directives derived from it.

    6. -
    7. Fixed the issue behind rejected pull request #30 by Andrew - Shadura. Dynamically extract the stubs variable declarations - from the Tcl header files and generate matching variable - definitions for use in the package code. The generated code - will now be always consistent with the headers, even when - critcl's own copy of them is replaced by system headers.

    8. -
    9. Fixed issue #31. Accepted patch by Andrew Shadura, with - changes (comments), for easier integration of critcl with - OS package systems, replacing critcl's copies of Tcl headers - with their own.

    10. -
    11. Fixed issue #32. Merged pull request by Andrew Shadura. - Various typos in documentation and comments.

    12. -
    13. Fixed issue #33. Handle files starting with a dot better.

    14. +
    15. Fixed bug where critcl::tsources interpreted relative +paths as relative to the current working directory instead of +relative to the ".critcl" file using the command, as all other +commands of this type do.

    16. +
    17. Fixed internals, preventing information collected for multiple +".critcl" files to leak between them. Notably, critcl::tk +is not a global configuration option anymore.

    18. +
    19. Fixed the command critcl::license to be a null-operation +in mode "compile & run", instead of throwing an error.

    20. +
    21. Fixed the critcl application's interference with the "compile & +run" result cache in -pkg mode by having it use a wholly +separate (and by default transient) directory for that mode.

    22. +
    23. Fixed bug where changes to a ".critcl" file did not result +in a rebuild for mode "compile & run". All relevant API commands now +ensure UUID changes.

    24. +
    25. Fixed bug in the backend handling of critcl::debug where +the companion c-sources of a ".critcl" file were not compiled +with debug options, although the ".critcl" file was.

    26. +
    27. Fixed bug in critcl::debug which prevented recognition of +mode "all" when it was not the first argument to the command.

    28. +
    29. Fixed bug in "preload.c" preventing its compilation on +non-windows platforms.

    30. +
    31. Fixed long-standing bug in the handling of namespace qualifiers +in the command name argument of critcl::cproc and +critcl::ccommand. It is now possible to specify a fully +qualified command name without issues.

    32. +
    33. Extended/reworked critcl::tsources to be the canonical +way of declaring ".tcl" companion files even for mode "compile & +run".

    34. +
    35. Extended/reworked critcl::tsources to allow the use of a +".critcl" file as its own Tcl companion file.

    36. +
    37. Extended critcl::framework to internally check for OS X +build target, and to ignore the declaration if its not.

    38. +
    39. Extended critcl::failed to be callable more than once in +a ".critcl" file. The first call forces the build, if it was not +done already, to get the result. Further calls return the cached +result of the first call.

    40. +
    41. Extended the handling of environment variable CC in the code +determining the compiler to use to deal with (i.e. remove) paths to +the compiler, compiler file extensions, and compiler options specified +after the compiler itself, leaving only the bare name of the compiler.

    42. +
    43. Extended the code handling the search for preloaded libraries +to print the paths it searched, making debugging of a search failure +easier.

    44. +
    45. A new command critcl::tcl can be used to declare the +version of Tcl minimally needed to build and run the ".critcl" +file and package. Defaults to 8.4 if not declared. Extended critcl to +have the stubs and headers for all of Tcl 8.4, 8.5, and 8.6.

    46. +
    47. A new command critcl::load forces the build and load of a +".critcl" file. This is the official way for overriding critcl's +default lazy-build-&-load-on-demand scheme for mode "compile & run".

      +

      Note that after using critcl::load / +critcl::failed in a ".critcl" file it is not possible to +use critcl commands in that file anymore. Doing so will throw an +error.

    48. +
    49. Extended the generation of '#line' pragmas to use +info frame (if available) to provide the C compiler with exact +line numbers into the ".critcl" file for the reporting of +warnings and errors.

    50. +
    51. Extended critcl::check with logging to help with +debugging build-time checks of the environment, plus an additional +optional argument to provide labeling.

    52. +
    53. Added a new command critcl::checklink which not only +tries to check the environment via compiling the code, but also +its linkability.

    54. +
    55. Added a new command critcl::msg for messaging, like +command critcl::error is for error reporting. Likewise this is a +hook a user of the package is allowed to override. The default +implementation, used by mode compile & run does nothing. The +implementation for mode generate package prints the message +to stdout.

      +

      Envisioned use is for the reporting of results determined by +critcl::check and critcl::checklink during building, to +help with debugging when something goes wrong with a check.

    56. +
    57. Exposed the argument processing internals of critcl::proc +for use by advanced users. The new commands are

      +
        +
      1. critcl::argnames

      2. +
      3. critcl::argcnames

      4. +
      5. critcl::argcsignature

      6. +
      7. critcl::argvardecls

      8. +
      9. critcl::argconversion

      10. +
      +

      Please see section Advanced Embedded C Code of the +critcl package documentation for details.

    58. +
    59. Extended the critcl package to intercept package +provide and record the file -> package name mapping. Plus other +internal changes now allow the use of namespaced package names while +still using proper path names and init function.

    60. +
    61. Dropped the unused commands critcl::optimize and +critcl::include.

    62. +
    63. Dropped -lib mode from the critcl application.

    64. +
    65. Dropped remnants of support for Tcl 8.3 and before.

    -

    Authors

    +

    Authors

    Jean Claude Wippler, Steve Landers, Andreas Kupries

    -

    Bugs, Ideas, Feedback

    +

    Bugs, Ideas, Feedback

    This document, and the package it describes, will undoubtedly contain bugs and other problems. Please report them at https://github.com/andreas-kupries/critcl/issues. @@ -765,6 +1020,6 @@

    diff -Nru critcl-3.1.9/embedded/www/files/critcl_literals.html critcl-3.1.17+dfsg/embedded/www/files/critcl_literals.html --- critcl-3.1.9/embedded/www/files/critcl_literals.html 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/embedded/www/files/critcl_literals.html 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,260 @@ + + +critcl::literals - C Runtime In Tcl (CriTcl) + + + + + +
    +
    [ + Table Of Contents +| Keyword Index + ]
    +

    critcl::literals(n) 1.2 doc "C Runtime In Tcl (CriTcl)"

    +

    Name

    +

    critcl::literals - CriTcl Utilities: Constant string pools

    +
    + +

    Synopsis

    +
    +
      +
    • package require Tcl 8.4
    • +
    • package require critcl ?3.1.11?
    • +
    • package require critcl::literals ?1.2?
    • +
    + +
    +
    +

    Description

    +

    Welcome to the C Runtime In Tcl, CriTcl for short, a +system to build C extension packages for Tcl on the fly, from C code +embedded within Tcl scripts, for all who wish to make their code go +faster.

    +

    This document is the reference manpage for the +critcl::literals package. This package provides convenience +commands for advanced functionality built on top of both critcl core +and package critcl::iassoc.

    +

    Many packages will have a fixed set of string constants +occuring in one or places. Most of them will be coded to create a new +string Tcl_Obj* from a C char* every time the constant +is needed, as this is easy to to, despite the inherent waste of +memory.

    +

    This package was written to make declaration and management of +string pools which do not waste memory as easy as the wasteful +solution, hiding all attendant complexity from the user.

    +

    Its intended audience are mainly developers wishing to write +Tcl packages with embedded C code.

    +

    This package resides in the Core Package Layer of CriTcl.

    +

    arch_core

    +
    +

    API

    +
    +
    ::critcl::literals::def name definition ?mode?
    +

    This command defines a C function with the given name which +provides access to a pool of constant strings with a Tcl interpreter.

    +

    The definition dictionary provides the mapping from the +C-level symbolic names to the string themselves.

    +

    The mode-list configures the output somewhat. The two +allowed modes are c and tcl. Both modes can be used +together. The default mode is tcl.

    +

    For mode tcl the new function has two arguments, a +Tcl_Interp* pointer refering to the interpreter holding the +string pool, and a code of type "name_names" (see below), the +symbolic name of the literal to return. The result of the function is +a Tcl_Obj* pointer to the requested string constant.

    +

    For mode c the new function has one argument, a code of +type "name_names" (see below), the symbolic name of the literal +to return. The result of the function is a const char* +pointer to the requested string constant.

    +

    The underlying string pool is automatically initialized on +first access, and finalized on interpreter destruction.

    +

    The package generates multiple things (declarations and +definitions) with names derived from name, which has to be a +proper C identifier.

    +
    +
    name
    +

    The mode tcl function providing access to the string pool. +Its signature is

    +
    +Tcl_Obj* name (Tcl_Interp* interp, name_names literal);
    +
    +
    +
    name_cstr
    +

    The mode c function providing access to the string pool. +Its signature is

    +
    +const char* name_cstr (name_names literal);
    +
    +
    +
    name_names
    +

    A C enumeration type containing the symbolic names of the strings +provided by the pool.

    +
    name.h
    +

    A header file containing the declarations for the accessor functions +and the enumeration type, for use by other parts of the system, if +necessary.

    +

    The generated file is stored in a place where it will not +interfere with the overall system outside of the package, yet also be +available for easy inclusion by package files (csources).

    +
    name
    +

    New in version 1.1: +For mode tcl the command registers a new result-type for +critcl::cproc with critcl, which takes an integer result from +the function and converts it to the equivalent string in the pool for +the script.

    +
    +
    +
    +

    Example

    +

    The example shown below is the specification of the string pool pulled +from the draft work on a Tcl binding to Linux's inotify APIs.

    +
    +package require Tcl 8.5
    +package require critcl 3.1.11
    +critcl::buildrequirement {
    +    package require critcl::literals
    +}
    +critcl::literals::def tcl_inotify_strings {
    +    w_create	"create"
    +    w_directory	"directory"
    +    w_events	"events"
    +    w_file	"file"
    +    w_handler	"handler"
    +    w_remove	"remove"
    +} {c tcl}
    +# Declarations: tcl_inotify_strings.h
    +# Type:         tcl_inotify_strings_names
    +# Accessor:     Tcl_Obj*    tcl_inotify_strings      (Tcl_Interp*               interp,
    +#                                                     tcl_inotify_strings_names literal);
    +# Accessor:     const char* tcl_inotify_strings_cstr (tcl_inotify_strings_names literal);
    +# ResultType:   tcl_inotify_strings
    +
    +
    +

    Authors

    +

    Andreas Kupries

    +
    +

    Bugs, Ideas, Feedback

    +

    This document, and the package it describes, will undoubtedly contain +bugs and other problems. +Please report such at https://github.com/andreas-kupries/critcl. +Please also report any ideas for enhancements you may have for either +package and/or documentation.

    +
    + +

    Category

    +

    Glueing/Embedded C code

    +
    + +
    diff -Nru critcl-3.1.9/embedded/www/files/critcl_pkg.html critcl-3.1.17+dfsg/embedded/www/files/critcl_pkg.html --- critcl-3.1.9/embedded/www/files/critcl_pkg.html 2013-05-10 05:57:04.000000000 +0000 +++ critcl-3.1.17+dfsg/embedded/www/files/critcl_pkg.html 2017-10-14 02:48:11.000000000 +0000 @@ -92,18 +92,18 @@ } --> - -

    [ - Table Of Contents + Table Of Contents | Keyword Index -]
    -

    critcl(n) 3.1.8 doc "C Runtime In Tcl (CriTcl)"

    + ]
    +

    critcl(n) 3.1.17 doc "C Runtime In Tcl (CriTcl)"

    Name

    critcl - Critcl - Package Reference

    @@ -127,42 +127,51 @@
  • Custom Build Configuration
  • Advanced: Location management
  • Advanced: Diversions
  • -
  • Advanced: Extending cproc
  • +
  • Advanced: File Generation
  • +
  • Advanced: Extending cproc
  • Concepts
  • Examples
  • -
  • Changes for version 2.1
  • -
  • Changes for version 3
  • -
  • Changes for version 3.0.1
  • -
  • Changes for version 3.0.2
  • -
  • Changes for version 3.0.3
  • -
  • Changes for version 3.0.4
  • -
  • Changes for version 3.0.5
  • -
  • Changes for version 3.0.6
  • -
  • Changes for version 3.0.7
  • -
  • Changes for version 3.1
  • -
  • Changes for version 3.1.1
  • -
  • Changes for version 3.1.2
  • -
  • Changes for version 3.1.3
  • +
  • Changes for version 3.1.17
  • +
  • Changes for version 3.1.16
  • +
  • Changes for version 3.1.15
  • +
  • Changes for version 3.1.14
  • +
  • Changes for version 3.1.13
  • +
  • Changes for version 3.1.12
  • +
  • Changes for version 3.1.11
  • +
  • Changes for version 3.1.10
  • +
  • Changes for version 3.1.9
  • +
  • Changes for version 3.1.8
  • +
  • Changes for version 3.1.7
  • +
  • Changes for version 3.1.6
  • +
  • Changes for version 3.1.5
  • Changes for version 3.1.4
  • -
  • Changes for version 3.1.5
  • -
  • Changes for version 3.1.6
  • -
  • Changes for version 3.1.7
  • -
  • Changes for version 3.1.8
  • -
  • Changes for version 3.1.9
  • -
  • Authors
  • -
  • Bugs, Ideas, Feedback
  • +
  • Changes for version 3.1.3
  • +
  • Changes for version 3.1.2
  • +
  • Changes for version 3.1.1
  • +
  • Changes for version 3.1
  • +
  • Changes for version 3.0.7
  • +
  • Changes for version 3.0.6
  • +
  • Changes for version 3.0.5
  • +
  • Changes for version 3.0.4
  • +
  • Changes for version 3.0.3
  • +
  • Changes for version 3.0.2
  • +
  • Changes for version 3.0.1
  • +
  • Changes for version 3
  • +
  • Changes for version 2.1
  • +
  • Authors
  • +
  • Bugs, Ideas, Feedback
  • Keywords
  • Category
  • Copyright
  • @@ -172,7 +181,7 @@
    • package require Tcl 8.4
    • -
    • package require critcl ?3.1.8?
    • +
    • package require critcl ?3.1.17?
    • package require platform ?1.0.2?
    • package require md5 ?2?
    @@ -181,98 +190,104 @@
  • ::critcl::ccommand tclname cfunname
  • ::critcl::ccommand tclname arguments body ?option value...?
  • ::critcl::cdata tclname data
  • -
  • ::critcl::cdefines definitions ?namespace?
  • -
  • ::critcl::cproc name arguments resulttype body ?option value...?
  • -
  • ::critcl::cproc name arguments resulttype
  • -
  • ::critcl::cinit text externals
  • -
  • ::critcl::api import name version
  • -
  • ::critcl::api function resulttype name arguments
  • -
  • ::critcl::api header ?pattern...?
  • -
  • ::critcl::api extheader ?file...?
  • -
  • ::critcl::license author ?text...?
  • -
  • ::critcl::summary text
  • -
  • ::critcl::description text
  • -
  • ::critcl::subject ?key...?
  • -
  • ::critcl::meta key ?word...?
  • -
  • ::critcl::meta? key
  • -
  • ::critcl::buildrequirement script
  • -
  • ::critcl::cheaders ?arg...?
  • -
  • ::critcl::csources ?pattern...?
  • -
  • ::critcl::clibraries ?arg...?
  • -
  • ::critcl::source path
  • -
  • ::critcl::tsources pattern...
  • -
  • ::critcl::owns pattern...
  • -
  • ::critcl::cflags ?arg...?
  • -
  • ::critcl::ldflags ?arg...?
  • -
  • ::critcl::framework ?arg...?
  • -
  • ::critcl::tcl version
  • -
  • ::critcl::tk
  • -
  • ::critcl::preload lib...
  • -
  • ::critcl::debug area...
  • -
  • ::critcl::check ?label? text
  • -
  • ::critcl::checklink ?label? text
  • -
  • ::critcl::msg ?-nonewline? msg
  • -
  • ::critcl::print ?-nonewline? ?chan? msg
  • -
  • ::critcl::compiled
  • -
  • ::critcl::compiling
  • -
  • ::critcl::done
  • -
  • ::critcl::failed
  • -
  • ::critcl::load
  • -
  • ::critcl::config option ?val?
  • -
  • ::critcl::cache ?path?
  • -
  • ::critcl::clean_cache ?pattern...?
  • -
  • ::critcl::readconfig path
  • -
  • ::critcl::showconfig ?chan?
  • -
  • ::critcl::showallconfig ?chan?
  • -
  • ::critcl::chooseconfig target ?nomatcherr?
  • -
  • ::critcl::setconfig target
  • -
  • ::critcl::actualtarget
  • -
  • ::critcl::buildforpackage ?flag?
  • -
  • ::critcl::cnothingtodo file
  • -
  • ::critcl::cresults ?file?
  • -
  • ::critcl::crosscheck
  • -
  • ::critcl::error msg
  • -
  • ::critcl::knowntargets
  • -
  • ::critcl::sharedlibext
  • -
  • ::critcl::targetconfig
  • -
  • ::critcl::buildplatform
  • -
  • ::critcl::targetplatform
  • -
  • ::critcl::cobjects ?arg...?
  • -
  • ::critcl::scan path
  • -
  • ::critcl::name2c name
  • -
  • ::critcl::argnames arguments
  • -
  • ::critcl::argcnames arguments
  • -
  • ::critcl::argcsignature arguments
  • -
  • ::critcl::argvardecls arguments
  • -
  • ::critcl::argconversion arguments ?n?
  • -
  • ::critcl::argoptional arguments
  • -
  • ::critcl::argdefaults arguments
  • -
  • ::critcl::argsupport arguments
  • -
  • ::critcl::userconfig define name description type ?default?
  • -
  • ::critcl::userconfig query name
  • -
  • ::critcl::userconfig set name value
  • -
  • ::critcl::at::caller
  • -
  • ::critcl::at::caller offset
  • -
  • ::critcl::at::caller offset level
  • -
  • ::critcl::at::here
  • -
  • ::critcl::at::get*
  • -
  • ::critcl::at::get
  • -
  • ::critcl::at::= file line
  • -
  • ::critcl::at::incr n...
  • -
  • ::critcl::at::incrt str...
  • -
  • ::critcl::at::caller!
  • -
  • ::critcl::at::caller! offset
  • -
  • ::critcl::at::caller! offset level
  • -
  • ::critcl::at::here!
  • -
  • ::critcl::collect_begin
  • -
  • ::critcl::collect_end
  • -
  • ::critcl::collect script
  • -
  • ::critcl::resulttype name body ?ctype?
  • -
  • ::critcl::resulttype name = origname
  • -
  • ::critcl::argtype name body ?ctype? ?ctypefun?
  • -
  • ::critcl::argtype name = origname
  • -
  • ::critcl::argtypesupport name code
  • -
  • ::preload library
  • +
  • ::critcl::cconst tclname resulttype value
  • +
  • ::critcl::cdefines definitions ?namespace?
  • +
  • ::critcl::cproc name arguments resulttype body ?option value...?
  • +
  • ::critcl::cproc name arguments resulttype
  • +
  • ::critcl::cinit text externals
  • +
  • ::critcl::include path
  • +
  • ::critcl::api import name version
  • +
  • ::critcl::api function resulttype name arguments
  • +
  • ::critcl::api header ?pattern...?
  • +
  • ::critcl::api extheader ?file...?
  • +
  • ::critcl::license author ?text...?
  • +
  • ::critcl::summary text
  • +
  • ::critcl::description text
  • +
  • ::critcl::subject ?key...?
  • +
  • ::critcl::meta key ?word...?
  • +
  • ::critcl::meta? key
  • +
  • ::critcl::buildrequirement script
  • +
  • ::critcl::cheaders ?arg...?
  • +
  • ::critcl::csources ?pattern...?
  • +
  • ::critcl::clibraries ?arg...?
  • +
  • ::critcl::source path
  • +
  • ::critcl::tsources pattern...
  • +
  • ::critcl::owns pattern...
  • +
  • ::critcl::cflags ?arg...?
  • +
  • ::critcl::ldflags ?arg...?
  • +
  • ::critcl::framework ?arg...?
  • +
  • ::critcl::tcl version
  • +
  • ::critcl::tk
  • +
  • ::critcl::preload lib...
  • +
  • ::critcl::debug area...
  • +
  • ::critcl::check ?label? text
  • +
  • ::critcl::checklink ?label? text
  • +
  • ::critcl::msg ?-nonewline? msg
  • +
  • ::critcl::print ?-nonewline? ?chan? msg
  • +
  • ::critcl::compiled
  • +
  • ::critcl::compiling
  • +
  • ::critcl::done
  • +
  • ::critcl::failed
  • +
  • ::critcl::load
  • +
  • ::critcl::config option ?val?
  • +
  • ::critcl::cache ?path?
  • +
  • ::critcl::clean_cache ?pattern...?
  • +
  • ::critcl::readconfig path
  • +
  • ::critcl::showconfig ?chan?
  • +
  • ::critcl::showallconfig ?chan?
  • +
  • ::critcl::chooseconfig target ?nomatcherr?
  • +
  • ::critcl::setconfig target
  • +
  • ::critcl::actualtarget
  • +
  • ::critcl::buildforpackage ?flag?
  • +
  • ::critcl::cnothingtodo file
  • +
  • ::critcl::cresults ?file?
  • +
  • ::critcl::crosscheck
  • +
  • ::critcl::error msg
  • +
  • ::critcl::knowntargets
  • +
  • ::critcl::sharedlibext
  • +
  • ::critcl::targetconfig
  • +
  • ::critcl::buildplatform
  • +
  • ::critcl::targetplatform
  • +
  • ::critcl::cobjects ?arg...?
  • +
  • ::critcl::scan path
  • +
  • ::critcl::name2c name
  • +
  • ::critcl::argnames arguments
  • +
  • ::critcl::argcnames arguments
  • +
  • ::critcl::argcsignature arguments
  • +
  • ::critcl::argvardecls arguments
  • +
  • ::critcl::argconversion arguments ?n?
  • +
  • ::critcl::argoptional arguments
  • +
  • ::critcl::argdefaults arguments
  • +
  • ::critcl::argsupport arguments
  • +
  • ::critcl::userconfig define name description type ?default?
  • +
  • ::critcl::userconfig query name
  • +
  • ::critcl::userconfig set name value
  • +
  • ::critcl::at::caller
  • +
  • ::critcl::at::caller offset
  • +
  • ::critcl::at::caller offset level
  • +
  • ::critcl::at::here
  • +
  • ::critcl::at::get*
  • +
  • ::critcl::at::get
  • +
  • ::critcl::at::= file line
  • +
  • ::critcl::at::incr n...
  • +
  • ::critcl::at::incrt str...
  • +
  • ::critcl::at::caller!
  • +
  • ::critcl::at::caller! offset
  • +
  • ::critcl::at::caller! offset level
  • +
  • ::critcl::at::here!
  • +
  • ::critcl::collect_begin
  • +
  • ::critcl::collect_end
  • +
  • ::critcl::collect script
  • +
  • ::critcl::make path contents
  • +
  • ::critcl::has-resulttype name
  • +
  • ::critcl::resulttype name body ?ctype?
  • +
  • ::critcl::resulttype name = origname
  • +
  • ::critcl::has-argtype name
  • +
  • ::critcl::argtype name body ?ctype? ?ctypefun?
  • +
  • ::critcl::argtype name = origname
  • +
  • ::critcl::argtypesupport name code ?guard?
  • +
  • ::critcl::argtyperelease name code
  • +
  • ::preload library
  • @@ -312,7 +327,7 @@ contained definitions (variables, functions, macros, etc.) available to all C code fragments specified after it. It itself can assume to have access to all definitions which were specified before it. -See section Runtime Behaviour for more details.

    +See section Runtime Behaviour for more details.

    The result of the command is the empty string.

    ::critcl::ccommand tclname cfunname

    This command creates a new Tcl command named tclname which is @@ -328,7 +343,7 @@ compiles it and makes the resulting definition available to all C code fragments declared later on. It itself can assume to have access to all definitions which came before it. -See section Runtime Behaviour for more details.

    +See section Runtime Behaviour for more details.

    The result of critcl::ccommand itself is the empty string.

    The list of arguments contain the names for the four @@ -377,10 +392,26 @@ the writer to do all of this on their own. I.e. the cost of the aforementioned flexibility is a higher complexity seen by the user.

    ::critcl::cdata tclname data
    -

    This command a new Tcl command named tclname which returns +

    This command creates a new Tcl command named tclname which returns data as a ByteArray result.

    The result of critcl::cdata itself is the empty string.

    -
    ::critcl::cdefines definitions ?namespace?
    +
    ::critcl::cconst tclname resulttype value
    +

    This command creates a new Tcl command named tclname which returns +the constant value as its result, with Tcl type resulttype.

    +

    The result of critcl::cconst itself is the empty string.

    +

    The command is similar to critcl::cdata in that it returns a +constant value. Contrary to critcl::cdata however it is not restricted +to ByteArray results, but accepts all result-types known to critcl::cproc. +Its semantics are actually equivalent to

    +
    +    cproc $tclname {} $resulttype "return $value ;"
    +
    +

    Contrary to critcl::cproc however it is internally optimized to +avoid generating a superfluous C function.

    +

    Note that nothing prevents the user from using a C define for the +value. Any visible C function is actually also allowed, as long as +it does not take arguments.

    +
    ::critcl::cdefines definitions ?namespace?

    This command creates Tcl variables in the specified namespace which are linked to the C enum values and #defines named as glob patterns in the list of definitions. Each @@ -398,7 +429,7 @@ ".critcl" file is actually compiled they have access to and check all C fragments defined with critcl::ccode, plus all the headers it has access to via critcl::cheaders, for that file.

    -
    ::critcl::cproc name arguments resulttype body ?option value...?
    +
    ::critcl::cproc name arguments resulttype body ?option value...?

    This command creates a new Tcl command named tclname which is implemented by the C code in body. In contrast to the low-level critcl::ccommand here the arguments @@ -409,7 +440,7 @@ compiles them and makes the resulting definitions available to all C code fragments declared later on. It itself can assume to have access to all definitions which came before it. -See section Runtime Behaviour for more details.

    +See section Runtime Behaviour for more details.

    The result of critcl::cproc itself is the empty string.

    The only options accepted by this command are:

    @@ -434,73 +465,106 @@ settings with prefix arguments which are not directly seen by the function, but influence argument counting and extraction.

    -

    The list below shows the values which are legal for resulttype, -and details their semantics:

    +

    Below is the list of predefined types legal for resulttype, plus +the details of their semantics. Note that it is possible to extend +this list with custom types if the standard does not support what is +needed. See section Advanced: Extending cproc for details.

    Tcl_Obj*
    object
    -

    The function returns a value of type "Tcl_Obj*". -This value becomes the interpreter result, if not 0. -The Tcl status is TCL_ERROR when a 0 is returned, and TCL_OK otherwise.

    -

    Attention: The conversion assumes that the value belonged to -the function, with an associated reference count, and decrements the -reference count to indicate the loss of ownership by the +

    The function returns a value of type Tcl_Obj*. +This value becomes the interpreter result, if not 0. The Tcl +status is TCL_ERROR when a 0 is returned, and +TCL_OK otherwise.

    +

    Note how it is the responsibility of the function to set +the interpreter result to an appropriate error message when returning +0.

    +

    Attention: The conversion assumes that the value belonged +to the function, with an associated reference count, and decrements +the reference count to indicate the loss of ownership by the function. This means that it is an error to return a value whose -reference count is zero.

    +reference count is zero. The system will crash at some point after the +return due to reuse of the freed memory.

    +
    Tcl_Obj*0
    +
    +
    object0
    +

    The function returns a value of type Tcl_Obj*. +This value becomes the interpreter result, if not 0. The Tcl +status is TCL_ERROR when a 0 is returned, and +TCL_OK otherwise.

    +

    Note how it is the responsibility of the function to set +the interpreter result to an appropriate error message when returning +0.

    +

    Attention: Contrary to Tcl_Obj* above this +conversion assumes that the returned value has a reference count of +0 and performs no decrement. Returning a value whose +reference count is greater than zero will likely cause a memory leak.

    char*
    vstring
    -

    The function returns a value of type "char*". -This value becomes the interpreter result, wrapped in a String. +

    The function returns a value of type char*. +This value becomes the interpreter result, wrapped in a String. It is assumed that the string is volatile in some way, with the -wrapping in a String duplicating it before making it the result, -ensuring that we will not access a dangling pointer in the future. -The Tcl status is always TCL_OK.

    +wrapping in a String duplicating it before making it the +result, ensuring that we will not access a dangling pointer in the +future. +The Tcl status is always TCL_OK.

    const char*
    -

    Like type char* above, except that the returned string is const-qualified.

    +

    Like type char* above, except that the returned string is +const-qualified.

    string
    dstring
    -

    The function returns a value of type "char*". +

    The function returns a value of type char*. Contrary to the previous string types here it is assumed that the value is dynamically allocated, via Tcl_Alloc. -This value becomes the interpreter result, as usual, but is not copied. -The Tcl status is always TCL_OK.

    +This value becomes the interpreter result, as usual, but is not +copied. +The Tcl status is always TCL_OK.

    double
    -

    The function returns a value of type "double". -This value becomes the interpreter result, properly wrapped (Int). -The Tcl status is always TCL_OK.

    +

    The function returns a value of type double. +This value becomes the interpreter result, properly wrapped as a +Double. +The Tcl status is always TCL_OK.

    float
    -

    The function returns a value of type "float". -This value becomes the interpreter result, properly wrapped (Double). -The Tcl status is always TCL_OK.

    +

    The function returns a value of type float. +This value becomes the interpreter result, properly wrapped as a +Double. +The Tcl status is always TCL_OK.

    boolean
    bool
    -

    The function returns a value of type "int", interpreted as boolean. -This value becomes the interpreter result, properly wrapped (Int). -The Tcl status is always TCL_OK.

    +

    The function returns a value of type int, interpreted as boolean. +This value becomes the interpreter result, properly wrapped as a +Int. +The Tcl status is always TCL_OK.

    int
    -

    The function returns a value of type "int". -This value becomes the interpreter result, properly wrapped (Int). -The Tcl status is always TCL_OK.

    +

    The function returns a value of type int. +This value becomes the interpreter result, properly wrapped as a +Int. +The Tcl status is always TCL_OK.

    long
    -

    The function returns a value of type "long int". -This value becomes the interpreter result, properly wrapped (Long). -The Tcl status is always TCL_OK.

    +

    The function returns a value of type long int. +This value becomes the interpreter result, properly wrapped as a +Long. +The Tcl status is always TCL_OK.

    +
    wideint
    +

    The function returns a value of type Tcl_WideInt. +This value becomes the interpreter result, properly wrapped as a +WideInt. +The Tcl status is always TCL_OK.

    ok
    -

    The function returns a value of type "int". +

    The function returns a value of type int. It is interpreted as the Tcl status code. -The interpreter result is left untouched (empty).

    +The interpreter result is left untouched (empty). For a different +outcome the function has to set the interpreter result by itself.

    void

    The function does not return a value. -The interpreter result is left untouched (empty). -The Tcl status is always TCL_OK.

    +The interpreter result is left untouched (empty). For a different +outcome the function has to set the interpreter result by itself. +The Tcl status is always TCL_OK.

    -

    Please note that it is possible to extend the above with custom -types if these types are not enough. See section -Advanced: Extending cproc for details.

    The arguments parameter has the overall syntax of a Tcl dictionary value, except that keys (argument names) and values (argument types) are specified in reverse order. Consider the @@ -518,63 +582,105 @@

     int {x 1} 

    x is an optional argument of type int and default value 1.

    -

    One limitation, and one caveat!

    -

    First, the set of optional arguments must be a single -contiguous segment in the argument list. This limits them to a series -of optional arguments at either the beginning, end, or middle of the -list. Multiple segments separated by non-optional arguments are -rejected, as the system cannot determine in these cases which -arguments are present and what to set where.

    -

    Second, the default value is assigned unconditionally. If a +

    A caveat! The default value is assigned unconditionally. If a custom argument type uses more complex validation, and the default may be invalid according to it, then the relevant checks have to be done in the procedure body. The argument conversion cannot do it as it is completely bypassed when the argument is not present. Overcoming this requires the separation of argument conversion and validation code.

    -

    The list below shows the values which are legal for argument -types, and details their semantics:

    +

    Below is the list of predefined types legal for arguments, plus +the details of their semantics. Note that it is possible to extend +this list with custom types if the standard does not support what is +needed. See section Advanced: Extending cproc for details.

    +

    Further note that the type of the first argument is allowed to +be Tcl_Interp*. In that case the argument in question is +not counted as an argument of the new Tcl command.

    Tcl_Obj*
    object
    -

    The function takes an argument of type "Tcl_Obj*". +

    The function takes an argument of type Tcl_Obj*. No argument checking is done. The Tcl level word is passed to the argument as-is.

    +
    pstring
    +

    The function takes an argument of type critcl_pstring +containing the original Tcl_Obj* reference of the Tcl argument, +plus the length of the string and a pointer to the character array.

    +
    +typedef struct critcl_pstring {
    +    Tcl_Obj* o;
    +    char*    s;
    +    int      len;
    +} critcl_pstring;
    +
    +
    +
    list
    +

    The function takes an argument of type critcl_list containing +the original Tcl_Obj* reference of the Tcl argument, plus the +length of the Tcl list and a pointer to the array of the list +elements.

    +
    +typedef struct critcl_list {
    +    Tcl_Obj*  o;
    +    Tcl_Obj** v;
    +    int       c;
    +} critcl_list;
    +
    +

    The Tcl argument must be convertible to List, an error is +thrown otherwise.

    bytearray
    rawchar*
    rawchar
    -

    The function takes an argument of type "char*". -The Tcl argument must be convertible to ByteArray, an error is thrown -otherwise. -Note that the length of the ByteArray is not passed to -the function.

    +

    The function takes an argument of type char*. +The Tcl argument must be convertible to ByteArray, an error is +thrown otherwise. +Note that the length of the ByteArray is not +passed to the function, making this type not very usable.

    +
    bytes
    +

    This is the new and usable ByteArray type.

    +

    The function takes an argument of type critcl_bytes +containing the original Tcl_Obj* reference of the Tcl argument, +plus the length of the byte array and a pointer to the byte data.

    +
    +typedef struct critcl_bytes {
    +    Tcl_Obj* o;
    +    char*    s;
    +    int      len;
    +} critcl_list;
    +
    +

    The Tcl argument must be convertible to ByteArray, an error is +thrown otherwise.

    char*
    -

    The function takes an argument of type "char*". +

    The function takes an argument of type char*. The string representation of the Tcl argument is passed in.

    double
    -

    The function takes an argument of type "double". -The Tcl argument must be convertible to Double, an error is thrown -otherwise.

    +

    The function takes an argument of type double. +The Tcl argument must be convertible to Double, an error is +thrown otherwise.

    float
    -

    The function takes an argument of type "float". -The Tcl argument must be convertible to Double, an error is thrown -otherwise.

    +

    The function takes an argument of type float. +The Tcl argument must be convertible to Double, an error is +thrown otherwise.

    boolean
    bool
    -

    The function takes an argument of type "int". -The Tcl argument must be convertible to Boolean, an error is thrown -otherwise.

    +

    The function takes an argument of type int. +The Tcl argument must be convertible to Boolean, an error is +thrown otherwise.

    int
    -

    The function takes an argument of type "int". -The Tcl argument must be convertible to Int, an error is thrown +

    The function takes an argument of type int. +The Tcl argument must be convertible to Int, an error is thrown otherwise.

    long
    -

    The function takes an argument of type "long int". -The Tcl argument must be convertible to Long, an error is thrown -otherwise.

    +

    The function takes an argument of type long int. +The Tcl argument must be convertible to Long, an error is +thrown otherwise.

    +
    wideint
    +

    The function takes an argument of type Tcl_WideInt. +The Tcl argument must be convertible to WideInt, an error is +thrown otherwise.

    void*
    double*
    @@ -586,41 +692,49 @@ The Tcl argument must be convertible to ByteArray, an error is thrown otherwise. The bytes in the ByteArray are then re-interpreted as the raw -representation of a C pointer of the given type which is then passed -as argument to the function. +representation of a single C pointer of the given type which is then +passed as argument to the function. In other words, this is for Tcl values somehow holding raw C pointers, i.e. memory addresses.

    Attention: These types are considered DEPRECATED. It is planned to remove their documentation in release 3.2, and their implementation in release 3.3. Their deprecation can be undone if good use cases are shown.

    -
    -

    Note that optional arguments are not possible. This -restriction is inherited from C.

    -

    Further note that the type of the first argument is allowed to -be Tcl_Interp*. In that case the argument in question is -not counted as an argument of the new Tcl command.

    -
    ::critcl::cproc name arguments resulttype
    + +
    ::critcl::cproc name arguments resulttype

    This variant of critcl::cproc assumes that the functionality to -connect is implemented by the C function name which has the +connect to is implemented by the C function name which has the signature described by the arguments and resulttype.

    It creates only the shim performing the conversions required by arguments and result.

    -
    ::critcl::cinit text externals
    +
    ::critcl::cinit text externals

    This command compiles the C code in text and externals.

    -

    Both have access to all definitions created by the previously -listed commands, regardless of their and its placement in the -".critcl" file. See section Runtime Behaviour for -more details.

    +

    Both arguments have access to all definitions created by the +previously listed commands, regardless of their placement in the +".critcl" file relative to this command. +See section Runtime Behaviour for more details.

    The C code in text is put into the body of the initialization function of the shared library backing the ".critcl" file, and is executed when this library is loaded into the interpreter.

    +

    This code has access to a variable interp of type +Tcl_Interp* referencing the Tcl interpreter currently being +initialized.

    The code in externals on the other hand is placed outside and just before the initialization function, making this is a good place for any external symbols required by initialization function which should not be accessible by any other parts of the C code.

    +

    Multiple invokations of this command are allowed, and a later +call has access to the information of all preceding ones.

    The result of the command is the empty string.

    +
    ::critcl::include path
    +

    This command is a convenient shorthand for

    +
    +critcl::code {
    +  #include <${path}>
    +}
    +
    +

    Stubs Table Management

    @@ -628,14 +742,14 @@ tables, Tcl's dynamic linking mechanism handling the resolution of symbols between C extensions. We won't go into its details here. See http://wiki.tcl.tk/285 -for an introduction in general, and section Stubs Tables +for an introduction in general, and section Stubs Tables for the details of critcl's particular variant.

    Critcl supports this via a single command, critcl::api, and its methods.

    First, importing stubs tables, i.e. APIs, from another extension:

    -
    ::critcl::api import name version
    +
    ::critcl::api import name version

    Critcl prepares the ".critcl" file and its companion ".c" files by including the headers

      @@ -683,7 +797,7 @@

      Second, declaration and export of a stubs table, i.e. API, for the current package, foo:

      -
      ::critcl::api function resulttype name arguments
      +
      ::critcl::api function resulttype name arguments

      This method declares that the function name is in the public API of the package, and its signature (type of the result, number, names and types of its arguments). @@ -694,7 +808,7 @@

      arguments is a list of C types and associated argument names. Like a dictionary, except that keys (argument names) and values (argument types) are swapped. The resulttype is a C type as well.

      -
      ::critcl::api header ?pattern...?
      +
      ::critcl::api header ?pattern...?

      This method notifies critcl of companion header files which have to be exported together with the generated stubs headers.

      All arguments are interpreted as glob pattern and the matching @@ -708,7 +822,7 @@

      Note that patterns which are not beginning with an absolute path are interpreted relative to the directory containing the current ".critcl" file.

      -
      ::critcl::api extheader ?file...?
      +
      ::critcl::api extheader ?file...?

      This method is similar ::critcl::api header, in that it notifies critcl of companion header files which have to be exported together with the generated stubs headers.

      @@ -728,7 +842,7 @@ critcl does it for them.

      In mode "compile & run" the generated header files, and their companion headers, if any, are placed in the subdirectory "foo" -of the Result Cache. As this location is implicitly added +of the Result Cache. As this location is implicitly added to the include search path any other package importing this API and and build in mode "compile & run" as well will find the these headers.

      For mode "generate package" the application was extended with a @@ -756,7 +870,7 @@ suitable for use by the TEApot tools.

      -
      ::critcl::license author ?text...?
      +
      ::critcl::license author ?text...?

      This command provides information about the author of the package, and its license.

      If no text is present the command expects to find a file @@ -772,21 +886,21 @@ "teapot.txt", under the keys as::author and license.

      The data specified by this command has priority over any information specified through the generic API ::critcl::meta.

      -
      ::critcl::summary text
      +
      ::critcl::summary text

      Declares a short (one line is recommended) description of the package.

      This information is ignored in mode "compile & run", only mode "generate package" uses it. In that case the information is placed into the meta data file "teapot.txt", under the key summary.

      The data specified by this command has priority over any information specified through the generic API ::critcl::meta.

      -
      ::critcl::description text
      +
      ::critcl::description text

      Declares a longer description of the package.

      This information is ignored in mode "compile & run", only mode "generate package" uses it. In that case the information is placed into the meta data file "teapot.txt", under the key description.

      The data specified by this command has priority over any information specified through the generic API ::critcl::meta.

      -
      ::critcl::subject ?key...?
      +
      ::critcl::subject ?key...?

      Declares one or more keywords and key-phrases describing the package, for an index.

      Multiple calls of this command accumulate keywords and phrases.

      @@ -795,7 +909,7 @@ into the meta data file "teapot.txt", under the key subject.

      The data specified by this command has priority over any information specified through the generic API ::critcl::meta.

      -
      ::critcl::meta key ?word...?
      +
      ::critcl::meta key ?word...?

      This command is for the declaration of arbitrary meta data outside of the reserved keys as::author, @@ -827,7 +941,7 @@ as::build::date and platform is automatically generated by critcl itself.

      -
      ::critcl::meta? key
      +
      ::critcl::meta? key

      This command enables the retrieval of meta data information from with the code defining a critcl based package. Given the key the associated value is returned as the result of the command.

      @@ -835,7 +949,7 @@ from within utility packages having to adapt C code templates to their environment. An example of a package using this command for exactly this purpose is critcl::class.

      -
      ::critcl::buildrequirement script
      +
      ::critcl::buildrequirement script

      This command provides control over the capturing of dependencies declared via package require. It runs the script, and any dependencies declared within are ignored, i.e. not recorded in the @@ -853,7 +967,7 @@ "BAR.tcl", preventing them from interfering with each other.

      The commands are:

      -
      ::critcl::cheaders ?arg...?
      +
      ::critcl::cheaders ?arg...?

      This command provides the compile step with additional header files and header locations.

      All arguments matching the glob pattern -* are @@ -867,16 +981,17 @@ absolute path are interpreted relative to the directory containing the current ".critcl" file.

      Note further that this declaration does not cause the -specified header files to be #include'd automatically. This -still has to be done via critcl::ccode where necessary. +specified header files to be automatically +#include'd. Inclusion still has to be done via either +critcl::include or critcl::ccode, where necessary. It does simply ensure that the compiler will be able to find these files when invoked, by providing the necessary command line flags -extending the compiler's search paths.

      +to extend the compiler's search paths.

      Multiple invocations of this command accumulate their information.

      -
      ::critcl::csources ?pattern...?
      +
      ::critcl::csources ?pattern...?

      This command provides the compile step with additional C source files.

      -

      All arguments are intepreted as glob patterns. Patterns +

      All arguments are interpreted as glob patterns. Patterns matching no file or non-existing files cause the command to throw an error. The files matching the patterns are made available to the compiler when it is invoked for the current ".critcl" file. This @@ -887,7 +1002,7 @@ current ".critcl" file.

      Multiple invocations of this command accumulate their information.

      -
      ::critcl::clibraries ?arg...?
      +
      ::critcl::clibraries ?arg...?

      This command provides the link step with additional libraries to link and library locations.

      All arguments matching the glob pattern -* are @@ -904,7 +1019,7 @@ current ".critcl" file.

      Multiple invocations of this command accumulate their information.

      -
      ::critcl::source path
      +
      ::critcl::source path

      This command evaluates the critcl commands in the file specified by path in the context of the current ".critcl" file.

      The argument is actually considered as glob pattern and all @@ -913,7 +1028,7 @@

      Note that a pattern not beginning with an absolute path is interpreted relative to the directory containing the current ".critcl" file.

      -
      ::critcl::tsources pattern...
      +
      ::critcl::tsources pattern...

      This command provides the critcl package with information about additional Tcl script files to source when the shared library is loaded.

      @@ -928,7 +1043,7 @@ information.

      The declared files are sourced after the shared library has been loaded, in the same order they were provided to critcl::tsources.

      -
      ::critcl::owns pattern...
      +
      ::critcl::owns pattern...

      This command is ignored by the regular build modes, i.e. both "compile and run", and "generate package". It is present to support the static code scanner of critcl v3's new mode to "generate TEA" packages.

      @@ -938,19 +1053,19 @@ critcl::tsources) because of getting specified dynamically, or getting directly sourced and this not visible to critcl in any other way.

      -
      ::critcl::cflags ?arg...?
      +
      ::critcl::cflags ?arg...?

      This command provides the compile step with additional compiler flags.

      All arguments are forwarded to the compiler's command line when it is invoked for the current ".critcl" file.

      Multiple invocations of this command accumulate their information.

      -
      ::critcl::ldflags ?arg...?
      +
      ::critcl::ldflags ?arg...?

      This command provides the link step with additional linker flags.

      All arguments are forwarded to the linkers's command line when it is invoked for the current ".critcl" file.

      Multiple invocations of this command accumulate their information.

      -
      ::critcl::framework ?arg...?
      +
      ::critcl::framework ?arg...?

      This command provides the link step with the names of additional frameworks to link on MacOS X. The command is ignored if we are not building for OS X. This means that it is possible to declare the OS X @@ -960,15 +1075,15 @@ it is invoked for the current ".critcl" file.

      Multiple invocations of this command accumulate their information.

      -
      ::critcl::tcl version
      +
      ::critcl::tcl version

      This command tells critcl for what minimum version of the Tcl runtime to compile and link the package for. If not specified critcl falls back to the default of 8.4.

      -
      ::critcl::tk
      +
      ::critcl::tk

      This command informs critcl that the package in question is based on Tk, and therefore needs the Tk headers for compilation, and the Tk stubs for linking.

      -
      ::critcl::preload lib...
      +
      ::critcl::preload lib...

      This command arranges that the named dependent external shared library is loaded before the generated package's shared library.

      Multiple invocations of this command accumulate their @@ -1016,9 +1131,9 @@

      If you are a developer wishing to understand or modify the internals of the critcl package then you possibly should read the -section explaining how the Preloading functionality is +section explaining how the Preloading functionality is implemented.

      -
      ::critcl::debug area...
      +
      ::critcl::debug area...

      This tells critcl if the package is to be compiled for debugging, and which areas to activate. Internally each area is translated into area-specific flags for the compiler which are then handed over to @@ -1040,7 +1155,7 @@

      The package provides six commands to control compilation and linking. These are:

      -
      ::critcl::check ?label? text
      +
      ::critcl::check ?label? text

      This command is useful to test if some functionality is available in the build environment, and then select other C code fragments based on that information. @@ -1049,7 +1164,7 @@ The command returns true on success, and false otherwise. If specified, the label is used to uniquely mark the check in the generated log.

      -
      ::critcl::checklink ?label? text
      +
      ::critcl::checklink ?label? text

      This command is an extenson of critcl::check above, useful to test if some functionality is available in the build environment, and then select other C code fragments based on that information. @@ -1058,7 +1173,7 @@ The command returns true on success, and false otherwise. If specified, the label is used to uniquely mark the check in the generated log.

      -
      ::critcl::msg ?-nonewline? msg
      +
      ::critcl::msg ?-nonewline? msg

      This command can be used by critc-based code to report results from critcl::check and critcl::checklink. The default implementation used by mode compile & run ignores any calls.

      @@ -1066,7 +1181,7 @@ redefine this procedure to perform their own way of message reporting. The package critcl::app and the application on top print such messages to stdout, for example.

      -
      ::critcl::print ?-nonewline? ?chan? msg
      +
      ::critcl::print ?-nonewline? ?chan? msg

      This command is used by the critcl internals to report its activity. Its signature is equivalent to the Tcl builtin command ::puts. The default implementation is effectively ::puts.

      @@ -1076,7 +1191,7 @@

      An example of this is Kettle where the newest revisions use this to highlight build warnings.

      -
      ::critcl::compiled
      +
      ::critcl::compiled

      This command returns a boolean value. It returns true if the C code of the current ".critcl" file is already compiled, and false otherwise.

      @@ -1087,11 +1202,11 @@ the load phase of "compile & run". In case of the two latter possibilities the result is true, and false for the first.

      -
      ::critcl::compiling
      +
      ::critcl::compiling

      This command returns a boolean value. It returns true if C code can be compiled on this platform in general, i.e. if a C compiler is available, and false otherwise.

      -
      ::critcl::done
      +
      ::critcl::done

      This command returns a boolean value. It returns true when critcl has built the embedded C code, and false otherwise.

      This enables the Tcl code of a critcl-based package to @@ -1101,33 +1216,37 @@ ".critcl" file. The result is managed on a per-file basis, like is done for the commands embedding C code and controlling the behaviour of compiler and linker.

      -

      See also section Modes Of Operation/Use.

      -
      ::critcl::failed
      +

      See also section Modes Of Operation/Use.

      +
      ::critcl::failed

      This command returns a boolean value. It returns true if -critcl has failed to build the package. As part of this it forces the -building of the package, but not its loading. Note that it will -attempt to build the package only on the first call; future calls for -the same package will return a cached result.

      +critcl has failed to build the package, and false otherwise, +i.e. success. As part of this it forces the building of the package, +but not its loading. Note that it will attempt to build the package +only on the first call; future calls for the same package will return +a cached result.

      This enables a critcl-based package to check itself for -availability and throw an error if it could not be built.

      -

      Note that this command is only useful from within in a -".critcl" file. The result is managed on a per-file basis, like -is done for the commands embedding C code and controlling the -behaviour of compiler and linker.

      -
      ::critcl::load
      +availability and throw an error if it could not be built. Note +that the command does not throw such an error itself.

      +

      Note further that this command is only useful from +within in a ".critcl" file. The result is managed on a per-file +basis, like is done for the commands embedding C code and controlling +the behaviour of compiler and linker.

      +
      ::critcl::load

      This command is like critcl::failed, except that it also forces the loading of the generated shared library, if it was built, and that its result has reversed sense.

      It returns true if critcl succeeded in building and -loading the package.

      +loading the package, and false otherwise, i.e. build- or +load-failure.

      This enables a critcl-based package to to not only check itself for availability and throw an error if it could not be built, but also force an immediate load, circumventing the default behaviour, which is -lazy. See also section Runtime Behaviour.

      -

      Note that this command is only useful from within in a -".critcl" file. The result is managed on a per-file basis, like -is done for the commands embedding C code and controlling the -behaviour of compiler and linker.

      +lazy. See also section Runtime Behaviour. Note that +the command does not throw any error itself.

      +

      Note further that this command is only useful from +within in a ".critcl" file. The result is managed on a per-file +basis, like is done for the commands embedding C code and controlling +the behaviour of compiler and linker.

    Build Management

    @@ -1139,7 +1258,7 @@ which is only useful to the CriTcl Application or similar tools.

    -
    ::critcl::config option ?val?
    +
    ::critcl::config option ?val?

    This command sets and returns critcl's global configuration options. These are

    force bool
    @@ -1148,7 +1267,12 @@ not. The default is off.

    lines bool

    This flag tells the package whether to embed #line directives into the -generated C code (when true) or not. By default this is on.

    +generated C code (when true) or not. By default this is on.

    +
    trace bool
    +

    Inactive by default. +When active code tracing entry and exit of critcl::cproc-based +is inserted into the C code. This implicitly activates the tracing +facility in general. (See package critcl::cutil).

    Side note: This facility requires the use of a tclsh supporting the builtin info frame command. If critcl is run by a tclsh not supporting this no #line directives will be emitted. The @@ -1183,25 +1307,25 @@ not. The default is off.

    outdir path

    The path where to place a generated shared library. Not set by -default, causing placement into the Result Cache.

    +default, causing placement into the Result Cache.

    Result Cache Management

    This package provides two commands for the management of the -Result Cache. See that section for background information.

    +Result Cache. See that section for background information.

    NOTE that these commands are irrelevant to anybody just wishing to write a package using critcl for the C parts. They are management commands which are only useful to the CriTcl Application or similar tools.

    -
    ::critcl::cache ?path?
    +
    ::critcl::cache ?path?

    This command sets and returns the path to the directory for the package's result cache.

    The default location is "~/.critcl/[platform::generic]" and usually does not require any changes.

    -
    ::critcl::clean_cache ?pattern...?
    +
    ::critcl::clean_cache ?pattern...?

    This command cleans the result cache, i.e. removes any and all files and directories in it. If one or more patterns are specified then only the files and directories matching them are removed.

    @@ -1216,30 +1340,30 @@ management commands which are only useful to the CriTcl Application or similar tools.

    -
    ::critcl::readconfig path
    +
    ::critcl::readconfig path

    This command reads the build configuration file at path and configures the package using the information for the currently set target platform.

    -
    ::critcl::showconfig ?chan?
    +
    ::critcl::showconfig ?chan?

    This command converts the currently active build configuration into a human-readable string and prints the result to the channel chan. If chan is not present the string is instead returned as the result of the command.

    -
    ::critcl::showallconfig ?chan?
    +
    ::critcl::showallconfig ?chan?

    This command converts the set of all known build configurations (from the currently active build configuration file last set with critcl::readconfig) into a string and print the result to the channel chan. If chan is not present the string is instead returned as the result of the command.

    -
    ::critcl::chooseconfig target ?nomatcherr?
    +
    ::critcl::chooseconfig target ?nomatcherr?

    This command takes a target identifier and matches it against all known targets, returning a list containing all the matching ones. This search is first done on an exact basis, and then via glob matching. If no known target matches the argument the default is to return an empty list. However, if the boolean nomatcherr is specified and set, and error will be thrown instead, using critcl::error.

    -
    ::critcl::setconfig target
    +
    ::critcl::setconfig target

    This command takes a target identifier and configures the package to use all its settings.

    @@ -1251,21 +1375,21 @@ These commands are irrelevant to anybody just wishing to write a ".critcl" file.

    -
    ::critcl::actualtarget
    +
    ::critcl::actualtarget

    This command returns the platform identifier of the target platform, i.e. the platform the generated code will be built for. In contrast to ::critcl::targetplatform this is the true target, with any cross-compilation information resolved.

    -
    ::critcl::buildforpackage ?flag?
    +
    ::critcl::buildforpackage ?flag?

    This command signals whether the next file to be build is built for inclusion into a package or not. If not specified the flag defaults to true, i.e. building for a package. This disables a number of things in the backend, namely the linking of that file into a shared library, and loading such. It is expected that the build results are later wrapped into a larger collection.

    -
    ::critcl::cnothingtodo file
    +
    ::critcl::cnothingtodo file

    This command checks whether there is anything to build for file.

    -
    ::critcl::cresults ?file?
    +
    ::critcl::cresults ?file?

    This command returns the build result information for the specified file. If no file is specified the information is taken from info script. The result in question is a Tcl dictionary with the following keys, @@ -1293,37 +1417,40 @@

    The list of companion ".tcl" files to source for the package in the ".critcl" file to run successfully.

    log
    -

    The build log in case of failure, and ::critcl::buildforpackage -having signaled the build of a package. Otherwise the empty string.

    +

    The full build log generated by the compiler/linker, including command +line data from critcl, and other things.

    +
    exl
    +

    The raw build log generated by the compiler/linker. This key contains +only the output generated by the invoked applications.

    -
    ::critcl::crosscheck
    +
    ::critcl::crosscheck

    This command checks if the package is configured for cross-compilation and prints a message to the standard error channel if so.

    -
    ::critcl::error msg
    +
    ::critcl::error msg

    This command is used by the package to report internal errors. The default implementation simply throws the error. Tools like the CriTcl Application are allowed to redefine this procedure to perform their own way of error reporting. There is one constraint they are not allowed to change: The procedure must not return to the caller.

    -
    ::critcl::knowntargets
    +
    ::critcl::knowntargets

    This command returns a list containing the identifiers of all targets found during the last invocation of critcl::readconfig.

    -
    ::critcl::sharedlibext
    +
    ::critcl::sharedlibext

    This command returns the file extension used by shared libraries on the target platform.

    -
    ::critcl::targetconfig
    +
    ::critcl::targetconfig

    This command returns the target identifier chosen to by either system or user to build code for.

    -
    ::critcl::buildplatform
    +
    ::critcl::buildplatform

    This command returns the platform identifier of the build platform, i.e. where the package is running on.

    -
    ::critcl::targetplatform
    +
    ::critcl::targetplatform

    This command returns the platform identifier of the target platform, i.e. the platform the generated code will be built for. In contrast to ::critcl::actualtarget this may be the name of a cross-compilation target.

    -
    ::critcl::cobjects ?arg...?
    +
    ::critcl::cobjects ?arg...?

    This command is like ::critcl::clibraries, provides the link step with additional information. Instead of libraries the arguments are object files however. @@ -1342,7 +1469,7 @@ current ".critcl" file.

    Multiple invocations of this command accumulate their information.

    -
    ::critcl::scan path
    +
    ::critcl::scan path

    This command is the main entry point to critcl's static code scanner. Invoked for a single ".critcl" file it returns a dictionary providing the following pieces information about it:

    @@ -1358,7 +1485,7 @@

    This command and the information it returns can be used by tools to implement processing modes like the assembly of a directory hierarchy containing a TEA-lookalike buildystem, etc.

    -
    ::critcl::name2c name
    +
    ::critcl::name2c name

    This command exposes the conversion of a Tcl level identifier of commands into various C-level pieces, i.e. Tcl namespace prefix, C namespace prefix, Tcl base name, and C base name.

    @@ -1375,25 +1502,25 @@

    For the advanced user five commands used inside of critcl::cproc are exposed. These are:

    -
    ::critcl::argnames arguments
    +
    ::critcl::argnames arguments

    This command takes an argument declaration as taken by critcl::cproc and returns a list of the user visible arguments found in the declaration.

    -
    ::critcl::argcnames arguments
    +
    ::critcl::argcnames arguments

    This command takes an argument declaration as taken by critcl::cproc and returns a list of the C side variable names for the user visible arguments found in the declaration. The names returned here match the names used in the declarations and code returned by ::critcl::argvardecls and ::critcl::argconversion.

    -
    ::critcl::argcsignature arguments
    +
    ::critcl::argcsignature arguments

    This command takes an argument declaration as taken by critcl::cproc and returns a list of C parameter declarations for all arguments found in the declaration.

    -
    ::critcl::argvardecls arguments
    +
    ::critcl::argvardecls arguments

    This command takes an argument declaration as taken by critcl::cproc and returns a list of C side variable declarations for the user visible arguments found in the declaration. The names used in these declarations match the names returned by ::critcl::argcnames.

    -
    ::critcl::argconversion arguments ?n?
    +
    ::critcl::argconversion arguments ?n?

    This command takes an argument declaration as taken by critcl::cproc and returns a list of C code fragments converting the user visible arguments found in the declaration from Tcl_Obj* to C types. The names used in these @@ -1401,14 +1528,14 @@

    The generated code assumes that the procedure arguments start at index n of the objv array. If this argument is not specified 1 will be assumed.

    -
    ::critcl::argoptional arguments
    +
    ::critcl::argoptional arguments

    This command takes an argument declaration as taken by critcl::cproc and returns a list of boolean values indicating which arguments are optional (true) and not (false).

    -
    ::critcl::argdefaults arguments
    +
    ::critcl::argdefaults arguments

    This command takes an argument declaration as taken by critcl::cproc and returns a list containing the default values for all optional arguments.

    -
    ::critcl::argsupport arguments
    +
    ::critcl::argsupport arguments

    This command takes an argument declaration as taken by critcl::cproc and returns a list of C code fragments needed to define the necessary supporting types.

    @@ -1419,7 +1546,7 @@ package-specific, i.e. developer-specified custom build configuration options.

    -
    ::critcl::userconfig define name description type ?default?
    +
    ::critcl::userconfig define name description type ?default?

    This command defines custom build configuration option, with description, type and optional default value.

    The type can be either bool, or a list of values.

    @@ -1439,14 +1566,14 @@ --disable-FOO, whereas an option whose type is a list of values is translated into a single configure option --with-FOO.

    -
    ::critcl::userconfig query name
    +
    ::critcl::userconfig query name

    This command queries the database of custom build configuration option for the current ".critcl" file and returns the chosen value. This may be the default if no value was set via ::critcl::userconfig set.

    It is at this point that definitions and set values are brought together, with the latter validated against the definition.

    -
    ::critcl::userconfig set name value
    +
    ::critcl::userconfig set name value

    This command is for use by a tool, like the critcl application, to specify values for custom build configuration options.

    At the time this command is used only the association between @@ -1491,29 +1618,29 @@ Note that this location information is completely independent of the generation of #line directives within critcl itself.

    -
    ::critcl::at::caller
    +
    ::critcl::at::caller

    This command stores the location of the caller of the current procedure as a tuple of file name and linenumber. Any previously stored location is overwritten. The result of the command is the empty string.

    -
    ::critcl::at::caller offset
    +
    ::critcl::at::caller offset

    As above, the stored line number is modified by the specified offset. In essence an implicit call of critcl::at::incr.

    -
    ::critcl::at::caller offset level
    +
    ::critcl::at::caller offset level

    As above, but the level the location information is taken from is modified as well. Level 0 is the caller, -1 its caller, etc.

    -
    ::critcl::at::here
    +
    ::critcl::at::here

    This command stores the current location in the current procedure as a tuple of file name and linenumber. Any previously stored location is overwritten. The result of the command is the empty string.

    -

    In terms of ::critcl::at::caller] this is equivalent to

    +

    In terms of ::critcl::at::caller this is equivalent to

     	critcl::at::caller 0 1
     
    -
    ::critcl::at::get*
    +
    ::critcl::at::get*

    This command takes the stored location and returns a formatted #line directive ready for embedding into some C code. The stored location is left untouched. @@ -1524,28 +1651,28 @@ before ours and thus be inactive. End result is that the outermost layer generating a directive will 'win', i.e. have its directive used. As it should be.

    -
    ::critcl::at::get
    +
    ::critcl::at::get

    This command is like the above, except that it also clears the stored location.

    -
    ::critcl::at::= file line
    +
    ::critcl::at::= file line

    This command allows the caller to set the stored location to anything they want, outside of critcl's control. The result of the command is the empty string.

    -
    ::critcl::at::incr n...
    +
    ::critcl::at::incr n...
    -
    ::critcl::at::incrt str...
    +
    ::critcl::at::incrt str...

    These commands allow the user to modify the line number of the stored location, changing it incrementally. The increment is specified as either a series of integer numbers (incr), or a series of strings to consider (incrt). In case of the latter the delta is the number of lines endings found in the strings.

    -
    ::critcl::at::caller!
    +
    ::critcl::at::caller!
    -
    ::critcl::at::caller! offset
    +
    ::critcl::at::caller! offset
    -
    ::critcl::at::caller! offset level
    +
    ::critcl::at::caller! offset level
    -
    ::critcl::at::here!
    +
    ::critcl::at::here!

    These are convenience commands combining caller and here with get. I.e. they store the location and immediately return it formatted as proper #line directive. Also note that after their @@ -1567,12 +1694,12 @@

    To help such developers three commands are provided to manage diversions and the collection of C code in memory. These are:

    -
    ::critcl::collect_begin
    +
    ::critcl::collect_begin

    This command starts the diversion of C code collection into memory.

    The result of the command is the empty string.

    Multiple calls are allowed, with each call opening a new nesting level of diversion.

    -
    ::critcl::collect_end
    +
    ::critcl::collect_end

    This command end the diversion of C code collection into memory and returns the collected C code.

    If multiple levels of diversion are open the call only closes @@ -1580,22 +1707,53 @@

    The command will throw an error if no diversion is active, indicating a mismatch in the pairing of collect_begin and collect_end.

    -
    ::critcl::collect script
    +
    ::critcl::collect script

    This is a convenience command which runs the script under diversion and returns the collected C code, ensuring the correct pairing of collect_begin and collect_end.

    -

    Advanced: Extending cproc

    +

    Advanced: File Generation

    +

    While file generation is related to the diversions explained in the +previous section they are not the same. +Even so, like diversions this feature is for higher-level packages +generating their own C code.

    +

    Three examples of utility packages using this facility comes +with critcl itself. +See the implementations of packages critcl::literals, +critcl::bitmap, and critcl::enum.

    +

    When splitting a package implementation into pieces it is often +sensible to have a number of pure C companion files containing +low-level code, yet these files may require information about the code +in the main ".critcl" file. Such declarations are normally not +exportable and using the stub table support does not make sense, as +this is completely internal to the package.

    +

    With the file generation command below the main ".critcl" +file can generate any number of header files for the C companions to +pick up.

    +
    +
    ::critcl::make path contents
    +

    This command creates the file path in a location where the C +companion files of the package are able to pick it up by simple +inclusion of path during their compilation, without interfering +with the outer system at all.

    +

    The generated file will contain the specified contents.

    +
    +
    +

    Advanced: Extending cproc

    While the critcl::cproc command understands the most common C types (see section Embedded C Code), sometimes this is not enough.

    To get around this limitation the commands in this section enable users of critcl to extend the set of argument and -result types understood by critcl::cproc. In other words, to -define their own custom types.

    +result types understood by critcl::cproc. In other words, they +allow them to define their own, custom, types.

    -
    ::critcl::resulttype name body ?ctype?
    +
    ::critcl::has-resulttype name
    +

    This command tests if the named result-type is known or not. +It returns a boolean value, true if the type is known and +false otherwise.

    +
    ::critcl::resulttype name body ?ctype?

    This command defines the result type name, and associates it with the C code doing the conversion (body) from C to Tcl. The C return type of the associated function, also the C type of the @@ -1604,7 +1762,7 @@

    If name is declared already an error will be thrown. Attention! The standard result type void is special as it has no accompanying result variable. This cannot be expressed -by the this extension command.

    +by this extension command.

    The body's responsibility is the conversion of the functions result into a Tcl result and a Tcl status. The first has to be set into the interpreter we are in, and the second has to be @@ -1632,11 +1790,15 @@ } int

    -
    ::critcl::resulttype name = origname
    +
    ::critcl::resulttype name = origname

    This form of the resulttype command declares name as an alias of result type origname, which has to be defined already. If this is not the case an error is thrown.

    -
    ::critcl::argtype name body ?ctype? ?ctypefun?
    +
    ::critcl::has-argtype name
    +

    This command tests if the named argument-type is known or not. +It returns a boolean value, true if the type is known and +false otherwise.

    +
    ::critcl::argtype name body ?ctype? ?ctypefun?

    This command defines the argument type name, and associates it with the C code doing the conversion (body) from Tcl to C The C type of the variable to hold the conversion result is @@ -1673,23 +1835,38 @@ }

    -
    ::critcl::argtype name = origname
    +
    ::critcl::argtype name = origname

    This form of the argtype command declares name as an alias of argument type origname, which has to be defined already. If this is not the case an error is thrown.

    -
    ::critcl::argtypesupport name code
    +
    ::critcl::argtypesupport name code ?guard?

    This command defines a C code fragment for the already defined argument type name which will be inserted before all functions using that type. Its purpose is the definition of any supporting C types needed by the argument type. -If the type is used by many functions the system ensure that only the +If the type is used by many functions the system ensures that only the first of the multiple insertions of the code fragment is active, and -the others disabled.

    +the others disabled. +The guard identifier is normally derived from name, but can also +be set explicitly, via guard. This latter allows different +custom types to share a common support structure without having to +perform their own guarding.

    +
    ::critcl::argtyperelease name code
    +

    This command defines a C code fragment for the already defined +argument type name which will be inserted whenever the worker +function of a critcl::cproc returns to the shim. It is the +responsibility of this fragment to unconditionally release any +resources the critcl::argtype conversion code allocated. +An example of this are the variadic types for the support of +the special, variadic args argument to critcl::cproc's. +They allocate a C array for the collected arguments which has to be +released when the worker returns. This command defines the C code +for doing that.

    Concepts

    -

    Modes Of Operation/Use

    +

    Modes Of Operation/Use

    CriTcl can be used in three different modes of operation, called

    1. Compile & Run, and

    2. @@ -1716,9 +1893,9 @@ make all isntall

      Regarding the caching of results please read the section about -the Result Cache fore more details.

      +the Result Cache fore more details.

    -

    Runtime Behaviour

    +

    Runtime Behaviour

    The default behaviour of critcl, the package is to defer the compilation, linking, and loading of any C code as much as possible, given that this is an expensive operation, mainly in the time @@ -1740,7 +1917,7 @@ ".critcl" file further definition of C code in this file is not allowed any longer.

    -

    File Mapping

    +

    File Mapping

    Each ".critcl" file is backed by a single private ".c" file containing that code, plus the boilerplate necessary for its compilation and linking as a single shared library.

    @@ -1757,15 +1934,15 @@ proper extern statements, but that the management (export and import) of package-specific stubs-tables is not supported. This means that dependent parts have to be forcibly loaded before their user, -with all that entails. See section Runtime Behaviour for +with all that entails. See section Runtime Behaviour for the relevant critcl limitation, and remember that many older platforms do not support the necessary resolution of symbols, the reason why stubs were invented for Tcl in the first place.

    -

    Result Cache

    +

    Result Cache

    The compilation of C code is time-consuming critcl not only defers it as much as possible, as described in section -Runtime Behaviour, but also caches the results.

    +Runtime Behaviour, but also caches the results.

    This means that on the first use of a ".critcl" file "FOO.tcl" the resulting object file and shared library are saved into the cache, and on future uses of the same file reused, @@ -1788,7 +1965,7 @@ on a shared (network) filesystem without having to fear interference between machines of different architectures.

    -

    Preloading functionality

    +

    Preloading functionality

    The audience of this section are developers wishing to understand and possibly modify the internals of critcl package and application. Package writers can skip this section.

    @@ -1799,7 +1976,7 @@ requiring the preload functionality. This support package exports a single Tcl command

    -
    ::preload library
    +
    ::preload library

    which is invoked once per libraries to preload, with the absolute path of that library. The command then loads the library.

    On windows the command will further use the Tcl command @@ -1819,7 +1996,7 @@ in the file "runtime.tcl", which is part of the critcl::app package.

    -

    Configuration Internals

    +

    Configuration Internals

    The audience of this section are developers wishing to understand and possibly modify the internals of critcl package and application. Package writers can skip this section.

    @@ -2024,7 +2201,7 @@ defines a default configuration variable and value.

    -

    Stubs Tables

    +

    Stubs Tables

    This section is for developers of extensions not based on critcl, yet also wishing to interface with stubs as they are understood and used by critcl, either by exporting their own stubs table to a @@ -2238,285 +2415,384 @@

    As the set of examples is a bit large, and growing, it has been put into a separate document. Please see section "Embedding C" in the document about Using CriTcl.

    +

    The latest changes are found at the top.

    -

    Changes for version 2.1

    -
      -
    1. Fixed bug where critcl::tsources interpreted relative -paths as relative to the current working directory instead of -relative to the ".critcl" file using the command, as all other -commands of this type do.

    2. -
    3. Fixed internals, preventing information collected for multiple -".critcl" files to leak between them. Notably, critcl::tk -is not a global configuration option anymore.

    4. -
    5. Fixed the command critcl::license to be a null-operation -in mode "compile & run", instead of throwing an error.

    6. -
    7. Fixed the critcl application's interference with the "compile & -run" result cache in -pkg mode by having it use a wholly -separate (and by default transient) directory for that mode.

    8. -
    9. Fixed bug where changes to a ".critcl" file did not result -in a rebuild for mode "compile & run". All relevant API commands now -ensure UUID changes.

    10. -
    11. Fixed bug in the backend handling of critcl::debug where -the companion c-sources of a ".critcl" file were not compiled -with debug options, although the ".critcl" file was.

    12. -
    13. Fixed bug in critcl::debug which prevented recognition of -mode "all" when it was not the first argument to the command.

    14. -
    15. Fixed bug in "preload.c" preventing its compilation on -non-windows platforms.

    16. -
    17. Fixed long-standing bug in the handling of namespace qualifiers -in the command name argument of critcl::cproc and -critcl::ccommand. It is now possible to specify a fully -qualified command name without issues.

    18. -
    19. Extended/reworked critcl::tsources to be the canonical -way of declaring ".tcl" companion files even for mode "compile & -run".

    20. -
    21. Extended/reworked critcl::tsources to allow the use of a -".critcl" file as its own Tcl companion file.

    22. -
    23. Extended critcl::framework to internally check for OS X -build target, and to ignore the declaration if its not.

    24. -
    25. Extended critcl::failed to be callable more than once in -a ".critcl" file. The first call forces the build, if it was not -done already, to get the result. Further calls return the cached -result of the first call.

    26. -
    27. Extended the handling of environment variable CC in the code -determining the compiler to use to deal with (i.e. remove) paths to -the compiler, compiler file extensions, and compiler options specified -after the compiler itself, leaving only the bare name of the compiler.

    28. -
    29. Extended the code handling the search for preloaded libraries -to print the paths it searched, making debugging of a search failure -easier.

    30. -
    31. A new command critcl::tcl can be used to declare the -version of Tcl minimally needed to build and run the ".critcl" -file and package. Defaults to 8.4 if not declared. Extended critcl to -have the stubs and headers for all of Tcl 8.4, 8.5, and 8.6.

    32. -
    33. A new command critcl::load forces the build and load of a -".critcl" file. This is the official way for overriding critcl's -default lazy-build-&-load-on-demand scheme for mode "compile & run".

      -

      Note that after using critcl::load / -critcl::failed in a ".critcl" file it is not possible to -use critcl commands in that file anymore. Doing so will throw an -error.

    34. -
    35. Extended the generation of '#line' pragmas to use -info frame (if available) to provide the C compiler with exact -line numbers into the ".critcl" file for the reporting of -warnings and errors.

    36. -
    37. Extended critcl::check with logging to help with -debugging build-time checks of the environment, plus an additional -optional argument to provide labeling.

    38. -
    39. Added a new command critcl::checklink which not only -tries to check the environment via compiling the code, but also -its linkability.

    40. -
    41. Added a new command critcl::msg for messaging, like -command critcl::error is for error reporting. Likewise this is a -hook a user of the package is allowed to override. The default -implementation, used by mode compile & run does nothing. The -implementation for mode generate package prints the message -to stdout.

      -

      Envisioned use is for the reporting of results determined by -critcl::check and critcl::checklink during building, to -help with debugging when something goes wrong with a check.

    42. -
    43. Exposed the argument processing internals of critcl::proc -for use by advanced users. The new commands are

      +

      Changes for version 3.1.17

        -
      1. critcl::argnames

      2. -
      3. critcl::argcnames

      4. -
      5. critcl::argcsignature

      6. -
      7. critcl::argvardecls

      8. -
      9. critcl::argconversion

      10. +
      11. Extension: Allow duplicate arg- and result-type definitions if + they are fully identical.

      12. +
      13. Bugfix. The application mishandled the possibility of + identical-named critcl::tsources. Possible because + critcl::tsources can be in subdirectories, a structure + which is not retained in the assembled package, causing + such files to overwrite each other and at least one lost. Fixed + by adding a serial number to the file names in the assembled + package.

      14. +
      15. Bugfix in the static scanner which made it loose requirement + information. Further added code to generally cleanup results at + the end (removal of duplicates, mainly).

      16. +
      17. Bugfix: Fixed issue #76. + Support installation directories which are not in the auto_path. + Without the patch the installed critcl will not find its + own packages and fail. Thank you to + Simon Bachmann for the + report and patch, and then his patience with me to getting to + actually apply it.

      18. +
      19. Bugfix: Fixed issue #75. + Extended critcl::include to now take multiple paths.

      20. +
      21. Added new compatibility package lmap84.

      22. +
      23. Fixed typos in various documentation files.

      24. +
      25. Fixed bug introduced by commit 86f415dd30 (3.1.16 release). The + separation of critcl::ccode into user and work layers + means that location retrieval has to go one more level up to + find the user location.

      26. +
      27. New supporting package critcl::cutil. Provides common + C level facilities useful to packages (assertions, tracing, + memory allocation shorthands).

      28. +
      29. Modified package critcl to make use of the new + tracing facilities to provide tracing of arguments and results + for critcl::ccommand and critcl::cproc invokations.

      30. +
      31. Modified packages critcl and critcl::class + to provide better function names for (class) method tracing. + Bumped package critcl::class to version 1.0.7.

      32. +
      33. Extended the support package critcl::literals with + limited configurability. It is now able to generate code for + C-level access to the pool without Tcl types (Mode c). + The previously existing functionality is accesssible under mode + tcl, which also is the default. Both modes can be used + together.

      34. +
      35. Extended the support package critcl::emap with + limited configurability. It is now able to generate code for + C-level access to the mapping without Tcl types + (Mode c). The previously existing functionality is + accessible under mode tcl, which also is the + default. Both modes can be used together.

      36. +
      +
      +

      Changes for version 3.1.16

      +
        +
      1. New feature. Extended critcl::cproc's argument handling + to allow arbitrary mixing of required and optional arguments.

      2. +
      3. New feature. + Potential Incompatibility.

        +

        Extended critcl::cproc's argument handling to treat an + argument args as variadic if it is the last argument of + the procedure.

      4. +
      5. New feature. Added two introspection commands, + critcl::has-argtype and critcl::has-resulttype. + These enable a user to test if a specific (named) type + conversion is implemented or not.

      6. +
      7. Added new result type Tcl_Obj*0, with alias + object0. The difference to Tcl_Obj* is in + the reference counting.

      8. +
      9. Extended the command critcl::argtypesupport with new + optional argument through which to explicitly specify the + identifier for guarding against multiple definitions.

      10. +
      11. Bugfix: Fixed problem with the implementation of issue #54 (See + 3.1.14). Always create the secondary log file. Otherwise + end-of-log handling may break, unconditionally assuming its + existence.

      12. +
      13. Bugfix: Fixed problem with the internal change to the hook + HandleDeclAfterBuild. Corrected the forgotten + critcl::cconst.

      14. +
      15. Debugging aid: Added comment holding the name of the result + type when emitting result conversions.

      16. +
      17. Bugfix: Fixed issue #60. Unbundled the package directories + containing multiple packages. All directories under "lib/" + now contain exactly one package.

      18. +
      19. Bugfix: Fixed issue #62, a few dict exists commands + operating on a fixed string instead of a variable.

      20. +
      21. Bugfix: Fixed issue #56. Release builders are reminded to run + the tests.

      22. +
      23. Bugfix: Fixed issue #55. For FreeBSD critcl's platform package + now identifies the Kernel ABI version. Initialization of the + cache directory now also uses platform::identify for the + default path, instead of platform::generic.

      24. +
      25. Bugfix: Fixed issue #58. Simplified the setup and use of + md5. Critcl now makes use of its own package for md5, using + itself to built it. There is no chicken/egg problem with this + as the -pkg mode used for this does not use md5. That + is limited to mode compile & run.

      26. +
      +
      +

      Changes for version 3.1.15

      +
        +
      1. Fixed version number bogosity with 3.1.14.

      2. +
      +
      +

      Changes for version 3.1.14

      +
        +
      1. Fixed issue #36. Added message to target all of the + Makefile generated for TEA mode. Additionally tweaked other + parts of the output to be less noisy.

      2. +
      3. Accepted request implied in issue #54. Unconditionally save + the compiler/linker build log into key log of the + dictionary returned by cresults, and save a copy of only + the execution output in the new key exl ("execution + log").

      4. +
      5. Fixed issue #53. Clarified the documentation of commands + critcl::load and critcl::failed with regard + to their results and the throwing of errors (does not happen).

      6. +
      7. Fixed issue #48. Modified mode "compile & run" to allow new + declarations in a file, after it was build, instead of + erroring out. The new decls are build when needed. Mode + "precompile" is unchanged and will continue to trap the + situation.

      8. +
      9. Fixed issue #52. Updated the local Tcl/Tk headers to + 8.4.20, 8.5.13, and 8.6.4.

      10. +
      11. Fixed issue #45. New feature command critcl::cconst.

      12. +
      13. critcl::util: New command locate to find a + file across a set of paths, and report an error when not + found. This is for use in autoconf-like header-searches and + similar configuration tests.

      14. +
      15. Modified 'AbortWhenCalledAfterBuild' to dump the entire stack + (info frame!). This should make it easier to determine the + location of the troubling declaration.

      16. +
      +
      +

      Changes for version 3.1.13

      +
        +
      1. Merged PR #43. Fixed bug loading adjunct Tcl sources.

      2. +
      3. Fixes in documentation and generated code of package + "critcl::enum". Bumped to version 1.0.1.

      4. +
      5. Fixes in documentation of package "critcl::bitmap".

      6. +
      7. New package "critcl::emap". In essence a variant or cross of + "critcl::bitmap" with behaviour like "critcl::enum".

      8. +
      9. Merged PR #49. Fixed documentation typo.

      10. +
      11. Merged PR #46. Fixed documentation typo.

      12. +
      13. Merged PR #47. Fixes to test results to match the accumulated + code changes. Also made portable across Tcl versions (varying + error syntax).

      14. +
      15. New predefined argument- and result-type "wideint" mapping to + Tcl_WideInt.

      16. +
      17. New predefined argument-type "bytes" mapping to tuple of + byte-array data and length. Note: The existing "bytearray" + type (and its aliases) was left untouched, to keep backward + compatibility.

      18. +
      19. Modified the internal interface between the Tcl shim and C + function underneath "critcl::cproc" with respect to the + handling of optional arguments. + An optional argument "X" now induces the use of two C + arguments, "X" and "has_X". The new argument "has_X" is of + boolean (int) type. It is set to true when X is set, and set + to false when X has the default value. C code which cares + about knowing if the argument is default or not is now able to + check that quickly, without having to code the default value + inside. + + NOTE: This change is visible in the output of the advanced + commands "argcnames", "argcsignature", "argvardecls", + and "argconversion".

      20. +
      21. Fixed issue #50 and documented the availability of variable + "interp" (type Tcl_Interp*) within "critcl::cinit" C code + fragments. + Note that while the old, undocumented name of the variable, + "ip", is still usable, it is deprecated. It will be fully + removed in two releases, i.e. for release 3.1.15. + The variable name was changed to be consistent with other code + environments.

      22. +
      23. Fixed issue #51. Disabled the generation of #line directives + for "critcl::config lines 0" coming from template files, or + code generated with them before the final value of this + setting was known.

      24. +
      25. Fixed issue with handling of namespaced package names in + "critcl::iassoc". Equivalent to a bug in "critcl::class" fixed + for critcl 3.1.1, critcl::class 1.0.1. + Note: "literals", "enum", "emap", and "bitmap" do not require + a fix as they are all built on top of "iassoc".

      26. +
      +
      +

      Changes for version 3.1.12

      +
        +
      1. Fixed issue 42. Clear ::errorInfo immediately after startup to + prevent leakage of irrelevant (caught) errors into our script + and confusing the usage code.

      2. +
      3. Fixed issue 40. Keep the order of libraries, and allow + duplicates. Both are things which are occasionally required for + proper linking.

      4. +
      5. Extended the utility package critcl::literals to + declare a cproc result-type for a pool.

        +

        Further fixed the generated header to handle multiple inclusion.

        +

        Bumped version to 1.1.

      6. +
      7. Fixed issue with utility package critcl::bitmap.

        +

        Fixed the generated header to handle multiple inclusion.

        +

        Bumped version to 1.0.1.

      8. +
      9. Created new utility package critcl::enum for the + quick and easy setup and use of mappings between C values + and Tcl strings. + Built on top of critcl::literals.

      10. +
      11. Added examples demonstrating the use of the utility packages + critcl::literals, + critcl::bitmap, and + critcl::enum

      12. +
      +
      +

      Changes for version 3.1.11

      +
        +
      1. Fixed issue #37, via pull request #38, with thanks to + Jos DeCoster. Information was stored into the v::delproc + and v::clientdata arrays using a different key than when + retrieving the same information, thus failing the latter.

      2. +
      3. New convenience command critcl::include for easy + inclusion of headers and other C files.

      4. +
      5. New command critcl::make to generate a local header of + other C files for use by other parts of a package through + inclusion.

      6. +
      7. New utility package critcl::literals for quick and + easy setup of and access to pools of fixed Tcl_Obj* strings. + Built on top of critcl::iassoc.

      8. +
      9. New utility package critcl::bitmap for quick and easy + setup and use of mappings between C bitsets and Tcl lists whose + string elements represent that set. + Built on top of critcl::iassoc.

      10. +
      +
      +

      Changes for version 3.1.10

      +
        +
      1. Fixed code version numbering forgotten with 3.1.9.

      2. +
      3. Fixed issue #35. In package mode (-pkg) the object cache + directory is unique to the process, thus we do not need + content-hashing to generate unique file names. A simple + counter is sufficient and much faster.

        +

        Note that mode "compile & run" is not as blessed and still + uses content-hasing with md5 to ensure unique file names + in its per-user object cache.

      4. +
      5. Fixed issue where the ccommand forgot to use its body as + input for the UUID generation. Thus ignoring changes to it in + mode compile & run, and not rebuilding a library for changed + sources. Bug and fix reported by Peter Spjuth.

      -

      Please see section Advanced Embedded C Code of the -critcl package documentation for details.

    44. -
    45. Extended the critcl package to intercept package -provide and record the file -> package name mapping. Plus other -internal changes now allow the use of namespaced package names while -still using proper path names and init function.

    46. -
    47. Dropped the unused commands critcl::optimize and -critcl::include.

    48. -
    49. Dropped -lib mode from the critcl application.

    50. -
    51. Dropped remnants of support for Tcl 8.3 and before.

    52. +
    +

    Changes for version 3.1.9

    +
      +
    1. Fixed issue #27. Added missing platform definitions for + various alternate linux and OS X targets.

    2. +
    3. Fixed issue #28. Added missing -mXX flags for linking at the + linux-{32,64}-* targets.

    4. +
    5. Fixed issue #29. Replaced the use of raw "cheaders" + information in the processing of "cdefines" with the proper + include directives derived from it.

    6. +
    7. Fixed the issue behind rejected pull request #30 by Andrew + Shadura. Dynamically extract the stubs variable declarations + from the Tcl header files and generate matching variable + definitions for use in the package code. The generated code + will now be always consistent with the headers, even when + critcl's own copy of them is replaced by system headers.

    8. +
    9. Fixed issue #31. Accepted patch by Andrew Shadura, with + changes (comments), for easier integration of critcl with + OS package systems, replacing critcl's copies of Tcl headers + with their own.

    10. +
    11. Fixed issue #32. Merged pull request by Andrew Shadura. + Various typos in documentation and comments.

    12. +
    13. Fixed issue #34. Handle files starting with a dot better.

    -

    Changes for version 3

    +

    Changes for version 3.1.8

      -
    1. The command critcl::platform was deprecated in version -2.1, superceded by critcl::targetplatform, yet kept for -compatibility. Now it has been removed.

    2. -
    3. The command critcl::compiled was kept with in version 2.1 -with semantics in contradiction to its, for compatibility. This -contradiction has been removed, changing the visible semantics of the -command to be in line with its name.

    4. -
    5. The change to version 3 became necessary because of the two -incompatible visible changes above.

    6. -
    7. Extended the application package with code handling a new -option -tea. Specifying this option invokes a special mode -where critcl generates a TEA package, i.e. wraps the input into a -directory hierarchy and support files which provide it TEA-lookalike -buildsystem.

      -

      This new option, and -pkg, exclude each other. If -both are specified the last used option takes precedence.

      -

      The generated package directory hierarchy is mostly -self-contained, but not fully. It requires not only a working -installation of Tcl, but also working installations of the packages -md5 and cmdline. Both of these are provided by the -Tcllib bundle. Not required, but recommended to have -installed are any of the packages which can accelerate md5's -operation, i.e. cryptkit, tcllibc, or -Trf.

    8. -
    9. Extended the critcl package with a new command -critcl::scan taking the path to a ".critcl" file, -statically scanning it, and returning license, version, a list of its -companion files, list of imported APIs, and list of -developer-specified custom configuration options. This data is the -foundation for the TEA wrapping described above.

      -

      Note that this is a static scan. While the other build -modes can (must) execute the ".critcl" file and make -platform-specific decisions regarding the assembled C code, companion -files, etc. the TEA wrap mode is not in a position to make -platform-specific decisions. It has to wrap everything which might -conceivably be needed when actually building. Hence the static scan. -This has however its own set of problems, namely the inability to -figure out any dynamic construction of companion file paths, at least -on its own. Thus:

    10. -
    11. Extended the API used by critcl-based packages with the command -critcl::owns. While this command is ignored by the regular build -modes the static scanner described above takes its arguments as the -names of companion files which have to be wrapped into the TEA package -and could not be figured by the scanner otherwise, like because of -dynamic paths to critcl::tsources, critcl::csources, -getting sourced directly, or simply being adjunct datafiles.

    12. -
    13. Extended the API used by critcl-based packages with the command -critcl::api for the management of stubs tables, be it their use, -and/or declaration and export.

      -

      Please see section Stubs Table Management of the -critcl package documentation for details.

    14. -
    15. Extended the API used by critcl-based packages with the command -critcl::userconfig for the management of developer-specified -custom configuration options, be it their use and/or declaration.

      -

      Please see section Custom Build Configuration of the -critcl package documentation for details.

    16. -
    17. Extended the API used by critcl-based packages with the -commands critcl::description, critcl::summary, -critcl::subject, critcl::meta, and -critcl::buildrequirement for the declaration of TEApot meta data -for/about the package.

      -

      Please see section Package Meta Data of the -critcl package documentation for details.

    18. +
    19. Fixed issue with package indices generated for Tcl 8.4. + Join the list of commands with semi-colon, not newline.

    20. +
    21. Fixed issue #26 which brought up use-cases I had forgotten to + consider while fixing bug #21 (see critcl 3.1.6).

    -

    Changes for version 3.0.1

    +

    Changes for version 3.1.7

      -
    1. Bugfixes all around. In detail:

    2. -
    3. Fixed recording of Tcl version requirements. Keep package name -and version together, unbreaking generated meta data and generated -package load command.

    4. -
    5. Fixed the build scripts: When installing, or wrapping for TEA, -generate any missing directories

    6. -
    7. Modified the build scripts to properly exit the application -when the window of their GUI is closed through the (X) button.

    8. -
    9. Removed an 8.5-ism (open wb) which had slipped into the main -build script.

    10. -
    11. Modified the example build scripts to separate the output for -the different examples (and packages) by adding empty lines.

    12. -
    13. stack::c example bugfix: Include API declarations for use in -the companion files.

    14. -
    15. Extended the documentation: Noted the need for a working -installation of a C compiler.

    16. -
    17. Extended the Windows target definitions and code to handle the -manifest files used by modern MS development environments. Note that -this code handles both possibilities, environment using manifests, and -(old(er)) environments without.

    18. -
    19. Extended the Windows 64bit target definitions and code to -auto-detect the need for the helper library "bufferoverflowU.lib" and -reconfigure the compile and link commands appropriately. We assume -that the library must be linked when present. This should be no harm -if the library is present, yet not needed. Just superfluous. We search -for the library in the paths specified by the environment variable -LIB.

    20. +
    21. Fixed issue #24. Extract and unconditionally display compiler + warnings found in the build log. Prevents users from missing + warnings which, while not causing the build to fail, may + still indicate problems.

    22. +
    23. New feature. Output hook. All non-messaging user output is now + routed through the command critcl::print, and users are + allowed to override it when using the critcl application-as-package.

    24. +
    25. New feature, by Ashok P. Nadkarni. Platform configurations can + inherit values from configurations defined before them.

    -

    Changes for version 3.0.2

    +

    Changes for version 3.1.6

      -
    1. Fixed issue in compile-and-run mode where commands put into the -auto_index are not found by Tcl's [unknown] command.

    2. -
    3. Fixed an array key mismatch breaking usage of client data and -delete function for procedure. Reported by Jos DeCoster, with patch.

    4. -
    5. Implemented a command line option -L, an equivalent of -option -I, just for library search paths.

    6. -
    7. Fixed github issues 5 and 8. Working around a missing variable -::errorInfo. It should always be present, however there seem to be -revisions of Tcl around which violate this assumption.

    8. +
    9. Fixed issue #21. While the multi-definition of the stub-table + pointer variables was ok with for all the C linkers seen so far + C++ linkers did not like this at all. Reworked the code to + ensure that this set of variables is generated only once, in + the wrapper around all the pieces to assemble.

    10. +
    11. Fixed issue #22, the handling of the command identifier + arguments of critcl::ccommand, critcl::cproc, and + critcl::cdata. We now properly allow any Tcl identifier + and generate proper internal C identifiers from them.

      +

      As part of this the signature of command critcl::name2c + changed. The command now delivers a list of four values instead + of three. The new value was added at the end.

      +

      Further adapted the implementation of package + critcl::class, a user of critcl::name2c. + This package is now at version 1.0.6 and requires critcl 3.1.6

      +

      Lastly fixed the mis-handling of option -cname in + critcl::ccommand, and critcl::cproc.

    12. +
    13. Fixed issue #23.

    -

    Changes for version 3.0.3

    +

    Changes for version 3.1.5

      -
    1. Fixed github issues 5 and 8, for the example build.tcl -scripts. Working around a missing variable ::errorInfo. It should -always be present, however there seem to be revisions of Tcl around -which violate this assumption.

    2. +
    3. Fixed issue #19. Made the regular expression extracting the + MSVC version number more general to make it work on german + language systems. This may have to be revisited in the future, + for other Windows locales.

    4. +
    5. Fixed issue #20. Made option -tea work on windows, at least in + a unix emulation environment like msys/mingw.

    -

    Changes for version 3.0.4

    +

    Changes for version 3.1.4

      -
    1. Fixed generation of the package's initname when the incoming - code is read from stdin and has no proper path.

    2. -
    3. Fixed github issue 11. Now using /LIBPATH instead of -L - on Windows (libinclude configuration setting).

    4. -
    5. Extended critcl to handle -l:path format of -l options. - GNU ld 2.22+ handles this by searching for the path as - is. Good when specifying static libraries, as plain -l looks - for shared libraries in preference over static. critcl handles - it now, as older GNU ld's do not understand it, nor the - various vendor-specific linkers.

    6. -
    7. Fixed github issue #12. Critcl now determines the version of - MSVC in use and uses it to switch between various link debug - options. Simplified the handling of bufferoverflowU.lib also, - making use of the same mechanism and collapsing the two - configurations sections we had back into one.

    8. -
    9. Reworked the insertion of #line pragmas into the generated C - code to avoid limitations on the line number argument imposed - by various compilers, and be more accurate.

    10. -
    11. Modified argument processing. Option -libdir now also - implies -L for its argument.

    12. -
    13. Extended handling of option -show (critcl::showconfig) - to list the path of the configuration file the data is coming - from. Good for debugging configuration processing.

    14. -
    15. Extended the build script with targets to regenerate the - embedded documentation, and diagrams, and to generate a - release.

    16. +
    17. Bugfix in package critcl::class. Generate a dummy + field in the class structure if the class has no class + variables. Without this change the structure would be empty, + and a number of compilers are not able to handle such a type.

    18. +
    19. Fixed a typo which broke the win64 configuration.

    20. +
    21. Fixed issue #16, a typo in the documentation of command + critcl::class.

    -

    Changes for version 3.0.5

    +

    Changes for version 3.1.3

      -
    1. Fixed bug in the new code for #line pragmas triggered when - specifying C code without leading whitespace.

    2. -
    3. Extended the documentation to have manpages for the license, - source retrieval, installer, and developer's guides.

    4. +
    5. Enhancement. In detail:

    6. +
    7. Added new argument type "pstring", for "Pascal String", a + counted string, i.e. a combination of string pointer and string + length.

    8. +
    9. Added new methods critcl::argtypesupport and + ::critcl::argsupport to define and use additional + supporting code for an argument type, here used by "pstring" + above to define the necessary structure.

    10. +
    11. Semi-bugfixes in the packages critcl::class and + critcl::iassoc. Pragmas for the AS meta data scanner + to ensure that the template files are made part of the package. + Versions bumped to 1.0.4 and 1.0.1 respectively.

    -

    Changes for version 3.0.6

    +

    Changes for version 3.1.2

      -
    1. Fixed github issue 10. The critcl application now delivers a - proper exit code (1) on build failure, instead of always - indicating success (status 0).

    2. -
    3. Fixed github issue 13. Handling of bufferoverflowU.lib for - release builds was inconsistent with handling for debug - builds. It is now identically handled (conditional) by - both cases.

    4. -
    5. Documentation cleanup, mainly in the installation guide, and - the README.md shown by github

    6. +
    7. Enhancement. In detail:

    8. +
    9. Extended critcl::cproc to be able to handle optional + arguments, in a limited way. This is automatically available to + critcl::class cproc-based methods as well.

    10. +
    11. Bugfix in lassign emulation for Tcl 8.4. Properly set + unused variables to the empty string. Bumped version of + emulation package lassign84 to 1.0.1.

    -

    Changes for version 3.0.7

    +

    Changes for version 3.1.1

      -
    1. Fixed the code generated by critcl::c++command. - The emitted code handed a non-static string table to - Tcl_GetIndexFromObj, in violation of the contract, which - requires the table to have a fixed address. This was a memory - smash waiting to happen. Thanks to Brian Griffin for alrerting - us to the general problem.

    2. +
    3. Bugfixes all around. In detail:

    4. +
    5. Fixed the generation of wrong#args errors for +critcl::cproc and derived code (critcl::class +cproc-based methods). Use NULL if there are no arguments, and +take the offset into account.

    6. +
    7. Fixed the handling of package names by +critcl::class. Forgot that they may contain namespace +separators. Bumped to version 1.0.1.

    8. +
    9. Extended a critcl::class generated error message in +instance creation for clarity. Bumped to version 1.0.2.

    -

    Changes for version 3.1

    +

    Changes for version 3.1

    1. Added a new higher-level package critcl::iassoc.

      This package simplifies the creation of code associating data @@ -2571,143 +2847,291 @@ critcl::class (see above) are users of these facilities.

    2. Extended the API with commands giving users the ability to define custom argument and result types for ::critcl::cproc.

      -

      See the section Advanced: Extending cproc for +

      See the section Advanced: Extending cproc for details of the provided commands.

    -

    Changes for version 3.1.1

    +

    Changes for version 3.0.7

      -
    1. Bugfixes all around. In detail:

    2. -
    3. Fixed the generation of wrong#args errors for -critcl::cproc and derived code (critcl::class -cproc-based methods). Use NULL if there are no arguments, and -take the offset into account.

    4. -
    5. Fixed the handling of package names by -critcl::class. Forgot that they may contain namespace -separators. Bumped to version 1.0.1.

    6. -
    7. Extended a critcl::class generated error message in -instance creation for clarity. Bumped to version 1.0.2.

    8. +
    9. Fixed the code generated by critcl::c++command. + The emitted code handed a non-static string table to + Tcl_GetIndexFromObj, in violation of the contract, which + requires the table to have a fixed address. This was a memory + smash waiting to happen. Thanks to Brian Griffin for alrerting + us to the general problem.

    -

    Changes for version 3.1.2

    +

    Changes for version 3.0.6

      -
    1. Enhancement. In detail:

    2. -
    3. Extended critcl::cproc to be able to handle optional - arguments, in a limited way. This is automatically available to - critcl::class cproc-based methods as well.

    4. -
    5. Bugfix in lassign emulation for Tcl 8.4. Properly set - unused variables to the empty string. Bumped version of - emulation package lassign84 to 1.0.1.

    6. +
    7. Fixed github issue 10. The critcl application now delivers a + proper exit code (1) on build failure, instead of always + indicating success (status 0).

    8. +
    9. Fixed github issue 13. Handling of bufferoverflowU.lib for + release builds was inconsistent with handling for debug + builds. It is now identically handled (conditional) by + both cases.

    10. +
    11. Documentation cleanup, mainly in the installation guide, and + the README.md shown by github

    -

    Changes for version 3.1.3

    +

    Changes for version 3.0.5

      -
    1. Enhancement. In detail:

    2. -
    3. Added new argument type "pstring", for "Pascal String", a - counted string, i.e. a combination of string pointer and string - length.

    4. -
    5. Added new methods critcl::argtypesupport and - ::critcl::argsupport to define and use additional - supporting code for an argument type, here used by "pstring" - above to define the necessary structure.

    6. -
    7. Semi-bugfixes in the packages critcl::class and - critcl::iassoc. Pragmas for the AS meta data scanner - to ensure that the template files are made part of the package. - Versions bumped to 1.0.4 and 1.0.1 respectively.

    8. +
    9. Fixed bug in the new code for #line pragmas triggered when + specifying C code without leading whitespace.

    10. +
    11. Extended the documentation to have manpages for the license, + source retrieval, installer, and developer's guides.

    -

    Changes for version 3.1.4

    +

    Changes for version 3.0.4

      -
    1. Bugfix in package critcl::class. Generate a dummy - field in the class structure if the class has no class - variables. Without this change the structure would be empty, - and a number of compilers are not able to handle such a type.

    2. -
    3. Fixed a typo which broke the win64 configuration.

    4. -
    5. Fixed issue #16, a typo in the documentation of command - critcl::class.

    6. +
    7. Fixed generation of the package's initname when the incoming + code is read from stdin and has no proper path.

    8. +
    9. Fixed github issue 11. Now using /LIBPATH instead of -L + on Windows (libinclude configuration setting).

    10. +
    11. Extended critcl to handle -l:path format of -l options. + GNU ld 2.22+ handles this by searching for the path as + is. Good when specifying static libraries, as plain -l looks + for shared libraries in preference over static. critcl handles + it now, as older GNU ld's do not understand it, nor the + various vendor-specific linkers.

    12. +
    13. Fixed github issue #12. Critcl now determines the version of + MSVC in use and uses it to switch between various link debug + options. Simplified the handling of bufferoverflowU.lib also, + making use of the same mechanism and collapsing the two + configurations sections we had back into one.

    14. +
    15. Reworked the insertion of #line pragmas into the generated C + code to avoid limitations on the line number argument imposed + by various compilers, and be more accurate.

    16. +
    17. Modified argument processing. Option -libdir now also + implies -L for its argument.

    18. +
    19. Extended handling of option -show (critcl::showconfig) + to list the path of the configuration file the data is coming + from. Good for debugging configuration processing.

    20. +
    21. Extended the build script with targets to regenerate the + embedded documentation, and diagrams, and to generate a + release.

    -

    Changes for version 3.1.5

    +

    Changes for version 3.0.3

      -
    1. Fixed issue #19. Made the regular expression extracting the - MSVC version number more general to make it work on german - language systems. This may have to be revisited in the future, - for other Windows locales.

    2. -
    3. Fixed issue #20. Made option -tea work on windows, at least in - a unix emulation environment like msys/mingw.

    4. +
    5. Fixed github issues 5 and 8, for the example build.tcl +scripts. Working around a missing variable ::errorInfo. It should +always be present, however there seem to be revisions of Tcl around +which violate this assumption.

    -

    Changes for version 3.1.6

    +

    Changes for version 3.0.2

      -
    1. Fixed issue #21. While the multi-definition of the stub-table - pointer variables was ok with for all the C linkers seen so far - C++ linkers did not like this at all. Reworked the code to - ensure that this set of variables is generated only once, in - the wrapper around all the pieces to assemble.

    2. -
    3. Fixed issue #22, the handling of the command identifier - arguments of critcl::ccommand, critcl::cproc, and - critcl::cdata. We now properly allow any Tcl identifier - and generate proper internal C identifiers from them.

      -

      As part of this the signature of command critcl::name2c - changed. The command now delivers a list of four values instead - of three. The new value was added at the end.

      -

      Further adapted the implementation of package - critcl::class, a user of critcl::name2c. - This package is now at version 1.0.6 and requires critcl 3.1.6

      -

      Lastly fixed the mis-handling of option -cname in - critcl::ccommand, and critcl::cproc.

    4. -
    5. Fixed issue #23.

    6. +
    7. Fixed issue in compile-and-run mode where commands put into the +auto_index are not found by Tcl's [unknown] command.

    8. +
    9. Fixed an array key mismatch breaking usage of client data and +delete function for procedure. Reported by Jos DeCoster, with patch.

    10. +
    11. Implemented a command line option -L, an equivalent of +option -I, just for library search paths.

    12. +
    13. Fixed github issues 5 and 8. Working around a missing variable +::errorInfo. It should always be present, however there seem to be +revisions of Tcl around which violate this assumption.

    -

    Changes for version 3.1.7

    +

    Changes for version 3.0.1

      -
    1. Fixed issue #24. Extract and unconditionally display compiler - warnings found in the build log. Prevents users from missing - warnings which, while not causing the build to fail, may - still indicate problems.

    2. -
    3. New feature. Output hook. All non-messaging user output is now - routed through the command critcl::print, and users are - allowed to override it when using the critcl application-as-package.

    4. -
    5. New feature, by Ashok P. Nadkarni. Platform configurations can - inherit values from configurations defined before them.

    6. +
    7. Bugfixes all around. In detail:

    8. +
    9. Fixed recording of Tcl version requirements. Keep package name +and version together, unbreaking generated meta data and generated +package load command.

    10. +
    11. Fixed the build scripts: When installing, or wrapping for TEA, +generate any missing directories

    12. +
    13. Modified the build scripts to properly exit the application +when the window of their GUI is closed through the (X) button.

    14. +
    15. Removed an 8.5-ism (open wb) which had slipped into the main +build script.

    16. +
    17. Modified the example build scripts to separate the output for +the different examples (and packages) by adding empty lines.

    18. +
    19. stack::c example bugfix: Include API declarations for use in +the companion files.

    20. +
    21. Extended the documentation: Noted the need for a working +installation of a C compiler.

    22. +
    23. Extended the Windows target definitions and code to handle the +manifest files used by modern MS development environments. Note that +this code handles both possibilities, environment using manifests, and +(old(er)) environments without.

    24. +
    25. Extended the Windows 64bit target definitions and code to +auto-detect the need for the helper library "bufferoverflowU.lib" and +reconfigure the compile and link commands appropriately. We assume +that the library must be linked when present. This should be no harm +if the library is present, yet not needed. Just superfluous. We search +for the library in the paths specified by the environment variable +LIB.

    -

    Changes for version 3.1.8

    +

    Changes for version 3

      -
    1. Fixed issue with package indices generated for Tcl 8.4. - Join the list of commands with semi-colon, not newline.

    2. -
    3. Fixed issue #26 which brought up use-cases I had forgotten to - consider while fixing bug #21 (see critcl 3.1.6).

    4. +
    5. The command critcl::platform was deprecated in version +2.1, superceded by critcl::targetplatform, yet kept for +compatibility. Now it has been removed.

    6. +
    7. The command critcl::compiled was kept with in version 2.1 +with semantics in contradiction to its, for compatibility. This +contradiction has been removed, changing the visible semantics of the +command to be in line with its name.

    8. +
    9. The change to version 3 became necessary because of the two +incompatible visible changes above.

    10. +
    11. Extended the application package with code handling a new +option -tea. Specifying this option invokes a special mode +where critcl generates a TEA package, i.e. wraps the input into a +directory hierarchy and support files which provide it TEA-lookalike +buildsystem.

      +

      This new option, and -pkg, exclude each other. If +both are specified the last used option takes precedence.

      +

      The generated package directory hierarchy is mostly +self-contained, but not fully. It requires not only a working +installation of Tcl, but also working installations of the packages +md5 and cmdline. Both of these are provided by the +Tcllib bundle. Not required, but recommended to have +installed are any of the packages which can accelerate md5's +operation, i.e. cryptkit, tcllibc, or +Trf.

    12. +
    13. Extended the critcl package with a new command +critcl::scan taking the path to a ".critcl" file, +statically scanning it, and returning license, version, a list of its +companion files, list of imported APIs, and list of +developer-specified custom configuration options. This data is the +foundation for the TEA wrapping described above.

      +

      Note that this is a static scan. While the other build +modes can (must) execute the ".critcl" file and make +platform-specific decisions regarding the assembled C code, companion +files, etc. the TEA wrap mode is not in a position to make +platform-specific decisions. It has to wrap everything which might +conceivably be needed when actually building. Hence the static scan. +This has however its own set of problems, namely the inability to +figure out any dynamic construction of companion file paths, at least +on its own. Thus:

    14. +
    15. Extended the API used by critcl-based packages with the command +critcl::owns. While this command is ignored by the regular build +modes the static scanner described above takes its arguments as the +names of companion files which have to be wrapped into the TEA package +and could not be figured by the scanner otherwise, like because of +dynamic paths to critcl::tsources, critcl::csources, +getting sourced directly, or simply being adjunct datafiles.

    16. +
    17. Extended the API used by critcl-based packages with the command +critcl::api for the management of stubs tables, be it their use, +and/or declaration and export.

      +

      Please see section Stubs Table Management of the +critcl package documentation for details.

    18. +
    19. Extended the API used by critcl-based packages with the command +critcl::userconfig for the management of developer-specified +custom configuration options, be it their use and/or declaration.

      +

      Please see section Custom Build Configuration of the +critcl package documentation for details.

    20. +
    21. Extended the API used by critcl-based packages with the +commands critcl::description, critcl::summary, +critcl::subject, critcl::meta, and +critcl::buildrequirement for the declaration of TEApot meta data +for/about the package.

      +

      Please see section Package Meta Data of the +critcl package documentation for details.

    -

    Changes for version 3.1.9

    +

    Changes for version 2.1

      -
    1. Fixed issue #27. Added missing platform definitions for - various alternate linux and OS X targets.

    2. -
    3. Fixed issue #28. Added missing -mXX flags for linking at the - linux-{32,64}-* targets.

    4. -
    5. Fixed issue #29. Replaced the use of raw "cheaders" - information in the processing of "cdefines" with the proper - include directives derived from it.

    6. -
    7. Fixed the issue behind rejected pull request #30 by Andrew - Shadura. Dynamically extract the stubs variable declarations - from the Tcl header files and generate matching variable - definitions for use in the package code. The generated code - will now be always consistent with the headers, even when - critcl's own copy of them is replaced by system headers.

    8. -
    9. Fixed issue #31. Accepted patch by Andrew Shadura, with - changes (comments), for easier integration of critcl with - OS package systems, replacing critcl's copies of Tcl headers - with their own.

    10. -
    11. Fixed issue #32. Merged pull request by Andrew Shadura. - Various typos in documentation and comments.

    12. -
    13. Fixed issue #33. Handle files starting with a dot better.

    14. +
    15. Fixed bug where critcl::tsources interpreted relative +paths as relative to the current working directory instead of +relative to the ".critcl" file using the command, as all other +commands of this type do.

    16. +
    17. Fixed internals, preventing information collected for multiple +".critcl" files to leak between them. Notably, critcl::tk +is not a global configuration option anymore.

    18. +
    19. Fixed the command critcl::license to be a null-operation +in mode "compile & run", instead of throwing an error.

    20. +
    21. Fixed the critcl application's interference with the "compile & +run" result cache in -pkg mode by having it use a wholly +separate (and by default transient) directory for that mode.

    22. +
    23. Fixed bug where changes to a ".critcl" file did not result +in a rebuild for mode "compile & run". All relevant API commands now +ensure UUID changes.

    24. +
    25. Fixed bug in the backend handling of critcl::debug where +the companion c-sources of a ".critcl" file were not compiled +with debug options, although the ".critcl" file was.

    26. +
    27. Fixed bug in critcl::debug which prevented recognition of +mode "all" when it was not the first argument to the command.

    28. +
    29. Fixed bug in "preload.c" preventing its compilation on +non-windows platforms.

    30. +
    31. Fixed long-standing bug in the handling of namespace qualifiers +in the command name argument of critcl::cproc and +critcl::ccommand. It is now possible to specify a fully +qualified command name without issues.

    32. +
    33. Extended/reworked critcl::tsources to be the canonical +way of declaring ".tcl" companion files even for mode "compile & +run".

    34. +
    35. Extended/reworked critcl::tsources to allow the use of a +".critcl" file as its own Tcl companion file.

    36. +
    37. Extended critcl::framework to internally check for OS X +build target, and to ignore the declaration if its not.

    38. +
    39. Extended critcl::failed to be callable more than once in +a ".critcl" file. The first call forces the build, if it was not +done already, to get the result. Further calls return the cached +result of the first call.

    40. +
    41. Extended the handling of environment variable CC in the code +determining the compiler to use to deal with (i.e. remove) paths to +the compiler, compiler file extensions, and compiler options specified +after the compiler itself, leaving only the bare name of the compiler.

    42. +
    43. Extended the code handling the search for preloaded libraries +to print the paths it searched, making debugging of a search failure +easier.

    44. +
    45. A new command critcl::tcl can be used to declare the +version of Tcl minimally needed to build and run the ".critcl" +file and package. Defaults to 8.4 if not declared. Extended critcl to +have the stubs and headers for all of Tcl 8.4, 8.5, and 8.6.

    46. +
    47. A new command critcl::load forces the build and load of a +".critcl" file. This is the official way for overriding critcl's +default lazy-build-&-load-on-demand scheme for mode "compile & run".

      +

      Note that after using critcl::load / +critcl::failed in a ".critcl" file it is not possible to +use critcl commands in that file anymore. Doing so will throw an +error.

    48. +
    49. Extended the generation of '#line' pragmas to use +info frame (if available) to provide the C compiler with exact +line numbers into the ".critcl" file for the reporting of +warnings and errors.

    50. +
    51. Extended critcl::check with logging to help with +debugging build-time checks of the environment, plus an additional +optional argument to provide labeling.

    52. +
    53. Added a new command critcl::checklink which not only +tries to check the environment via compiling the code, but also +its linkability.

    54. +
    55. Added a new command critcl::msg for messaging, like +command critcl::error is for error reporting. Likewise this is a +hook a user of the package is allowed to override. The default +implementation, used by mode compile & run does nothing. The +implementation for mode generate package prints the message +to stdout.

      +

      Envisioned use is for the reporting of results determined by +critcl::check and critcl::checklink during building, to +help with debugging when something goes wrong with a check.

    56. +
    57. Exposed the argument processing internals of critcl::proc +for use by advanced users. The new commands are

      +
        +
      1. critcl::argnames

      2. +
      3. critcl::argcnames

      4. +
      5. critcl::argcsignature

      6. +
      7. critcl::argvardecls

      8. +
      9. critcl::argconversion

      10. +
      +

      Please see section Advanced Embedded C Code of the +critcl package documentation for details.

    58. +
    59. Extended the critcl package to intercept package +provide and record the file -> package name mapping. Plus other +internal changes now allow the use of namespaced package names while +still using proper path names and init function.

    60. +
    61. Dropped the unused commands critcl::optimize and +critcl::include.

    62. +
    63. Dropped -lib mode from the critcl application.

    64. +
    65. Dropped remnants of support for Tcl 8.3 and before.

    -

    Authors

    +

    Authors

    Jean Claude Wippler, Steve Landers, Andreas Kupries

    -

    Bugs, Ideas, Feedback

    +

    Bugs, Ideas, Feedback

    This document, and the package it describes, will undoubtedly contain bugs and other problems. Please report them at https://github.com/andreas-kupries/critcl/issues. @@ -2724,6 +3148,6 @@

    diff -Nru critcl-3.1.9/embedded/www/files/critcl_sources.html critcl-3.1.17+dfsg/embedded/www/files/critcl_sources.html --- critcl-3.1.9/embedded/www/files/critcl_sources.html 2013-05-10 05:57:04.000000000 +0000 +++ critcl-3.1.17+dfsg/embedded/www/files/critcl_sources.html 2017-10-14 02:48:11.000000000 +0000 @@ -92,18 +92,18 @@ } --> - -

    [ - Table Of Contents + Table Of Contents | Keyword Index -]
    -

    critcl_sources(n) 3.1.8 doc "C Runtime In Tcl (CriTcl)"

    + ]
    +

    critcl_sources(n) 3.1.17 doc "C Runtime In Tcl (CriTcl)"

    Name

    critcl_sources - Critcl - How To Get The Sources

    @@ -184,6 +184,6 @@
    diff -Nru critcl-3.1.9/embedded/www/files/critcl_usingit.html critcl-3.1.17+dfsg/embedded/www/files/critcl_usingit.html --- critcl-3.1.9/embedded/www/files/critcl_usingit.html 2013-05-10 05:57:04.000000000 +0000 +++ critcl-3.1.17+dfsg/embedded/www/files/critcl_usingit.html 2017-10-14 02:48:11.000000000 +0000 @@ -92,18 +92,18 @@ } --> - -

    [ - Table Of Contents + Table Of Contents | Keyword Index -]
    -

    critcl_use(n) 3.1.8 doc "C Runtime In Tcl (CriTcl)"

    + ]
    +

    critcl_use(n) 3.1.17 doc "C Runtime In Tcl (CriTcl)"

    Name

    critcl_use - Using Critcl

    @@ -114,38 +114,43 @@
  • Embedding C
  • Checking your C
  • Building Critcl Packages
  • Authors
  • @@ -205,10 +210,9 @@

    with the expression pretending to be something very complex and slow. Converting this to C we get:

    -    package require critcl
         critcl::cproc math {double x double y double z} double {
             double up   = rand () * sin (x);
    -	double down = pow(y, log (z);
    +        double down = pow(y, log (z));
             return up/down;
         }
     
    @@ -224,45 +228,284 @@ arguments and results.

    -

    Handling A Variable Number Of Arguments

    +

    Custom Types, Introduction

    +

    When writing bindings to external libraries critcl::cproc is +usually the most convenient way of writing the lower layers. This is +however hampered by the fact that critcl on its own only supports a +few standard (arguably the most import) standard types, whereas the +functions we wish to bind most certainly will use much more, specific +to the library's function.

    +

    The critcl commands argtype, resulttype and their +adjuncts are provided to help here, by allowing a developer to extend +critcl's type system with custom conversions.

    +

    This and the three following sections will demonstrate this, +from trivial to complex.

    +

    The most trivial use is to create types which are aliases of +existing types, standard or other. As an alias it simply copies and +uses the conversion code from the referenced types.

    +

    Our example is pulled from an incomplete project of mine, a +binding to Jeffrey Kegler's libmarpa library managing +Earley parsers. Several custom types simply reflect the typedef's done +by the library, to make the critcl::cprocs as self-documenting +as the underlying library functions themselves.

    +
    +    critcl::argtype Marpa_Symbol_ID     = int
    +    critcl::argtype Marpa_Rule_ID       = int
    +    critcl::argtype Marpa_Rule_Int      = int
    +    critcl::argtype Marpa_Rank          = int
    +    critcl::argtype Marpa_Earleme       = int
    +    critcl::argtype Marpa_Earley_Set_ID = int
    +    ...
    +    method sym-rank: proc {
    +        Marpa_Symbol_ID sym
    +        Marpa_Rank      rank
    +    } Marpa_Rank {
    +        return marpa_g_symbol_rank_set (instance->grammar, sym, rank);
    +    }
    +    ...
    +
    +
    +

    Custom Types, Semi-trivial

    +

    A more involved custom argument type would be to map from Tcl strings +to some internal representation, like an integer code.

    +

    The first example is taken from the tclyaml package, +a binding to the libyaml library. In a few places we have to +map readable names for block styles, scalar styles, etc. to the +internal enumeration.

    +
    +    critcl::argtype yaml_sequence_style_t {
    +        if (!encode_sequence_style (interp, @@, &@A)) return TCL_ERROR;
    +    }
    +    ...
    +    critcl::ccode {
    +        static const char* ty_block_style_names [] = {
    +            "any", "block", "flow", NULL
    +        };
    +        static int
    +        encode_sequence_style (Tcl_Interp* interp, Tcl_Obj* style,
    +                               yaml_sequence_style_t* estyle)
    +        {
    +            int value;
    +            if (Tcl_GetIndexFromObj (interp, style, ty_block_style_names,
    +                                     "sequence style", 0, &value) != TCL_OK) {
    +                return 0;
    +            }
    +            *estyle = value;
    +            return 1;
    +        }
    +    }
    +    ...
    +    method sequence_start proc {
    +        pstring anchor
    +        pstring tag
    +        int implicit
    +        yaml_sequence_style_t style
    +    } ok {
    +        /* Syntax: <instance> seq_start <anchor> <tag> <implicit> <style> */
    +        ...
    +    }
    +    ...
    +
    +

    It should be noted that this code precedes the advent of the +supporting generator package critcl::emap. using the +generator the definition of the mapping becomes much simpler:

    +
    +    critcl::emap::def yaml_sequence_style_t {
    +        any   0
    +        block 1
    +        flow  2
    +    }
    +
    +

    Note that the generator will not only provide the conversions, but +also define the argument and result types needed for their use by +critcl::cproc. +Another example of such a semi-trivial argument type can be found in +the CRIMP package, which defines a Tcl_ObjType for +image values. This not only provides a basic argument type for +any image, but also derived types which check that the image has a +specific format. Here we see for the first time non-integer arguments, +and the need to define the C types used for variables holding the C +level value, and the type of function parameters (Due to C promotion +rules we may need different types).

    +
    +    critcl::argtype image {
    +        if (crimp_get_image_from_obj (interp, @@, &@A) != TCL_OK) {
    +            return TCL_ERROR;
    +        }
    +    } crimp_image* crimp_image*
    +    ...
    +        set map [list <<type>> $type]
    +        critcl::argtype image_$type [string map $map {
    +            if (crimp_get_image_from_obj (interp, @@, &@A) != TCL_OK) {
    +                return TCL_ERROR;
    +            }
    +            if (@A->itype != crimp_imagetype_find ("crimp::image::<<type>>")) {
    +                Tcl_SetObjResult (interp,
    +                                  Tcl_NewStringObj ("expected image type <<type>>",
    +                                                    -1));
    +                return TCL_ERROR;
    +            }
    +        }] crimp_image* crimp_image*
    +    ...
    +
    +
    +

    Custom Types, Support structures

    +

    The adjunct command critcl::argtypesupport is for when the +conversion needs additional definitions, for example a helper +structure.

    +

    An example of this can be found among the standard types of +critcl itself, the pstring type. This type provides the C +function with not only the string pointer, but also the string length, +and the Tcl_Obj* this data came from. As critcl::cproc's +calling conventions allow us only one argument for the data of the +parameter a structure is needed to convey these three pieces of +information.

    +

    Thus the argument type is defined as

    +
    +    critcl::argtype pstring {
    +        @A.s = Tcl_GetStringFromObj(@@, &(@A.len));
    +        @A.o = @@;
    +    } critcl_pstring critcl_pstring
    +    critcl::argtypesupport pstring {
    +        typedef struct critcl_pstring {
    +            Tcl_Obj* o;
    +            char*    s;
    +            int      len;
    +        } critcl_pstring;
    +    }
    +
    +

    In the case of such a structure being large we may wish to +allocate it on the heap instead of having it taking space on the +stack. If we do that we need another adjunct command, +critcl::argtyperelease. This command specifies the code required +to release dynamically allocated resources when the worker function +returns, before the shim returns to the caller in Tcl. +To keep things simple our example is synthetic, a modification of +pstring above, to demonstrate the technique. An actual, but +more complex example is the code to support the variadic args +argument of critcl::cproc.

    +
    +    critcl::argtype pstring {
    +        @A = (critcl_pstring*) ckalloc(sizeof(critcl_pstring));
    +        @A->s = Tcl_GetStringFromObj(@@, &(@A->len));
    +        @A->o = @@;
    +    } critcl_pstring* critcl_pstring*
    +    critcl::argtypesupport pstring {
    +        typedef struct critcl_pstring {
    +            Tcl_Obj* o;
    +            char*    s;
    +            int      len;
    +        } critcl_pstring;
    +    }
    +    critcl::argtyperelease pstring {
    +        ckfree ((char*)) @A);
    +    }
    +
    +

    Note, the above example shows only the most simple case of an +allocated argument, with a conversion that cannot fail (namely, string +retrieval). If the conversion can fail then either allocation has to +be defered to happen only on successful conversion, or the conversion +code has to release the allocated memory itself in the failure path, +because it will never reach the code defined via +critcl::argtyperelease in that case.

    +
    +

    Custom Types, Results

    +

    All of the previous sections dealt with argument conversions, +i.e. going from Tcl into C. +Custom result types are for the reverse direction, from C to Tcl. +This is usually easier, as most of the time errors should not be +possible. Supporting structures, or allocating them on the heap are +not really required and therefore not supported.

    +

    The example of a result type shown below was pulled from +KineTcl. It is a variant of the builtin result type +Tcl_Obj*, aka object. The builtin conversion assumes +that the object returned by the function has a refcount of 1 (or +higher), with the function having held the reference, and releases +that reference after placing the value into the interp result. The +conversion below on the other hand assumes that the value has a +refcount of 0 and thus that decrementing it is forbidden, lest it be +released much to early, and crashing the system.

    +
    +    critcl::resulttype KTcl_Obj* {
    +        if (rv == NULL) { return TCL_ERROR; }
    +        Tcl_SetObjResult(interp, rv);
    +        /* No refcount adjustment */
    +        return TCL_OK;
    +    } Tcl_Obj*
    +
    +

    This type of definition is also found in Marpa and recent +hacking hacking on CRIMP introduced it there as well. Which +is why this definition became a builtin type starting with version +3.1.16, under the names Tcl_Obj*0 and object0.

    +

    Going back to errors and their handling, of course, if a +function we are wrapping signals them in-band, then the conversion of +such results has to deal with that. This happens for example in +KineTcl, where we find

    +
    +    critcl::resulttype XnStatus {
    +        if (rv != XN_STATUS_OK) {
    +            Tcl_AppendResult (interp, xnGetStatusString (rv), NULL);
    +            return TCL_ERROR;
    +        }
    +        return TCL_OK;
    +    }
    +    critcl::resulttype XnDepthPixel {
    +        if (rv == ((XnDepthPixel) -1)) {
    +            Tcl_AppendResult (interp,
    +                              "Inheritance error: Not a depth generator",
    +                              NULL);
    +            return TCL_ERROR;
    +        }
    +        Tcl_SetObjResult (interp, Tcl_NewIntObj (rv));
    +        return TCL_OK;
    +    }
    +
    +
    +

    Handling A Variable Number Of Arguments

    In A Simple Procedure we demonstrated how easy a translation to C can be. Is it still as easy when we introduce something moderately complex like handling a variable number of arguments ? A feature which is needed to handle commands with options -and optional arguments ? Unfortunately not. -We can use critcl::cproc only if the number of arguments is -known beforehand, i.e. at the time of declaration. This of course also -means that they do not support default arguments either.

    -

    Thus, to handle something like the example below

    +and optional arguments ?

    +

    Well, starting with version 3.1.16 critcl::cproc does +have full support for optional arguments, args-style variadics, +and default values, extending its range to everything covered by the +builtin proc. The only thing not truly supported are options +(i.e. flag arguments) of any kind.

    +

    For the moment, and the example, let us pretend that we can use +critcl::cproc only if the number of arguments is fully known +beforehand, i.e. at the time of declaration. +Then we have to use critcl::ccommand to handle the translation +of the procedure shown below:

         proc math {args} {
             set sum 0
    -        foreach y { set sum [expr {$sum + $y}] }
    -	return $sum
    +        foreach y $args { set sum [expr {$sum + $y}] }
    +        return $sum
         }
     
    -

    we have to use critcl::ccommand instead.

    Its advantage: Access to the low-level C arguments representing -the Tcl arguments of the command. -That allows things like variable number of arguments, optional -arguments, options, etc.

    +the Tcl arguments of the command. Full control over argument +conversion, argument validation, etc.

    Its disadvantage: Access to the low-level C arguments -representing the Tcl arguments of the command. -Where critcl::cproc handles the task of converting from Tcl to C +representing the Tcl arguments of the command. Assuming the burden of +having to write argument conversion, argument validation, etc. Where +critcl::cproc handles the task of converting from Tcl to C values (for arguments) and back (for the result), with -critcl::commands we have to do this on our own.

    -

    Here is the translation of the example:

    +critcl::command it is the developer who has to write all this +code.

    +

    Under our restriction the translation of the example is:

    -    package require critcl
         critcl::ccommand math {cd ip oc ov} {
             double sum = 0;
             double y;
    +        oc --;
             while (oc) {
                 if (Tcl_GetDoubleFromObj (ip, ov[oc], &y) != TCL_OK) {
    -	        return TCL_ERROR;
    +                return TCL_ERROR;
                 }
                 sum += y;
    -	    oc --;
    +            oc --;
             }
             Tcl_SetObjResult (ip, Tcl_NewDoubleObj (sum));
             return TCL_OK:
    @@ -292,8 +535,23 @@
     
     
     
    +

    Now, letting go of our pretenses regarding the limitations of +critcl::cproc, due to the support it does have for +args-style variadics (since version 3.1.16) we can write a much +simpler translation:

    +
    +    critcl::cproc math {double args} double {
    +        double sum = 0;
    +        args.c --;
    +        while (args.c) {
    +            sum += args.v[args.c];
    +            args.c --;
    +        }
    +        return sum;
    +    }
    +
    -

    Data As A Tcl Command

    +

    Data As A Tcl Command

    Here we assume that we have a Tcl procedure which returns a fixed string. In the final product we are going to C to hide this string from the casual user.

    @@ -309,11 +567,11 @@

    There is nothing really notable here.

    -

    Blocks of arbitrary C

    +

    Blocks of arbitrary C

    Often just defining Tcl commands in C, as demonstrated in the sections A Simple Procedure, -Handling A Variable Number Of Arguments, and -Data As A Tcl Command +Handling A Variable Number Of Arguments, and +Data As A Tcl Command is not really enough. For example we may have several of our new C commands using the same code over and over, and we wish avoid this duplication. Or we wish to @@ -347,7 +605,30 @@ Tcl_ObjType holding the data of a SHA1 context used during the incremental calculation of sha1 hashes.

    -

    Lifting constants

    +

    Constant values

    +

    While one might believe that there is no need for commands which +returns constant values that is not true. Commands reporting on +compile-time configuration, like version numbers, available features, +etc. are at least one use case for such commands.

    +

    The reason for creating critcl commands to support them ? +Convenience to the user, yes, but further than that, the ability to +optimize the internals, i.e. the generated code.

    +

    A cproc would be easy to write, but incurs overhead due +to a superfluous work function. A ccommand has no overhead, +except that of the user having to write the argument checking and +result conversion.

    +

    Using critcl::cconst is both convenient and without code +overhead. +Our example is a function found in package tcl-linenoise, +that is, if cconst had existed at the time of writing. It +returns a configuration value reporting to the policy layer if an +extended mode for hidden input is available from the bound +linenoise, or not.

    +
    +    critcl::cconst linenoise::hidden_extended boolean 1
    +
    +
    +

    Lifting constants

    When writing a critcl-based package to make a third-party library available to scripts we do not only have to make the relevant functions available as commands, often we also have to know all @@ -386,14 +667,14 @@ These commands do not create the defines in the C level. They only lift pre-existing material. Which can come from the headers of the third-party library, the usual -case, but also from Blocks of arbitrary C.

    +case, but also from Blocks of arbitrary C.

    A corrollary to the above: What is not where, cannot be lifted. All listed names and patterns which have no actual C code declaring them are ignored, i.e. not mapped.

    -

    Finding header files

    +

    Finding header files

    A notable thing in the example shown in the section about -Blocks of arbitrary C is the

    +Blocks of arbitrary C is the

         #include "sha1.h"
     
    @@ -428,7 +709,7 @@ In other words, the second form of invoking critcl::cheaders is pretty much only for headers which accompany the ".critcl" file.

    -

    Separate C sources

    +

    Separate C sources

    In all of the examples shown so far the C code was fully embedded in a ".critcl" file. However, if the C part is large it can make sense to break it out of the ".critcl" file into one or more separate @@ -454,14 +735,14 @@ the relevant ".critcl" file.

    This example also demonstrates again the use of critcl::cheaders, which we also saw in section -Finding header files.

    +Finding header files.

    -

    Finding external libraries

    +

    Finding external libraries

    When creating a package exposing some third-party library to Tcl -Finding header files is only the first part, to enable +Finding header files is only the first part, to enable failure-free compilation. We also have to find the library/ies themselves so that they can be linked to our package. This is -described here. The last issue, Lifting constants from C +described here. The last issue, Lifting constants from C to Tcl for the use by scripts is handled in a separate section and example.

    The relevant command is critcl::clibraries. Its basic @@ -486,7 +767,7 @@ Note that this command can be used unconditionally. If the build target is not OS X it is ignored.

    -

    Customizing the compile and link steps

    +

    Customizing the compile and link steps

    The commands critcl::cflags and critcl::ldflags enable you to provide custom options to the compile and link phases for a ".critcl" file.

    @@ -497,11 +778,11 @@ Among the latter, especially platform-specific settings, for example byteorder.

    This makes critcl::check an important adjunct command, as -this is the API for Checking The Environment, and then +this is the API for Checking The Environment, and then selecting the compile & link flags to use.

    I currently have no specific example to demonstrate these commands.

    -

    Having both C and Tcl functionality

    +

    Having both C and Tcl functionality

    Often enough only pieces of a package require recoding in C to boost the whole system. Or, alternatively, the package in question consists of a low-level layer C with a Tcl layer above encoding policies and @@ -526,9 +807,9 @@ automatically sourced when the C parts are made available, thus making the Tcl parts available as well.

    -

    Using C with Tcl functionality as fallback

    +

    Using C with Tcl functionality as fallback

    There is one special case of -Having both C and Tcl functionality +Having both C and Tcl functionality which deserves its own section.

    The possibility of not having the fast C code on some platform, and using a slower Tcl implementation of the functionality. In other @@ -750,7 +1031,7 @@ ... platform-specific C/Tcl -- uuid.

    -

    Unlazy Packages

    +

    Unlazy Packages

    By default critcl is a bit inconsistent between modes "compile & run" and "generate package". The result of the latter is a standard Tcl package which loads and sources all of its files immediately when it @@ -816,7 +1097,7 @@

    It is related and similar to critcl::load, the command to overcome the lazy loading, as shown in section -Unlazy Packages.

    +Unlazy Packages.

    Like it is not allowed, nor possible to use critcl commands declaring anything after critcl::failed has been called, making it pretty much the last critcl command in a ".critcl" file. @@ -837,7 +1118,7 @@

    as these only query information, namely the build status, and are protected against multiple calls.

    -

    Which Tcl ?

    +

    Which Tcl ?

    When building the shared library from the embedded C sources one of the things critcl does for us is to provide the Tcl headers, especially the stubs declarations.

    @@ -855,7 +1136,7 @@ ... Declare your code ...
    -

    Making A Widget

    +

    Making A Widget

    ... requires compiling against the Tk headers, and linking with Tk's stubs. For our convenience we have a simple, single command to activate all the necessary machinery, with critcl supplying the header @@ -871,7 +1152,7 @@

    Please note that this doesn't release you from the necessity of learning Tk's C API and how to use it to make a widget work. Sorry.

    -

    Checking The Environment

    +

    Checking The Environment

    ... may be necessary when creating a binding to some third-party library. The headers for this library may be found in non-standard locations, ditto for the library/ies itself. We may not have the @@ -903,7 +1184,7 @@ in non-standard locations we have the full power of Tcl available, i.e. loops, the file and glob commands, etc., which can then be followed by a critcl::cheader command to declare the -location we found (See also Finding header files).

    +location we found (See also Finding header files).

    A nice extension to critcl would be a package collecting pocedures for common tasks like that, sort of like an autoconf for Tcl. critcl::config seems to be nice @@ -939,7 +1220,7 @@

    and pretty much everything else you can imagine.

    -

    License Invoked

    +

    License Invoked

    When writing packages it is always good manners to provide prospective users with the license the package is under, so that they can decide whether they truly want to use the package, or not.

    @@ -955,14 +1236,14 @@

    Building Critcl Packages

    This is the section for developers having to generate packages from ".critcl" files, i.e binaries for deployment,

    -

    Getting Help ...

    +

    Getting Help ...

    ... Is easy. Running

         critcl -help
     

    prints the basics of using the application to stdout.

    -

    Pre-Filling The Result Cache

    +

    Pre-Filling The Result Cache

    The default mode of the critcl application is to take a series of ".critcl" files, build their binaries, and leave them behind in the result cache. When the files are later actually used the @@ -990,9 +1271,9 @@

    These can be combined, of course.

    -

    Building A Package

    +

    Building A Package

    To build the binary package for a ".critcl" file, instead of -Pre-Filling The Result Cache, simply specify the option +Pre-Filling The Result Cache, simply specify the option -pkg.

         critcl -pkg foo.tcl
    @@ -1018,9 +1299,9 @@
     

    The package name derived from that is still foo.

    -

    Building And Installing A Package

    +

    Building And Installing A Package

    Here we assume that you know the basics of how to build a package. -If not, please read section Building A Package first.

    +If not, please read section Building A Package first.

    By default critcl will place all newly-made packages in the subdirectory "lib" of the current working directory. I.e. running

    @@ -1046,9 +1327,9 @@

    will build the package and place it in the directory "/path/to/lib/foo".

    -

    Building For Debugging

    +

    Building For Debugging

    Here we assume that you know the basics of how to build a package. -If not, please read section Building A Package first.

    +If not, please read section Building A Package first.

    An important issue, when there is trouble with the package, debugging becomes necessary a evil. Critcl supports this through the -debug option. @@ -1078,7 +1359,7 @@ critcl -pkg -debug symbols -debug memory foo

    -

    Retargeting The Binaries

    +

    Retargeting The Binaries

    The configuration settings critcl uses to drive the compiler, linker, etc. are by default selected based on the platform it is run on, to generate binaries which properly work on this platform.

    @@ -1103,7 +1384,7 @@ compiler, linke, etc. are found first in the PATH.

    -

    Custom Configurations

    +

    Custom Configurations

    The compiler configurations coming with critcl currently cover all hosts having gcc installed (the foremost among these are Linux and OS X), plus the native compilers of the more @@ -1130,7 +1411,7 @@ This is an advanced topic pretty much out of scope for this tutorial beyond what was already said.

    -

    Custom Header Path

    +

    Custom Header Path

    Sometimes the use of critcl::headers might not be enough for a package to find its headers. Maybe they are outside of the paths checked by the setup code. @@ -1143,7 +1424,7 @@

    and the specified header will be handed to the package to be built.

    -

    Introspection of Targets And Configurations

    +

    Introspection of Targets And Configurations

    To see a list containing the names of all the available configurations, run

    @@ -1187,6 +1468,6 @@
     
     
    diff -Nru critcl-3.1.9/embedded/www/files/critcl_util.html critcl-3.1.17+dfsg/embedded/www/files/critcl_util.html --- critcl-3.1.9/embedded/www/files/critcl_util.html 2013-05-10 05:57:04.000000000 +0000 +++ critcl-3.1.17+dfsg/embedded/www/files/critcl_util.html 2017-10-14 02:48:11.000000000 +0000 @@ -92,17 +92,17 @@ } --> - - @@ -151,6 +154,34 @@

    This command checks the build-time environment for the existence of the C function name. It returns true on success, and false otherwise.

    +
    ::critcl::util::def path define ?value?
    +

    This command extends the specified configuration file path with a +#define directive for the named define. If the value +is not specified it will default to 1.

    +

    The result of the command is an empty string.

    +

    Note that the configuration file is maintained in the critcl::cache +directory.

    +
    ::critcl::util::undef path define
    +

    This command extends the specified configuration file path with an +#undef directive for the named define.

    +

    The result of the command is an empty string.

    +

    Note that the configuration file is maintained in the critcl::cache +directory.

    +
    ::critcl::util::locate label paths ?cmd?
    +

    This command checks the build-time environment for the existence of a file +in a set of possible paths.

    +

    If the option cmd prefix is specified it will be called with +the full path of a found file as its only argument to perform further checks. +A return value of false will reject the path and continue the search.

    +

    The return value of the command is the found path, as listed in +paths. As a side effect the command will also print the found path, +prefixed with the label, using critcl::msg.

    +

    Failure to find the path is reported via critcl::error, and a +possible empty string as the result, if critcl::error does not +terminate execution.

    +

    Relative paths are allowed as elements of paths, and are +normalized relative to the directory containing the currently handled +critcl file.

    Authors

    @@ -170,6 +201,6 @@

    Glueing/Embedded C code

    diff -Nru critcl-3.1.9/embedded/www/files/license.html critcl-3.1.17+dfsg/embedded/www/files/license.html --- critcl-3.1.9/embedded/www/files/license.html 2013-05-10 05:57:04.000000000 +0000 +++ critcl-3.1.17+dfsg/embedded/www/files/license.html 2017-10-14 02:48:11.000000000 +0000 @@ -92,17 +92,17 @@ } --> - -

    [ - Table Of Contents + Table Of Contents | Keyword Index -]
    + ]

    critcl_license(n) 1 doc "C Runtime In Tcl (CriTcl)"

    Name

    critcl_license - Critcl - License

    @@ -182,6 +182,6 @@
    diff -Nru critcl-3.1.9/embedded/www/index.html critcl-3.1.17+dfsg/embedded/www/index.html --- critcl-3.1.9/embedded/www/index.html 2013-05-10 05:57:04.000000000 +0000 +++ critcl-3.1.17+dfsg/embedded/www/index.html 2017-10-14 02:48:11.000000000 +0000 @@ -8,116 +8,165 @@
    [ - Table Of Contents -]
    + Table Of Contents + ]

    Keyword Index -- doc



    - + + + + + + + + - + - + + + + - + - + - + + + + + + + + + + + + - + + + + + + +
    -Keywords: C +Keywords: B
    C class bitmask + critcl::bitmap · critcl::emap +
    bitset + critcl::bitmap · critcl::emap +
    +Keywords: C +
    C class critcl::class
    C code - critcl · critcl::app · critcl::class · critcl::iassoc · critcl::util · critcl_app · critcl_changes · critcl_devguide · critcl_install_guide · critcl_introduction · critcl_license · critcl_sources · critcl_use + critcl · critcl-cproc-types · critcl::app · critcl::bitmap · critcl::class · critcl::cutil · critcl::emap · critcl::enum · critcl::iassoc · critcl::literals · critcl::util · critcl_app · critcl_changes · critcl_devguide · critcl_install_guide · critcl_introduction · critcl_license · critcl_sources · critcl_use
    C instance C instance critcl::class
    C object C object critcl::class
    code generator - critcl · critcl::app · critcl::class · critcl::iassoc · critcl::util · critcl_app · critcl_changes · critcl_devguide · critcl_install_guide · critcl_introduction · critcl_license · critcl_sources · critcl_use + critcl · critcl-cproc-types · critcl::app · critcl::bitmap · critcl::class · critcl::cutil · critcl::emap · critcl::enum · critcl::iassoc · critcl::literals · critcl::util · critcl_app · critcl_changes · critcl_devguide · critcl_install_guide · critcl_introduction · critcl_license · critcl_sources · critcl_use
    compile & run - critcl · critcl::app · critcl::class · critcl::iassoc · critcl::util · critcl_app · critcl_changes · critcl_devguide · critcl_install_guide · critcl_introduction · critcl_license · critcl_sources · critcl_use + critcl · critcl-cproc-types · critcl::app · critcl::bitmap · critcl::class · critcl::cutil · critcl::emap · critcl::enum · critcl::iassoc · critcl::literals · critcl::util · critcl_app · critcl_changes · critcl_devguide · critcl_install_guide · critcl_introduction · critcl_license · critcl_sources · critcl_use
    compiler - critcl · critcl::app · critcl::class · critcl::iassoc · critcl::util · critcl_app · critcl_changes · critcl_devguide · critcl_install_guide · critcl_introduction · critcl_license · critcl_sources · critcl_use + critcl · critcl-cproc-types · critcl::app · critcl::bitmap · critcl::class · critcl::cutil · critcl::emap · critcl::enum · critcl::iassoc · critcl::literals · critcl::util · critcl_app · critcl_changes · critcl_devguide · critcl_install_guide · critcl_introduction · critcl_license · critcl_sources · critcl_use +
    conversion + critcl::enum
    -Keywords: D +Keywords: D
    dynamic code generation - critcl · critcl::app · critcl::class · critcl::iassoc · critcl::util · critcl_app · critcl_changes · critcl_devguide · critcl_install_guide · critcl_introduction · critcl_license · critcl_sources · critcl_use + critcl · critcl-cproc-types · critcl::app · critcl::bitmap · critcl::class · critcl::cutil · critcl::emap · critcl::enum · critcl::iassoc · critcl::literals · critcl::util · critcl_app · critcl_changes · critcl_devguide · critcl_install_guide · critcl_introduction · critcl_license · critcl_sources · critcl_use
    dynamic compilation - critcl · critcl::app · critcl::class · critcl::iassoc · critcl::util · critcl_app · critcl_changes · critcl_devguide · critcl_install_guide · critcl_introduction · critcl_license · critcl_sources · critcl_use + critcl · critcl-cproc-types · critcl::app · critcl::bitmap · critcl::class · critcl::cutil · critcl::emap · critcl::enum · critcl::iassoc · critcl::literals · critcl::util · critcl_app · critcl_changes · critcl_devguide · critcl_install_guide · critcl_introduction · critcl_license · critcl_sources · critcl_use
    -Keywords: E +Keywords: E
    Embedded C Code - critcl · critcl::app · critcl::class · critcl::iassoc · critcl::util · critcl_app · critcl_changes · critcl_devguide · critcl_install_guide · critcl_introduction · critcl_license · critcl_sources · critcl_use + critcl · critcl-cproc-types · critcl::app · critcl::bitmap · critcl::class · critcl::cutil · critcl::emap · critcl::enum · critcl::iassoc · critcl::literals · critcl::util · critcl_app · critcl_changes · critcl_devguide · critcl_install_guide · critcl_introduction · critcl_license · critcl_sources · critcl_use +
    +Keywords: F +
    flags + critcl::bitmap · critcl::emap
    -Keywords: G +Keywords: G
    generate package - critcl · critcl::app · critcl::class · critcl::iassoc · critcl::util · critcl_app · critcl_changes · critcl_devguide · critcl_install_guide · critcl_introduction · critcl_license · critcl_sources · critcl_use + critcl · critcl-cproc-types · critcl::app · critcl::bitmap · critcl::class · critcl::cutil · critcl::emap · critcl::enum · critcl::iassoc · critcl::literals · critcl::util · critcl_app · critcl_changes · critcl_devguide · critcl_install_guide · critcl_introduction · critcl_license · critcl_sources · critcl_use
    -Keywords: L +Keywords: I
    int to string mapping + critcl::enum +
    +Keywords: L +
    linker - critcl · critcl::app · critcl::class · critcl::iassoc · critcl::util · critcl_app · critcl_changes · critcl_devguide · critcl_install_guide · critcl_introduction · critcl_license · critcl_sources · critcl_use + critcl · critcl-cproc-types · critcl::app · critcl::bitmap · critcl::class · critcl::cutil · critcl::emap · critcl::enum · critcl::iassoc · critcl::literals · critcl::util · critcl_app · critcl_changes · critcl_devguide · critcl_install_guide · critcl_introduction · critcl_license · critcl_sources · critcl_use +
    literal pool + critcl::enum · critcl::literals
    -Keywords: O +Keywords: O
    on demand compilation - critcl · critcl::app · critcl::class · critcl::iassoc · critcl::util · critcl_app · critcl_changes · critcl_devguide · critcl_install_guide · critcl_introduction · critcl_license · critcl_sources · critcl_use + critcl · critcl-cproc-types · critcl::app · critcl::bitmap · critcl::class · critcl::cutil · critcl::emap · critcl::enum · critcl::iassoc · critcl::literals · critcl::util · critcl_app · critcl_changes · critcl_devguide · critcl_install_guide · critcl_introduction · critcl_license · critcl_sources · critcl_use
    on-the-fly compilation - critcl · critcl::app · critcl::class · critcl::iassoc · critcl::util · critcl_app · critcl_changes · critcl_devguide · critcl_install_guide · critcl_introduction · critcl_license · critcl_sources · critcl_use + critcl · critcl-cproc-types · critcl::app · critcl::bitmap · critcl::class · critcl::cutil · critcl::emap · critcl::enum · critcl::iassoc · critcl::literals · critcl::util · critcl_app · critcl_changes · critcl_devguide · critcl_install_guide · critcl_introduction · critcl_license · critcl_sources · critcl_use
    -Keywords: S +Keywords: S
    singleton singleton + critcl::bitmap · critcl::emap · critcl::enum · critcl::iassoc · critcl::literals +
    string pool + critcl::enum · critcl::literals +
    string to int mapping - critcl::iassoc + critcl::enum
    -Keywords: T +Keywords: T
    Tcl Interp Association - critcl::iassoc + critcl::bitmap · critcl::emap · critcl::enum · critcl::iassoc · critcl::literals
    \ No newline at end of file diff -Nru critcl-3.1.9/embedded/www/toc.html critcl-3.1.17+dfsg/embedded/www/toc.html --- critcl-3.1.9/embedded/www/toc.html 2013-05-10 05:57:04.000000000 +0000 +++ critcl-3.1.17+dfsg/embedded/www/toc.html 2017-10-14 02:48:11.000000000 +0000 @@ -7,8 +7,8 @@ -->
    [ - Keyword Index -]
    + Keyword Index + ]

    Table Of Contents


    doc

    @@ -17,17 +17,41 @@ + + + + + + + + + + + + + + + + + + + + + + + + diff -Nru critcl-3.1.9/examples/bitmap/bitmap.tcl critcl-3.1.17+dfsg/examples/bitmap/bitmap.tcl --- critcl-3.1.9/examples/bitmap/bitmap.tcl 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/examples/bitmap/bitmap.tcl 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,66 @@ +# bitmap.tcl -- +# +# A template demonstrating the handling of bitmap conversions. +# +# Copyright (c) 2014 Andreas Kupries + +# # ## ### ##### ######## ############# ##################### +## Requirements + +package require Tcl 8.4 +package require critcl 3.1.11 +package require critcl::bitmap 1 + +# # ## ### ##### ######## ############# ##################### +## Administrivia + +critcl::license {Andreas Kupries} BSD + +critcl::summary {Bitmap conversion} + +critcl::description { + This package implements nothing. It serves only as a + demonstration and template on how to declare a bitmap + converter and use it in cproc's or ccommand's. +} + +critcl::subject demonstration {bitmap conversion} {encode bitmap} \ + {decode bitmap} {convert bitmap} + +# # ## ### ##### ######## ############# ##################### +## C code. + +critcl::bitmap::def demo { + global 1 + exact 2 + filler 4 +} + +critcl::cproc encode {Tcl_Interp* ip Tcl_Obj* flags} int { + int mask; + demo_encode (ip, flags, &mask); + return mask; +} + +critcl::cproc decode {Tcl_Interp* ip int mask} object { + Tcl_Obj* res = demo_decode (ip, mask); + Tcl_IncrRefCount (res); + return res; +} + +# Encode hidden in the argtype. +critcl::cproc xencode {Tcl_Interp* ip demo flags} int { + return flags; +} + +# Decode hidden in the resultype +critcl::cproc xdecode {Tcl_Interp* ip int mask} demo { + return mask; +} + +# encode {exact filler} => 6 +# decode 5 => {global filler} + +# ### ### ### ######### ######### ######### +## Ready +package provide bitmap 1 diff -Nru critcl-3.1.9/examples/bitmap/build.tcl critcl-3.1.17+dfsg/examples/bitmap/build.tcl --- critcl-3.1.9/examples/bitmap/build.tcl 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/examples/bitmap/build.tcl 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,283 @@ +#!/bin/sh +# -*- tcl -*- \ +exec tclsh "$0" ${1+"$@"} +set me [file normalize [info script]] +set packages {bitmap} +proc main {} { + global argv tcl_platform tag + set tag {} + if {![llength $argv]} { + if {$tcl_platform(platform) eq "windows"} { + set argv gui + } else { + set argv help + } + } + if {[catch { + eval _$argv + }]} usage + exit 0 +} +proc usage {{status 1}} { + global errorInfo + if {[info exists errorInfo] && ($errorInfo ne {}) && + ![string match {invalid command name "_*"*} $errorInfo] + } { + puts stderr $::errorInfo + exit + } + + global argv0 + set prefix "Usage: " + foreach c [lsort -dict [info commands _*]] { + set c [string range $c 1 end] + if {[catch { + H${c} + } res]} { + puts stderr "$prefix$argv0 $c args...\n" + } else { + puts stderr "$prefix$argv0 $c $res\n" + } + set prefix " " + } + exit $status +} +proc tag {t} { + global tag + set tag $t + return +} +proc myexit {} { + tag ok + puts DONE + return +} +proc log {args} { + global tag + set newline 1 + if {[lindex $args 0] eq "-nonewline"} { + set newline 0 + set args [lrange $args 1 end] + } + if {[llength $args] == 2} { + lassign $args chan text + if {$chan ni {stdout stderr}} { + ::_puts {*}[lrange [info level 0] 1 end] + return + } + } else { + set text [lindex $args 0] + set chan stdout + } + # chan <=> tag, if not overriden + if {[string match {Files left*} $text]} { + set tag warn + set text \n$text + } + if {$tag eq {}} { set tag $chan } + #::_puts $tag/$text + + .t insert end-1c $text $tag + set tag {} + if {$newline} { + .t insert end-1c \n + } + + update + return +} +proc +x {path} { + catch { file attributes $path -permissions u+x } + return +} +proc grep {file pattern} { + set lines [split [read [set chan [open $file r]]] \n] + close $chan + return [lsearch -all -inline -glob $lines $pattern] +} +proc version {file} { + set provisions [grep $file {*package provide*}] + #puts /$provisions/ + return [lindex $provisions 0 3] +} +proc Hhelp {} { return "\n\tPrint this help" } +proc _help {} { + usage 0 + return +} +proc Hrecipes {} { return "\n\tList all brew commands, without details." } +proc _recipes {} { + set r {} + foreach c [info commands _*] { + lappend r [string range $c 1 end] + } + puts [lsort -dict $r] + return +} +proc Hinstall {} { return "?destination?\n\tInstall all packages, and application.\n\tdestination = path of package directory, default \[info library\]." } +proc _install {{ldir {}}} { + global packages + if {[llength [info level 0]] < 2} { + set ldir [info library] + set idir [file dirname [file dirname $ldir]]/include + } else { + set idir [file dirname $ldir]/include + } + + # Create directories, might not exist. + file mkdir $idir + file mkdir $ldir + + package require critcl::app + + foreach p $packages { + set src [file dirname $::me]/$p.tcl + set version [version $src] + + file delete -force [pwd]/BUILD + critcl::app::main [list -cache [pwd]/BUILD -libdir $ldir -includedir $idir -pkg $src] + + if {![file exists $ldir/$p]} { + set ::NOTE {warn {DONE, with FAILURES}} + break + } + + file delete -force $ldir/$p$version + file rename $ldir/$p $ldir/$p$version + + puts -nonewline "Installed package: " + tag ok + puts $ldir/$p$version + } + return +} +proc Hdebug {} { return "?destination?\n\tInstall debug builds of all packages.\n\tdestination = path of package directory, default \[info library\]." } +proc _debug {{ldir {}}} { + global packages + if {[llength [info level 0]] < 2} { + set ldir [info library] + set idir [file dirname [file dirname $ldir]]/include + } else { + set idir [file dirname $ldir]/include + } + + # Create directories, might not exist. + file mkdir $idir + file mkdir $ldir + + package require critcl::app + + foreach p $packages { + set src [file dirname $::me]/$p.tcl + set version [version $src] + + file delete -force [pwd]/BUILD.$p + critcl::app::main [list -cache [pwd]/BUILD.$p -keep -debug all -libdir $ldir -includedir $idir -pkg $src] + + if {![file exists $ldir/$p]} { + set ::NOTE {warn {DONE, with FAILURES}} + break + } + + file delete -force $ldir/$p$version + file rename $ldir/$p $ldir/$p$version + + puts -nonewline "Installed package: " + tag ok + puts $ldir/$p$version + } + return +} +proc Hgui {} { return "\n\tInstall all packages, and application.\n\tDone from a small GUI." } +proc _gui {} { + global INSTALLPATH + package require Tk + package require widget::scrolledwindow + + wm protocol . WM_DELETE_WINDOW ::_exit + + label .l -text {Install Path: } + entry .e -textvariable ::INSTALLPATH + button .i -command Install -text Install + + widget::scrolledwindow .st -borderwidth 1 -relief sunken + text .t + .st setwidget .t + + .t tag configure stdout -font {Helvetica 8} + .t tag configure stderr -background red -font {Helvetica 12} + .t tag configure ok -background green -font {Helvetica 8} + .t tag configure warn -background yellow -font {Helvetica 12} + + grid .l -row 0 -column 0 -sticky new + grid .e -row 0 -column 1 -sticky new + grid .i -row 0 -column 2 -sticky new + grid .st -row 1 -column 0 -sticky swen -columnspan 2 + + grid rowconfigure . 0 -weight 0 + grid rowconfigure . 1 -weight 1 + + grid columnconfigure . 0 -weight 0 + grid columnconfigure . 1 -weight 1 + grid columnconfigure . 2 -weight 0 + + set INSTALLPATH [info library] + + # Redirect all output into our log window, and disable uncontrolled exit. + rename ::puts ::_puts + rename ::log ::puts + rename ::exit ::_exit + rename ::myexit ::exit + + # And start to interact with the user. + vwait forever + return +} +proc Install {} { + global INSTALLPATH NOTE + .i configure -state disabled + + set NOTE {ok DONE} + set fail [catch { + _install $INSTALLPATH + + puts "" + tag [lindex $NOTE 0] + puts [lindex $NOTE 1] + } e o] + + .i configure -state normal + .i configure -command ::_exit -text Exit -bg green + + if {$fail} { + # rethrow + return {*}$o $e + } + return +} +proc Hwrap4tea {} { return "?destination?\n\tGenerate a source package with TEA-based build system wrapped around critcl.\n\tdestination = path of source package directory, default is sub-directory 'tea' of the CWD." } +proc _wrap4tea {{dst {}}} { + global packages + + if {[llength [info level 0]] < 2} { + set dst [file join [pwd] tea] + } + + file mkdir $dst + + package require critcl::app + + foreach p $packages { + set src [file dirname $::me]/$p.tcl + set version [version $src] + + file delete -force [pwd]/BUILD + critcl::app::main [list -cache [pwd]/BUILD -libdir $dst -tea $src] + file delete -force $dst/$p$version + file rename $dst/$p $dst/$p$version + + puts "Wrapped package: $dst/$p$version" + } + return +} +main diff -Nru critcl-3.1.9/examples/bitmap/cr.tcl critcl-3.1.17+dfsg/examples/bitmap/cr.tcl --- critcl-3.1.9/examples/bitmap/cr.tcl 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/examples/bitmap/cr.tcl 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,45 @@ +#!/usr/bin/env tclsh +# -*- tcl -*- +# Run the example via mode "compile & run". +# Note: generic code, same in all examples. + +cd [file dirname [file normalize [info script]]] +source ../../lib/critcl/critcl.tcl + +# Show the config +puts "" +puts "target-config: [critcl::targetconfig]" +puts "target-platform: [critcl::targetplatform]" +puts "target-actual: [critcl::actualtarget]" +puts "build-platform: [critcl::buildplatform]" +puts "cache: [critcl::cache]" +puts "" + +# Pull the package, ignoring build and examples ... +foreach f [glob *.tcl] { + if {[string match build* $f]} continue + if {[string match cr* $f]} continue + if {[string match example* $f]} continue + + puts "Reading $f ..." + source $f +} + +proc ex {args} { + set code [catch {uplevel 1 $args} result] + set code [string map {0 ok 1 error 2 break 3 continue} $code] + set max [expr {80 - [string length $args] - [string length "Example: "]}] + puts "Example: $args [string repeat _ $max]" + puts "Code: (($code))" + puts "Result: (($result))" + puts "" + return +} + +# ... and run the examples. +foreach f [glob -nocomplain example*] { + puts "Running $f ..." + source $f +} + +exit diff -Nru critcl-3.1.9/examples/bitmap/example.tcl critcl-3.1.17+dfsg/examples/bitmap/example.tcl --- critcl-3.1.9/examples/bitmap/example.tcl 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/examples/bitmap/example.tcl 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,6 @@ +#!/usr/bin/env tclsh + +ex encode {exact filler} +ex decode 5 +ex xencode global +ex xdecode 6 diff -Nru critcl-3.1.9/examples/clist/cr.tcl critcl-3.1.17+dfsg/examples/clist/cr.tcl --- critcl-3.1.9/examples/clist/cr.tcl 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/examples/clist/cr.tcl 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,45 @@ +#!/usr/bin/env tclsh +# -*- tcl -*- +# Run the example via mode "compile & run". +# Note: generic code, same in all examples. + +cd [file dirname [file normalize [info script]]] +source ../../lib/critcl/critcl.tcl + +# Show the config +puts "" +puts "target-config: [critcl::targetconfig]" +puts "target-platform: [critcl::targetplatform]" +puts "target-actual: [critcl::actualtarget]" +puts "build-platform: [critcl::buildplatform]" +puts "cache: [critcl::cache]" +puts "" + +# Pull the package, ignoring build and examples ... +foreach f [glob *.tcl] { + if {[string match build* $f]} continue + if {[string match cr* $f]} continue + if {[string match example* $f]} continue + + puts "Reading $f ..." + source $f +} + +proc ex {args} { + set code [catch {uplevel 1 $args} result] + set code [string map {0 ok 1 error 2 break 3 continue} $code] + set max [expr {80 - [string length $args] - [string length "Example: "]}] + puts "Example: $args [string repeat _ $max]" + puts "Code: (($code))" + puts "Result: (($result))" + puts "" + return +} + +# ... and run the examples. +foreach f [glob -nocomplain example*] { + puts "Running $f ..." + source $f +} + +exit diff -Nru critcl-3.1.9/examples/clist/example.tcl critcl-3.1.17+dfsg/examples/clist/example.tcl --- critcl-3.1.9/examples/clist/example.tcl 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/examples/clist/example.tcl 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,21 @@ + +package require Tcl 8.5 +package require lambda + +# Force compile and load. +catch {clist::map} + +# squares +ex clist map [lambda {x} { + expr {$x * $x} +}] {0 1 2 3 4 5 6 7 8 9} + +# filter out even numbers <=> select odd numbers +ex ::clist::filter [lambda {x} { + expr {$x % 2} +}] {0 1 2 3 4 5 6 7 8 9} + +# sum +ex ::clist foldl [lambda {a x} { + expr {$a + $x} +}] 0 {0 1 2 3 4 5 6 7 8 9} diff -Nru critcl-3.1.9/examples/cr.tcl critcl-3.1.17+dfsg/examples/cr.tcl --- critcl-3.1.9/examples/cr.tcl 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/examples/cr.tcl 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,21 @@ +#!/usr/bin/env tclsh +# -*- tcl -*- + +set selfdir [file dirname [file normalize [info script]]] +set self [file tail [info script]] + +set pattern [lindex $argv 0] +if {$pattern eq ""} { + set pattern * +} +# Perform "compile & run" in the sub-directories. + +puts "" +foreach cr [lsort -dict [glob -directory $selfdir $pattern/$self]] { + puts "$cr _______________________________________________" + catch { + eval [list exec 2>@ stderr >@ stdout [info nameofexecutable] $cr] + } + puts "" + puts "" +} diff -Nru critcl-3.1.9/examples/emap/build.tcl critcl-3.1.17+dfsg/examples/emap/build.tcl --- critcl-3.1.9/examples/emap/build.tcl 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/examples/emap/build.tcl 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,283 @@ +#!/bin/sh +# -*- tcl -*- \ +exec tclsh "$0" ${1+"$@"} +set me [file normalize [info script]] +set packages {emap} +proc main {} { + global argv tcl_platform tag + set tag {} + if {![llength $argv]} { + if {$tcl_platform(platform) eq "windows"} { + set argv gui + } else { + set argv help + } + } + if {[catch { + eval _$argv + }]} usage + exit 0 +} +proc usage {{status 1}} { + global errorInfo + if {[info exists errorInfo] && ($errorInfo ne {}) && + ![string match {invalid command name "_*"*} $errorInfo] + } { + puts stderr $::errorInfo + exit + } + + global argv0 + set prefix "Usage: " + foreach c [lsort -dict [info commands _*]] { + set c [string range $c 1 end] + if {[catch { + H${c} + } res]} { + puts stderr "$prefix$argv0 $c args...\n" + } else { + puts stderr "$prefix$argv0 $c $res\n" + } + set prefix " " + } + exit $status +} +proc tag {t} { + global tag + set tag $t + return +} +proc myexit {} { + tag ok + puts DONE + return +} +proc log {args} { + global tag + set newline 1 + if {[lindex $args 0] eq "-nonewline"} { + set newline 0 + set args [lrange $args 1 end] + } + if {[llength $args] == 2} { + lassign $args chan text + if {$chan ni {stdout stderr}} { + ::_puts {*}[lrange [info level 0] 1 end] + return + } + } else { + set text [lindex $args 0] + set chan stdout + } + # chan <=> tag, if not overriden + if {[string match {Files left*} $text]} { + set tag warn + set text \n$text + } + if {$tag eq {}} { set tag $chan } + #::_puts $tag/$text + + .t insert end-1c $text $tag + set tag {} + if {$newline} { + .t insert end-1c \n + } + + update + return +} +proc +x {path} { + catch { file attributes $path -permissions u+x } + return +} +proc grep {file pattern} { + set lines [split [read [set chan [open $file r]]] \n] + close $chan + return [lsearch -all -inline -glob $lines $pattern] +} +proc version {file} { + set provisions [grep $file {*package provide*}] + #puts /$provisions/ + return [lindex $provisions 0 3] +} +proc Hhelp {} { return "\n\tPrint this help" } +proc _help {} { + usage 0 + return +} +proc Hrecipes {} { return "\n\tList all brew commands, without details." } +proc _recipes {} { + set r {} + foreach c [info commands _*] { + lappend r [string range $c 1 end] + } + puts [lsort -dict $r] + return +} +proc Hinstall {} { return "?destination?\n\tInstall all packages, and application.\n\tdestination = path of package directory, default \[info library\]." } +proc _install {{ldir {}}} { + global packages + if {[llength [info level 0]] < 2} { + set ldir [info library] + set idir [file dirname [file dirname $ldir]]/include + } else { + set idir [file dirname $ldir]/include + } + + # Create directories, might not exist. + file mkdir $idir + file mkdir $ldir + + package require critcl::app + + foreach p $packages { + set src [file dirname $::me]/$p.tcl + set version [version $src] + + file delete -force [pwd]/BUILD + critcl::app::main [list -cache [pwd]/BUILD -libdir $ldir -includedir $idir -pkg $src] + + if {![file exists $ldir/$p]} { + set ::NOTE {warn {DONE, with FAILURES}} + break + } + + file delete -force $ldir/$p$version + file rename $ldir/$p $ldir/$p$version + + puts -nonewline "Installed package: " + tag ok + puts $ldir/$p$version + } + return +} +proc Hdebug {} { return "?destination?\n\tInstall debug builds of all packages.\n\tdestination = path of package directory, default \[info library\]." } +proc _debug {{ldir {}}} { + global packages + if {[llength [info level 0]] < 2} { + set ldir [info library] + set idir [file dirname [file dirname $ldir]]/include + } else { + set idir [file dirname $ldir]/include + } + + # Create directories, might not exist. + file mkdir $idir + file mkdir $ldir + + package require critcl::app + + foreach p $packages { + set src [file dirname $::me]/$p.tcl + set version [version $src] + + file delete -force [pwd]/BUILD.$p + critcl::app::main [list -cache [pwd]/BUILD.$p -keep -debug all -libdir $ldir -includedir $idir -pkg $src] + + if {![file exists $ldir/$p]} { + set ::NOTE {warn {DONE, with FAILURES}} + break + } + + file delete -force $ldir/$p$version + file rename $ldir/$p $ldir/$p$version + + puts -nonewline "Installed package: " + tag ok + puts $ldir/$p$version + } + return +} +proc Hgui {} { return "\n\tInstall all packages, and application.\n\tDone from a small GUI." } +proc _gui {} { + global INSTALLPATH + package require Tk + package require widget::scrolledwindow + + wm protocol . WM_DELETE_WINDOW ::_exit + + label .l -text {Install Path: } + entry .e -textvariable ::INSTALLPATH + button .i -command Install -text Install + + widget::scrolledwindow .st -borderwidth 1 -relief sunken + text .t + .st setwidget .t + + .t tag configure stdout -font {Helvetica 8} + .t tag configure stderr -background red -font {Helvetica 12} + .t tag configure ok -background green -font {Helvetica 8} + .t tag configure warn -background yellow -font {Helvetica 12} + + grid .l -row 0 -column 0 -sticky new + grid .e -row 0 -column 1 -sticky new + grid .i -row 0 -column 2 -sticky new + grid .st -row 1 -column 0 -sticky swen -columnspan 2 + + grid rowconfigure . 0 -weight 0 + grid rowconfigure . 1 -weight 1 + + grid columnconfigure . 0 -weight 0 + grid columnconfigure . 1 -weight 1 + grid columnconfigure . 2 -weight 0 + + set INSTALLPATH [info library] + + # Redirect all output into our log window, and disable uncontrolled exit. + rename ::puts ::_puts + rename ::log ::puts + rename ::exit ::_exit + rename ::myexit ::exit + + # And start to interact with the user. + vwait forever + return +} +proc Install {} { + global INSTALLPATH NOTE + .i configure -state disabled + + set NOTE {ok DONE} + set fail [catch { + _install $INSTALLPATH + + puts "" + tag [lindex $NOTE 0] + puts [lindex $NOTE 1] + } e o] + + .i configure -state normal + .i configure -command ::_exit -text Exit -bg green + + if {$fail} { + # rethrow + return {*}$o $e + } + return +} +proc Hwrap4tea {} { return "?destination?\n\tGenerate a source package with TEA-based build system wrapped around critcl.\n\tdestination = path of source package directory, default is sub-directory 'tea' of the CWD." } +proc _wrap4tea {{dst {}}} { + global packages + + if {[llength [info level 0]] < 2} { + set dst [file join [pwd] tea] + } + + file mkdir $dst + + package require critcl::app + + foreach p $packages { + set src [file dirname $::me]/$p.tcl + set version [version $src] + + file delete -force [pwd]/BUILD + critcl::app::main [list -cache [pwd]/BUILD -libdir $dst -tea $src] + file delete -force $dst/$p$version + file rename $dst/$p $dst/$p$version + + puts "Wrapped package: $dst/$p$version" + } + return +} +main diff -Nru critcl-3.1.9/examples/emap/cr.tcl critcl-3.1.17+dfsg/examples/emap/cr.tcl --- critcl-3.1.9/examples/emap/cr.tcl 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/examples/emap/cr.tcl 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,45 @@ +#!/usr/bin/env tclsh +# -*- tcl -*- +# Run the example via mode "compile & run". +# Note: generic code, same in all examples. + +cd [file dirname [file normalize [info script]]] +source ../../lib/critcl/critcl.tcl + +# Show the config +puts "" +puts "target-config: [critcl::targetconfig]" +puts "target-platform: [critcl::targetplatform]" +puts "target-actual: [critcl::actualtarget]" +puts "build-platform: [critcl::buildplatform]" +puts "cache: [critcl::cache]" +puts "" + +# Pull the package, ignoring build and examples ... +foreach f [glob *.tcl] { + if {[string match build* $f]} continue + if {[string match cr* $f]} continue + if {[string match example* $f]} continue + + puts "Reading $f ..." + source $f +} + +proc ex {args} { + set code [catch {uplevel 1 $args} result] + set code [string map {0 ok 1 error 2 break 3 continue} $code] + set max [expr {80 - [string length $args] - [string length "Example: "]}] + puts "Example: $args [string repeat _ $max]" + puts "Code: (($code))" + puts "Result: (($result))" + puts "" + return +} + +# ... and run the examples. +foreach f [glob -nocomplain example*] { + puts "Running $f ..." + source $f +} + +exit diff -Nru critcl-3.1.9/examples/emap/emap-ex.tcl critcl-3.1.17+dfsg/examples/emap/emap-ex.tcl --- critcl-3.1.9/examples/emap/emap-ex.tcl 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/examples/emap/emap-ex.tcl 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,75 @@ +# emap_ex.tcl -- +# +# A template demonstrating the handling of emap conversions. +# +# Copyright (c) 2014 Andreas Kupries + +# # ## ### ##### ######## ############# ##################### +## Requirements + +package require Tcl 8.4 +package require critcl 3.1.11 +package require critcl::emap 1 + +# # ## ### ##### ######## ############# ##################### +## Administrivia + +critcl::license {Andreas Kupries} BSD + +critcl::summary {Bitmap conversion} + +critcl::description { + This package implements nothing. It serves only as a + demonstration and template on how to declare an emap + converter and use it in cproc's or ccommand's. +} + +critcl::subject demonstration {emap conversion} {encode emap} \ + {decode emap} {convert emap} + +# # ## ### ##### ######## ############# ##################### +## C code. + +critcl::ccode { + #define STATE_INIT 0 + #define STATE_MIX 1 + #define STATE_DONE 2 +} + +critcl::emap::def demo { + init STATE_INIT + mix STATE_MIX + done STATE_DONE +} +# Add -nocase as last argument for case-insensitive Tcl strings. + +critcl::cproc encode {Tcl_Interp* ip Tcl_Obj* state} int { + int scode; + if (demo_encode (ip, state, &scode) != TCL_OK) { + return -1; + } + return scode; +} + +critcl::cproc decode {Tcl_Interp* ip int scode} object { + Tcl_Obj* res = demo_decode (ip, scode); + if (res) { Tcl_IncrRefCount (res); } + return res; +} + +# Encode hidden in the argtype. +critcl::cproc xencode {Tcl_Interp* ip demo state} int { + return state; +} + +# Decode hidden in the resultype +critcl::cproc xdecode {Tcl_Interp* ip int state} demo { + return state; +} + +# encode {exact filler} => 6 +# decode 5 => {global filler} + +# ### ### ### ######### ######### ######### +## Ready +package provide emap 1 diff -Nru critcl-3.1.9/examples/emap/example.tcl critcl-3.1.17+dfsg/examples/emap/example.tcl --- critcl-3.1.9/examples/emap/example.tcl 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/examples/emap/example.tcl 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,16 @@ + +package require emap + +ex encode mix ;# 1 +ex xencode done ;# 2 + +ex decode 0 ;# init +ex xdecode 1 ;# mix + +ex encode foo +ex xencode bar +ex decode 55 +ex xdecode -2 + +ex xencode MIX + diff -Nru critcl-3.1.9/examples/emap-both/build.tcl critcl-3.1.17+dfsg/examples/emap-both/build.tcl --- critcl-3.1.9/examples/emap-both/build.tcl 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/examples/emap-both/build.tcl 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,283 @@ +#!/bin/sh +# -*- tcl -*- \ +exec tclsh "$0" ${1+"$@"} +set me [file normalize [info script]] +set packages {emap-both} +proc main {} { + global argv tcl_platform tag + set tag {} + if {![llength $argv]} { + if {$tcl_platform(platform) eq "windows"} { + set argv gui + } else { + set argv help + } + } + if {[catch { + eval _$argv + }]} usage + exit 0 +} +proc usage {{status 1}} { + global errorInfo + if {[info exists errorInfo] && ($errorInfo ne {}) && + ![string match {invalid command name "_*"*} $errorInfo] + } { + puts stderr $::errorInfo + exit + } + + global argv0 + set prefix "Usage: " + foreach c [lsort -dict [info commands _*]] { + set c [string range $c 1 end] + if {[catch { + H${c} + } res]} { + puts stderr "$prefix$argv0 $c args...\n" + } else { + puts stderr "$prefix$argv0 $c $res\n" + } + set prefix " " + } + exit $status +} +proc tag {t} { + global tag + set tag $t + return +} +proc myexit {} { + tag ok + puts DONE + return +} +proc log {args} { + global tag + set newline 1 + if {[lindex $args 0] eq "-nonewline"} { + set newline 0 + set args [lrange $args 1 end] + } + if {[llength $args] == 2} { + lassign $args chan text + if {$chan ni {stdout stderr}} { + ::_puts {*}[lrange [info level 0] 1 end] + return + } + } else { + set text [lindex $args 0] + set chan stdout + } + # chan <=> tag, if not overriden + if {[string match {Files left*} $text]} { + set tag warn + set text \n$text + } + if {$tag eq {}} { set tag $chan } + #::_puts $tag/$text + + .t insert end-1c $text $tag + set tag {} + if {$newline} { + .t insert end-1c \n + } + + update + return +} +proc +x {path} { + catch { file attributes $path -permissions u+x } + return +} +proc grep {file pattern} { + set lines [split [read [set chan [open $file r]]] \n] + close $chan + return [lsearch -all -inline -glob $lines $pattern] +} +proc version {file} { + set provisions [grep $file {*package provide*}] + #puts /$provisions/ + return [lindex $provisions 0 3] +} +proc Hhelp {} { return "\n\tPrint this help" } +proc _help {} { + usage 0 + return +} +proc Hrecipes {} { return "\n\tList all brew commands, without details." } +proc _recipes {} { + set r {} + foreach c [info commands _*] { + lappend r [string range $c 1 end] + } + puts [lsort -dict $r] + return +} +proc Hinstall {} { return "?destination?\n\tInstall all packages, and application.\n\tdestination = path of package directory, default \[info library\]." } +proc _install {{ldir {}}} { + global packages + if {[llength [info level 0]] < 2} { + set ldir [info library] + set idir [file dirname [file dirname $ldir]]/include + } else { + set idir [file dirname $ldir]/include + } + + # Create directories, might not exist. + file mkdir $idir + file mkdir $ldir + + package require critcl::app + + foreach p $packages { + set src [file dirname $::me]/$p.tcl + set version [version $src] + + file delete -force [pwd]/BUILD + critcl::app::main [list -cache [pwd]/BUILD -libdir $ldir -includedir $idir -pkg $src] + + if {![file exists $ldir/$p]} { + set ::NOTE {warn {DONE, with FAILURES}} + break + } + + file delete -force $ldir/$p$version + file rename $ldir/$p $ldir/$p$version + + puts -nonewline "Installed package: " + tag ok + puts $ldir/$p$version + } + return +} +proc Hdebug {} { return "?destination?\n\tInstall debug builds of all packages.\n\tdestination = path of package directory, default \[info library\]." } +proc _debug {{ldir {}}} { + global packages + if {[llength [info level 0]] < 2} { + set ldir [info library] + set idir [file dirname [file dirname $ldir]]/include + } else { + set idir [file dirname $ldir]/include + } + + # Create directories, might not exist. + file mkdir $idir + file mkdir $ldir + + package require critcl::app + + foreach p $packages { + set src [file dirname $::me]/$p.tcl + set version [version $src] + + file delete -force [pwd]/BUILD.$p + critcl::app::main [list -cache [pwd]/BUILD.$p -keep -debug all -libdir $ldir -includedir $idir -pkg $src] + + if {![file exists $ldir/$p]} { + set ::NOTE {warn {DONE, with FAILURES}} + break + } + + file delete -force $ldir/$p$version + file rename $ldir/$p $ldir/$p$version + + puts -nonewline "Installed package: " + tag ok + puts $ldir/$p$version + } + return +} +proc Hgui {} { return "\n\tInstall all packages, and application.\n\tDone from a small GUI." } +proc _gui {} { + global INSTALLPATH + package require Tk + package require widget::scrolledwindow + + wm protocol . WM_DELETE_WINDOW ::_exit + + label .l -text {Install Path: } + entry .e -textvariable ::INSTALLPATH + button .i -command Install -text Install + + widget::scrolledwindow .st -borderwidth 1 -relief sunken + text .t + .st setwidget .t + + .t tag configure stdout -font {Helvetica 8} + .t tag configure stderr -background red -font {Helvetica 12} + .t tag configure ok -background green -font {Helvetica 8} + .t tag configure warn -background yellow -font {Helvetica 12} + + grid .l -row 0 -column 0 -sticky new + grid .e -row 0 -column 1 -sticky new + grid .i -row 0 -column 2 -sticky new + grid .st -row 1 -column 0 -sticky swen -columnspan 2 + + grid rowconfigure . 0 -weight 0 + grid rowconfigure . 1 -weight 1 + + grid columnconfigure . 0 -weight 0 + grid columnconfigure . 1 -weight 1 + grid columnconfigure . 2 -weight 0 + + set INSTALLPATH [info library] + + # Redirect all output into our log window, and disable uncontrolled exit. + rename ::puts ::_puts + rename ::log ::puts + rename ::exit ::_exit + rename ::myexit ::exit + + # And start to interact with the user. + vwait forever + return +} +proc Install {} { + global INSTALLPATH NOTE + .i configure -state disabled + + set NOTE {ok DONE} + set fail [catch { + _install $INSTALLPATH + + puts "" + tag [lindex $NOTE 0] + puts [lindex $NOTE 1] + } e o] + + .i configure -state normal + .i configure -command ::_exit -text Exit -bg green + + if {$fail} { + # rethrow + return {*}$o $e + } + return +} +proc Hwrap4tea {} { return "?destination?\n\tGenerate a source package with TEA-based build system wrapped around critcl.\n\tdestination = path of source package directory, default is sub-directory 'tea' of the CWD." } +proc _wrap4tea {{dst {}}} { + global packages + + if {[llength [info level 0]] < 2} { + set dst [file join [pwd] tea] + } + + file mkdir $dst + + package require critcl::app + + foreach p $packages { + set src [file dirname $::me]/$p.tcl + set version [version $src] + + file delete -force [pwd]/BUILD + critcl::app::main [list -cache [pwd]/BUILD -libdir $dst -tea $src] + file delete -force $dst/$p$version + file rename $dst/$p $dst/$p$version + + puts "Wrapped package: $dst/$p$version" + } + return +} +main diff -Nru critcl-3.1.9/examples/emap-both/cr.tcl critcl-3.1.17+dfsg/examples/emap-both/cr.tcl --- critcl-3.1.9/examples/emap-both/cr.tcl 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/examples/emap-both/cr.tcl 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,45 @@ +#!/usr/bin/env tclsh +# -*- tcl -*- +# Run the example via mode "compile & run". +# Note: generic code, same in all examples. + +cd [file dirname [file normalize [info script]]] +source ../../lib/critcl/critcl.tcl + +# Show the config +puts "" +puts "target-config: [critcl::targetconfig]" +puts "target-platform: [critcl::targetplatform]" +puts "target-actual: [critcl::actualtarget]" +puts "build-platform: [critcl::buildplatform]" +puts "cache: [critcl::cache]" +puts "" + +# Pull the package, ignoring build and examples ... +foreach f [glob *.tcl] { + if {[string match build* $f]} continue + if {[string match cr* $f]} continue + if {[string match example* $f]} continue + + puts "Reading $f ..." + source $f +} + +proc ex {args} { + set code [catch {uplevel 1 $args} result] + set code [string map {0 ok 1 error 2 break 3 continue} $code] + set max [expr {80 - [string length $args] - [string length "Example: "]}] + puts "Example: $args [string repeat _ $max]" + puts "Code: (($code))" + puts "Result: (($result))" + puts "" + return +} + +# ... and run the examples. +foreach f [glob -nocomplain example*] { + puts "Running $f ..." + source $f +} + +exit diff -Nru critcl-3.1.9/examples/emap-both/emap-both.tcl critcl-3.1.17+dfsg/examples/emap-both/emap-both.tcl --- critcl-3.1.9/examples/emap-both/emap-both.tcl 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/examples/emap-both/emap-both.tcl 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,71 @@ +# emap_ex.tcl -- +# +# A template demonstrating the handling of emap conversions. +# +# Copyright (c) 2014 Andreas Kupries + +# # ## ### ##### ######## ############# ##################### +## Requirements + +package require Tcl 8.4 +package require critcl 3.1.11 +package require critcl::emap 1 + +# # ## ### ##### ######## ############# ##################### +## Administrivia + +critcl::license {Andreas Kupries} BSD + +critcl::summary {Bitmap conversion} + +critcl::description { + This package implements nothing. It serves only as a + demonstration and template on how to declare an emap + converter and use it in cproc's or ccommand's. +} + +critcl::subject demonstration {emap conversion} {encode emap} \ + {decode emap} {convert emap} + +# # ## ### ##### ######## ############# ##################### +## C code. + +critcl::ccode { + #define STATE_INIT 0 + #define STATE_MIX 1 + #define STATE_DONE 2 +} + +critcl::emap::def demo { + init STATE_INIT + mix STATE_MIX + done STATE_DONE +} -mode {c tcl} +# Add -nocase as last argument for case-insensitive Tcl strings. + +critcl::cproc encode {Tcl_Interp* ip Tcl_Obj* state} int { + return demo_encode_cstr (Tcl_GetString(state)); +} + +critcl::cproc decode {Tcl_Interp* ip int scode} object { + Tcl_Obj* res = Tcl_NewStringObj (demo_decode_cstr (scode), -1); + if (res) { Tcl_IncrRefCount (res); } + return res; +} + +# Encode hidden in the argtype. +critcl::cproc xencode {Tcl_Interp* ip demo state} int { + return state; +} + +# Decode hidden in the resultype +critcl::cproc xdecode {Tcl_Interp* ip int state} demo { + return state; +} + +# encode {exact filler} => 6 +# decode 5 => {global filler} + +# ### ### ### ######### ######### ######### +## Ready +package provide emap-both 1 diff -Nru critcl-3.1.9/examples/emap-both/example.tcl critcl-3.1.17+dfsg/examples/emap-both/example.tcl --- critcl-3.1.9/examples/emap-both/example.tcl 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/examples/emap-both/example.tcl 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,16 @@ + +package require emap-both + +ex encode mix ;# 1 +ex xencode done ;# 2 + +ex decode 0 ;# init +ex xdecode 1 ;# mix + +ex encode foo +ex xencode bar +ex decode 55 +ex xdecode -2 + +ex xencode MIX + diff -Nru critcl-3.1.9/examples/emap-c/build.tcl critcl-3.1.17+dfsg/examples/emap-c/build.tcl --- critcl-3.1.9/examples/emap-c/build.tcl 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/examples/emap-c/build.tcl 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,283 @@ +#!/bin/sh +# -*- tcl -*- \ +exec tclsh "$0" ${1+"$@"} +set me [file normalize [info script]] +set packages {emap-c} +proc main {} { + global argv tcl_platform tag + set tag {} + if {![llength $argv]} { + if {$tcl_platform(platform) eq "windows"} { + set argv gui + } else { + set argv help + } + } + if {[catch { + eval _$argv + }]} usage + exit 0 +} +proc usage {{status 1}} { + global errorInfo + if {[info exists errorInfo] && ($errorInfo ne {}) && + ![string match {invalid command name "_*"*} $errorInfo] + } { + puts stderr $::errorInfo + exit + } + + global argv0 + set prefix "Usage: " + foreach c [lsort -dict [info commands _*]] { + set c [string range $c 1 end] + if {[catch { + H${c} + } res]} { + puts stderr "$prefix$argv0 $c args...\n" + } else { + puts stderr "$prefix$argv0 $c $res\n" + } + set prefix " " + } + exit $status +} +proc tag {t} { + global tag + set tag $t + return +} +proc myexit {} { + tag ok + puts DONE + return +} +proc log {args} { + global tag + set newline 1 + if {[lindex $args 0] eq "-nonewline"} { + set newline 0 + set args [lrange $args 1 end] + } + if {[llength $args] == 2} { + lassign $args chan text + if {$chan ni {stdout stderr}} { + ::_puts {*}[lrange [info level 0] 1 end] + return + } + } else { + set text [lindex $args 0] + set chan stdout + } + # chan <=> tag, if not overriden + if {[string match {Files left*} $text]} { + set tag warn + set text \n$text + } + if {$tag eq {}} { set tag $chan } + #::_puts $tag/$text + + .t insert end-1c $text $tag + set tag {} + if {$newline} { + .t insert end-1c \n + } + + update + return +} +proc +x {path} { + catch { file attributes $path -permissions u+x } + return +} +proc grep {file pattern} { + set lines [split [read [set chan [open $file r]]] \n] + close $chan + return [lsearch -all -inline -glob $lines $pattern] +} +proc version {file} { + set provisions [grep $file {*package provide*}] + #puts /$provisions/ + return [lindex $provisions 0 3] +} +proc Hhelp {} { return "\n\tPrint this help" } +proc _help {} { + usage 0 + return +} +proc Hrecipes {} { return "\n\tList all brew commands, without details." } +proc _recipes {} { + set r {} + foreach c [info commands _*] { + lappend r [string range $c 1 end] + } + puts [lsort -dict $r] + return +} +proc Hinstall {} { return "?destination?\n\tInstall all packages, and application.\n\tdestination = path of package directory, default \[info library\]." } +proc _install {{ldir {}}} { + global packages + if {[llength [info level 0]] < 2} { + set ldir [info library] + set idir [file dirname [file dirname $ldir]]/include + } else { + set idir [file dirname $ldir]/include + } + + # Create directories, might not exist. + file mkdir $idir + file mkdir $ldir + + package require critcl::app + + foreach p $packages { + set src [file dirname $::me]/$p.tcl + set version [version $src] + + file delete -force [pwd]/BUILD + critcl::app::main [list -cache [pwd]/BUILD -libdir $ldir -includedir $idir -pkg $src] + + if {![file exists $ldir/$p]} { + set ::NOTE {warn {DONE, with FAILURES}} + break + } + + file delete -force $ldir/$p$version + file rename $ldir/$p $ldir/$p$version + + puts -nonewline "Installed package: " + tag ok + puts $ldir/$p$version + } + return +} +proc Hdebug {} { return "?destination?\n\tInstall debug builds of all packages.\n\tdestination = path of package directory, default \[info library\]." } +proc _debug {{ldir {}}} { + global packages + if {[llength [info level 0]] < 2} { + set ldir [info library] + set idir [file dirname [file dirname $ldir]]/include + } else { + set idir [file dirname $ldir]/include + } + + # Create directories, might not exist. + file mkdir $idir + file mkdir $ldir + + package require critcl::app + + foreach p $packages { + set src [file dirname $::me]/$p.tcl + set version [version $src] + + file delete -force [pwd]/BUILD.$p + critcl::app::main [list -cache [pwd]/BUILD.$p -keep -debug all -libdir $ldir -includedir $idir -pkg $src] + + if {![file exists $ldir/$p]} { + set ::NOTE {warn {DONE, with FAILURES}} + break + } + + file delete -force $ldir/$p$version + file rename $ldir/$p $ldir/$p$version + + puts -nonewline "Installed package: " + tag ok + puts $ldir/$p$version + } + return +} +proc Hgui {} { return "\n\tInstall all packages, and application.\n\tDone from a small GUI." } +proc _gui {} { + global INSTALLPATH + package require Tk + package require widget::scrolledwindow + + wm protocol . WM_DELETE_WINDOW ::_exit + + label .l -text {Install Path: } + entry .e -textvariable ::INSTALLPATH + button .i -command Install -text Install + + widget::scrolledwindow .st -borderwidth 1 -relief sunken + text .t + .st setwidget .t + + .t tag configure stdout -font {Helvetica 8} + .t tag configure stderr -background red -font {Helvetica 12} + .t tag configure ok -background green -font {Helvetica 8} + .t tag configure warn -background yellow -font {Helvetica 12} + + grid .l -row 0 -column 0 -sticky new + grid .e -row 0 -column 1 -sticky new + grid .i -row 0 -column 2 -sticky new + grid .st -row 1 -column 0 -sticky swen -columnspan 2 + + grid rowconfigure . 0 -weight 0 + grid rowconfigure . 1 -weight 1 + + grid columnconfigure . 0 -weight 0 + grid columnconfigure . 1 -weight 1 + grid columnconfigure . 2 -weight 0 + + set INSTALLPATH [info library] + + # Redirect all output into our log window, and disable uncontrolled exit. + rename ::puts ::_puts + rename ::log ::puts + rename ::exit ::_exit + rename ::myexit ::exit + + # And start to interact with the user. + vwait forever + return +} +proc Install {} { + global INSTALLPATH NOTE + .i configure -state disabled + + set NOTE {ok DONE} + set fail [catch { + _install $INSTALLPATH + + puts "" + tag [lindex $NOTE 0] + puts [lindex $NOTE 1] + } e o] + + .i configure -state normal + .i configure -command ::_exit -text Exit -bg green + + if {$fail} { + # rethrow + return {*}$o $e + } + return +} +proc Hwrap4tea {} { return "?destination?\n\tGenerate a source package with TEA-based build system wrapped around critcl.\n\tdestination = path of source package directory, default is sub-directory 'tea' of the CWD." } +proc _wrap4tea {{dst {}}} { + global packages + + if {[llength [info level 0]] < 2} { + set dst [file join [pwd] tea] + } + + file mkdir $dst + + package require critcl::app + + foreach p $packages { + set src [file dirname $::me]/$p.tcl + set version [version $src] + + file delete -force [pwd]/BUILD + critcl::app::main [list -cache [pwd]/BUILD -libdir $dst -tea $src] + file delete -force $dst/$p$version + file rename $dst/$p $dst/$p$version + + puts "Wrapped package: $dst/$p$version" + } + return +} +main diff -Nru critcl-3.1.9/examples/emap-c/cr.tcl critcl-3.1.17+dfsg/examples/emap-c/cr.tcl --- critcl-3.1.9/examples/emap-c/cr.tcl 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/examples/emap-c/cr.tcl 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,45 @@ +#!/usr/bin/env tclsh +# -*- tcl -*- +# Run the example via mode "compile & run". +# Note: generic code, same in all examples. + +cd [file dirname [file normalize [info script]]] +source ../../lib/critcl/critcl.tcl + +# Show the config +puts "" +puts "target-config: [critcl::targetconfig]" +puts "target-platform: [critcl::targetplatform]" +puts "target-actual: [critcl::actualtarget]" +puts "build-platform: [critcl::buildplatform]" +puts "cache: [critcl::cache]" +puts "" + +# Pull the package, ignoring build and examples ... +foreach f [glob *.tcl] { + if {[string match build* $f]} continue + if {[string match cr* $f]} continue + if {[string match example* $f]} continue + + puts "Reading $f ..." + source $f +} + +proc ex {args} { + set code [catch {uplevel 1 $args} result] + set code [string map {0 ok 1 error 2 break 3 continue} $code] + set max [expr {80 - [string length $args] - [string length "Example: "]}] + puts "Example: $args [string repeat _ $max]" + puts "Code: (($code))" + puts "Result: (($result))" + puts "" + return +} + +# ... and run the examples. +foreach f [glob -nocomplain example*] { + puts "Running $f ..." + source $f +} + +exit diff -Nru critcl-3.1.9/examples/emap-c/emap-c.tcl critcl-3.1.17+dfsg/examples/emap-c/emap-c.tcl --- critcl-3.1.9/examples/emap-c/emap-c.tcl 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/examples/emap-c/emap-c.tcl 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,61 @@ +# emap_ex.tcl -- +# +# A template demonstrating the handling of emap conversions. +# +# Copyright (c) 2014 Andreas Kupries + +# # ## ### ##### ######## ############# ##################### +## Requirements + +package require Tcl 8.4 +package require critcl 3.1.11 +package require critcl::emap 1 + +# # ## ### ##### ######## ############# ##################### +## Administrivia + +critcl::license {Andreas Kupries} BSD + +critcl::summary {Bitmap conversion} + +critcl::description { + This package implements nothing. It serves only as a + demonstration and template on how to declare an emap + converter and use it in cproc's or ccommand's. +} + +critcl::subject demonstration {emap conversion} {encode emap} \ + {decode emap} {convert emap} + +# # ## ### ##### ######## ############# ##################### +## C code. + +critcl::ccode { + #define STATE_INIT 0 + #define STATE_MIX 1 + #define STATE_DONE 2 +} + +critcl::emap::def demo { + init STATE_INIT + mix STATE_MIX + done STATE_DONE +} -mode c +# Add -nocase as last argument for case-insensitive Tcl strings. + +critcl::cproc encode {Tcl_Interp* ip Tcl_Obj* state} int { + return demo_encode_cstr (Tcl_GetString(state)); +} + +critcl::cproc decode {Tcl_Interp* ip int scode} object { + Tcl_Obj* res = Tcl_NewStringObj (demo_decode_cstr (scode), -1); + if (res) { Tcl_IncrRefCount (res); } + return res; +} + +# encode {exact filler} => 6 +# decode 5 => {global filler} + +# ### ### ### ######### ######### ######### +## Ready +package provide emap-c 1 diff -Nru critcl-3.1.9/examples/emap-c/example.tcl critcl-3.1.17+dfsg/examples/emap-c/example.tcl --- critcl-3.1.9/examples/emap-c/example.tcl 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/examples/emap-c/example.tcl 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,8 @@ + +package require emap-c + +ex encode mix ;# 1 +ex encode foo + +ex decode 0 ;# init +ex decode 55 diff -Nru critcl-3.1.9/examples/emapint/build.tcl critcl-3.1.17+dfsg/examples/emapint/build.tcl --- critcl-3.1.9/examples/emapint/build.tcl 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/examples/emapint/build.tcl 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,283 @@ +#!/bin/sh +# -*- tcl -*- \ +exec tclsh "$0" ${1+"$@"} +set me [file normalize [info script]] +set packages {emapint} +proc main {} { + global argv tcl_platform tag + set tag {} + if {![llength $argv]} { + if {$tcl_platform(platform) eq "windows"} { + set argv gui + } else { + set argv help + } + } + if {[catch { + eval _$argv + }]} usage + exit 0 +} +proc usage {{status 1}} { + global errorInfo + if {[info exists errorInfo] && ($errorInfo ne {}) && + ![string match {invalid command name "_*"*} $errorInfo] + } { + puts stderr $::errorInfo + exit + } + + global argv0 + set prefix "Usage: " + foreach c [lsort -dict [info commands _*]] { + set c [string range $c 1 end] + if {[catch { + H${c} + } res]} { + puts stderr "$prefix$argv0 $c args...\n" + } else { + puts stderr "$prefix$argv0 $c $res\n" + } + set prefix " " + } + exit $status +} +proc tag {t} { + global tag + set tag $t + return +} +proc myexit {} { + tag ok + puts DONE + return +} +proc log {args} { + global tag + set newline 1 + if {[lindex $args 0] eq "-nonewline"} { + set newline 0 + set args [lrange $args 1 end] + } + if {[llength $args] == 2} { + lassign $args chan text + if {$chan ni {stdout stderr}} { + ::_puts {*}[lrange [info level 0] 1 end] + return + } + } else { + set text [lindex $args 0] + set chan stdout + } + # chan <=> tag, if not overriden + if {[string match {Files left*} $text]} { + set tag warn + set text \n$text + } + if {$tag eq {}} { set tag $chan } + #::_puts $tag/$text + + .t insert end-1c $text $tag + set tag {} + if {$newline} { + .t insert end-1c \n + } + + update + return +} +proc +x {path} { + catch { file attributes $path -permissions u+x } + return +} +proc grep {file pattern} { + set lines [split [read [set chan [open $file r]]] \n] + close $chan + return [lsearch -all -inline -glob $lines $pattern] +} +proc version {file} { + set provisions [grep $file {*package provide*}] + #puts /$provisions/ + return [lindex $provisions 0 3] +} +proc Hhelp {} { return "\n\tPrint this help" } +proc _help {} { + usage 0 + return +} +proc Hrecipes {} { return "\n\tList all brew commands, without details." } +proc _recipes {} { + set r {} + foreach c [info commands _*] { + lappend r [string range $c 1 end] + } + puts [lsort -dict $r] + return +} +proc Hinstall {} { return "?destination?\n\tInstall all packages, and application.\n\tdestination = path of package directory, default \[info library\]." } +proc _install {{ldir {}}} { + global packages + if {[llength [info level 0]] < 2} { + set ldir [info library] + set idir [file dirname [file dirname $ldir]]/include + } else { + set idir [file dirname $ldir]/include + } + + # Create directories, might not exist. + file mkdir $idir + file mkdir $ldir + + package require critcl::app + + foreach p $packages { + set src [file dirname $::me]/$p.tcl + set version [version $src] + + file delete -force [pwd]/BUILD + critcl::app::main [list -cache [pwd]/BUILD -libdir $ldir -includedir $idir -pkg $src] + + if {![file exists $ldir/$p]} { + set ::NOTE {warn {DONE, with FAILURES}} + break + } + + file delete -force $ldir/$p$version + file rename $ldir/$p $ldir/$p$version + + puts -nonewline "Installed package: " + tag ok + puts $ldir/$p$version + } + return +} +proc Hdebug {} { return "?destination?\n\tInstall debug builds of all packages.\n\tdestination = path of package directory, default \[info library\]." } +proc _debug {{ldir {}}} { + global packages + if {[llength [info level 0]] < 2} { + set ldir [info library] + set idir [file dirname [file dirname $ldir]]/include + } else { + set idir [file dirname $ldir]/include + } + + # Create directories, might not exist. + file mkdir $idir + file mkdir $ldir + + package require critcl::app + + foreach p $packages { + set src [file dirname $::me]/$p.tcl + set version [version $src] + + file delete -force [pwd]/BUILD.$p + critcl::app::main [list -cache [pwd]/BUILD.$p -keep -debug all -libdir $ldir -includedir $idir -pkg $src] + + if {![file exists $ldir/$p]} { + set ::NOTE {warn {DONE, with FAILURES}} + break + } + + file delete -force $ldir/$p$version + file rename $ldir/$p $ldir/$p$version + + puts -nonewline "Installed package: " + tag ok + puts $ldir/$p$version + } + return +} +proc Hgui {} { return "\n\tInstall all packages, and application.\n\tDone from a small GUI." } +proc _gui {} { + global INSTALLPATH + package require Tk + package require widget::scrolledwindow + + wm protocol . WM_DELETE_WINDOW ::_exit + + label .l -text {Install Path: } + entry .e -textvariable ::INSTALLPATH + button .i -command Install -text Install + + widget::scrolledwindow .st -borderwidth 1 -relief sunken + text .t + .st setwidget .t + + .t tag configure stdout -font {Helvetica 8} + .t tag configure stderr -background red -font {Helvetica 12} + .t tag configure ok -background green -font {Helvetica 8} + .t tag configure warn -background yellow -font {Helvetica 12} + + grid .l -row 0 -column 0 -sticky new + grid .e -row 0 -column 1 -sticky new + grid .i -row 0 -column 2 -sticky new + grid .st -row 1 -column 0 -sticky swen -columnspan 2 + + grid rowconfigure . 0 -weight 0 + grid rowconfigure . 1 -weight 1 + + grid columnconfigure . 0 -weight 0 + grid columnconfigure . 1 -weight 1 + grid columnconfigure . 2 -weight 0 + + set INSTALLPATH [info library] + + # Redirect all output into our log window, and disable uncontrolled exit. + rename ::puts ::_puts + rename ::log ::puts + rename ::exit ::_exit + rename ::myexit ::exit + + # And start to interact with the user. + vwait forever + return +} +proc Install {} { + global INSTALLPATH NOTE + .i configure -state disabled + + set NOTE {ok DONE} + set fail [catch { + _install $INSTALLPATH + + puts "" + tag [lindex $NOTE 0] + puts [lindex $NOTE 1] + } e o] + + .i configure -state normal + .i configure -command ::_exit -text Exit -bg green + + if {$fail} { + # rethrow + return {*}$o $e + } + return +} +proc Hwrap4tea {} { return "?destination?\n\tGenerate a source package with TEA-based build system wrapped around critcl.\n\tdestination = path of source package directory, default is sub-directory 'tea' of the CWD." } +proc _wrap4tea {{dst {}}} { + global packages + + if {[llength [info level 0]] < 2} { + set dst [file join [pwd] tea] + } + + file mkdir $dst + + package require critcl::app + + foreach p $packages { + set src [file dirname $::me]/$p.tcl + set version [version $src] + + file delete -force [pwd]/BUILD + critcl::app::main [list -cache [pwd]/BUILD -libdir $dst -tea $src] + file delete -force $dst/$p$version + file rename $dst/$p $dst/$p$version + + puts "Wrapped package: $dst/$p$version" + } + return +} +main diff -Nru critcl-3.1.9/examples/emapint/cr.tcl critcl-3.1.17+dfsg/examples/emapint/cr.tcl --- critcl-3.1.9/examples/emapint/cr.tcl 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/examples/emapint/cr.tcl 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,45 @@ +#!/usr/bin/env tclsh +# -*- tcl -*- +# Run the example via mode "compile & run". +# Note: generic code, same in all examples. + +cd [file dirname [file normalize [info script]]] +source ../../lib/critcl/critcl.tcl + +# Show the config +puts "" +puts "target-config: [critcl::targetconfig]" +puts "target-platform: [critcl::targetplatform]" +puts "target-actual: [critcl::actualtarget]" +puts "build-platform: [critcl::buildplatform]" +puts "cache: [critcl::cache]" +puts "" + +# Pull the package, ignoring build and examples ... +foreach f [glob *.tcl] { + if {[string match build* $f]} continue + if {[string match cr* $f]} continue + if {[string match example* $f]} continue + + puts "Reading $f ..." + source $f +} + +proc ex {args} { + set code [catch {uplevel 1 $args} result] + set code [string map {0 ok 1 error 2 break 3 continue} $code] + set max [expr {80 - [string length $args] - [string length "Example: "]}] + puts "Example: $args [string repeat _ $max]" + puts "Code: (($code))" + puts "Result: (($result))" + puts "" + return +} + +# ... and run the examples. +foreach f [glob -nocomplain example*] { + puts "Running $f ..." + source $f +} + +exit diff -Nru critcl-3.1.9/examples/emapint/emapint.tcl critcl-3.1.17+dfsg/examples/emapint/emapint.tcl --- critcl-3.1.9/examples/emapint/emapint.tcl 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/examples/emapint/emapint.tcl 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,74 @@ +# emap_ex.tcl -- +# +# A template demonstrating the handling of emap conversions. +# +# Copyright (c) 2014 Andreas Kupries + +# # ## ### ##### ######## ############# ##################### +## Requirements + +package require Tcl 8.4 +package require critcl 3.1.11 +package require critcl::emap 1 + +# # ## ### ##### ######## ############# ##################### +## Administrivia + +critcl::license {Andreas Kupries} BSD + +critcl::summary {Bitmap conversion} + +critcl::description { + This package implements nothing. It serves only as a + demonstration and template on how to declare an emap + converter and use it in cproc's or ccommand's. +} + +critcl::subject demonstration {emap conversion} {encode emap} \ + {decode emap} {convert emap} + +# # ## ### ##### ######## ############# ##################### +## C code. + +critcl::emap::def demo { + init 0 + start 0 + mix 1 + final 2 + done 2 +} -nocase +# Add +# loop 5 +# to the spec to see an example with a hole in the code sequence. +# Append -nocase as last arg to make encoding case-insensitive. + +critcl::cproc encode {Tcl_Interp* ip Tcl_Obj* state} int { + int scode; + if (demo_encode (ip, state, &scode) != TCL_OK) { + return -1; + } + return scode; +} + +critcl::cproc decode {Tcl_Interp* ip int scode} object { + Tcl_Obj* res = demo_decode (ip, scode); + if (res) { Tcl_IncrRefCount (res); } + return res; +} + +# Encode hidden in the argtype. +critcl::cproc xencode {Tcl_Interp* ip demo state} int { + return state; +} + +# Decode hidden in the resultype +critcl::cproc xdecode {Tcl_Interp* ip int state} demo { + return state; +} + +# encode {exact filler} => 6 +# decode 5 => {global filler} + +# ### ### ### ######### ######### ######### +## Ready +package provide emapint 1 diff -Nru critcl-3.1.9/examples/emapint/example.tcl critcl-3.1.17+dfsg/examples/emapint/example.tcl --- critcl-3.1.9/examples/emapint/example.tcl 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/examples/emapint/example.tcl 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,16 @@ + +package require emapint + +ex encode mix ;# 1 +ex xencode done ;# 2 + +ex decode 0 ;# init +ex xdecode 1 ;# mix + +ex encode foo +ex xencode bar +ex decode 55 +ex decode 4 +ex xdecode -2 +ex xdecode 4 +ex xencode MIX diff -Nru critcl-3.1.9/examples/emapint-both/build.tcl critcl-3.1.17+dfsg/examples/emapint-both/build.tcl --- critcl-3.1.9/examples/emapint-both/build.tcl 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/examples/emapint-both/build.tcl 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,283 @@ +#!/bin/sh +# -*- tcl -*- \ +exec tclsh "$0" ${1+"$@"} +set me [file normalize [info script]] +set packages {emapint-both} +proc main {} { + global argv tcl_platform tag + set tag {} + if {![llength $argv]} { + if {$tcl_platform(platform) eq "windows"} { + set argv gui + } else { + set argv help + } + } + if {[catch { + eval _$argv + }]} usage + exit 0 +} +proc usage {{status 1}} { + global errorInfo + if {[info exists errorInfo] && ($errorInfo ne {}) && + ![string match {invalid command name "_*"*} $errorInfo] + } { + puts stderr $::errorInfo + exit + } + + global argv0 + set prefix "Usage: " + foreach c [lsort -dict [info commands _*]] { + set c [string range $c 1 end] + if {[catch { + H${c} + } res]} { + puts stderr "$prefix$argv0 $c args...\n" + } else { + puts stderr "$prefix$argv0 $c $res\n" + } + set prefix " " + } + exit $status +} +proc tag {t} { + global tag + set tag $t + return +} +proc myexit {} { + tag ok + puts DONE + return +} +proc log {args} { + global tag + set newline 1 + if {[lindex $args 0] eq "-nonewline"} { + set newline 0 + set args [lrange $args 1 end] + } + if {[llength $args] == 2} { + lassign $args chan text + if {$chan ni {stdout stderr}} { + ::_puts {*}[lrange [info level 0] 1 end] + return + } + } else { + set text [lindex $args 0] + set chan stdout + } + # chan <=> tag, if not overriden + if {[string match {Files left*} $text]} { + set tag warn + set text \n$text + } + if {$tag eq {}} { set tag $chan } + #::_puts $tag/$text + + .t insert end-1c $text $tag + set tag {} + if {$newline} { + .t insert end-1c \n + } + + update + return +} +proc +x {path} { + catch { file attributes $path -permissions u+x } + return +} +proc grep {file pattern} { + set lines [split [read [set chan [open $file r]]] \n] + close $chan + return [lsearch -all -inline -glob $lines $pattern] +} +proc version {file} { + set provisions [grep $file {*package provide*}] + #puts /$provisions/ + return [lindex $provisions 0 3] +} +proc Hhelp {} { return "\n\tPrint this help" } +proc _help {} { + usage 0 + return +} +proc Hrecipes {} { return "\n\tList all brew commands, without details." } +proc _recipes {} { + set r {} + foreach c [info commands _*] { + lappend r [string range $c 1 end] + } + puts [lsort -dict $r] + return +} +proc Hinstall {} { return "?destination?\n\tInstall all packages, and application.\n\tdestination = path of package directory, default \[info library\]." } +proc _install {{ldir {}}} { + global packages + if {[llength [info level 0]] < 2} { + set ldir [info library] + set idir [file dirname [file dirname $ldir]]/include + } else { + set idir [file dirname $ldir]/include + } + + # Create directories, might not exist. + file mkdir $idir + file mkdir $ldir + + package require critcl::app + + foreach p $packages { + set src [file dirname $::me]/$p.tcl + set version [version $src] + + file delete -force [pwd]/BUILD + critcl::app::main [list -cache [pwd]/BUILD -libdir $ldir -includedir $idir -pkg $src] + + if {![file exists $ldir/$p]} { + set ::NOTE {warn {DONE, with FAILURES}} + break + } + + file delete -force $ldir/$p$version + file rename $ldir/$p $ldir/$p$version + + puts -nonewline "Installed package: " + tag ok + puts $ldir/$p$version + } + return +} +proc Hdebug {} { return "?destination?\n\tInstall debug builds of all packages.\n\tdestination = path of package directory, default \[info library\]." } +proc _debug {{ldir {}}} { + global packages + if {[llength [info level 0]] < 2} { + set ldir [info library] + set idir [file dirname [file dirname $ldir]]/include + } else { + set idir [file dirname $ldir]/include + } + + # Create directories, might not exist. + file mkdir $idir + file mkdir $ldir + + package require critcl::app + + foreach p $packages { + set src [file dirname $::me]/$p.tcl + set version [version $src] + + file delete -force [pwd]/BUILD.$p + critcl::app::main [list -cache [pwd]/BUILD.$p -keep -debug all -libdir $ldir -includedir $idir -pkg $src] + + if {![file exists $ldir/$p]} { + set ::NOTE {warn {DONE, with FAILURES}} + break + } + + file delete -force $ldir/$p$version + file rename $ldir/$p $ldir/$p$version + + puts -nonewline "Installed package: " + tag ok + puts $ldir/$p$version + } + return +} +proc Hgui {} { return "\n\tInstall all packages, and application.\n\tDone from a small GUI." } +proc _gui {} { + global INSTALLPATH + package require Tk + package require widget::scrolledwindow + + wm protocol . WM_DELETE_WINDOW ::_exit + + label .l -text {Install Path: } + entry .e -textvariable ::INSTALLPATH + button .i -command Install -text Install + + widget::scrolledwindow .st -borderwidth 1 -relief sunken + text .t + .st setwidget .t + + .t tag configure stdout -font {Helvetica 8} + .t tag configure stderr -background red -font {Helvetica 12} + .t tag configure ok -background green -font {Helvetica 8} + .t tag configure warn -background yellow -font {Helvetica 12} + + grid .l -row 0 -column 0 -sticky new + grid .e -row 0 -column 1 -sticky new + grid .i -row 0 -column 2 -sticky new + grid .st -row 1 -column 0 -sticky swen -columnspan 2 + + grid rowconfigure . 0 -weight 0 + grid rowconfigure . 1 -weight 1 + + grid columnconfigure . 0 -weight 0 + grid columnconfigure . 1 -weight 1 + grid columnconfigure . 2 -weight 0 + + set INSTALLPATH [info library] + + # Redirect all output into our log window, and disable uncontrolled exit. + rename ::puts ::_puts + rename ::log ::puts + rename ::exit ::_exit + rename ::myexit ::exit + + # And start to interact with the user. + vwait forever + return +} +proc Install {} { + global INSTALLPATH NOTE + .i configure -state disabled + + set NOTE {ok DONE} + set fail [catch { + _install $INSTALLPATH + + puts "" + tag [lindex $NOTE 0] + puts [lindex $NOTE 1] + } e o] + + .i configure -state normal + .i configure -command ::_exit -text Exit -bg green + + if {$fail} { + # rethrow + return {*}$o $e + } + return +} +proc Hwrap4tea {} { return "?destination?\n\tGenerate a source package with TEA-based build system wrapped around critcl.\n\tdestination = path of source package directory, default is sub-directory 'tea' of the CWD." } +proc _wrap4tea {{dst {}}} { + global packages + + if {[llength [info level 0]] < 2} { + set dst [file join [pwd] tea] + } + + file mkdir $dst + + package require critcl::app + + foreach p $packages { + set src [file dirname $::me]/$p.tcl + set version [version $src] + + file delete -force [pwd]/BUILD + critcl::app::main [list -cache [pwd]/BUILD -libdir $dst -tea $src] + file delete -force $dst/$p$version + file rename $dst/$p $dst/$p$version + + puts "Wrapped package: $dst/$p$version" + } + return +} +main diff -Nru critcl-3.1.9/examples/emapint-both/cr.tcl critcl-3.1.17+dfsg/examples/emapint-both/cr.tcl --- critcl-3.1.9/examples/emapint-both/cr.tcl 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/examples/emapint-both/cr.tcl 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,45 @@ +#!/usr/bin/env tclsh +# -*- tcl -*- +# Run the example via mode "compile & run". +# Note: generic code, same in all examples. + +cd [file dirname [file normalize [info script]]] +source ../../lib/critcl/critcl.tcl + +# Show the config +puts "" +puts "target-config: [critcl::targetconfig]" +puts "target-platform: [critcl::targetplatform]" +puts "target-actual: [critcl::actualtarget]" +puts "build-platform: [critcl::buildplatform]" +puts "cache: [critcl::cache]" +puts "" + +# Pull the package, ignoring build and examples ... +foreach f [glob *.tcl] { + if {[string match build* $f]} continue + if {[string match cr* $f]} continue + if {[string match example* $f]} continue + + puts "Reading $f ..." + source $f +} + +proc ex {args} { + set code [catch {uplevel 1 $args} result] + set code [string map {0 ok 1 error 2 break 3 continue} $code] + set max [expr {80 - [string length $args] - [string length "Example: "]}] + puts "Example: $args [string repeat _ $max]" + puts "Code: (($code))" + puts "Result: (($result))" + puts "" + return +} + +# ... and run the examples. +foreach f [glob -nocomplain example*] { + puts "Running $f ..." + source $f +} + +exit diff -Nru critcl-3.1.9/examples/emapint-both/emapint-both.tcl critcl-3.1.17+dfsg/examples/emapint-both/emapint-both.tcl --- critcl-3.1.9/examples/emapint-both/emapint-both.tcl 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/examples/emapint-both/emapint-both.tcl 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,70 @@ +# emap_ex.tcl -- +# +# A template demonstrating the handling of emap conversions. +# +# Copyright (c) 2014 Andreas Kupries + +# # ## ### ##### ######## ############# ##################### +## Requirements + +package require Tcl 8.4 +package require critcl 3.1.11 +package require critcl::emap 1 + +# # ## ### ##### ######## ############# ##################### +## Administrivia + +critcl::license {Andreas Kupries} BSD + +critcl::summary {Bitmap conversion} + +critcl::description { + This package implements nothing. It serves only as a + demonstration and template on how to declare an emap + converter and use it in cproc's or ccommand's. +} + +critcl::subject demonstration {emap conversion} {encode emap} \ + {decode emap} {convert emap} + +# # ## ### ##### ######## ############# ##################### +## C code. + +critcl::emap::def demo { + init 0 + start 0 + mix 1 + final 2 + done 2 +} -nocase -mode {c tcl} +# Add +# loop 5 +# to the spec to see an example with a hole in the code sequence. +# Append -nocase as last arg to make encoding case-insensitive. + +critcl::cproc encode {Tcl_Interp* ip Tcl_Obj* state} int { + return demo_encode_cstr (Tcl_GetString(state)); +} + +critcl::cproc decode {Tcl_Interp* ip int scode} object { + Tcl_Obj* res = Tcl_NewStringObj (demo_decode_cstr (scode), -1); + if (res) { Tcl_IncrRefCount (res); } + return res; +} + +# Encode hidden in the argtype. +critcl::cproc xencode {Tcl_Interp* ip demo state} int { + return state; +} + +# Decode hidden in the resultype +critcl::cproc xdecode {Tcl_Interp* ip int state} demo { + return state; +} + +# encode {exact filler} => 6 +# decode 5 => {global filler} + +# ### ### ### ######### ######### ######### +## Ready +package provide emapint-both 1 diff -Nru critcl-3.1.9/examples/emapint-both/example.tcl critcl-3.1.17+dfsg/examples/emapint-both/example.tcl --- critcl-3.1.9/examples/emapint-both/example.tcl 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/examples/emapint-both/example.tcl 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,16 @@ + +package require emapint-both + +ex encode mix ;# 1 +ex xencode done ;# 2 + +ex decode 0 ;# init +ex xdecode 1 ;# mix + +ex encode foo +ex xencode bar +ex decode 55 +ex decode 4 +ex xdecode -2 +ex xdecode 4 +ex xencode MIX diff -Nru critcl-3.1.9/examples/emapint-c/build.tcl critcl-3.1.17+dfsg/examples/emapint-c/build.tcl --- critcl-3.1.9/examples/emapint-c/build.tcl 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/examples/emapint-c/build.tcl 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,283 @@ +#!/bin/sh +# -*- tcl -*- \ +exec tclsh "$0" ${1+"$@"} +set me [file normalize [info script]] +set packages {emapint-c} +proc main {} { + global argv tcl_platform tag + set tag {} + if {![llength $argv]} { + if {$tcl_platform(platform) eq "windows"} { + set argv gui + } else { + set argv help + } + } + if {[catch { + eval _$argv + }]} usage + exit 0 +} +proc usage {{status 1}} { + global errorInfo + if {[info exists errorInfo] && ($errorInfo ne {}) && + ![string match {invalid command name "_*"*} $errorInfo] + } { + puts stderr $::errorInfo + exit + } + + global argv0 + set prefix "Usage: " + foreach c [lsort -dict [info commands _*]] { + set c [string range $c 1 end] + if {[catch { + H${c} + } res]} { + puts stderr "$prefix$argv0 $c args...\n" + } else { + puts stderr "$prefix$argv0 $c $res\n" + } + set prefix " " + } + exit $status +} +proc tag {t} { + global tag + set tag $t + return +} +proc myexit {} { + tag ok + puts DONE + return +} +proc log {args} { + global tag + set newline 1 + if {[lindex $args 0] eq "-nonewline"} { + set newline 0 + set args [lrange $args 1 end] + } + if {[llength $args] == 2} { + lassign $args chan text + if {$chan ni {stdout stderr}} { + ::_puts {*}[lrange [info level 0] 1 end] + return + } + } else { + set text [lindex $args 0] + set chan stdout + } + # chan <=> tag, if not overriden + if {[string match {Files left*} $text]} { + set tag warn + set text \n$text + } + if {$tag eq {}} { set tag $chan } + #::_puts $tag/$text + + .t insert end-1c $text $tag + set tag {} + if {$newline} { + .t insert end-1c \n + } + + update + return +} +proc +x {path} { + catch { file attributes $path -permissions u+x } + return +} +proc grep {file pattern} { + set lines [split [read [set chan [open $file r]]] \n] + close $chan + return [lsearch -all -inline -glob $lines $pattern] +} +proc version {file} { + set provisions [grep $file {*package provide*}] + #puts /$provisions/ + return [lindex $provisions 0 3] +} +proc Hhelp {} { return "\n\tPrint this help" } +proc _help {} { + usage 0 + return +} +proc Hrecipes {} { return "\n\tList all brew commands, without details." } +proc _recipes {} { + set r {} + foreach c [info commands _*] { + lappend r [string range $c 1 end] + } + puts [lsort -dict $r] + return +} +proc Hinstall {} { return "?destination?\n\tInstall all packages, and application.\n\tdestination = path of package directory, default \[info library\]." } +proc _install {{ldir {}}} { + global packages + if {[llength [info level 0]] < 2} { + set ldir [info library] + set idir [file dirname [file dirname $ldir]]/include + } else { + set idir [file dirname $ldir]/include + } + + # Create directories, might not exist. + file mkdir $idir + file mkdir $ldir + + package require critcl::app + + foreach p $packages { + set src [file dirname $::me]/$p.tcl + set version [version $src] + + file delete -force [pwd]/BUILD + critcl::app::main [list -cache [pwd]/BUILD -libdir $ldir -includedir $idir -pkg $src] + + if {![file exists $ldir/$p]} { + set ::NOTE {warn {DONE, with FAILURES}} + break + } + + file delete -force $ldir/$p$version + file rename $ldir/$p $ldir/$p$version + + puts -nonewline "Installed package: " + tag ok + puts $ldir/$p$version + } + return +} +proc Hdebug {} { return "?destination?\n\tInstall debug builds of all packages.\n\tdestination = path of package directory, default \[info library\]." } +proc _debug {{ldir {}}} { + global packages + if {[llength [info level 0]] < 2} { + set ldir [info library] + set idir [file dirname [file dirname $ldir]]/include + } else { + set idir [file dirname $ldir]/include + } + + # Create directories, might not exist. + file mkdir $idir + file mkdir $ldir + + package require critcl::app + + foreach p $packages { + set src [file dirname $::me]/$p.tcl + set version [version $src] + + file delete -force [pwd]/BUILD.$p + critcl::app::main [list -cache [pwd]/BUILD.$p -keep -debug all -libdir $ldir -includedir $idir -pkg $src] + + if {![file exists $ldir/$p]} { + set ::NOTE {warn {DONE, with FAILURES}} + break + } + + file delete -force $ldir/$p$version + file rename $ldir/$p $ldir/$p$version + + puts -nonewline "Installed package: " + tag ok + puts $ldir/$p$version + } + return +} +proc Hgui {} { return "\n\tInstall all packages, and application.\n\tDone from a small GUI." } +proc _gui {} { + global INSTALLPATH + package require Tk + package require widget::scrolledwindow + + wm protocol . WM_DELETE_WINDOW ::_exit + + label .l -text {Install Path: } + entry .e -textvariable ::INSTALLPATH + button .i -command Install -text Install + + widget::scrolledwindow .st -borderwidth 1 -relief sunken + text .t + .st setwidget .t + + .t tag configure stdout -font {Helvetica 8} + .t tag configure stderr -background red -font {Helvetica 12} + .t tag configure ok -background green -font {Helvetica 8} + .t tag configure warn -background yellow -font {Helvetica 12} + + grid .l -row 0 -column 0 -sticky new + grid .e -row 0 -column 1 -sticky new + grid .i -row 0 -column 2 -sticky new + grid .st -row 1 -column 0 -sticky swen -columnspan 2 + + grid rowconfigure . 0 -weight 0 + grid rowconfigure . 1 -weight 1 + + grid columnconfigure . 0 -weight 0 + grid columnconfigure . 1 -weight 1 + grid columnconfigure . 2 -weight 0 + + set INSTALLPATH [info library] + + # Redirect all output into our log window, and disable uncontrolled exit. + rename ::puts ::_puts + rename ::log ::puts + rename ::exit ::_exit + rename ::myexit ::exit + + # And start to interact with the user. + vwait forever + return +} +proc Install {} { + global INSTALLPATH NOTE + .i configure -state disabled + + set NOTE {ok DONE} + set fail [catch { + _install $INSTALLPATH + + puts "" + tag [lindex $NOTE 0] + puts [lindex $NOTE 1] + } e o] + + .i configure -state normal + .i configure -command ::_exit -text Exit -bg green + + if {$fail} { + # rethrow + return {*}$o $e + } + return +} +proc Hwrap4tea {} { return "?destination?\n\tGenerate a source package with TEA-based build system wrapped around critcl.\n\tdestination = path of source package directory, default is sub-directory 'tea' of the CWD." } +proc _wrap4tea {{dst {}}} { + global packages + + if {[llength [info level 0]] < 2} { + set dst [file join [pwd] tea] + } + + file mkdir $dst + + package require critcl::app + + foreach p $packages { + set src [file dirname $::me]/$p.tcl + set version [version $src] + + file delete -force [pwd]/BUILD + critcl::app::main [list -cache [pwd]/BUILD -libdir $dst -tea $src] + file delete -force $dst/$p$version + file rename $dst/$p $dst/$p$version + + puts "Wrapped package: $dst/$p$version" + } + return +} +main diff -Nru critcl-3.1.9/examples/emapint-c/cr.tcl critcl-3.1.17+dfsg/examples/emapint-c/cr.tcl --- critcl-3.1.9/examples/emapint-c/cr.tcl 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/examples/emapint-c/cr.tcl 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,45 @@ +#!/usr/bin/env tclsh +# -*- tcl -*- +# Run the example via mode "compile & run". +# Note: generic code, same in all examples. + +cd [file dirname [file normalize [info script]]] +source ../../lib/critcl/critcl.tcl + +# Show the config +puts "" +puts "target-config: [critcl::targetconfig]" +puts "target-platform: [critcl::targetplatform]" +puts "target-actual: [critcl::actualtarget]" +puts "build-platform: [critcl::buildplatform]" +puts "cache: [critcl::cache]" +puts "" + +# Pull the package, ignoring build and examples ... +foreach f [glob *.tcl] { + if {[string match build* $f]} continue + if {[string match cr* $f]} continue + if {[string match example* $f]} continue + + puts "Reading $f ..." + source $f +} + +proc ex {args} { + set code [catch {uplevel 1 $args} result] + set code [string map {0 ok 1 error 2 break 3 continue} $code] + set max [expr {80 - [string length $args] - [string length "Example: "]}] + puts "Example: $args [string repeat _ $max]" + puts "Code: (($code))" + puts "Result: (($result))" + puts "" + return +} + +# ... and run the examples. +foreach f [glob -nocomplain example*] { + puts "Running $f ..." + source $f +} + +exit diff -Nru critcl-3.1.9/examples/emapint-c/emapint-c.tcl critcl-3.1.17+dfsg/examples/emapint-c/emapint-c.tcl --- critcl-3.1.9/examples/emapint-c/emapint-c.tcl 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/examples/emapint-c/emapint-c.tcl 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,60 @@ +# emap_ex.tcl -- +# +# A template demonstrating the handling of emap conversions. +# +# Copyright (c) 2014 Andreas Kupries + +# # ## ### ##### ######## ############# ##################### +## Requirements + +package require Tcl 8.4 +package require critcl 3.1.11 +package require critcl::emap 1 + +# # ## ### ##### ######## ############# ##################### +## Administrivia + +critcl::license {Andreas Kupries} BSD + +critcl::summary {Bitmap conversion} + +critcl::description { + This package implements nothing. It serves only as a + demonstration and template on how to declare an emap + converter and use it in cproc's or ccommand's. +} + +critcl::subject demonstration {emap conversion} {encode emap} \ + {decode emap} {convert emap} + +# # ## ### ##### ######## ############# ##################### +## C code. + +critcl::emap::def demo { + init 0 + start 0 + mix 1 + final 2 + done 2 +} -nocase -mode c +# Add +# loop 5 +# to the spec to see an example with a hole in the code sequence. +# Append -nocase as last arg to make encoding case-insensitive. + +critcl::cproc encode {Tcl_Interp* ip Tcl_Obj* state} int { + return demo_encode_cstr (Tcl_GetString(state)); +} + +critcl::cproc decode {Tcl_Interp* ip int scode} object { + Tcl_Obj* res = Tcl_NewStringObj (demo_decode_cstr (scode), -1); + if (res) { Tcl_IncrRefCount (res); } + return res; +} + +# encode {exact filler} => 6 +# decode 5 => {global filler} + +# ### ### ### ######### ######### ######### +## Ready +package provide emapint-c 1 diff -Nru critcl-3.1.9/examples/emapint-c/example.tcl critcl-3.1.17+dfsg/examples/emapint-c/example.tcl --- critcl-3.1.9/examples/emapint-c/example.tcl 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/examples/emapint-c/example.tcl 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,9 @@ + +package require emapint-c + +ex encode mix ;# 1 +ex encode foo + +ex decode 0 ;# init +ex decode 55 +ex decode 4 diff -Nru critcl-3.1.9/examples/enum/build.tcl critcl-3.1.17+dfsg/examples/enum/build.tcl --- critcl-3.1.9/examples/enum/build.tcl 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/examples/enum/build.tcl 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,283 @@ +#!/bin/sh +# -*- tcl -*- \ +exec tclsh "$0" ${1+"$@"} +set me [file normalize [info script]] +set packages {enum} +proc main {} { + global argv tcl_platform tag + set tag {} + if {![llength $argv]} { + if {$tcl_platform(platform) eq "windows"} { + set argv gui + } else { + set argv help + } + } + if {[catch { + eval _$argv + }]} usage + exit 0 +} +proc usage {{status 1}} { + global errorInfo + if {[info exists errorInfo] && ($errorInfo ne {}) && + ![string match {invalid command name "_*"*} $errorInfo] + } { + puts stderr $::errorInfo + exit + } + + global argv0 + set prefix "Usage: " + foreach c [lsort -dict [info commands _*]] { + set c [string range $c 1 end] + if {[catch { + H${c} + } res]} { + puts stderr "$prefix$argv0 $c args...\n" + } else { + puts stderr "$prefix$argv0 $c $res\n" + } + set prefix " " + } + exit $status +} +proc tag {t} { + global tag + set tag $t + return +} +proc myexit {} { + tag ok + puts DONE + return +} +proc log {args} { + global tag + set newline 1 + if {[lindex $args 0] eq "-nonewline"} { + set newline 0 + set args [lrange $args 1 end] + } + if {[llength $args] == 2} { + lassign $args chan text + if {$chan ni {stdout stderr}} { + ::_puts {*}[lrange [info level 0] 1 end] + return + } + } else { + set text [lindex $args 0] + set chan stdout + } + # chan <=> tag, if not overriden + if {[string match {Files left*} $text]} { + set tag warn + set text \n$text + } + if {$tag eq {}} { set tag $chan } + #::_puts $tag/$text + + .t insert end-1c $text $tag + set tag {} + if {$newline} { + .t insert end-1c \n + } + + update + return +} +proc +x {path} { + catch { file attributes $path -permissions u+x } + return +} +proc grep {file pattern} { + set lines [split [read [set chan [open $file r]]] \n] + close $chan + return [lsearch -all -inline -glob $lines $pattern] +} +proc version {file} { + set provisions [grep $file {*package provide*}] + #puts /$provisions/ + return [lindex $provisions 0 3] +} +proc Hhelp {} { return "\n\tPrint this help" } +proc _help {} { + usage 0 + return +} +proc Hrecipes {} { return "\n\tList all brew commands, without details." } +proc _recipes {} { + set r {} + foreach c [info commands _*] { + lappend r [string range $c 1 end] + } + puts [lsort -dict $r] + return +} +proc Hinstall {} { return "?destination?\n\tInstall all packages, and application.\n\tdestination = path of package directory, default \[info library\]." } +proc _install {{ldir {}}} { + global packages + if {[llength [info level 0]] < 2} { + set ldir [info library] + set idir [file dirname [file dirname $ldir]]/include + } else { + set idir [file dirname $ldir]/include + } + + # Create directories, might not exist. + file mkdir $idir + file mkdir $ldir + + package require critcl::app + + foreach p $packages { + set src [file dirname $::me]/$p.tcl + set version [version $src] + + file delete -force [pwd]/BUILD + critcl::app::main [list -cache [pwd]/BUILD -libdir $ldir -includedir $idir -pkg $src] + + if {![file exists $ldir/$p]} { + set ::NOTE {warn {DONE, with FAILURES}} + break + } + + file delete -force $ldir/$p$version + file rename $ldir/$p $ldir/$p$version + + puts -nonewline "Installed package: " + tag ok + puts $ldir/$p$version + } + return +} +proc Hdebug {} { return "?destination?\n\tInstall debug builds of all packages.\n\tdestination = path of package directory, default \[info library\]." } +proc _debug {{ldir {}}} { + global packages + if {[llength [info level 0]] < 2} { + set ldir [info library] + set idir [file dirname [file dirname $ldir]]/include + } else { + set idir [file dirname $ldir]/include + } + + # Create directories, might not exist. + file mkdir $idir + file mkdir $ldir + + package require critcl::app + + foreach p $packages { + set src [file dirname $::me]/$p.tcl + set version [version $src] + + file delete -force [pwd]/BUILD.$p + critcl::app::main [list -cache [pwd]/BUILD.$p -keep -debug all -libdir $ldir -includedir $idir -pkg $src] + + if {![file exists $ldir/$p]} { + set ::NOTE {warn {DONE, with FAILURES}} + break + } + + file delete -force $ldir/$p$version + file rename $ldir/$p $ldir/$p$version + + puts -nonewline "Installed package: " + tag ok + puts $ldir/$p$version + } + return +} +proc Hgui {} { return "\n\tInstall all packages, and application.\n\tDone from a small GUI." } +proc _gui {} { + global INSTALLPATH + package require Tk + package require widget::scrolledwindow + + wm protocol . WM_DELETE_WINDOW ::_exit + + label .l -text {Install Path: } + entry .e -textvariable ::INSTALLPATH + button .i -command Install -text Install + + widget::scrolledwindow .st -borderwidth 1 -relief sunken + text .t + .st setwidget .t + + .t tag configure stdout -font {Helvetica 8} + .t tag configure stderr -background red -font {Helvetica 12} + .t tag configure ok -background green -font {Helvetica 8} + .t tag configure warn -background yellow -font {Helvetica 12} + + grid .l -row 0 -column 0 -sticky new + grid .e -row 0 -column 1 -sticky new + grid .i -row 0 -column 2 -sticky new + grid .st -row 1 -column 0 -sticky swen -columnspan 2 + + grid rowconfigure . 0 -weight 0 + grid rowconfigure . 1 -weight 1 + + grid columnconfigure . 0 -weight 0 + grid columnconfigure . 1 -weight 1 + grid columnconfigure . 2 -weight 0 + + set INSTALLPATH [info library] + + # Redirect all output into our log window, and disable uncontrolled exit. + rename ::puts ::_puts + rename ::log ::puts + rename ::exit ::_exit + rename ::myexit ::exit + + # And start to interact with the user. + vwait forever + return +} +proc Install {} { + global INSTALLPATH NOTE + .i configure -state disabled + + set NOTE {ok DONE} + set fail [catch { + _install $INSTALLPATH + + puts "" + tag [lindex $NOTE 0] + puts [lindex $NOTE 1] + } e o] + + .i configure -state normal + .i configure -command ::_exit -text Exit -bg green + + if {$fail} { + # rethrow + return {*}$o $e + } + return +} +proc Hwrap4tea {} { return "?destination?\n\tGenerate a source package with TEA-based build system wrapped around critcl.\n\tdestination = path of source package directory, default is sub-directory 'tea' of the CWD." } +proc _wrap4tea {{dst {}}} { + global packages + + if {[llength [info level 0]] < 2} { + set dst [file join [pwd] tea] + } + + file mkdir $dst + + package require critcl::app + + foreach p $packages { + set src [file dirname $::me]/$p.tcl + set version [version $src] + + file delete -force [pwd]/BUILD + critcl::app::main [list -cache [pwd]/BUILD -libdir $dst -tea $src] + file delete -force $dst/$p$version + file rename $dst/$p $dst/$p$version + + puts "Wrapped package: $dst/$p$version" + } + return +} +main diff -Nru critcl-3.1.9/examples/enum/cr.tcl critcl-3.1.17+dfsg/examples/enum/cr.tcl --- critcl-3.1.9/examples/enum/cr.tcl 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/examples/enum/cr.tcl 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,45 @@ +#!/usr/bin/env tclsh +# -*- tcl -*- +# Run the example via mode "compile & run". +# Note: generic code, same in all examples. + +cd [file dirname [file normalize [info script]]] +source ../../lib/critcl/critcl.tcl + +# Show the config +puts "" +puts "target-config: [critcl::targetconfig]" +puts "target-platform: [critcl::targetplatform]" +puts "target-actual: [critcl::actualtarget]" +puts "build-platform: [critcl::buildplatform]" +puts "cache: [critcl::cache]" +puts "" + +# Pull the package, ignoring build and examples ... +foreach f [glob *.tcl] { + if {[string match build* $f]} continue + if {[string match cr* $f]} continue + if {[string match example* $f]} continue + + puts "Reading $f ..." + source $f +} + +proc ex {args} { + set code [catch {uplevel 1 $args} result] + set code [string map {0 ok 1 error 2 break 3 continue} $code] + set max [expr {80 - [string length $args] - [string length "Example: "]}] + puts "Example: $args [string repeat _ $max]" + puts "Code: (($code))" + puts "Result: (($result))" + puts "" + return +} + +# ... and run the examples. +foreach f [glob -nocomplain example*] { + puts "Running $f ..." + source $f +} + +exit diff -Nru critcl-3.1.9/examples/enum/enum.tcl critcl-3.1.17+dfsg/examples/enum/enum.tcl --- critcl-3.1.9/examples/enum/enum.tcl 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/examples/enum/enum.tcl 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,77 @@ +# bitmap.tcl -- +# +# A template demonstrating the handling of enum conversions. +# +# Copyright (c) 2014 Andreas Kupries + +# # ## ### ##### ######## ############# ##################### +## Requirements + +package require Tcl 8.4 +package require critcl 3.1.11 +package require critcl::enum 1 + +# # ## ### ##### ######## ############# ##################### +## Administrivia + +critcl::license {Andreas Kupries} BSD + +critcl::summary {Enum conversion} + +critcl::description { + This package implements nothing. It serves only as a + demonstration and template on how to declare an enum + converter and use it in cproc's or ccommand's. +} + +critcl::subject demonstration {enum conversion} {encode enum} \ + {decode enum} {convert enum} + +# # ## ### ##### ######## ############# ##################### +## C code. + +critcl::enum::def demo { + E_global global + E_exact exact + E_filler filler +} + +critcl::cproc encode {Tcl_Interp* ip Tcl_Obj* str} int { + int val; + demo_GetFromObj (ip, str, 0, &val); + return val; +} + +critcl::cproc decode {Tcl_Interp* ip int val} object { + Tcl_Obj* res = demo_ToObj (ip, val); + Tcl_IncrRefCount (res); + return res; +} + +# Encode hidden in the argtype. +critcl::cproc xencode {Tcl_Interp* ip demo str} int { + return str; +} + +# Encode hidden in the argtype. +critcl::cproc xencode-p {Tcl_Interp* ip demo-prefix str} int { + return str; +} + +# Decode hidden in the resultype +critcl::cproc xdecode {Tcl_Interp* ip int val} demo { + return val; +} + +# encode exact => 1 +# xencode filler => 2 +# xencode-p glob => 0 +# xencode glob => /error/ + +# decode 2 => filler +# xdecode 0 => global +# decode 8 => panic, abort, core dump + +# ### ### ### ######### ######### ######### +## Ready +package provide enum 1 diff -Nru critcl-3.1.9/examples/enum/example.tcl critcl-3.1.17+dfsg/examples/enum/example.tcl --- critcl-3.1.9/examples/enum/example.tcl 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/examples/enum/example.tcl 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,11 @@ + +ex encode exact +ex xencode filler +ex xencode-p glob +ex xencode glob + +ex decode 2 +ex xdecode 0 + +#ex decode 8 => panic, abort, core dump +#ex xdecode 8 ditto diff -Nru critcl-3.1.9/examples/icounter/cr.tcl critcl-3.1.17+dfsg/examples/icounter/cr.tcl --- critcl-3.1.9/examples/icounter/cr.tcl 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/examples/icounter/cr.tcl 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,45 @@ +#!/usr/bin/env tclsh +# -*- tcl -*- +# Run the example via mode "compile & run". +# Note: generic code, same in all examples. + +cd [file dirname [file normalize [info script]]] +source ../../lib/critcl/critcl.tcl + +# Show the config +puts "" +puts "target-config: [critcl::targetconfig]" +puts "target-platform: [critcl::targetplatform]" +puts "target-actual: [critcl::actualtarget]" +puts "build-platform: [critcl::buildplatform]" +puts "cache: [critcl::cache]" +puts "" + +# Pull the package, ignoring build and examples ... +foreach f [glob *.tcl] { + if {[string match build* $f]} continue + if {[string match cr* $f]} continue + if {[string match example* $f]} continue + + puts "Reading $f ..." + source $f +} + +proc ex {args} { + set code [catch {uplevel 1 $args} result] + set code [string map {0 ok 1 error 2 break 3 continue} $code] + set max [expr {80 - [string length $args] - [string length "Example: "]}] + puts "Example: $args [string repeat _ $max]" + puts "Code: (($code))" + puts "Result: (($result))" + puts "" + return +} + +# ... and run the examples. +foreach f [glob -nocomplain example*] { + puts "Running $f ..." + source $f +} + +exit diff -Nru critcl-3.1.9/examples/icounter/example.tcl critcl-3.1.17+dfsg/examples/icounter/example.tcl --- critcl-3.1.9/examples/icounter/example.tcl 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/examples/icounter/example.tcl 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,6 @@ + +# Force compile and load. +catch {icounter 4} + +ex icounter 0 +ex ::icounter -1 diff -Nru critcl-3.1.9/examples/lit-both/build.tcl critcl-3.1.17+dfsg/examples/lit-both/build.tcl --- critcl-3.1.9/examples/lit-both/build.tcl 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/examples/lit-both/build.tcl 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,283 @@ +#!/bin/sh +# -*- tcl -*- \ +exec tclsh "$0" ${1+"$@"} +set me [file normalize [info script]] +set packages {pool} +proc main {} { + global argv tcl_platform tag + set tag {} + if {![llength $argv]} { + if {$tcl_platform(platform) eq "windows"} { + set argv gui + } else { + set argv help + } + } + if {[catch { + eval _$argv + }]} usage + exit 0 +} +proc usage {{status 1}} { + global errorInfo + if {[info exists errorInfo] && ($errorInfo ne {}) && + ![string match {invalid command name "_*"*} $errorInfo] + } { + puts stderr $::errorInfo + exit + } + + global argv0 + set prefix "Usage: " + foreach c [lsort -dict [info commands _*]] { + set c [string range $c 1 end] + if {[catch { + H${c} + } res]} { + puts stderr "$prefix$argv0 $c args...\n" + } else { + puts stderr "$prefix$argv0 $c $res\n" + } + set prefix " " + } + exit $status +} +proc tag {t} { + global tag + set tag $t + return +} +proc myexit {} { + tag ok + puts DONE + return +} +proc log {args} { + global tag + set newline 1 + if {[lindex $args 0] eq "-nonewline"} { + set newline 0 + set args [lrange $args 1 end] + } + if {[llength $args] == 2} { + lassign $args chan text + if {$chan ni {stdout stderr}} { + ::_puts {*}[lrange [info level 0] 1 end] + return + } + } else { + set text [lindex $args 0] + set chan stdout + } + # chan <=> tag, if not overriden + if {[string match {Files left*} $text]} { + set tag warn + set text \n$text + } + if {$tag eq {}} { set tag $chan } + #::_puts $tag/$text + + .t insert end-1c $text $tag + set tag {} + if {$newline} { + .t insert end-1c \n + } + + update + return +} +proc +x {path} { + catch { file attributes $path -permissions u+x } + return +} +proc grep {file pattern} { + set lines [split [read [set chan [open $file r]]] \n] + close $chan + return [lsearch -all -inline -glob $lines $pattern] +} +proc version {file} { + set provisions [grep $file {*package provide*}] + #puts /$provisions/ + return [lindex $provisions 0 3] +} +proc Hhelp {} { return "\n\tPrint this help" } +proc _help {} { + usage 0 + return +} +proc Hrecipes {} { return "\n\tList all brew commands, without details." } +proc _recipes {} { + set r {} + foreach c [info commands _*] { + lappend r [string range $c 1 end] + } + puts [lsort -dict $r] + return +} +proc Hinstall {} { return "?destination?\n\tInstall all packages, and application.\n\tdestination = path of package directory, default \[info library\]." } +proc _install {{ldir {}}} { + global packages + if {[llength [info level 0]] < 2} { + set ldir [info library] + set idir [file dirname [file dirname $ldir]]/include + } else { + set idir [file dirname $ldir]/include + } + + # Create directories, might not exist. + file mkdir $idir + file mkdir $ldir + + package require critcl::app + + foreach p $packages { + set src [file dirname $::me]/$p.tcl + set version [version $src] + + file delete -force [pwd]/BUILD + critcl::app::main [list -cache [pwd]/BUILD -libdir $ldir -includedir $idir -pkg $src] + + if {![file exists $ldir/$p]} { + set ::NOTE {warn {DONE, with FAILURES}} + break + } + + file delete -force $ldir/$p$version + file rename $ldir/$p $ldir/$p$version + + puts -nonewline "Installed package: " + tag ok + puts $ldir/$p$version + } + return +} +proc Hdebug {} { return "?destination?\n\tInstall debug builds of all packages.\n\tdestination = path of package directory, default \[info library\]." } +proc _debug {{ldir {}}} { + global packages + if {[llength [info level 0]] < 2} { + set ldir [info library] + set idir [file dirname [file dirname $ldir]]/include + } else { + set idir [file dirname $ldir]/include + } + + # Create directories, might not exist. + file mkdir $idir + file mkdir $ldir + + package require critcl::app + + foreach p $packages { + set src [file dirname $::me]/$p.tcl + set version [version $src] + + file delete -force [pwd]/BUILD.$p + critcl::app::main [list -cache [pwd]/BUILD.$p -keep -debug all -libdir $ldir -includedir $idir -pkg $src] + + if {![file exists $ldir/$p]} { + set ::NOTE {warn {DONE, with FAILURES}} + break + } + + file delete -force $ldir/$p$version + file rename $ldir/$p $ldir/$p$version + + puts -nonewline "Installed package: " + tag ok + puts $ldir/$p$version + } + return +} +proc Hgui {} { return "\n\tInstall all packages, and application.\n\tDone from a small GUI." } +proc _gui {} { + global INSTALLPATH + package require Tk + package require widget::scrolledwindow + + wm protocol . WM_DELETE_WINDOW ::_exit + + label .l -text {Install Path: } + entry .e -textvariable ::INSTALLPATH + button .i -command Install -text Install + + widget::scrolledwindow .st -borderwidth 1 -relief sunken + text .t + .st setwidget .t + + .t tag configure stdout -font {Helvetica 8} + .t tag configure stderr -background red -font {Helvetica 12} + .t tag configure ok -background green -font {Helvetica 8} + .t tag configure warn -background yellow -font {Helvetica 12} + + grid .l -row 0 -column 0 -sticky new + grid .e -row 0 -column 1 -sticky new + grid .i -row 0 -column 2 -sticky new + grid .st -row 1 -column 0 -sticky swen -columnspan 2 + + grid rowconfigure . 0 -weight 0 + grid rowconfigure . 1 -weight 1 + + grid columnconfigure . 0 -weight 0 + grid columnconfigure . 1 -weight 1 + grid columnconfigure . 2 -weight 0 + + set INSTALLPATH [info library] + + # Redirect all output into our log window, and disable uncontrolled exit. + rename ::puts ::_puts + rename ::log ::puts + rename ::exit ::_exit + rename ::myexit ::exit + + # And start to interact with the user. + vwait forever + return +} +proc Install {} { + global INSTALLPATH NOTE + .i configure -state disabled + + set NOTE {ok DONE} + set fail [catch { + _install $INSTALLPATH + + puts "" + tag [lindex $NOTE 0] + puts [lindex $NOTE 1] + } e o] + + .i configure -state normal + .i configure -command ::_exit -text Exit -bg green + + if {$fail} { + # rethrow + return {*}$o $e + } + return +} +proc Hwrap4tea {} { return "?destination?\n\tGenerate a source package with TEA-based build system wrapped around critcl.\n\tdestination = path of source package directory, default is sub-directory 'tea' of the CWD." } +proc _wrap4tea {{dst {}}} { + global packages + + if {[llength [info level 0]] < 2} { + set dst [file join [pwd] tea] + } + + file mkdir $dst + + package require critcl::app + + foreach p $packages { + set src [file dirname $::me]/$p.tcl + set version [version $src] + + file delete -force [pwd]/BUILD + critcl::app::main [list -cache [pwd]/BUILD -libdir $dst -tea $src] + file delete -force $dst/$p$version + file rename $dst/$p $dst/$p$version + + puts "Wrapped package: $dst/$p$version" + } + return +} +main diff -Nru critcl-3.1.9/examples/lit-both/cr.tcl critcl-3.1.17+dfsg/examples/lit-both/cr.tcl --- critcl-3.1.9/examples/lit-both/cr.tcl 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/examples/lit-both/cr.tcl 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,45 @@ +#!/usr/bin/env tclsh +# -*- tcl -*- +# Run the example via mode "compile & run". +# Note: generic code, same in all examples. + +cd [file dirname [file normalize [info script]]] +source ../../lib/critcl/critcl.tcl + +# Show the config +puts "" +puts "target-config: [critcl::targetconfig]" +puts "target-platform: [critcl::targetplatform]" +puts "target-actual: [critcl::actualtarget]" +puts "build-platform: [critcl::buildplatform]" +puts "cache: [critcl::cache]" +puts "" + +# Pull the package, ignoring build and examples ... +foreach f [glob *.tcl] { + if {[string match build* $f]} continue + if {[string match cr* $f]} continue + if {[string match example* $f]} continue + + puts "Reading $f ..." + source $f +} + +proc ex {args} { + set code [catch {uplevel 1 $args} result] + set code [string map {0 ok 1 error 2 break 3 continue} $code] + set max [expr {80 - [string length $args] - [string length "Example: "]}] + puts "Example: $args [string repeat _ $max]" + puts "Code: (($code))" + puts "Result: (($result))" + puts "" + return +} + +# ... and run the examples. +foreach f [glob -nocomplain example*] { + puts "Running $f ..." + source $f +} + +exit diff -Nru critcl-3.1.9/examples/lit-both/example.tcl critcl-3.1.17+dfsg/examples/lit-both/example.tcl --- critcl-3.1.9/examples/lit-both/example.tcl 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/examples/lit-both/example.tcl 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,6 @@ + +# Force compile and load. +catch {str} + +ex str 1 +ex cstr 2 diff -Nru critcl-3.1.9/examples/lit-both/pool.tcl critcl-3.1.17+dfsg/examples/lit-both/pool.tcl --- critcl-3.1.9/examples/lit-both/pool.tcl 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/examples/lit-both/pool.tcl 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,57 @@ +# pool.tcl -- +# +# A template demonstrating the handling of string/literal pools. +# +# Copyright (c) 2014 Andreas Kupries + +# # ## ### ##### ######## ############# ##################### +## Requirements + +package require Tcl 8.4 +package require critcl 3.1.11 +package require critcl::literals 1.1 ;# result-type + +# # ## ### ##### ######## ############# ##################### +## Administrivia + +critcl::license {Andreas Kupries} BSD + +critcl::summary {String pools} + +critcl::description { + This package implements nothing. It serves only as a + demonstration and template on how to declare a shared + string pool and use it in cproc's or ccommand's +} + +critcl::subject demonstration {string pool} {literal pool} \ + {shared strings} {shared literals} + +# # ## ### ##### ######## ############# ##################### +## C code. + +critcl::literals::def demo { + here "here" + comes "comes" + the "the" + sun "sun" +} {c tcl} + +critcl::cproc str {Tcl_Interp* ip int code} object { + Tcl_Obj* res = demo (ip, code); + Tcl_IncrRefCount (res); + return res; +} + +critcl::cproc cstr {Tcl_Interp* ip int code} object { + Tcl_Obj* res = Tcl_NewStringObj (demo_cstr (code), -1); + Tcl_IncrRefCount (res); + return res; +} + +# str 0 +# str 7 - panic, abort, core dump + +# ### ### ### ######### ######### ######### +## Ready +package provide pool 1 diff -Nru critcl-3.1.9/examples/lit-c/build.tcl critcl-3.1.17+dfsg/examples/lit-c/build.tcl --- critcl-3.1.9/examples/lit-c/build.tcl 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/examples/lit-c/build.tcl 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,283 @@ +#!/bin/sh +# -*- tcl -*- \ +exec tclsh "$0" ${1+"$@"} +set me [file normalize [info script]] +set packages {pool} +proc main {} { + global argv tcl_platform tag + set tag {} + if {![llength $argv]} { + if {$tcl_platform(platform) eq "windows"} { + set argv gui + } else { + set argv help + } + } + if {[catch { + eval _$argv + }]} usage + exit 0 +} +proc usage {{status 1}} { + global errorInfo + if {[info exists errorInfo] && ($errorInfo ne {}) && + ![string match {invalid command name "_*"*} $errorInfo] + } { + puts stderr $::errorInfo + exit + } + + global argv0 + set prefix "Usage: " + foreach c [lsort -dict [info commands _*]] { + set c [string range $c 1 end] + if {[catch { + H${c} + } res]} { + puts stderr "$prefix$argv0 $c args...\n" + } else { + puts stderr "$prefix$argv0 $c $res\n" + } + set prefix " " + } + exit $status +} +proc tag {t} { + global tag + set tag $t + return +} +proc myexit {} { + tag ok + puts DONE + return +} +proc log {args} { + global tag + set newline 1 + if {[lindex $args 0] eq "-nonewline"} { + set newline 0 + set args [lrange $args 1 end] + } + if {[llength $args] == 2} { + lassign $args chan text + if {$chan ni {stdout stderr}} { + ::_puts {*}[lrange [info level 0] 1 end] + return + } + } else { + set text [lindex $args 0] + set chan stdout + } + # chan <=> tag, if not overriden + if {[string match {Files left*} $text]} { + set tag warn + set text \n$text + } + if {$tag eq {}} { set tag $chan } + #::_puts $tag/$text + + .t insert end-1c $text $tag + set tag {} + if {$newline} { + .t insert end-1c \n + } + + update + return +} +proc +x {path} { + catch { file attributes $path -permissions u+x } + return +} +proc grep {file pattern} { + set lines [split [read [set chan [open $file r]]] \n] + close $chan + return [lsearch -all -inline -glob $lines $pattern] +} +proc version {file} { + set provisions [grep $file {*package provide*}] + #puts /$provisions/ + return [lindex $provisions 0 3] +} +proc Hhelp {} { return "\n\tPrint this help" } +proc _help {} { + usage 0 + return +} +proc Hrecipes {} { return "\n\tList all brew commands, without details." } +proc _recipes {} { + set r {} + foreach c [info commands _*] { + lappend r [string range $c 1 end] + } + puts [lsort -dict $r] + return +} +proc Hinstall {} { return "?destination?\n\tInstall all packages, and application.\n\tdestination = path of package directory, default \[info library\]." } +proc _install {{ldir {}}} { + global packages + if {[llength [info level 0]] < 2} { + set ldir [info library] + set idir [file dirname [file dirname $ldir]]/include + } else { + set idir [file dirname $ldir]/include + } + + # Create directories, might not exist. + file mkdir $idir + file mkdir $ldir + + package require critcl::app + + foreach p $packages { + set src [file dirname $::me]/$p.tcl + set version [version $src] + + file delete -force [pwd]/BUILD + critcl::app::main [list -cache [pwd]/BUILD -libdir $ldir -includedir $idir -pkg $src] + + if {![file exists $ldir/$p]} { + set ::NOTE {warn {DONE, with FAILURES}} + break + } + + file delete -force $ldir/$p$version + file rename $ldir/$p $ldir/$p$version + + puts -nonewline "Installed package: " + tag ok + puts $ldir/$p$version + } + return +} +proc Hdebug {} { return "?destination?\n\tInstall debug builds of all packages.\n\tdestination = path of package directory, default \[info library\]." } +proc _debug {{ldir {}}} { + global packages + if {[llength [info level 0]] < 2} { + set ldir [info library] + set idir [file dirname [file dirname $ldir]]/include + } else { + set idir [file dirname $ldir]/include + } + + # Create directories, might not exist. + file mkdir $idir + file mkdir $ldir + + package require critcl::app + + foreach p $packages { + set src [file dirname $::me]/$p.tcl + set version [version $src] + + file delete -force [pwd]/BUILD.$p + critcl::app::main [list -cache [pwd]/BUILD.$p -keep -debug all -libdir $ldir -includedir $idir -pkg $src] + + if {![file exists $ldir/$p]} { + set ::NOTE {warn {DONE, with FAILURES}} + break + } + + file delete -force $ldir/$p$version + file rename $ldir/$p $ldir/$p$version + + puts -nonewline "Installed package: " + tag ok + puts $ldir/$p$version + } + return +} +proc Hgui {} { return "\n\tInstall all packages, and application.\n\tDone from a small GUI." } +proc _gui {} { + global INSTALLPATH + package require Tk + package require widget::scrolledwindow + + wm protocol . WM_DELETE_WINDOW ::_exit + + label .l -text {Install Path: } + entry .e -textvariable ::INSTALLPATH + button .i -command Install -text Install + + widget::scrolledwindow .st -borderwidth 1 -relief sunken + text .t + .st setwidget .t + + .t tag configure stdout -font {Helvetica 8} + .t tag configure stderr -background red -font {Helvetica 12} + .t tag configure ok -background green -font {Helvetica 8} + .t tag configure warn -background yellow -font {Helvetica 12} + + grid .l -row 0 -column 0 -sticky new + grid .e -row 0 -column 1 -sticky new + grid .i -row 0 -column 2 -sticky new + grid .st -row 1 -column 0 -sticky swen -columnspan 2 + + grid rowconfigure . 0 -weight 0 + grid rowconfigure . 1 -weight 1 + + grid columnconfigure . 0 -weight 0 + grid columnconfigure . 1 -weight 1 + grid columnconfigure . 2 -weight 0 + + set INSTALLPATH [info library] + + # Redirect all output into our log window, and disable uncontrolled exit. + rename ::puts ::_puts + rename ::log ::puts + rename ::exit ::_exit + rename ::myexit ::exit + + # And start to interact with the user. + vwait forever + return +} +proc Install {} { + global INSTALLPATH NOTE + .i configure -state disabled + + set NOTE {ok DONE} + set fail [catch { + _install $INSTALLPATH + + puts "" + tag [lindex $NOTE 0] + puts [lindex $NOTE 1] + } e o] + + .i configure -state normal + .i configure -command ::_exit -text Exit -bg green + + if {$fail} { + # rethrow + return {*}$o $e + } + return +} +proc Hwrap4tea {} { return "?destination?\n\tGenerate a source package with TEA-based build system wrapped around critcl.\n\tdestination = path of source package directory, default is sub-directory 'tea' of the CWD." } +proc _wrap4tea {{dst {}}} { + global packages + + if {[llength [info level 0]] < 2} { + set dst [file join [pwd] tea] + } + + file mkdir $dst + + package require critcl::app + + foreach p $packages { + set src [file dirname $::me]/$p.tcl + set version [version $src] + + file delete -force [pwd]/BUILD + critcl::app::main [list -cache [pwd]/BUILD -libdir $dst -tea $src] + file delete -force $dst/$p$version + file rename $dst/$p $dst/$p$version + + puts "Wrapped package: $dst/$p$version" + } + return +} +main diff -Nru critcl-3.1.9/examples/lit-c/cr.tcl critcl-3.1.17+dfsg/examples/lit-c/cr.tcl --- critcl-3.1.9/examples/lit-c/cr.tcl 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/examples/lit-c/cr.tcl 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,45 @@ +#!/usr/bin/env tclsh +# -*- tcl -*- +# Run the example via mode "compile & run". +# Note: generic code, same in all examples. + +cd [file dirname [file normalize [info script]]] +source ../../lib/critcl/critcl.tcl + +# Show the config +puts "" +puts "target-config: [critcl::targetconfig]" +puts "target-platform: [critcl::targetplatform]" +puts "target-actual: [critcl::actualtarget]" +puts "build-platform: [critcl::buildplatform]" +puts "cache: [critcl::cache]" +puts "" + +# Pull the package, ignoring build and examples ... +foreach f [glob *.tcl] { + if {[string match build* $f]} continue + if {[string match cr* $f]} continue + if {[string match example* $f]} continue + + puts "Reading $f ..." + source $f +} + +proc ex {args} { + set code [catch {uplevel 1 $args} result] + set code [string map {0 ok 1 error 2 break 3 continue} $code] + set max [expr {80 - [string length $args] - [string length "Example: "]}] + puts "Example: $args [string repeat _ $max]" + puts "Code: (($code))" + puts "Result: (($result))" + puts "" + return +} + +# ... and run the examples. +foreach f [glob -nocomplain example*] { + puts "Running $f ..." + source $f +} + +exit diff -Nru critcl-3.1.9/examples/lit-c/example.tcl critcl-3.1.17+dfsg/examples/lit-c/example.tcl --- critcl-3.1.9/examples/lit-c/example.tcl 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/examples/lit-c/example.tcl 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,5 @@ + +# Force compile and load. +catch {str} + +ex str 3 diff -Nru critcl-3.1.9/examples/lit-c/pool.tcl critcl-3.1.17+dfsg/examples/lit-c/pool.tcl --- critcl-3.1.9/examples/lit-c/pool.tcl 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/examples/lit-c/pool.tcl 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,57 @@ +# pool.tcl -- +# +# A template demonstrating the handling of string/literal pools. +# Configured for C access, no wrappers for Tcl. +# +# Copyright (c) 2014-2017 Andreas Kupries + +# # ## ### ##### ######## ############# ##################### +## Requirements + +package require Tcl 8.4 +package require critcl 3.1.11 +package require critcl::literals 1.2 ;# result-type + +# # ## ### ##### ######## ############# ##################### +## Administrivia + +critcl::license {Andreas Kupries} BSD + +critcl::summary {String pools} + +critcl::description { + This package implements nothing. It serves only as a + demonstration and template on how to declare a shared + string pool and use it in cproc's or ccommand's +} + +critcl::subject demonstration \ + {string pool} \ + {literal pool} \ + {shared strings} \ + {shared literals} + +# # ## ### ##### ######## ############# ##################### +## C code. + +critcl::literals::def demo { + here "here" + comes "comes" + the "the" + sun "sun" +} c + +critcl::cproc str {Tcl_Interp* ip int code} object { + Tcl_Obj* res = Tcl_NewStringObj (demo_cstr (code), -1); + Tcl_IncrRefCount (res); + return res; +} + +# str 0 +# str 7 - panic, abort, core dump + +# # ## ### ##### ######## ############# ##################### + +# ### ### ### ######### ######### ######### +## Ready +package provide pool 1 diff -Nru critcl-3.1.9/examples/literals/build.tcl critcl-3.1.17+dfsg/examples/literals/build.tcl --- critcl-3.1.9/examples/literals/build.tcl 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/examples/literals/build.tcl 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,283 @@ +#!/bin/sh +# -*- tcl -*- \ +exec tclsh "$0" ${1+"$@"} +set me [file normalize [info script]] +set packages {pool} +proc main {} { + global argv tcl_platform tag + set tag {} + if {![llength $argv]} { + if {$tcl_platform(platform) eq "windows"} { + set argv gui + } else { + set argv help + } + } + if {[catch { + eval _$argv + }]} usage + exit 0 +} +proc usage {{status 1}} { + global errorInfo + if {[info exists errorInfo] && ($errorInfo ne {}) && + ![string match {invalid command name "_*"*} $errorInfo] + } { + puts stderr $::errorInfo + exit + } + + global argv0 + set prefix "Usage: " + foreach c [lsort -dict [info commands _*]] { + set c [string range $c 1 end] + if {[catch { + H${c} + } res]} { + puts stderr "$prefix$argv0 $c args...\n" + } else { + puts stderr "$prefix$argv0 $c $res\n" + } + set prefix " " + } + exit $status +} +proc tag {t} { + global tag + set tag $t + return +} +proc myexit {} { + tag ok + puts DONE + return +} +proc log {args} { + global tag + set newline 1 + if {[lindex $args 0] eq "-nonewline"} { + set newline 0 + set args [lrange $args 1 end] + } + if {[llength $args] == 2} { + lassign $args chan text + if {$chan ni {stdout stderr}} { + ::_puts {*}[lrange [info level 0] 1 end] + return + } + } else { + set text [lindex $args 0] + set chan stdout + } + # chan <=> tag, if not overriden + if {[string match {Files left*} $text]} { + set tag warn + set text \n$text + } + if {$tag eq {}} { set tag $chan } + #::_puts $tag/$text + + .t insert end-1c $text $tag + set tag {} + if {$newline} { + .t insert end-1c \n + } + + update + return +} +proc +x {path} { + catch { file attributes $path -permissions u+x } + return +} +proc grep {file pattern} { + set lines [split [read [set chan [open $file r]]] \n] + close $chan + return [lsearch -all -inline -glob $lines $pattern] +} +proc version {file} { + set provisions [grep $file {*package provide*}] + #puts /$provisions/ + return [lindex $provisions 0 3] +} +proc Hhelp {} { return "\n\tPrint this help" } +proc _help {} { + usage 0 + return +} +proc Hrecipes {} { return "\n\tList all brew commands, without details." } +proc _recipes {} { + set r {} + foreach c [info commands _*] { + lappend r [string range $c 1 end] + } + puts [lsort -dict $r] + return +} +proc Hinstall {} { return "?destination?\n\tInstall all packages, and application.\n\tdestination = path of package directory, default \[info library\]." } +proc _install {{ldir {}}} { + global packages + if {[llength [info level 0]] < 2} { + set ldir [info library] + set idir [file dirname [file dirname $ldir]]/include + } else { + set idir [file dirname $ldir]/include + } + + # Create directories, might not exist. + file mkdir $idir + file mkdir $ldir + + package require critcl::app + + foreach p $packages { + set src [file dirname $::me]/$p.tcl + set version [version $src] + + file delete -force [pwd]/BUILD + critcl::app::main [list -cache [pwd]/BUILD -libdir $ldir -includedir $idir -pkg $src] + + if {![file exists $ldir/$p]} { + set ::NOTE {warn {DONE, with FAILURES}} + break + } + + file delete -force $ldir/$p$version + file rename $ldir/$p $ldir/$p$version + + puts -nonewline "Installed package: " + tag ok + puts $ldir/$p$version + } + return +} +proc Hdebug {} { return "?destination?\n\tInstall debug builds of all packages.\n\tdestination = path of package directory, default \[info library\]." } +proc _debug {{ldir {}}} { + global packages + if {[llength [info level 0]] < 2} { + set ldir [info library] + set idir [file dirname [file dirname $ldir]]/include + } else { + set idir [file dirname $ldir]/include + } + + # Create directories, might not exist. + file mkdir $idir + file mkdir $ldir + + package require critcl::app + + foreach p $packages { + set src [file dirname $::me]/$p.tcl + set version [version $src] + + file delete -force [pwd]/BUILD.$p + critcl::app::main [list -cache [pwd]/BUILD.$p -keep -debug all -libdir $ldir -includedir $idir -pkg $src] + + if {![file exists $ldir/$p]} { + set ::NOTE {warn {DONE, with FAILURES}} + break + } + + file delete -force $ldir/$p$version + file rename $ldir/$p $ldir/$p$version + + puts -nonewline "Installed package: " + tag ok + puts $ldir/$p$version + } + return +} +proc Hgui {} { return "\n\tInstall all packages, and application.\n\tDone from a small GUI." } +proc _gui {} { + global INSTALLPATH + package require Tk + package require widget::scrolledwindow + + wm protocol . WM_DELETE_WINDOW ::_exit + + label .l -text {Install Path: } + entry .e -textvariable ::INSTALLPATH + button .i -command Install -text Install + + widget::scrolledwindow .st -borderwidth 1 -relief sunken + text .t + .st setwidget .t + + .t tag configure stdout -font {Helvetica 8} + .t tag configure stderr -background red -font {Helvetica 12} + .t tag configure ok -background green -font {Helvetica 8} + .t tag configure warn -background yellow -font {Helvetica 12} + + grid .l -row 0 -column 0 -sticky new + grid .e -row 0 -column 1 -sticky new + grid .i -row 0 -column 2 -sticky new + grid .st -row 1 -column 0 -sticky swen -columnspan 2 + + grid rowconfigure . 0 -weight 0 + grid rowconfigure . 1 -weight 1 + + grid columnconfigure . 0 -weight 0 + grid columnconfigure . 1 -weight 1 + grid columnconfigure . 2 -weight 0 + + set INSTALLPATH [info library] + + # Redirect all output into our log window, and disable uncontrolled exit. + rename ::puts ::_puts + rename ::log ::puts + rename ::exit ::_exit + rename ::myexit ::exit + + # And start to interact with the user. + vwait forever + return +} +proc Install {} { + global INSTALLPATH NOTE + .i configure -state disabled + + set NOTE {ok DONE} + set fail [catch { + _install $INSTALLPATH + + puts "" + tag [lindex $NOTE 0] + puts [lindex $NOTE 1] + } e o] + + .i configure -state normal + .i configure -command ::_exit -text Exit -bg green + + if {$fail} { + # rethrow + return {*}$o $e + } + return +} +proc Hwrap4tea {} { return "?destination?\n\tGenerate a source package with TEA-based build system wrapped around critcl.\n\tdestination = path of source package directory, default is sub-directory 'tea' of the CWD." } +proc _wrap4tea {{dst {}}} { + global packages + + if {[llength [info level 0]] < 2} { + set dst [file join [pwd] tea] + } + + file mkdir $dst + + package require critcl::app + + foreach p $packages { + set src [file dirname $::me]/$p.tcl + set version [version $src] + + file delete -force [pwd]/BUILD + critcl::app::main [list -cache [pwd]/BUILD -libdir $dst -tea $src] + file delete -force $dst/$p$version + file rename $dst/$p $dst/$p$version + + puts "Wrapped package: $dst/$p$version" + } + return +} +main diff -Nru critcl-3.1.9/examples/literals/cr.tcl critcl-3.1.17+dfsg/examples/literals/cr.tcl --- critcl-3.1.9/examples/literals/cr.tcl 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/examples/literals/cr.tcl 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,45 @@ +#!/usr/bin/env tclsh +# -*- tcl -*- +# Run the example via mode "compile & run". +# Note: generic code, same in all examples. + +cd [file dirname [file normalize [info script]]] +source ../../lib/critcl/critcl.tcl + +# Show the config +puts "" +puts "target-config: [critcl::targetconfig]" +puts "target-platform: [critcl::targetplatform]" +puts "target-actual: [critcl::actualtarget]" +puts "build-platform: [critcl::buildplatform]" +puts "cache: [critcl::cache]" +puts "" + +# Pull the package, ignoring build and examples ... +foreach f [glob *.tcl] { + if {[string match build* $f]} continue + if {[string match cr* $f]} continue + if {[string match example* $f]} continue + + puts "Reading $f ..." + source $f +} + +proc ex {args} { + set code [catch {uplevel 1 $args} result] + set code [string map {0 ok 1 error 2 break 3 continue} $code] + set max [expr {80 - [string length $args] - [string length "Example: "]}] + puts "Example: $args [string repeat _ $max]" + puts "Code: (($code))" + puts "Result: (($result))" + puts "" + return +} + +# ... and run the examples. +foreach f [glob -nocomplain example*] { + puts "Running $f ..." + source $f +} + +exit diff -Nru critcl-3.1.9/examples/literals/example.tcl critcl-3.1.17+dfsg/examples/literals/example.tcl --- critcl-3.1.9/examples/literals/example.tcl 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/examples/literals/example.tcl 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,6 @@ + +# Force compile and load. +catch {str} + +ex str 1 +ex xstr 2 diff -Nru critcl-3.1.9/examples/literals/pool.tcl critcl-3.1.17+dfsg/examples/literals/pool.tcl --- critcl-3.1.9/examples/literals/pool.tcl 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/examples/literals/pool.tcl 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,56 @@ +# pool.tcl -- +# +# A template demonstrating the handling of string/literal pools. +# +# Copyright (c) 2014 Andreas Kupries + +# # ## ### ##### ######## ############# ##################### +## Requirements + +package require Tcl 8.4 +package require critcl 3.1.11 +package require critcl::literals 1.1 ;# result-type + +# # ## ### ##### ######## ############# ##################### +## Administrivia + +critcl::license {Andreas Kupries} BSD + +critcl::summary {String pools} + +critcl::description { + This package implements nothing. It serves only as a + demonstration and template on how to declare a shared + string pool and use it in cproc's or ccommand's +} + +critcl::subject demonstration {string pool} {literal pool} \ + {shared strings} {shared literals} + +# # ## ### ##### ######## ############# ##################### +## C code. + +critcl::literals::def demo { + here "here" + comes "comes" + the "the" + sun "sun" +} + +critcl::cproc str {Tcl_Interp* ip int code} object { + Tcl_Obj* res = demo (ip, code); + Tcl_IncrRefCount (res); + return res; +} + +# Conversion hidden in the result-type +critcl::cproc xstr {Tcl_Interp* ip int code} demo { + return code; +} + +# str 0 +# str 7 - panic, abort, core dump + +# ### ### ### ######### ######### ######### +## Ready +package provide pool 1 diff -Nru critcl-3.1.9/examples/md5/cr.tcl critcl-3.1.17+dfsg/examples/md5/cr.tcl --- critcl-3.1.9/examples/md5/cr.tcl 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/examples/md5/cr.tcl 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,45 @@ +#!/usr/bin/env tclsh +# -*- tcl -*- +# Run the example via mode "compile & run". +# Note: generic code, same in all examples. + +cd [file dirname [file normalize [info script]]] +source ../../lib/critcl/critcl.tcl + +# Show the config +puts "" +puts "target-config: [critcl::targetconfig]" +puts "target-platform: [critcl::targetplatform]" +puts "target-actual: [critcl::actualtarget]" +puts "build-platform: [critcl::buildplatform]" +puts "cache: [critcl::cache]" +puts "" + +# Pull the package, ignoring build and examples ... +foreach f [glob *.tcl] { + if {[string match build* $f]} continue + if {[string match cr* $f]} continue + if {[string match example* $f]} continue + + puts "Reading $f ..." + source $f +} + +proc ex {args} { + set code [catch {uplevel 1 $args} result] + set code [string map {0 ok 1 error 2 break 3 continue} $code] + set max [expr {80 - [string length $args] - [string length "Example: "]}] + puts "Example: $args [string repeat _ $max]" + puts "Code: (($code))" + puts "Result: (($result))" + puts "" + return +} + +# ... and run the examples. +foreach f [glob -nocomplain example*] { + puts "Running $f ..." + source $f +} + +exit diff -Nru critcl-3.1.9/examples/md5/example.tcl critcl-3.1.17+dfsg/examples/md5/example.tcl --- critcl-3.1.9/examples/md5/example.tcl 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/examples/md5/example.tcl 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,39 @@ + +package require critcl_md5c +#set pkgtest 1 + +#source ../../lib/critcl-md5c/md5c.tcl + + proc md5c_try {} { + foreach {msg expected} { + "" + "d41d8cd98f00b204e9800998ecf8427e" + "a" + "0cc175b9c0f1b6a831c399e269772661" + "abc" + "900150983cd24fb0d6963f7d28e17f72" + "message digest" + "f96b697d7cb7938d525a2f31aaf161d0" + "abcdefghijklmnopqrstuvwxyz" + "c3fcd3d76192e4007dfb496cca67e13b" + "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789" + "d174ab98d277d9f5a5611c2c9f419d9f" + "12345678901234567890123456789012345678901234567890123456789012345678901234567890" + "57edf4a22be3c955ac49da2e2107b67a" + } { + puts "testing: md5 \"$msg\"" + binary scan [md5c $msg] H* computed + puts "computed: $computed" + if {0 != [string compare $computed $expected]} { + puts "expected: $expected" + puts "FAILED" + } + } + + foreach len {10 50 100 500 1000 5000 10000 50000 100000 500000 1000000} { + set blanks [format %$len.0s ""] + puts "input length $len: [time {md5c $blanks} 1000]" + } + } + + md5c_try diff -Nru critcl-3.1.9/examples/optional/cr.tcl critcl-3.1.17+dfsg/examples/optional/cr.tcl --- critcl-3.1.9/examples/optional/cr.tcl 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/examples/optional/cr.tcl 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,45 @@ +#!/usr/bin/env tclsh +# -*- tcl -*- +# Run the example via mode "compile & run". +# Note: generic code, same in all examples. + +cd [file dirname [file normalize [info script]]] +source ../../lib/critcl/critcl.tcl + +# Show the config +puts "" +puts "target-config: [critcl::targetconfig]" +puts "target-platform: [critcl::targetplatform]" +puts "target-actual: [critcl::actualtarget]" +puts "build-platform: [critcl::buildplatform]" +puts "cache: [critcl::cache]" +puts "" + +# Pull the package, ignoring build and examples ... +foreach f [glob *.tcl] { + if {[string match build* $f]} continue + if {[string match cr* $f]} continue + if {[string match example* $f]} continue + + puts "Reading $f ..." + source $f +} + +proc ex {args} { + set code [catch {uplevel 1 $args} result] + set code [string map {0 ok 1 error 2 break 3 continue} $code] + set max [expr {80 - [string length $args] - [string length "Example: "]}] + puts "Example: $args [string repeat _ $max]" + puts "Code: (($code))" + puts "Result: (($result))" + puts "" + return +} + +# ... and run the examples. +foreach f [glob -nocomplain example*] { + puts "Running $f ..." + source $f +} + +exit diff -Nru critcl-3.1.9/examples/optional/example.tcl critcl-3.1.17+dfsg/examples/optional/example.tcl --- critcl-3.1.9/examples/optional/example.tcl 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/examples/optional/example.tcl 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,18 @@ +#!/usr/bin/env tclsh + +package require Tcl 8.5 +package require optional + +foreach a { + {} + {6} + {6 7} + {6 7 8} + {6 7 8 9} + {6 7 8 9 0} +} { + ex fixed {*}$a + ex optional_head {*}$a + ex optional_middle {*}$a + ex optional_tail {*}$a +} diff -Nru critcl-3.1.9/examples/optional/optional.tcl critcl-3.1.17+dfsg/examples/optional/optional.tcl --- critcl-3.1.9/examples/optional/optional.tcl 2013-05-10 05:57:04.000000000 +0000 +++ critcl-3.1.17+dfsg/examples/optional/optional.tcl 2017-10-14 02:48:11.000000000 +0000 @@ -25,14 +25,30 @@ } critcl::subject demonstration {cproc optional arguments} +#critcl::config lines 0 # # ## ### ##### ######## ############# ##################### ## C code. -critcl::cproc fixed {int a int b int c int d} void {} -critcl::cproc optional_head {int {a 1} int {b 2} int c int d} void {} -critcl::cproc optional_tail {int a int b int {c 1} int {d 2}} void {} -critcl::cproc optional_middle {int a int {b 1} int {c 2} int d} void {} +critcl::cproc fixed {int a int b int c int d} void { + printf ("F|%d|%d|%d|%d|\n", a,b,c,d); + fflush(stdout); +} + +critcl::cproc optional_head {int {a 1} int {b 2} int c int d} void { + printf ("H|%d|%d|%d|%d|\n", a,b,c,d); + fflush(stdout); +} + +critcl::cproc optional_tail {int a int b int {c 1} int {d 2}} void { + printf ("T|%d|%d|%d|%d|\n", a,b,c,d); + fflush(stdout); +} + +critcl::cproc optional_middle {int a int {b 1} int {c 2} int d} void { + printf ("M|%d|%d|%d|%d|\n", a,b,c,d); + fflush(stdout); +} # ### ### ### ######### ######### ######### ## Ready diff -Nru critcl-3.1.9/examples/queue/cr.tcl critcl-3.1.17+dfsg/examples/queue/cr.tcl --- critcl-3.1.9/examples/queue/cr.tcl 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/examples/queue/cr.tcl 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,45 @@ +#!/usr/bin/env tclsh +# -*- tcl -*- +# Run the example via mode "compile & run". +# Note: generic code, same in all examples. + +cd [file dirname [file normalize [info script]]] +source ../../lib/critcl/critcl.tcl + +# Show the config +puts "" +puts "target-config: [critcl::targetconfig]" +puts "target-platform: [critcl::targetplatform]" +puts "target-actual: [critcl::actualtarget]" +puts "build-platform: [critcl::buildplatform]" +puts "cache: [critcl::cache]" +puts "" + +# Pull the package, ignoring build and examples ... +foreach f [glob *.tcl] { + if {[string match build* $f]} continue + if {[string match cr* $f]} continue + if {[string match example* $f]} continue + + puts "Reading $f ..." + source $f +} + +proc ex {args} { + set code [catch {uplevel 1 $args} result] + set code [string map {0 ok 1 error 2 break 3 continue} $code] + set max [expr {80 - [string length $args] - [string length "Example: "]}] + puts "Example: $args [string repeat _ $max]" + puts "Code: (($code))" + puts "Result: (($result))" + puts "" + return +} + +# ... and run the examples. +foreach f [glob -nocomplain example*] { + puts "Running $f ..." + source $f +} + +exit diff -Nru critcl-3.1.9/examples/queue/example.tcl critcl-3.1.17+dfsg/examples/queue/example.tcl --- critcl-3.1.9/examples/queue/example.tcl 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/examples/queue/example.tcl 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,12 @@ + +ex queuec new +ex queuec1 size +ex queuec1 clear +ex queuec1 put a b c +ex queuec1 peek 2 +ex queuec1 get 2 +ex queuec1 size +ex queuec1 clear +ex queuec1 size +ex queuec1 destroy +ex queuec1 diff -Nru critcl-3.1.9/examples/selfcompanion/cr.tcl critcl-3.1.17+dfsg/examples/selfcompanion/cr.tcl --- critcl-3.1.9/examples/selfcompanion/cr.tcl 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/examples/selfcompanion/cr.tcl 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,45 @@ +#!/usr/bin/env tclsh +# -*- tcl -*- +# Run the example via mode "compile & run". +# Note: generic code, same in all examples. + +cd [file dirname [file normalize [info script]]] +source ../../lib/critcl/critcl.tcl + +# Show the config +puts "" +puts "target-config: [critcl::targetconfig]" +puts "target-platform: [critcl::targetplatform]" +puts "target-actual: [critcl::actualtarget]" +puts "build-platform: [critcl::buildplatform]" +puts "cache: [critcl::cache]" +puts "" + +# Pull the package, ignoring build and examples ... +foreach f [glob *.tcl] { + if {[string match build* $f]} continue + if {[string match cr* $f]} continue + if {[string match example* $f]} continue + + puts "Reading $f ..." + source $f +} + +proc ex {args} { + set code [catch {uplevel 1 $args} result] + set code [string map {0 ok 1 error 2 break 3 continue} $code] + set max [expr {80 - [string length $args] - [string length "Example: "]}] + puts "Example: $args [string repeat _ $max]" + puts "Code: (($code))" + puts "Result: (($result))" + puts "" + return +} + +# ... and run the examples. +foreach f [glob -nocomplain example*] { + puts "Running $f ..." + source $f +} + +exit diff -Nru critcl-3.1.9/examples/selfcompanion/example.tcl critcl-3.1.17+dfsg/examples/selfcompanion/example.tcl --- critcl-3.1.9/examples/selfcompanion/example.tcl 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/examples/selfcompanion/example.tcl 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,3 @@ + +ex self +ex companion diff -Nru critcl-3.1.9/examples/selfcompanion/selfcompanion.tcl critcl-3.1.17+dfsg/examples/selfcompanion/selfcompanion.tcl --- critcl-3.1.9/examples/selfcompanion/selfcompanion.tcl 2013-05-10 05:57:04.000000000 +0000 +++ critcl-3.1.17+dfsg/examples/selfcompanion/selfcompanion.tcl 2017-10-14 02:48:11.000000000 +0000 @@ -67,7 +67,7 @@ # # ## ### ##### ######## ############# ##################### ## C code. -critcl::cdata self "self" +critcl::cdata self "me" # ... And other parts of the C level ... diff -Nru critcl-3.1.9/examples/tk8.4/build.tcl critcl-3.1.17+dfsg/examples/tk8.4/build.tcl --- critcl-3.1.9/examples/tk8.4/build.tcl 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/examples/tk8.4/build.tcl 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,287 @@ +#!/bin/sh +# -*- tcl -*- \ +exec tclsh "$0" ${1+"$@"} +set me [file normalize [info script]] +set packages {icounter} +proc main {} { + global argv tcl_platform tag + set tag {} + if {![llength $argv]} { + if {$tcl_platform(platform) eq "windows"} { + set argv gui + } else { + set argv help + } + } + if {[catch { + eval _$argv + }]} usage + exit 0 +} +proc usage {{status 1}} { + global errorInfo + if {($errorInfo ne {}) && + ![string match {invalid command name "_*"*} $errorInfo] + } { + puts stderr $::errorInfo + exit + } + + global argv0 + set prefix "Usage: " + foreach c [lsort -dict [info commands _*]] { + set c [string range $c 1 end] + if {[catch { + H${c} + } res]} { + puts stderr "$prefix$argv0 $c args...\n" + } else { + puts stderr "$prefix$argv0 $c $res\n" + } + set prefix " " + } + exit $status +} +proc tag {t} { + global tag + set tag $t + return +} +proc myexit {} { + tag ok + puts DONE + return +} +proc log {args} { + global tag + set newline 1 + if {[lindex $args 0] eq "-nonewline"} { + set newline 0 + set args [lrange $args 1 end] + } + if {[llength $args] == 2} { + lassign $args chan text + if {$chan ni {stdout stderr}} { + ::_puts {*}[lrange [info level 0] 1 end] + return + } + } else { + set text [lindex $args 0] + set chan stdout + } + # chan <=> tag, if not overriden + if {[string match {Files left*} $text]} { + set tag warn + set text \n$text + } + if {$tag eq {}} { set tag $chan } + #::_puts $tag/$text + + .t insert end-1c $text $tag + set tag {} + if {$newline} { + .t insert end-1c \n + } + + update + return +} +proc +x {path} { + catch { file attributes $path -permissions u+x } + return +} +proc grep {file pattern} { + set lines [split [read [set chan [open $file r]]] \n] + close $chan + return [lsearch -all -inline -glob $lines $pattern] +} +proc version {file} { + set provisions [grep $file {*package provide*}] + #puts /$provisions/ + return [lindex $provisions 0 3] +} +proc Hhelp {} { return "\n\tPrint this help" } +proc _help {} { + usage 0 + return +} +proc Hrecipes {} { return "\n\tList all brew commands, without details." } +proc _recipes {} { + set r {} + foreach c [info commands _*] { + lappend r [string range $c 1 end] + } + puts [lsort -dict $r] + return +} +proc Hinstall {} { return "?destination?\n\tInstall all packages.\n\tdestination = path of package directory, default \[info library\]." } +proc _install {{ldir {}}} { + global packages + if {[llength [info level 0]] < 2} { + set ldir [info library] + set idir [file dirname [file dirname $ldir]]/include + } else { + set idir [file dirname $ldir]/include + } + + # Create directories, might not exist. + file mkdir $idir + file mkdir $ldir + + package require critcl::app + + foreach p $packages { + puts "" + + set src [file dirname $::me]/$p.tcl + set version [version $src] + + file delete -force [pwd]/BUILD + critcl::app::main [list -cache [pwd]/BUILD -libdir $ldir -includedir $idir -pkg $src] + + if {![file exists $ldir/$p]} { + set ::NOTE {warn {DONE, with FAILURES}} + break + } + + file delete -force $ldir/$p$version + file rename $ldir/$p $ldir/$p$version + + puts -nonewline "Installed package: " + tag ok + puts $ldir/$p$version + } + return +} +proc Hdebug {} { return "?destination?\n\tInstall all packages, build for debugging.\n\tdestination = path of package directory, default \[info library\]." } +proc _debug {{ldir {}}} { + global packages + if {[llength [info level 0]] < 2} { + set ldir [info library] + set idir [file dirname [file dirname $ldir]]/include + } else { + set idir [file dirname $ldir]/include + } + + # Create directories, might not exist. + file mkdir $idir + file mkdir $ldir + + package require critcl::app + + foreach p $packages { + puts "" + + set src [file dirname $::me]/$p.tcl + set version [version $src] + + file delete -force [pwd]/BUILD.$p + critcl::app::main [list -keep -debug symbols -cache [pwd]/BUILD.$p -libdir $ldir -includedir $idir -pkg $src] + + if {![file exists $ldir/$p]} { + set ::NOTE {warn {DONE, with FAILURES}} + break + } + + file delete -force $ldir/$p$version + file rename $ldir/$p $ldir/$p$version + + puts -nonewline "Installed package: " + tag ok + puts $ldir/$p$version + } + return +} +proc Hgui {} { return "\n\tInstall all packages, and application.\n\tDone from a small GUI." } +proc _gui {} { + global INSTALLPATH + package require Tk + package require widget::scrolledwindow + + wm protocol . WM_DELETE_WINDOW ::_exit + + label .l -text {Install Path: } + entry .e -textvariable ::INSTALLPATH + button .i -command Install -text Install + + widget::scrolledwindow .st -borderwidth 1 -relief sunken + text .t + .st setwidget .t + + .t tag configure stdout -font {Helvetica 8} + .t tag configure stderr -background red -font {Helvetica 12} + .t tag configure ok -background green -font {Helvetica 8} + .t tag configure warn -background yellow -font {Helvetica 12} + + grid .l -row 0 -column 0 -sticky new + grid .e -row 0 -column 1 -sticky new + grid .i -row 0 -column 2 -sticky new + grid .st -row 1 -column 0 -sticky swen -columnspan 2 + + grid rowconfigure . 0 -weight 0 + grid rowconfigure . 1 -weight 1 + + grid columnconfigure . 0 -weight 0 + grid columnconfigure . 1 -weight 1 + grid columnconfigure . 2 -weight 0 + + set INSTALLPATH [info library] + + # Redirect all output into our log window, and disable uncontrolled exit. + rename ::puts ::_puts + rename ::log ::puts + rename ::exit ::_exit + rename ::myexit ::exit + + # And start to interact with the user. + vwait forever + return +} +proc Install {} { + global INSTALLPATH NOTE + .i configure -state disabled + + set NOTE {ok DONE} + set fail [catch { + _install $INSTALLPATH + + puts "" + tag [lindex $NOTE 0] + puts [lindex $NOTE 1] + } e o] + + .i configure -state normal + .i configure -command ::_exit -text Exit -bg green + + if {$fail} { + # rethrow + return {*}$o $e + } + return +} +proc Hwrap4tea {} { return "?destination?\n\tGenerate a source package with TEA-based build system wrapped around critcl.\n\tdestination = path of source package directory, default is sub-directory 'tea' of the CWD." } +proc _wrap4tea {{dst {}}} { + global packages + + if {[llength [info level 0]] < 2} { + set dst [file join [pwd] tea] + } + + file mkdir $dst + + package require critcl::app + + foreach p $packages { + set src [file dirname $::me]/$p.tcl + set version [version $src] + + file delete -force [pwd]/BUILD + critcl::app::main [list -cache [pwd]/BUILD -libdir $dst -tea $src] + file delete -force $dst/$p$version + file rename $dst/$p $dst/$p$version + + puts "Wrapped package: $dst/$p$version" + } + return +} +main diff -Nru critcl-3.1.9/examples/tk8.4/cr.tcl critcl-3.1.17+dfsg/examples/tk8.4/cr.tcl --- critcl-3.1.9/examples/tk8.4/cr.tcl 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/examples/tk8.4/cr.tcl 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,48 @@ +#!/usr/bin/env tclsh +# -*- tcl -*- +# Run the example via mode "compile & run". +# Note: generic code, same in all examples. + +cd [file dirname [file normalize [info script]]] +source ../../lib/critcl/critcl.tcl + +catch {puts [package ifneeded critcl::platform [package present critcl::platform]]} +catch {puts [package ifneeded platform [package present platform]]} + +# Show the config +puts "" +puts "target-config: [critcl::targetconfig]" +puts "target-platform: [critcl::targetplatform]" +puts "target-actual: [critcl::actualtarget]" +puts "build-platform: [critcl::buildplatform]" +puts "cache: [critcl::cache]" +puts "" + +# Pull the package, ignoring build and examples ... +foreach f [glob *.tcl] { + if {[string match build* $f]} continue + if {[string match cr* $f]} continue + if {[string match example* $f]} continue + + puts "Reading $f ..." + source $f +} + +proc ex {args} { + set code [catch {uplevel 1 $args} result] + set code [string map {0 ok 1 error 2 break 3 continue} $code] + set max [expr {80 - [string length $args] - [string length "Example: "]}] + puts "Example: $args [string repeat _ $max]" + puts "Code: (($code))" + puts "Result: (($result))" + puts "" + return +} + +# ... and run the examples. +foreach f [glob -nocomplain example*] { + puts "Running $f ..." + source $f +} + +exit diff -Nru critcl-3.1.9/examples/tk8.4/example.tcl critcl-3.1.17+dfsg/examples/tk8.4/example.tcl --- critcl-3.1.9/examples/tk8.4/example.tcl 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/examples/tk8.4/example.tcl 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,6 @@ + +# Force compile and load. +catch {icounter 4} + +ex icounter 0 +ex ::icounter -1 diff -Nru critcl-3.1.9/examples/tk8.4/icounter.tcl critcl-3.1.17+dfsg/examples/tk8.4/icounter.tcl --- critcl-3.1.9/examples/tk8.4/icounter.tcl 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/examples/tk8.4/icounter.tcl 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,47 @@ +# tk8.4.tcl -- +# +# Implementation of a counter associated an interpreter. +# This code based on critcl v3.1, API compatible to the PTI [x]. +# [x] Pure Tcl Implementation. +# +# Copyright (c) 2016 Andreas Kupries +# +# See the file "license.terms" for information on usage and redistribution +# of this file, and for a DISCLAIMER OF ALL WARRANTIES. + +package require Tcl 8.4 +package require critcl 3.1 + +critcl::buildrequirement { + package require critcl::iassoc ; # Maintain an interpreter association. +} + +# # ## ### ##### ######## ############# ##################### +## Administrivia + +critcl::tcl 8.4 +critcl::tk + +# # ## ### ##### ######## ############# ##################### +## Define and maintain the per-interp structure. + +critcl::iassoc::def icounter {int base} { + int counter; /* The counter variable */ +} { + data->counter = base; +} { + /* Nothing to release */ +} + +# # ## ### ##### ######## ############# ##################### +## Access and expose the per-interp structure to scripts. + +critcl::cproc icounter {Tcl_Interp* interp int base} int { + icounter_data d = icounter (interp, base); + d->counter ++; + return d->counter; +} + +# ### ### ### ######### ######### ######### +## Ready +package provide icounter 1 diff -Nru critcl-3.1.9/examples/tk8.5/build.tcl critcl-3.1.17+dfsg/examples/tk8.5/build.tcl --- critcl-3.1.9/examples/tk8.5/build.tcl 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/examples/tk8.5/build.tcl 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,287 @@ +#!/bin/sh +# -*- tcl -*- \ +exec tclsh "$0" ${1+"$@"} +set me [file normalize [info script]] +set packages {icounter} +proc main {} { + global argv tcl_platform tag + set tag {} + if {![llength $argv]} { + if {$tcl_platform(platform) eq "windows"} { + set argv gui + } else { + set argv help + } + } + if {[catch { + eval _$argv + }]} usage + exit 0 +} +proc usage {{status 1}} { + global errorInfo + if {($errorInfo ne {}) && + ![string match {invalid command name "_*"*} $errorInfo] + } { + puts stderr $::errorInfo + exit + } + + global argv0 + set prefix "Usage: " + foreach c [lsort -dict [info commands _*]] { + set c [string range $c 1 end] + if {[catch { + H${c} + } res]} { + puts stderr "$prefix$argv0 $c args...\n" + } else { + puts stderr "$prefix$argv0 $c $res\n" + } + set prefix " " + } + exit $status +} +proc tag {t} { + global tag + set tag $t + return +} +proc myexit {} { + tag ok + puts DONE + return +} +proc log {args} { + global tag + set newline 1 + if {[lindex $args 0] eq "-nonewline"} { + set newline 0 + set args [lrange $args 1 end] + } + if {[llength $args] == 2} { + lassign $args chan text + if {$chan ni {stdout stderr}} { + ::_puts {*}[lrange [info level 0] 1 end] + return + } + } else { + set text [lindex $args 0] + set chan stdout + } + # chan <=> tag, if not overriden + if {[string match {Files left*} $text]} { + set tag warn + set text \n$text + } + if {$tag eq {}} { set tag $chan } + #::_puts $tag/$text + + .t insert end-1c $text $tag + set tag {} + if {$newline} { + .t insert end-1c \n + } + + update + return +} +proc +x {path} { + catch { file attributes $path -permissions u+x } + return +} +proc grep {file pattern} { + set lines [split [read [set chan [open $file r]]] \n] + close $chan + return [lsearch -all -inline -glob $lines $pattern] +} +proc version {file} { + set provisions [grep $file {*package provide*}] + #puts /$provisions/ + return [lindex $provisions 0 3] +} +proc Hhelp {} { return "\n\tPrint this help" } +proc _help {} { + usage 0 + return +} +proc Hrecipes {} { return "\n\tList all brew commands, without details." } +proc _recipes {} { + set r {} + foreach c [info commands _*] { + lappend r [string range $c 1 end] + } + puts [lsort -dict $r] + return +} +proc Hinstall {} { return "?destination?\n\tInstall all packages.\n\tdestination = path of package directory, default \[info library\]." } +proc _install {{ldir {}}} { + global packages + if {[llength [info level 0]] < 2} { + set ldir [info library] + set idir [file dirname [file dirname $ldir]]/include + } else { + set idir [file dirname $ldir]/include + } + + # Create directories, might not exist. + file mkdir $idir + file mkdir $ldir + + package require critcl::app + + foreach p $packages { + puts "" + + set src [file dirname $::me]/$p.tcl + set version [version $src] + + file delete -force [pwd]/BUILD + critcl::app::main [list -cache [pwd]/BUILD -libdir $ldir -includedir $idir -pkg $src] + + if {![file exists $ldir/$p]} { + set ::NOTE {warn {DONE, with FAILURES}} + break + } + + file delete -force $ldir/$p$version + file rename $ldir/$p $ldir/$p$version + + puts -nonewline "Installed package: " + tag ok + puts $ldir/$p$version + } + return +} +proc Hdebug {} { return "?destination?\n\tInstall all packages, build for debugging.\n\tdestination = path of package directory, default \[info library\]." } +proc _debug {{ldir {}}} { + global packages + if {[llength [info level 0]] < 2} { + set ldir [info library] + set idir [file dirname [file dirname $ldir]]/include + } else { + set idir [file dirname $ldir]/include + } + + # Create directories, might not exist. + file mkdir $idir + file mkdir $ldir + + package require critcl::app + + foreach p $packages { + puts "" + + set src [file dirname $::me]/$p.tcl + set version [version $src] + + file delete -force [pwd]/BUILD.$p + critcl::app::main [list -keep -debug symbols -cache [pwd]/BUILD.$p -libdir $ldir -includedir $idir -pkg $src] + + if {![file exists $ldir/$p]} { + set ::NOTE {warn {DONE, with FAILURES}} + break + } + + file delete -force $ldir/$p$version + file rename $ldir/$p $ldir/$p$version + + puts -nonewline "Installed package: " + tag ok + puts $ldir/$p$version + } + return +} +proc Hgui {} { return "\n\tInstall all packages, and application.\n\tDone from a small GUI." } +proc _gui {} { + global INSTALLPATH + package require Tk + package require widget::scrolledwindow + + wm protocol . WM_DELETE_WINDOW ::_exit + + label .l -text {Install Path: } + entry .e -textvariable ::INSTALLPATH + button .i -command Install -text Install + + widget::scrolledwindow .st -borderwidth 1 -relief sunken + text .t + .st setwidget .t + + .t tag configure stdout -font {Helvetica 8} + .t tag configure stderr -background red -font {Helvetica 12} + .t tag configure ok -background green -font {Helvetica 8} + .t tag configure warn -background yellow -font {Helvetica 12} + + grid .l -row 0 -column 0 -sticky new + grid .e -row 0 -column 1 -sticky new + grid .i -row 0 -column 2 -sticky new + grid .st -row 1 -column 0 -sticky swen -columnspan 2 + + grid rowconfigure . 0 -weight 0 + grid rowconfigure . 1 -weight 1 + + grid columnconfigure . 0 -weight 0 + grid columnconfigure . 1 -weight 1 + grid columnconfigure . 2 -weight 0 + + set INSTALLPATH [info library] + + # Redirect all output into our log window, and disable uncontrolled exit. + rename ::puts ::_puts + rename ::log ::puts + rename ::exit ::_exit + rename ::myexit ::exit + + # And start to interact with the user. + vwait forever + return +} +proc Install {} { + global INSTALLPATH NOTE + .i configure -state disabled + + set NOTE {ok DONE} + set fail [catch { + _install $INSTALLPATH + + puts "" + tag [lindex $NOTE 0] + puts [lindex $NOTE 1] + } e o] + + .i configure -state normal + .i configure -command ::_exit -text Exit -bg green + + if {$fail} { + # rethrow + return {*}$o $e + } + return +} +proc Hwrap4tea {} { return "?destination?\n\tGenerate a source package with TEA-based build system wrapped around critcl.\n\tdestination = path of source package directory, default is sub-directory 'tea' of the CWD." } +proc _wrap4tea {{dst {}}} { + global packages + + if {[llength [info level 0]] < 2} { + set dst [file join [pwd] tea] + } + + file mkdir $dst + + package require critcl::app + + foreach p $packages { + set src [file dirname $::me]/$p.tcl + set version [version $src] + + file delete -force [pwd]/BUILD + critcl::app::main [list -cache [pwd]/BUILD -libdir $dst -tea $src] + file delete -force $dst/$p$version + file rename $dst/$p $dst/$p$version + + puts "Wrapped package: $dst/$p$version" + } + return +} +main diff -Nru critcl-3.1.9/examples/tk8.5/cr.tcl critcl-3.1.17+dfsg/examples/tk8.5/cr.tcl --- critcl-3.1.9/examples/tk8.5/cr.tcl 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/examples/tk8.5/cr.tcl 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,48 @@ +#!/usr/bin/env tclsh +# -*- tcl -*- +# Run the example via mode "compile & run". +# Note: generic code, same in all examples. + +cd [file dirname [file normalize [info script]]] +source ../../lib/critcl/critcl.tcl + +catch {puts [package ifneeded critcl::platform [package present critcl::platform]]} +catch {puts [package ifneeded platform [package present platform]]} + +# Show the config +puts "" +puts "target-config: [critcl::targetconfig]" +puts "target-platform: [critcl::targetplatform]" +puts "target-actual: [critcl::actualtarget]" +puts "build-platform: [critcl::buildplatform]" +puts "cache: [critcl::cache]" +puts "" + +# Pull the package, ignoring build and examples ... +foreach f [glob *.tcl] { + if {[string match build* $f]} continue + if {[string match cr* $f]} continue + if {[string match example* $f]} continue + + puts "Reading $f ..." + source $f +} + +proc ex {args} { + set code [catch {uplevel 1 $args} result] + set code [string map {0 ok 1 error 2 break 3 continue} $code] + set max [expr {80 - [string length $args] - [string length "Example: "]}] + puts "Example: $args [string repeat _ $max]" + puts "Code: (($code))" + puts "Result: (($result))" + puts "" + return +} + +# ... and run the examples. +foreach f [glob -nocomplain example*] { + puts "Running $f ..." + source $f +} + +exit diff -Nru critcl-3.1.9/examples/tk8.5/example.tcl critcl-3.1.17+dfsg/examples/tk8.5/example.tcl --- critcl-3.1.9/examples/tk8.5/example.tcl 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/examples/tk8.5/example.tcl 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,6 @@ + +# Force compile and load. +catch {icounter 4} + +ex icounter 0 +ex ::icounter -1 diff -Nru critcl-3.1.9/examples/tk8.5/icounter.tcl critcl-3.1.17+dfsg/examples/tk8.5/icounter.tcl --- critcl-3.1.9/examples/tk8.5/icounter.tcl 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/examples/tk8.5/icounter.tcl 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,47 @@ +# tk8.5.tcl -- +# +# Implementation of a counter associated an interpreter. +# This code based on critcl v3.1, API compatible to the PTI [x]. +# [x] Pure Tcl Implementation. +# +# Copyright (c) 2016 Andreas Kupries +# +# See the file "license.terms" for information on usage and redistribution +# of this file, and for a DISCLAIMER OF ALL WARRANTIES. + +package require Tcl 8.5 +package require critcl 3.1 + +critcl::buildrequirement { + package require critcl::iassoc ; # Maintain an interpreter association. +} + +# # ## ### ##### ######## ############# ##################### +## Administrivia + +critcl::tcl 8.5 +critcl::tk + +# # ## ### ##### ######## ############# ##################### +## Define and maintain the per-interp structure. + +critcl::iassoc::def icounter {int base} { + int counter; /* The counter variable */ +} { + data->counter = base; +} { + /* Nothing to release */ +} + +# # ## ### ##### ######## ############# ##################### +## Access and expose the per-interp structure to scripts. + +critcl::cproc icounter {Tcl_Interp* interp int base} int { + icounter_data d = icounter (interp, base); + d->counter ++; + return d->counter; +} + +# ### ### ### ######### ######### ######### +## Ready +package provide icounter 1 diff -Nru critcl-3.1.9/examples/tk8.6/build.tcl critcl-3.1.17+dfsg/examples/tk8.6/build.tcl --- critcl-3.1.9/examples/tk8.6/build.tcl 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/examples/tk8.6/build.tcl 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,287 @@ +#!/bin/sh +# -*- tcl -*- \ +exec tclsh "$0" ${1+"$@"} +set me [file normalize [info script]] +set packages {icounter} +proc main {} { + global argv tcl_platform tag + set tag {} + if {![llength $argv]} { + if {$tcl_platform(platform) eq "windows"} { + set argv gui + } else { + set argv help + } + } + if {[catch { + eval _$argv + }]} usage + exit 0 +} +proc usage {{status 1}} { + global errorInfo + if {($errorInfo ne {}) && + ![string match {invalid command name "_*"*} $errorInfo] + } { + puts stderr $::errorInfo + exit + } + + global argv0 + set prefix "Usage: " + foreach c [lsort -dict [info commands _*]] { + set c [string range $c 1 end] + if {[catch { + H${c} + } res]} { + puts stderr "$prefix$argv0 $c args...\n" + } else { + puts stderr "$prefix$argv0 $c $res\n" + } + set prefix " " + } + exit $status +} +proc tag {t} { + global tag + set tag $t + return +} +proc myexit {} { + tag ok + puts DONE + return +} +proc log {args} { + global tag + set newline 1 + if {[lindex $args 0] eq "-nonewline"} { + set newline 0 + set args [lrange $args 1 end] + } + if {[llength $args] == 2} { + lassign $args chan text + if {$chan ni {stdout stderr}} { + ::_puts {*}[lrange [info level 0] 1 end] + return + } + } else { + set text [lindex $args 0] + set chan stdout + } + # chan <=> tag, if not overriden + if {[string match {Files left*} $text]} { + set tag warn + set text \n$text + } + if {$tag eq {}} { set tag $chan } + #::_puts $tag/$text + + .t insert end-1c $text $tag + set tag {} + if {$newline} { + .t insert end-1c \n + } + + update + return +} +proc +x {path} { + catch { file attributes $path -permissions u+x } + return +} +proc grep {file pattern} { + set lines [split [read [set chan [open $file r]]] \n] + close $chan + return [lsearch -all -inline -glob $lines $pattern] +} +proc version {file} { + set provisions [grep $file {*package provide*}] + #puts /$provisions/ + return [lindex $provisions 0 3] +} +proc Hhelp {} { return "\n\tPrint this help" } +proc _help {} { + usage 0 + return +} +proc Hrecipes {} { return "\n\tList all brew commands, without details." } +proc _recipes {} { + set r {} + foreach c [info commands _*] { + lappend r [string range $c 1 end] + } + puts [lsort -dict $r] + return +} +proc Hinstall {} { return "?destination?\n\tInstall all packages.\n\tdestination = path of package directory, default \[info library\]." } +proc _install {{ldir {}}} { + global packages + if {[llength [info level 0]] < 2} { + set ldir [info library] + set idir [file dirname [file dirname $ldir]]/include + } else { + set idir [file dirname $ldir]/include + } + + # Create directories, might not exist. + file mkdir $idir + file mkdir $ldir + + package require critcl::app + + foreach p $packages { + puts "" + + set src [file dirname $::me]/$p.tcl + set version [version $src] + + file delete -force [pwd]/BUILD + critcl::app::main [list -cache [pwd]/BUILD -libdir $ldir -includedir $idir -pkg $src] + + if {![file exists $ldir/$p]} { + set ::NOTE {warn {DONE, with FAILURES}} + break + } + + file delete -force $ldir/$p$version + file rename $ldir/$p $ldir/$p$version + + puts -nonewline "Installed package: " + tag ok + puts $ldir/$p$version + } + return +} +proc Hdebug {} { return "?destination?\n\tInstall all packages, build for debugging.\n\tdestination = path of package directory, default \[info library\]." } +proc _debug {{ldir {}}} { + global packages + if {[llength [info level 0]] < 2} { + set ldir [info library] + set idir [file dirname [file dirname $ldir]]/include + } else { + set idir [file dirname $ldir]/include + } + + # Create directories, might not exist. + file mkdir $idir + file mkdir $ldir + + package require critcl::app + + foreach p $packages { + puts "" + + set src [file dirname $::me]/$p.tcl + set version [version $src] + + file delete -force [pwd]/BUILD.$p + critcl::app::main [list -keep -debug symbols -cache [pwd]/BUILD.$p -libdir $ldir -includedir $idir -pkg $src] + + if {![file exists $ldir/$p]} { + set ::NOTE {warn {DONE, with FAILURES}} + break + } + + file delete -force $ldir/$p$version + file rename $ldir/$p $ldir/$p$version + + puts -nonewline "Installed package: " + tag ok + puts $ldir/$p$version + } + return +} +proc Hgui {} { return "\n\tInstall all packages, and application.\n\tDone from a small GUI." } +proc _gui {} { + global INSTALLPATH + package require Tk + package require widget::scrolledwindow + + wm protocol . WM_DELETE_WINDOW ::_exit + + label .l -text {Install Path: } + entry .e -textvariable ::INSTALLPATH + button .i -command Install -text Install + + widget::scrolledwindow .st -borderwidth 1 -relief sunken + text .t + .st setwidget .t + + .t tag configure stdout -font {Helvetica 8} + .t tag configure stderr -background red -font {Helvetica 12} + .t tag configure ok -background green -font {Helvetica 8} + .t tag configure warn -background yellow -font {Helvetica 12} + + grid .l -row 0 -column 0 -sticky new + grid .e -row 0 -column 1 -sticky new + grid .i -row 0 -column 2 -sticky new + grid .st -row 1 -column 0 -sticky swen -columnspan 2 + + grid rowconfigure . 0 -weight 0 + grid rowconfigure . 1 -weight 1 + + grid columnconfigure . 0 -weight 0 + grid columnconfigure . 1 -weight 1 + grid columnconfigure . 2 -weight 0 + + set INSTALLPATH [info library] + + # Redirect all output into our log window, and disable uncontrolled exit. + rename ::puts ::_puts + rename ::log ::puts + rename ::exit ::_exit + rename ::myexit ::exit + + # And start to interact with the user. + vwait forever + return +} +proc Install {} { + global INSTALLPATH NOTE + .i configure -state disabled + + set NOTE {ok DONE} + set fail [catch { + _install $INSTALLPATH + + puts "" + tag [lindex $NOTE 0] + puts [lindex $NOTE 1] + } e o] + + .i configure -state normal + .i configure -command ::_exit -text Exit -bg green + + if {$fail} { + # rethrow + return {*}$o $e + } + return +} +proc Hwrap4tea {} { return "?destination?\n\tGenerate a source package with TEA-based build system wrapped around critcl.\n\tdestination = path of source package directory, default is sub-directory 'tea' of the CWD." } +proc _wrap4tea {{dst {}}} { + global packages + + if {[llength [info level 0]] < 2} { + set dst [file join [pwd] tea] + } + + file mkdir $dst + + package require critcl::app + + foreach p $packages { + set src [file dirname $::me]/$p.tcl + set version [version $src] + + file delete -force [pwd]/BUILD + critcl::app::main [list -cache [pwd]/BUILD -libdir $dst -tea $src] + file delete -force $dst/$p$version + file rename $dst/$p $dst/$p$version + + puts "Wrapped package: $dst/$p$version" + } + return +} +main diff -Nru critcl-3.1.9/examples/tk8.6/cr.tcl critcl-3.1.17+dfsg/examples/tk8.6/cr.tcl --- critcl-3.1.9/examples/tk8.6/cr.tcl 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/examples/tk8.6/cr.tcl 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,48 @@ +#!/usr/bin/env tclsh +# -*- tcl -*- +# Run the example via mode "compile & run". +# Note: generic code, same in all examples. + +cd [file dirname [file normalize [info script]]] +source ../../lib/critcl/critcl.tcl + +catch {puts [package ifneeded critcl::platform [package present critcl::platform]]} +catch {puts [package ifneeded platform [package present platform]]} + +# Show the config +puts "" +puts "target-config: [critcl::targetconfig]" +puts "target-platform: [critcl::targetplatform]" +puts "target-actual: [critcl::actualtarget]" +puts "build-platform: [critcl::buildplatform]" +puts "cache: [critcl::cache]" +puts "" + +# Pull the package, ignoring build and examples ... +foreach f [glob *.tcl] { + if {[string match build* $f]} continue + if {[string match cr* $f]} continue + if {[string match example* $f]} continue + + puts "Reading $f ..." + source $f +} + +proc ex {args} { + set code [catch {uplevel 1 $args} result] + set code [string map {0 ok 1 error 2 break 3 continue} $code] + set max [expr {80 - [string length $args] - [string length "Example: "]}] + puts "Example: $args [string repeat _ $max]" + puts "Code: (($code))" + puts "Result: (($result))" + puts "" + return +} + +# ... and run the examples. +foreach f [glob -nocomplain example*] { + puts "Running $f ..." + source $f +} + +exit diff -Nru critcl-3.1.9/examples/tk8.6/example.tcl critcl-3.1.17+dfsg/examples/tk8.6/example.tcl --- critcl-3.1.9/examples/tk8.6/example.tcl 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/examples/tk8.6/example.tcl 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,6 @@ + +# Force compile and load. +catch {icounter 4} + +ex icounter 0 +ex ::icounter -1 diff -Nru critcl-3.1.9/examples/tk8.6/icounter.tcl critcl-3.1.17+dfsg/examples/tk8.6/icounter.tcl --- critcl-3.1.9/examples/tk8.6/icounter.tcl 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/examples/tk8.6/icounter.tcl 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,47 @@ +# tk8.6.tcl -- +# +# Implementation of a counter associated an interpreter. +# This code based on critcl v3.1, API compatible to the PTI [x]. +# [x] Pure Tcl Implementation. +# +# Copyright (c) 2012 Andreas Kupries +# +# See the file "license.terms" for information on usage and redistribution +# of this file, and for a DISCLAIMER OF ALL WARRANTIES. + +package require Tcl 8.5 +package require critcl 3.1 + +critcl::buildrequirement { + package require critcl::iassoc ; # Maintain an interpreter association. +} + +# # ## ### ##### ######## ############# ##################### +## Administrivia + +critcl::tcl 8.6 +critcl::tk + +# # ## ### ##### ######## ############# ##################### +## Define and maintain the per-interp structure. + +critcl::iassoc::def icounter {int base} { + int counter; /* The counter variable */ +} { + data->counter = base; +} { + /* Nothing to release */ +} + +# # ## ### ##### ######## ############# ##################### +## Access and expose the per-interp structure to scripts. + +critcl::cproc icounter {Tcl_Interp* interp int base} int { + icounter_data d = icounter (interp, base); + d->counter ++; + return d->counter; +} + +# ### ### ### ######### ######### ######### +## Ready +package provide icounter 1 diff -Nru critcl-3.1.9/examples/trace/build.tcl critcl-3.1.17+dfsg/examples/trace/build.tcl --- critcl-3.1.9/examples/trace/build.tcl 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/examples/trace/build.tcl 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,283 @@ +#!/bin/sh +# -*- tcl -*- \ +exec tclsh "$0" ${1+"$@"} +set me [file normalize [info script]] +set packages {pool} +proc main {} { + global argv tcl_platform tag + set tag {} + if {![llength $argv]} { + if {$tcl_platform(platform) eq "windows"} { + set argv gui + } else { + set argv help + } + } + if {[catch { + eval _$argv + }]} usage + exit 0 +} +proc usage {{status 1}} { + global errorInfo + if {[info exists errorInfo] && ($errorInfo ne {}) && + ![string match {invalid command name "_*"*} $errorInfo] + } { + puts stderr $::errorInfo + exit + } + + global argv0 + set prefix "Usage: " + foreach c [lsort -dict [info commands _*]] { + set c [string range $c 1 end] + if {[catch { + H${c} + } res]} { + puts stderr "$prefix$argv0 $c args...\n" + } else { + puts stderr "$prefix$argv0 $c $res\n" + } + set prefix " " + } + exit $status +} +proc tag {t} { + global tag + set tag $t + return +} +proc myexit {} { + tag ok + puts DONE + return +} +proc log {args} { + global tag + set newline 1 + if {[lindex $args 0] eq "-nonewline"} { + set newline 0 + set args [lrange $args 1 end] + } + if {[llength $args] == 2} { + lassign $args chan text + if {$chan ni {stdout stderr}} { + ::_puts {*}[lrange [info level 0] 1 end] + return + } + } else { + set text [lindex $args 0] + set chan stdout + } + # chan <=> tag, if not overriden + if {[string match {Files left*} $text]} { + set tag warn + set text \n$text + } + if {$tag eq {}} { set tag $chan } + #::_puts $tag/$text + + .t insert end-1c $text $tag + set tag {} + if {$newline} { + .t insert end-1c \n + } + + update + return +} +proc +x {path} { + catch { file attributes $path -permissions u+x } + return +} +proc grep {file pattern} { + set lines [split [read [set chan [open $file r]]] \n] + close $chan + return [lsearch -all -inline -glob $lines $pattern] +} +proc version {file} { + set provisions [grep $file {*package provide*}] + #puts /$provisions/ + return [lindex $provisions 0 3] +} +proc Hhelp {} { return "\n\tPrint this help" } +proc _help {} { + usage 0 + return +} +proc Hrecipes {} { return "\n\tList all brew commands, without details." } +proc _recipes {} { + set r {} + foreach c [info commands _*] { + lappend r [string range $c 1 end] + } + puts [lsort -dict $r] + return +} +proc Hinstall {} { return "?destination?\n\tInstall all packages, and application.\n\tdestination = path of package directory, default \[info library\]." } +proc _install {{ldir {}}} { + global packages + if {[llength [info level 0]] < 2} { + set ldir [info library] + set idir [file dirname [file dirname $ldir]]/include + } else { + set idir [file dirname $ldir]/include + } + + # Create directories, might not exist. + file mkdir $idir + file mkdir $ldir + + package require critcl::app + + foreach p $packages { + set src [file dirname $::me]/$p.tcl + set version [version $src] + + file delete -force [pwd]/BUILD + critcl::app::main [list -keep -cache [pwd]/BUILD -libdir $ldir -includedir $idir -pkg $src] + + if {![file exists $ldir/$p]} { + set ::NOTE {warn {DONE, with FAILURES}} + break + } + + file delete -force $ldir/$p$version + file rename $ldir/$p $ldir/$p$version + + puts -nonewline "Installed package: " + tag ok + puts $ldir/$p$version + } + return +} +proc Hdebug {} { return "?destination?\n\tInstall debug builds of all packages.\n\tdestination = path of package directory, default \[info library\]." } +proc _debug {{ldir {}}} { + global packages + if {[llength [info level 0]] < 2} { + set ldir [info library] + set idir [file dirname [file dirname $ldir]]/include + } else { + set idir [file dirname $ldir]/include + } + + # Create directories, might not exist. + file mkdir $idir + file mkdir $ldir + + package require critcl::app + + foreach p $packages { + set src [file dirname $::me]/$p.tcl + set version [version $src] + + file delete -force [pwd]/BUILD.$p + critcl::app::main [list -cache [pwd]/BUILD.$p -keep -debug all -libdir $ldir -includedir $idir -pkg $src] + + if {![file exists $ldir/$p]} { + set ::NOTE {warn {DONE, with FAILURES}} + break + } + + file delete -force $ldir/$p$version + file rename $ldir/$p $ldir/$p$version + + puts -nonewline "Installed package: " + tag ok + puts $ldir/$p$version + } + return +} +proc Hgui {} { return "\n\tInstall all packages, and application.\n\tDone from a small GUI." } +proc _gui {} { + global INSTALLPATH + package require Tk + package require widget::scrolledwindow + + wm protocol . WM_DELETE_WINDOW ::_exit + + label .l -text {Install Path: } + entry .e -textvariable ::INSTALLPATH + button .i -command Install -text Install + + widget::scrolledwindow .st -borderwidth 1 -relief sunken + text .t + .st setwidget .t + + .t tag configure stdout -font {Helvetica 8} + .t tag configure stderr -background red -font {Helvetica 12} + .t tag configure ok -background green -font {Helvetica 8} + .t tag configure warn -background yellow -font {Helvetica 12} + + grid .l -row 0 -column 0 -sticky new + grid .e -row 0 -column 1 -sticky new + grid .i -row 0 -column 2 -sticky new + grid .st -row 1 -column 0 -sticky swen -columnspan 2 + + grid rowconfigure . 0 -weight 0 + grid rowconfigure . 1 -weight 1 + + grid columnconfigure . 0 -weight 0 + grid columnconfigure . 1 -weight 1 + grid columnconfigure . 2 -weight 0 + + set INSTALLPATH [info library] + + # Redirect all output into our log window, and disable uncontrolled exit. + rename ::puts ::_puts + rename ::log ::puts + rename ::exit ::_exit + rename ::myexit ::exit + + # And start to interact with the user. + vwait forever + return +} +proc Install {} { + global INSTALLPATH NOTE + .i configure -state disabled + + set NOTE {ok DONE} + set fail [catch { + _install $INSTALLPATH + + puts "" + tag [lindex $NOTE 0] + puts [lindex $NOTE 1] + } e o] + + .i configure -state normal + .i configure -command ::_exit -text Exit -bg green + + if {$fail} { + # rethrow + return {*}$o $e + } + return +} +proc Hwrap4tea {} { return "?destination?\n\tGenerate a source package with TEA-based build system wrapped around critcl.\n\tdestination = path of source package directory, default is sub-directory 'tea' of the CWD." } +proc _wrap4tea {{dst {}}} { + global packages + + if {[llength [info level 0]] < 2} { + set dst [file join [pwd] tea] + } + + file mkdir $dst + + package require critcl::app + + foreach p $packages { + set src [file dirname $::me]/$p.tcl + set version [version $src] + + file delete -force [pwd]/BUILD + critcl::app::main [list -cache [pwd]/BUILD -libdir $dst -tea $src] + file delete -force $dst/$p$version + file rename $dst/$p $dst/$p$version + + puts "Wrapped package: $dst/$p$version" + } + return +} +main diff -Nru critcl-3.1.9/examples/trace/cr.tcl critcl-3.1.17+dfsg/examples/trace/cr.tcl --- critcl-3.1.9/examples/trace/cr.tcl 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/examples/trace/cr.tcl 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,45 @@ +#!/usr/bin/env tclsh +# -*- tcl -*- +# Run the example via mode "compile & run". +# Note: generic code, same in all examples. + +cd [file dirname [file normalize [info script]]] +source ../../lib/critcl/critcl.tcl + +# Show the config +puts "" +puts "target-config: [critcl::targetconfig]" +puts "target-platform: [critcl::targetplatform]" +puts "target-actual: [critcl::actualtarget]" +puts "build-platform: [critcl::buildplatform]" +puts "cache: [critcl::cache]" +puts "" + +# Pull the package, ignoring build and examples ... +foreach f [glob *.tcl] { + if {[string match build* $f]} continue + if {[string match cr* $f]} continue + if {[string match example* $f]} continue + + puts "Reading $f ..." + source $f +} + +proc ex {args} { + set code [catch {uplevel 1 $args} result] + set code [string map {0 ok 1 error 2 break 3 continue} $code] + set max [expr {80 - [string length $args] - [string length "Example: "]}] + puts "Example: $args [string repeat _ $max]" + puts "Code: (($code))" + puts "Result: (($result))" + puts "" + return +} + +# ... and run the examples. +foreach f [glob -nocomplain example*] { + puts "Running $f ..." + source $f +} + +exit diff -Nru critcl-3.1.9/examples/trace/example.tcl critcl-3.1.17+dfsg/examples/trace/example.tcl --- critcl-3.1.9/examples/trace/example.tcl 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/examples/trace/example.tcl 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,9 @@ + +# Force compile and load. +catch {str} + +ex str 1 +ex xstr 3 +ex moon +ex nothing +ex xstr sun diff -Nru critcl-3.1.9/examples/trace/pool.tcl critcl-3.1.17+dfsg/examples/trace/pool.tcl --- critcl-3.1.9/examples/trace/pool.tcl 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/examples/trace/pool.tcl 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,65 @@ +# pool.tcl -- +# +# A template demonstrating the cproc/ccommand tracing facility. +# Built on top of the string pool demonstrator. +# +# Copyright (c) 2014 Andreas Kupries + +# # ## ### ##### ######## ############# ##################### +## Requirements + +package require Tcl 8.4 +package require critcl 3.1.11 +package require critcl::literals 1.1 ;# result-type + +# Activate tracing code +critcl::config trace yes + +# # ## ### ##### ######## ############# ##################### +## Administrivia + +critcl::license {Andreas Kupries} BSD + +critcl::summary {Tracing cproc, ccomands, etc} + +critcl::description { + This package implements nothing. It serves only as a + demonstration and template on how to activate the builtin + tracing of cprocs, ccommands, etc. +} + +critcl::subject demonstration trace {narrative trace} debug + +# # ## ### ##### ######## ############# ##################### +## C code. + +critcl::literals::def demo { + here "here" + comes "comes" + the "the" + sun "sun" +} + +critcl::cproc str {Tcl_Interp* ip int code} object { + Tcl_Obj* res = demo (ip, code); + Tcl_IncrRefCount (res); + return res; +} + +critcl::cproc xstr {Tcl_Interp* ip int code} demo { + return code; +} + +critcl::cconst moon int 55 + +critcl::ccommand nothing {} { + /* Set nothing */ + return TCL_OK; +} + +# str 0 +# str 7 - panic, abort, core dump + +# ### ### ### ######### ######### ######### +## Ready +package provide pool 1 diff -Nru critcl-3.1.9/examples/variadic/build.tcl critcl-3.1.17+dfsg/examples/variadic/build.tcl --- critcl-3.1.9/examples/variadic/build.tcl 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/examples/variadic/build.tcl 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,283 @@ +#!/bin/sh +# -*- tcl -*- \ +exec tclsh "$0" ${1+"$@"} +set me [file normalize [info script]] +set packages {variadic} +proc main {} { + global argv tcl_platform tag + set tag {} + if {![llength $argv]} { + if {$tcl_platform(platform) eq "windows"} { + set argv gui + } else { + set argv help + } + } + if {[catch { + eval _$argv + }]} usage + exit 0 +} +proc usage {{status 1}} { + global errorInfo + if {[info exists errorInfo] && ($errorInfo ne {}) && + ![string match {invalid command name "_*"*} $errorInfo] + } { + puts stderr $::errorInfo + exit + } + + global argv0 + set prefix "Usage: " + foreach c [lsort -dict [info commands _*]] { + set c [string range $c 1 end] + if {[catch { + H${c} + } res]} { + puts stderr "$prefix$argv0 $c args...\n" + } else { + puts stderr "$prefix$argv0 $c $res\n" + } + set prefix " " + } + exit $status +} +proc tag {t} { + global tag + set tag $t + return +} +proc myexit {} { + tag ok + puts DONE + return +} +proc log {args} { + global tag + set newline 1 + if {[lindex $args 0] eq "-nonewline"} { + set newline 0 + set args [lrange $args 1 end] + } + if {[llength $args] == 2} { + lassign $args chan text + if {$chan ni {stdout stderr}} { + ::_puts {*}[lrange [info level 0] 1 end] + return + } + } else { + set text [lindex $args 0] + set chan stdout + } + # chan <=> tag, if not overriden + if {[string match {Files left*} $text]} { + set tag warn + set text \n$text + } + if {$tag eq {}} { set tag $chan } + #::_puts $tag/$text + + .t insert end-1c $text $tag + set tag {} + if {$newline} { + .t insert end-1c \n + } + + update + return +} +proc +x {path} { + catch { file attributes $path -permissions u+x } + return +} +proc grep {file pattern} { + set lines [split [read [set chan [open $file r]]] \n] + close $chan + return [lsearch -all -inline -glob $lines $pattern] +} +proc version {file} { + set provisions [grep $file {*package provide*}] + #puts /$provisions/ + return [lindex $provisions 0 3] +} +proc Hhelp {} { return "\n\tPrint this help" } +proc _help {} { + usage 0 + return +} +proc Hrecipes {} { return "\n\tList all brew commands, without details." } +proc _recipes {} { + set r {} + foreach c [info commands _*] { + lappend r [string range $c 1 end] + } + puts [lsort -dict $r] + return +} +proc Hinstall {} { return "?destination?\n\tInstall all packages, and application.\n\tdestination = path of package directory, default \[info library\]." } +proc _install {{ldir {}}} { + global packages + if {[llength [info level 0]] < 2} { + set ldir [info library] + set idir [file dirname [file dirname $ldir]]/include + } else { + set idir [file dirname $ldir]/include + } + + # Create directories, might not exist. + file mkdir $idir + file mkdir $ldir + + package require critcl::app + + foreach p $packages { + set src [file dirname $::me]/$p.tcl + set version [version $src] + + file delete -force [pwd]/BUILD + critcl::app::main [list -cache [pwd]/BUILD -libdir $ldir -includedir $idir -pkg $src] + + if {![file exists $ldir/$p]} { + set ::NOTE {warn {DONE, with FAILURES}} + break + } + + file delete -force $ldir/$p$version + file rename $ldir/$p $ldir/$p$version + + puts -nonewline "Installed package: " + tag ok + puts $ldir/$p$version + } + return +} +proc Hdebug {} { return "?destination?\n\tInstall debug builds of all packages.\n\tdestination = path of package directory, default \[info library\]." } +proc _debug {{ldir {}}} { + global packages + if {[llength [info level 0]] < 2} { + set ldir [info library] + set idir [file dirname [file dirname $ldir]]/include + } else { + set idir [file dirname $ldir]/include + } + + # Create directories, might not exist. + file mkdir $idir + file mkdir $ldir + + package require critcl::app + + foreach p $packages { + set src [file dirname $::me]/$p.tcl + set version [version $src] + + file delete -force [pwd]/BUILD.$p + critcl::app::main [list -cache [pwd]/BUILD.$p -keep -debug all -libdir $ldir -includedir $idir -pkg $src] + + if {![file exists $ldir/$p]} { + set ::NOTE {warn {DONE, with FAILURES}} + break + } + + file delete -force $ldir/$p$version + file rename $ldir/$p $ldir/$p$version + + puts -nonewline "Installed package: " + tag ok + puts $ldir/$p$version + } + return +} +proc Hgui {} { return "\n\tInstall all packages, and application.\n\tDone from a small GUI." } +proc _gui {} { + global INSTALLPATH + package require Tk + package require widget::scrolledwindow + + wm protocol . WM_DELETE_WINDOW ::_exit + + label .l -text {Install Path: } + entry .e -textvariable ::INSTALLPATH + button .i -command Install -text Install + + widget::scrolledwindow .st -borderwidth 1 -relief sunken + text .t + .st setwidget .t + + .t tag configure stdout -font {Helvetica 8} + .t tag configure stderr -background red -font {Helvetica 12} + .t tag configure ok -background green -font {Helvetica 8} + .t tag configure warn -background yellow -font {Helvetica 12} + + grid .l -row 0 -column 0 -sticky new + grid .e -row 0 -column 1 -sticky new + grid .i -row 0 -column 2 -sticky new + grid .st -row 1 -column 0 -sticky swen -columnspan 2 + + grid rowconfigure . 0 -weight 0 + grid rowconfigure . 1 -weight 1 + + grid columnconfigure . 0 -weight 0 + grid columnconfigure . 1 -weight 1 + grid columnconfigure . 2 -weight 0 + + set INSTALLPATH [info library] + + # Redirect all output into our log window, and disable uncontrolled exit. + rename ::puts ::_puts + rename ::log ::puts + rename ::exit ::_exit + rename ::myexit ::exit + + # And start to interact with the user. + vwait forever + return +} +proc Install {} { + global INSTALLPATH NOTE + .i configure -state disabled + + set NOTE {ok DONE} + set fail [catch { + _install $INSTALLPATH + + puts "" + tag [lindex $NOTE 0] + puts [lindex $NOTE 1] + } e o] + + .i configure -state normal + .i configure -command ::_exit -text Exit -bg green + + if {$fail} { + # rethrow + return {*}$o $e + } + return +} +proc Hwrap4tea {} { return "?destination?\n\tGenerate a source package with TEA-based build system wrapped around critcl.\n\tdestination = path of source package directory, default is sub-directory 'tea' of the CWD." } +proc _wrap4tea {{dst {}}} { + global packages + + if {[llength [info level 0]] < 2} { + set dst [file join [pwd] tea] + } + + file mkdir $dst + + package require critcl::app + + foreach p $packages { + set src [file dirname $::me]/$p.tcl + set version [version $src] + + file delete -force [pwd]/BUILD + critcl::app::main [list -cache [pwd]/BUILD -libdir $dst -tea $src] + file delete -force $dst/$p$version + file rename $dst/$p $dst/$p$version + + puts "Wrapped package: $dst/$p$version" + } + return +} +main diff -Nru critcl-3.1.9/examples/variadic/cr.tcl critcl-3.1.17+dfsg/examples/variadic/cr.tcl --- critcl-3.1.9/examples/variadic/cr.tcl 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/examples/variadic/cr.tcl 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,45 @@ +#!/usr/bin/env tclsh +# -*- tcl -*- +# Run the example via mode "compile & run". +# Note: generic code, same in all examples. + +cd [file dirname [file normalize [info script]]] +source ../../lib/critcl/critcl.tcl + +# Show the config +puts "" +puts "target-config: [critcl::targetconfig]" +puts "target-platform: [critcl::targetplatform]" +puts "target-actual: [critcl::actualtarget]" +puts "build-platform: [critcl::buildplatform]" +puts "cache: [critcl::cache]" +puts "" + +# Pull the package, ignoring build and examples ... +foreach f [glob *.tcl] { + if {[string match build* $f]} continue + if {[string match cr* $f]} continue + if {[string match example* $f]} continue + + puts "Reading $f ..." + source $f +} + +proc ex {args} { + set code [catch {uplevel 1 $args} result] + set code [string map {0 ok 1 error 2 break 3 continue} $code] + set max [expr {80 - [string length $args] - [string length "Example: "]}] + puts "Example: $args [string repeat _ $max]" + puts "Code: (($code))" + puts "Result: (($result))" + puts "" + return +} + +# ... and run the examples. +foreach f [glob -nocomplain example*] { + puts "Running $f ..." + source $f +} + +exit diff -Nru critcl-3.1.9/examples/variadic/example.tcl critcl-3.1.17+dfsg/examples/variadic/example.tcl --- critcl-3.1.9/examples/variadic/example.tcl 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/examples/variadic/example.tcl 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,16 @@ +#!/usr/bin/env tclsh + +package require Tcl 8.5 +package require variadic + +foreach a { + {} + {6} + {6 7} + {6 7 8} + {6 7 8 9} + {6 7 8 9 0} +} { + ex variadic {*}$a + ex ovariadic {*}$a +} diff -Nru critcl-3.1.9/examples/variadic/variadic.tcl critcl-3.1.17+dfsg/examples/variadic/variadic.tcl --- critcl-3.1.9/examples/variadic/variadic.tcl 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/examples/variadic/variadic.tcl 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,48 @@ +# variadic.tcl -- +# +# A template demonstrating the handling of variadic arguments +# to cproc. +# +# Copyright (c) 2012 Andreas Kupries + +# # ## ### ##### ######## ############# ##################### +## Requirements + +package require Tcl 8.4 +package require critcl 3.1.2 + +# # ## ### ##### ######## ############# ##################### +## Administrivia + +critcl::license {Andreas Kupries} BSD + +critcl::summary {Variadic arguments for cproc} + +critcl::description { + This package implements nothing. It serves only as a + demonstration and template on how to declare cproc's + with variadic arguments. +} + +critcl::subject demonstration {cproc variadic arguments} +#critcl::config lines 0 + +# # ## ### ##### ######## ############# ##################### +## C code. + +critcl::cproc variadic {int args} void { + int i; + for (i=0; i < args.c; i++) printf ("[%2d] = %d\n", i, args.v[i]); + fflush(stdout); +} + +critcl::cproc ovariadic {Tcl_Obj* args} void { + int i; + for (i=0; i < args.c; i++) printf ("[%2d] = '%s'\n", i, Tcl_GetString(args.v[i])); + fflush(stdout); +} + + +# ### ### ### ######### ######### ######### +## Ready +package provide variadic 1 Binary files /tmp/tmpUXjsSR/seHzD0tFUw/critcl-3.1.9/examples/zlibwrap/zlib/contrib/dotzlib/DotZLib.chm and /tmp/tmpUXjsSR/wJAxI_fbvC/critcl-3.1.17+dfsg/examples/zlibwrap/zlib/contrib/dotzlib/DotZLib.chm differ diff -Nru critcl-3.1.9/lib/app-critcl/critcl.tcl critcl-3.1.17+dfsg/lib/app-critcl/critcl.tcl --- critcl-3.1.9/lib/app-critcl/critcl.tcl 2013-05-10 05:57:04.000000000 +0000 +++ critcl-3.1.17+dfsg/lib/app-critcl/critcl.tcl 2017-10-14 02:48:11.000000000 +0000 @@ -33,9 +33,8 @@ namespace eval ::critcl::app {} # # ## ### ##### ######## ############# ##################### - -# Intercept 'package' calls. - +## Intercept 'package' calls. +# # This code is present to handle the possibility of building multiple # different versions of the same package, or of different packages # having dependencies on different versions of a 3rd party @@ -100,6 +99,32 @@ } # # ## ### ##### ######## ############# ##################### +## +# Rewrite the hook handling declarations found after the build. +# The default of clearing state for a new build is not the right +# thing to do in mode "precompile". Here we want to see an ERROR. + +proc ::critcl::HandleDeclAfterBuild {} { + if {![done]} return + set cloc {} + if {![catch { + array set loc [info frame -2] + } msg]} { + if {$loc(type) eq "source"} { + set cloc "@$loc(file):$loc(line)" + } else { + set cloc " ([array get loc])" + } + } ;#else { set cloc " ($msg)" } + + append err [lindex [info level -1] 0] + append err $cloc + append err ": Illegal attempt to define C code in [This] after it was built." + append err \n [at::SHOWFRAMES] + error $err +} + +# # ## ### ##### ######## ############# ##################### proc ::critcl::app::main {argv} { Cmdline $argv @@ -111,6 +136,7 @@ if {$v::mode eq "pkg"} { set pkgcache [PackageCache] critcl::cache $pkgcache + critcl::fastuuid } ProcessInput @@ -238,6 +264,12 @@ #critcl::config lines 0 set v::keep 1 } + trace-commands { + critcl::config trace 1 + } + trace { + critcl::cflags -DCRITCL_TRACER + } help { incr help } libdir { set v::libdir $arg @@ -738,7 +770,7 @@ array set r $results append v::edecls "extern Tcl_AppInitProc $r(initname)_Init;\n" - append v::initnames " if ($r(initname)_Init(ip) != TCL_OK) return TCL_ERROR;\n" + append v::initnames " if ($r(initname)_Init(interp) != TCL_OK) return TCL_ERROR;\n" append v::license [License $f $r(license)] lappend v::pkgs $r(pkgname) @@ -818,7 +850,7 @@ eval $lib set lib critcl::clibraries - critcl::lappendlist lib [lsort -unique $v::clibraries] + critcl::lappendlist lib $v::clibraries eval $lib eval [linsert [lsort -unique $v::ldflags] 0 critcl::ldflags] @@ -1248,14 +1280,16 @@ set tcldir [file join $pkgdir tcl] file mkdir $tcldir set files {} + set id 0 foreach t $v::tsources { - file copy -force $t $tcldir + set dst [file tail $t] + set dst [file rootname $dst]_[incr id][file extension $dst] - set t [file tail $t] - lappend files $t + file copy -force $t $tcldir/$dst + lappend files $dst # Metadata management - lappend v::meta [list included tcl/$t] + lappend v::meta [list included tcl/$dst] } return $files } diff -Nru critcl-3.1.9/lib/app-critcl/pkgIndex.tcl critcl-3.1.17+dfsg/lib/app-critcl/pkgIndex.tcl --- critcl-3.1.9/lib/app-critcl/pkgIndex.tcl 2013-05-10 05:57:04.000000000 +0000 +++ critcl-3.1.17+dfsg/lib/app-critcl/pkgIndex.tcl 2017-10-14 02:48:11.000000000 +0000 @@ -1 +1 @@ -package ifneeded critcl::app 3.1.8 [list source [file join $dir critcl.tcl]] +package ifneeded critcl::app 3.1.17 [list source [file join $dir critcl.tcl]] diff -Nru critcl-3.1.9/lib/app-critcl/tea/Makefile.in critcl-3.1.17+dfsg/lib/app-critcl/tea/Makefile.in --- critcl-3.1.9/lib/app-critcl/tea/Makefile.in 2013-05-10 05:57:04.000000000 +0000 +++ critcl-3.1.17+dfsg/lib/app-critcl/tea/Makefile.in 2017-10-14 02:48:11.000000000 +0000 @@ -68,10 +68,15 @@ #======================================================================== all: + @echo %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + @echo Please run '"make install"' to build and install the package. + @echo Critcl has no separate build-step. + doc: + @echo No documentation to build. -install: all - echo %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% ; \ +install: + @echo %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% ; \ cat $(top_builddir)/Config | grep -v '^#' ; \ echo %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% ; \ rm -rf $(top_builddir)/results-tea ; \ @@ -80,9 +85,9 @@ -I $(exec_prefix)/include \ -I $(includedir)@@APIUSE@@ \ @@UCONFIGUSE@@ \ - -keep -cache $(top_builddir)/results-tea \ + -keep -cache $(top_builddir)/results-tea \ -target TEA -config $(top_builddir)/Config \ - -libdir $(DESTDIR)$(libdir) \ + -libdir $(DESTDIR)$(libdir) \ -includedir $(DESTDIR)$(includedir) \ -pkg $(PACKAGE)$(VERSION) \ $(PKG_TCL_SOURCES) ; \ @@ -90,15 +95,15 @@ cat $(top_builddir)/results-tea/*.log echo %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% ; \ -install-auto: all show-auto - rm -rf $(top_builddir)/results-auto ; \ +install-auto: show-auto + @rm -rf $(top_builddir)/results-auto ; \ $(TCLSH_PROG) $(CRITCL) \ -I $(prefix)/include \ -I $(exec_prefix)/include \ -I $(includedir)@@APIUSE@@ \ @@UCONFIGUSE@@ \ -keep -cache $(top_builddir)/results-auto \ - -libdir $(DESTDIR)$(libdir) \ + -libdir $(DESTDIR)$(libdir) \ -includedir $(DESTDIR)$(includedir) \ -pkg $(PACKAGE)$(VERSION) \ $(PKG_TCL_SOURCES) ; \ @@ -107,16 +112,17 @@ echo %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% ; \ install-doc: + @echo No documentation to install. show: - $(TCLSH_PROG) $(CRITCL) \ + @$(TCLSH_PROG) $(CRITCL) \ -keep -cache $(top_builddir)/results-tea \ -target TEA -config $(top_builddir)/Config \ -libdir $(DESTDIR)$(libdir) \ -pkg -show show-auto: - $(TCLSH_PROG) $(CRITCL) \ + @$(TCLSH_PROG) $(CRITCL) \ -keep -cache $(top_builddir)/results-auto \ -libdir $(DESTDIR)$(libdir) \ -pkg -show diff -Nru critcl-3.1.9/lib/critcl/Config critcl-3.1.17+dfsg/lib/critcl/Config --- critcl-3.1.9/lib/critcl/Config 2013-05-10 05:57:04.000000000 +0000 +++ critcl-3.1.17+dfsg/lib/critcl/Config 2017-10-14 02:48:11.000000000 +0000 @@ -6,6 +6,7 @@ # but shouldn't need to for typical *nix toolchains using gcc # # platform sets the platform (defaults to platform::generic) +# target indicates that this is a cross-compile target, the value is the actual platform code. # compile compile a C source file to an object file # version print the compiler version number # ldout See below @@ -27,8 +28,7 @@ # include cflag to add an include directory # noassert cflag to turn off assertions in Tcl code # threadflags cflags to enable threaded build -# target indicates that this is a cross-compile target -# sharedlibext the platform shared library extension +# sharedlibext the platform's file extension for shared libraries # # (Support for Fortran) # fcompile compile a Fortran source file to an object file diff -Nru critcl-3.1.9/lib/critcl/critcl_c/pkginit.c critcl-3.1.17+dfsg/lib/critcl/critcl_c/pkginit.c --- critcl-3.1.9/lib/critcl/critcl_c/pkginit.c 2013-05-10 05:57:04.000000000 +0000 +++ critcl-3.1.17+dfsg/lib/critcl/critcl_c/pkginit.c 2017-10-14 02:48:11.000000000 +0000 @@ -4,8 +4,9 @@ #endif ${ext} DLLEXPORT int -${ininame}_Init(Tcl_Interp *ip) +${ininame}_Init(Tcl_Interp *interp) { +#define ip interp #if USE_TCL_STUBS - if (!MyInitTclStubs(ip)) return TCL_ERROR; + if (!MyInitTclStubs(interp)) return TCL_ERROR; #endif diff -Nru critcl-3.1.9/lib/critcl/critcl_c/pkginitend.c critcl-3.1.17+dfsg/lib/critcl/critcl_c/pkginitend.c --- critcl-3.1.9/lib/critcl/critcl_c/pkginitend.c 2013-05-10 05:57:04.000000000 +0000 +++ critcl-3.1.17+dfsg/lib/critcl/critcl_c/pkginitend.c 2017-10-14 02:48:11.000000000 +0000 @@ -1,4 +1,5 @@ return TCL_OK; +#undef ip } #ifdef __cplusplus } diff -Nru critcl-3.1.9/lib/critcl/critcl_c/pkginittk.c critcl-3.1.17+dfsg/lib/critcl/critcl_c/pkginittk.c --- critcl-3.1.9/lib/critcl/critcl_c/pkginittk.c 2013-05-10 05:57:04.000000000 +0000 +++ critcl-3.1.17+dfsg/lib/critcl/critcl_c/pkginittk.c 2017-10-14 02:48:11.000000000 +0000 @@ -1,5 +1,5 @@ # line 1 "MyInitTkStubs" #if USE_TK_STUBS - if (!MyInitTkStubs(ip)) return TCL_ERROR; + if (!MyInitTkStubs(interp)) return TCL_ERROR; #endif diff -Nru critcl-3.1.9/lib/critcl/critcl_c/storageclass.c critcl-3.1.17+dfsg/lib/critcl/critcl_c/storageclass.c --- critcl-3.1.9/lib/critcl/critcl_c/storageclass.c 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/lib/critcl/critcl_c/storageclass.c 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,26 @@ +/* + * These macros are used to control whether functions are being declared for + * import or export. If a function is being declared while it is being built + * to be included in a shared library, then it should have the DLLEXPORT + * storage class. If is being declared for use by a module that is going to + * link against the shared library, then it should have the DLLIMPORT storage + * class. If the symbol is beind declared for a static build or for use from a + * stub library, then the storage class should be empty. + * + * The convention is that a macro called BUILD_xxxx, where xxxx is the name of + * a library we are building, is set on the compile line for sources that are + * to be placed in the library. When this macro is set, the storage class will + * be set to DLLEXPORT. At the end of the header file, the storage class will + * be reset to DLLIMPORT. + */ + +#undef TCL_STORAGE_CLASS +#ifdef BUILD_@cname@ +# define TCL_STORAGE_CLASS DLLEXPORT +#else +# ifdef USE_@up@_STUBS +# define TCL_STORAGE_CLASS +# else +# define TCL_STORAGE_CLASS DLLIMPORT +# endif +#endif diff -Nru critcl-3.1.9/lib/critcl/critcl_c/stubs.c critcl-3.1.17+dfsg/lib/critcl/critcl_c/stubs.c --- critcl-3.1.9/lib/critcl/critcl_c/stubs.c 2013-05-10 05:57:04.000000000 +0000 +++ critcl-3.1.17+dfsg/lib/critcl/critcl_c/stubs.c 2017-10-14 02:48:11.000000000 +0000 @@ -1,5 +1,5 @@ -# line 1 "MyInitTclStubs" +#line 1 "MyInitTclStubs" #if USE_TCL_STUBS $stubs diff -Nru critcl-3.1.9/lib/critcl/critcl_c/stubs_e.c critcl-3.1.17+dfsg/lib/critcl/critcl_c/stubs_e.c --- critcl-3.1.9/lib/critcl/critcl_c/stubs_e.c 2013-05-10 05:57:04.000000000 +0000 +++ critcl-3.1.17+dfsg/lib/critcl/critcl_c/stubs_e.c 2017-10-14 02:48:11.000000000 +0000 @@ -1,5 +1,5 @@ -# line 1 "MyInitTclStubs" +#line 1 "MyInitTclStubs" #if USE_TCL_STUBS static int diff -Nru critcl-3.1.9/lib/critcl/critcl_c/tcl8.4/tclDecls.h critcl-3.1.17+dfsg/lib/critcl/critcl_c/tcl8.4/tclDecls.h --- critcl-3.1.9/lib/critcl/critcl_c/tcl8.4/tclDecls.h 2013-05-10 05:57:04.000000000 +0000 +++ critcl-3.1.17+dfsg/lib/critcl/critcl_c/tcl8.4/tclDecls.h 2017-10-14 02:48:11.000000000 +0000 @@ -7,8 +7,6 @@ * * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tclDecls.h,v 1.93.2.7 2006/09/22 01:26:23 andreas_kupries Exp $ */ #ifndef _TCLDECLS @@ -27,407 +25,405 @@ */ /* 0 */ -EXTERN int Tcl_PkgProvideEx _ANSI_ARGS_((Tcl_Interp* interp, - CONST char* name, CONST char* version, +EXTERN int Tcl_PkgProvideEx _ANSI_ARGS_((Tcl_Interp *interp, + CONST char *name, CONST char *version, ClientData clientData)); /* 1 */ EXTERN CONST84_RETURN char * Tcl_PkgRequireEx _ANSI_ARGS_(( - Tcl_Interp * interp, CONST char * name, - CONST char * version, int exact, - ClientData * clientDataPtr)); + Tcl_Interp *interp, CONST char *name, + CONST char *version, int exact, + ClientData *clientDataPtr)); /* 2 */ EXTERN void Tcl_Panic _ANSI_ARGS_(TCL_VARARGS(CONST char *,format)); /* 3 */ EXTERN char * Tcl_Alloc _ANSI_ARGS_((unsigned int size)); /* 4 */ -EXTERN void Tcl_Free _ANSI_ARGS_((char * ptr)); +EXTERN void Tcl_Free _ANSI_ARGS_((char *ptr)); /* 5 */ -EXTERN char * Tcl_Realloc _ANSI_ARGS_((char * ptr, +EXTERN char * Tcl_Realloc _ANSI_ARGS_((char *ptr, unsigned int size)); /* 6 */ -EXTERN char * Tcl_DbCkalloc _ANSI_ARGS_((unsigned int size, - CONST char * file, int line)); +EXTERN char * Tcl_DbCkalloc _ANSI_ARGS_((unsigned int size, + CONST char *file, int line)); /* 7 */ -EXTERN int Tcl_DbCkfree _ANSI_ARGS_((char * ptr, - CONST char * file, int line)); +EXTERN void Tcl_DbCkfree _ANSI_ARGS_((char *ptr, + CONST char *file, int line)); /* 8 */ -EXTERN char * Tcl_DbCkrealloc _ANSI_ARGS_((char * ptr, - unsigned int size, CONST char * file, +EXTERN char * Tcl_DbCkrealloc _ANSI_ARGS_((char *ptr, + unsigned int size, CONST char *file, int line)); -#if !defined(__WIN32__) && !defined(MAC_TCL) /* UNIX */ +#if !defined(__WIN32__) && !defined(MAC_OSX_TCL) /* UNIX */ /* 9 */ -EXTERN void Tcl_CreateFileHandler _ANSI_ARGS_((int fd, int mask, - Tcl_FileProc * proc, ClientData clientData)); +EXTERN void Tcl_CreateFileHandler _ANSI_ARGS_((int fd, int mask, + Tcl_FileProc *proc, ClientData clientData)); #endif /* UNIX */ -#if !defined(__WIN32__) && !defined(MAC_TCL) /* UNIX */ +#ifdef MAC_OSX_TCL /* MACOSX */ +/* 9 */ +EXTERN void Tcl_CreateFileHandler _ANSI_ARGS_((int fd, int mask, + Tcl_FileProc *proc, ClientData clientData)); +#endif /* MACOSX */ +#if !defined(__WIN32__) && !defined(MAC_OSX_TCL) /* UNIX */ /* 10 */ EXTERN void Tcl_DeleteFileHandler _ANSI_ARGS_((int fd)); #endif /* UNIX */ +#ifdef MAC_OSX_TCL /* MACOSX */ +/* 10 */ +EXTERN void Tcl_DeleteFileHandler _ANSI_ARGS_((int fd)); +#endif /* MACOSX */ /* 11 */ -EXTERN void Tcl_SetTimer _ANSI_ARGS_((Tcl_Time * timePtr)); +EXTERN void Tcl_SetTimer _ANSI_ARGS_((Tcl_Time *timePtr)); /* 12 */ EXTERN void Tcl_Sleep _ANSI_ARGS_((int ms)); /* 13 */ -EXTERN int Tcl_WaitForEvent _ANSI_ARGS_((Tcl_Time * timePtr)); +EXTERN int Tcl_WaitForEvent _ANSI_ARGS_((Tcl_Time *timePtr)); /* 14 */ EXTERN int Tcl_AppendAllObjTypes _ANSI_ARGS_(( - Tcl_Interp * interp, Tcl_Obj * objPtr)); + Tcl_Interp *interp, Tcl_Obj *objPtr)); /* 15 */ EXTERN void Tcl_AppendStringsToObj _ANSI_ARGS_(TCL_VARARGS(Tcl_Obj *,objPtr)); /* 16 */ -EXTERN void Tcl_AppendToObj _ANSI_ARGS_((Tcl_Obj* objPtr, - CONST char* bytes, int length)); +EXTERN void Tcl_AppendToObj _ANSI_ARGS_((Tcl_Obj *objPtr, + CONST char *bytes, int length)); /* 17 */ -EXTERN Tcl_Obj * Tcl_ConcatObj _ANSI_ARGS_((int objc, +EXTERN Tcl_Obj * Tcl_ConcatObj _ANSI_ARGS_((int objc, Tcl_Obj *CONST objv[])); /* 18 */ -EXTERN int Tcl_ConvertToType _ANSI_ARGS_((Tcl_Interp * interp, - Tcl_Obj * objPtr, Tcl_ObjType * typePtr)); +EXTERN int Tcl_ConvertToType _ANSI_ARGS_((Tcl_Interp *interp, + Tcl_Obj *objPtr, Tcl_ObjType *typePtr)); /* 19 */ -EXTERN void Tcl_DbDecrRefCount _ANSI_ARGS_((Tcl_Obj * objPtr, - CONST char * file, int line)); +EXTERN void Tcl_DbDecrRefCount _ANSI_ARGS_((Tcl_Obj *objPtr, + CONST char *file, int line)); /* 20 */ -EXTERN void Tcl_DbIncrRefCount _ANSI_ARGS_((Tcl_Obj * objPtr, - CONST char * file, int line)); +EXTERN void Tcl_DbIncrRefCount _ANSI_ARGS_((Tcl_Obj *objPtr, + CONST char *file, int line)); /* 21 */ -EXTERN int Tcl_DbIsShared _ANSI_ARGS_((Tcl_Obj * objPtr, - CONST char * file, int line)); +EXTERN int Tcl_DbIsShared _ANSI_ARGS_((Tcl_Obj *objPtr, + CONST char *file, int line)); /* 22 */ -EXTERN Tcl_Obj * Tcl_DbNewBooleanObj _ANSI_ARGS_((int boolValue, - CONST char * file, int line)); +EXTERN Tcl_Obj * Tcl_DbNewBooleanObj _ANSI_ARGS_((int boolValue, + CONST char *file, int line)); /* 23 */ EXTERN Tcl_Obj * Tcl_DbNewByteArrayObj _ANSI_ARGS_(( - CONST unsigned char * bytes, int length, - CONST char * file, int line)); + CONST unsigned char *bytes, int length, + CONST char *file, int line)); /* 24 */ -EXTERN Tcl_Obj * Tcl_DbNewDoubleObj _ANSI_ARGS_((double doubleValue, - CONST char * file, int line)); +EXTERN Tcl_Obj * Tcl_DbNewDoubleObj _ANSI_ARGS_((double doubleValue, + CONST char *file, int line)); /* 25 */ -EXTERN Tcl_Obj * Tcl_DbNewListObj _ANSI_ARGS_((int objc, - Tcl_Obj *CONST * objv, CONST char * file, +EXTERN Tcl_Obj * Tcl_DbNewListObj _ANSI_ARGS_((int objc, + Tcl_Obj *CONST *objv, CONST char *file, int line)); /* 26 */ -EXTERN Tcl_Obj * Tcl_DbNewLongObj _ANSI_ARGS_((long longValue, - CONST char * file, int line)); +EXTERN Tcl_Obj * Tcl_DbNewLongObj _ANSI_ARGS_((long longValue, + CONST char *file, int line)); /* 27 */ -EXTERN Tcl_Obj * Tcl_DbNewObj _ANSI_ARGS_((CONST char * file, - int line)); +EXTERN Tcl_Obj * Tcl_DbNewObj _ANSI_ARGS_((CONST char *file, int line)); /* 28 */ -EXTERN Tcl_Obj * Tcl_DbNewStringObj _ANSI_ARGS_((CONST char * bytes, - int length, CONST char * file, int line)); +EXTERN Tcl_Obj * Tcl_DbNewStringObj _ANSI_ARGS_((CONST char *bytes, + int length, CONST char *file, int line)); /* 29 */ -EXTERN Tcl_Obj * Tcl_DuplicateObj _ANSI_ARGS_((Tcl_Obj * objPtr)); +EXTERN Tcl_Obj * Tcl_DuplicateObj _ANSI_ARGS_((Tcl_Obj *objPtr)); /* 30 */ -EXTERN void TclFreeObj _ANSI_ARGS_((Tcl_Obj * objPtr)); +EXTERN void TclFreeObj _ANSI_ARGS_((Tcl_Obj *objPtr)); /* 31 */ -EXTERN int Tcl_GetBoolean _ANSI_ARGS_((Tcl_Interp * interp, - CONST char * str, int * boolPtr)); +EXTERN int Tcl_GetBoolean _ANSI_ARGS_((Tcl_Interp *interp, + CONST char *src, int *boolPtr)); /* 32 */ EXTERN int Tcl_GetBooleanFromObj _ANSI_ARGS_(( - Tcl_Interp * interp, Tcl_Obj * objPtr, - int * boolPtr)); + Tcl_Interp *interp, Tcl_Obj *objPtr, + int *boolPtr)); /* 33 */ -EXTERN unsigned char * Tcl_GetByteArrayFromObj _ANSI_ARGS_(( - Tcl_Obj * objPtr, int * lengthPtr)); +EXTERN unsigned char * Tcl_GetByteArrayFromObj _ANSI_ARGS_((Tcl_Obj *objPtr, + int *lengthPtr)); /* 34 */ -EXTERN int Tcl_GetDouble _ANSI_ARGS_((Tcl_Interp * interp, - CONST char * str, double * doublePtr)); +EXTERN int Tcl_GetDouble _ANSI_ARGS_((Tcl_Interp *interp, + CONST char *src, double *doublePtr)); /* 35 */ -EXTERN int Tcl_GetDoubleFromObj _ANSI_ARGS_(( - Tcl_Interp * interp, Tcl_Obj * objPtr, - double * doublePtr)); +EXTERN int Tcl_GetDoubleFromObj _ANSI_ARGS_((Tcl_Interp *interp, + Tcl_Obj *objPtr, double *doublePtr)); /* 36 */ -EXTERN int Tcl_GetIndexFromObj _ANSI_ARGS_((Tcl_Interp * interp, - Tcl_Obj * objPtr, CONST84 char ** tablePtr, - CONST char * msg, int flags, int * indexPtr)); +EXTERN int Tcl_GetIndexFromObj _ANSI_ARGS_((Tcl_Interp *interp, + Tcl_Obj *objPtr, CONST84 char **tablePtr, + CONST char *msg, int flags, int *indexPtr)); /* 37 */ -EXTERN int Tcl_GetInt _ANSI_ARGS_((Tcl_Interp * interp, - CONST char * str, int * intPtr)); +EXTERN int Tcl_GetInt _ANSI_ARGS_((Tcl_Interp *interp, + CONST char *src, int *intPtr)); /* 38 */ -EXTERN int Tcl_GetIntFromObj _ANSI_ARGS_((Tcl_Interp * interp, - Tcl_Obj * objPtr, int * intPtr)); +EXTERN int Tcl_GetIntFromObj _ANSI_ARGS_((Tcl_Interp *interp, + Tcl_Obj *objPtr, int *intPtr)); /* 39 */ -EXTERN int Tcl_GetLongFromObj _ANSI_ARGS_((Tcl_Interp * interp, - Tcl_Obj * objPtr, long * longPtr)); +EXTERN int Tcl_GetLongFromObj _ANSI_ARGS_((Tcl_Interp *interp, + Tcl_Obj *objPtr, long *longPtr)); /* 40 */ -EXTERN Tcl_ObjType * Tcl_GetObjType _ANSI_ARGS_((CONST char * typeName)); +EXTERN Tcl_ObjType * Tcl_GetObjType _ANSI_ARGS_((CONST char *typeName)); /* 41 */ -EXTERN char * Tcl_GetStringFromObj _ANSI_ARGS_((Tcl_Obj * objPtr, - int * lengthPtr)); +EXTERN char * Tcl_GetStringFromObj _ANSI_ARGS_((Tcl_Obj *objPtr, + int *lengthPtr)); /* 42 */ -EXTERN void Tcl_InvalidateStringRep _ANSI_ARGS_(( - Tcl_Obj * objPtr)); +EXTERN void Tcl_InvalidateStringRep _ANSI_ARGS_((Tcl_Obj *objPtr)); /* 43 */ EXTERN int Tcl_ListObjAppendList _ANSI_ARGS_(( - Tcl_Interp * interp, Tcl_Obj * listPtr, - Tcl_Obj * elemListPtr)); + Tcl_Interp *interp, Tcl_Obj *listPtr, + Tcl_Obj *elemListPtr)); /* 44 */ EXTERN int Tcl_ListObjAppendElement _ANSI_ARGS_(( - Tcl_Interp * interp, Tcl_Obj * listPtr, - Tcl_Obj * objPtr)); + Tcl_Interp *interp, Tcl_Obj *listPtr, + Tcl_Obj *objPtr)); /* 45 */ EXTERN int Tcl_ListObjGetElements _ANSI_ARGS_(( - Tcl_Interp * interp, Tcl_Obj * listPtr, - int * objcPtr, Tcl_Obj *** objvPtr)); + Tcl_Interp *interp, Tcl_Obj *listPtr, + int *objcPtr, Tcl_Obj ***objvPtr)); /* 46 */ -EXTERN int Tcl_ListObjIndex _ANSI_ARGS_((Tcl_Interp * interp, - Tcl_Obj * listPtr, int index, - Tcl_Obj ** objPtrPtr)); +EXTERN int Tcl_ListObjIndex _ANSI_ARGS_((Tcl_Interp *interp, + Tcl_Obj *listPtr, int index, + Tcl_Obj **objPtrPtr)); /* 47 */ -EXTERN int Tcl_ListObjLength _ANSI_ARGS_((Tcl_Interp * interp, - Tcl_Obj * listPtr, int * lengthPtr)); +EXTERN int Tcl_ListObjLength _ANSI_ARGS_((Tcl_Interp *interp, + Tcl_Obj *listPtr, int *lengthPtr)); /* 48 */ -EXTERN int Tcl_ListObjReplace _ANSI_ARGS_((Tcl_Interp * interp, - Tcl_Obj * listPtr, int first, int count, +EXTERN int Tcl_ListObjReplace _ANSI_ARGS_((Tcl_Interp *interp, + Tcl_Obj *listPtr, int first, int count, int objc, Tcl_Obj *CONST objv[])); /* 49 */ EXTERN Tcl_Obj * Tcl_NewBooleanObj _ANSI_ARGS_((int boolValue)); /* 50 */ EXTERN Tcl_Obj * Tcl_NewByteArrayObj _ANSI_ARGS_(( - CONST unsigned char* bytes, int length)); + CONST unsigned char *bytes, int length)); /* 51 */ EXTERN Tcl_Obj * Tcl_NewDoubleObj _ANSI_ARGS_((double doubleValue)); /* 52 */ EXTERN Tcl_Obj * Tcl_NewIntObj _ANSI_ARGS_((int intValue)); /* 53 */ -EXTERN Tcl_Obj * Tcl_NewListObj _ANSI_ARGS_((int objc, +EXTERN Tcl_Obj * Tcl_NewListObj _ANSI_ARGS_((int objc, Tcl_Obj *CONST objv[])); /* 54 */ EXTERN Tcl_Obj * Tcl_NewLongObj _ANSI_ARGS_((long longValue)); /* 55 */ EXTERN Tcl_Obj * Tcl_NewObj _ANSI_ARGS_((void)); /* 56 */ -EXTERN Tcl_Obj * Tcl_NewStringObj _ANSI_ARGS_((CONST char * bytes, +EXTERN Tcl_Obj * Tcl_NewStringObj _ANSI_ARGS_((CONST char *bytes, int length)); /* 57 */ -EXTERN void Tcl_SetBooleanObj _ANSI_ARGS_((Tcl_Obj * objPtr, +EXTERN void Tcl_SetBooleanObj _ANSI_ARGS_((Tcl_Obj *objPtr, int boolValue)); /* 58 */ -EXTERN unsigned char * Tcl_SetByteArrayLength _ANSI_ARGS_((Tcl_Obj * objPtr, +EXTERN unsigned char * Tcl_SetByteArrayLength _ANSI_ARGS_((Tcl_Obj *objPtr, int length)); /* 59 */ -EXTERN void Tcl_SetByteArrayObj _ANSI_ARGS_((Tcl_Obj * objPtr, - CONST unsigned char * bytes, int length)); +EXTERN void Tcl_SetByteArrayObj _ANSI_ARGS_((Tcl_Obj *objPtr, + CONST unsigned char *bytes, int length)); /* 60 */ -EXTERN void Tcl_SetDoubleObj _ANSI_ARGS_((Tcl_Obj * objPtr, +EXTERN void Tcl_SetDoubleObj _ANSI_ARGS_((Tcl_Obj *objPtr, double doubleValue)); /* 61 */ -EXTERN void Tcl_SetIntObj _ANSI_ARGS_((Tcl_Obj * objPtr, +EXTERN void Tcl_SetIntObj _ANSI_ARGS_((Tcl_Obj *objPtr, int intValue)); /* 62 */ -EXTERN void Tcl_SetListObj _ANSI_ARGS_((Tcl_Obj * objPtr, +EXTERN void Tcl_SetListObj _ANSI_ARGS_((Tcl_Obj *objPtr, int objc, Tcl_Obj *CONST objv[])); /* 63 */ -EXTERN void Tcl_SetLongObj _ANSI_ARGS_((Tcl_Obj * objPtr, +EXTERN void Tcl_SetLongObj _ANSI_ARGS_((Tcl_Obj *objPtr, long longValue)); /* 64 */ -EXTERN void Tcl_SetObjLength _ANSI_ARGS_((Tcl_Obj * objPtr, +EXTERN void Tcl_SetObjLength _ANSI_ARGS_((Tcl_Obj *objPtr, int length)); /* 65 */ -EXTERN void Tcl_SetStringObj _ANSI_ARGS_((Tcl_Obj* objPtr, - CONST char* bytes, int length)); +EXTERN void Tcl_SetStringObj _ANSI_ARGS_((Tcl_Obj *objPtr, + CONST char *bytes, int length)); /* 66 */ -EXTERN void Tcl_AddErrorInfo _ANSI_ARGS_((Tcl_Interp * interp, - CONST char * message)); +EXTERN void Tcl_AddErrorInfo _ANSI_ARGS_((Tcl_Interp *interp, + CONST char *message)); /* 67 */ -EXTERN void Tcl_AddObjErrorInfo _ANSI_ARGS_((Tcl_Interp * interp, - CONST char * message, int length)); +EXTERN void Tcl_AddObjErrorInfo _ANSI_ARGS_((Tcl_Interp *interp, + CONST char *message, int length)); /* 68 */ -EXTERN void Tcl_AllowExceptions _ANSI_ARGS_((Tcl_Interp * interp)); +EXTERN void Tcl_AllowExceptions _ANSI_ARGS_((Tcl_Interp *interp)); /* 69 */ -EXTERN void Tcl_AppendElement _ANSI_ARGS_((Tcl_Interp * interp, - CONST char * string)); +EXTERN void Tcl_AppendElement _ANSI_ARGS_((Tcl_Interp *interp, + CONST char *element)); /* 70 */ EXTERN void Tcl_AppendResult _ANSI_ARGS_(TCL_VARARGS(Tcl_Interp *,interp)); /* 71 */ -EXTERN Tcl_AsyncHandler Tcl_AsyncCreate _ANSI_ARGS_((Tcl_AsyncProc * proc, +EXTERN Tcl_AsyncHandler Tcl_AsyncCreate _ANSI_ARGS_((Tcl_AsyncProc *proc, ClientData clientData)); /* 72 */ EXTERN void Tcl_AsyncDelete _ANSI_ARGS_((Tcl_AsyncHandler async)); /* 73 */ -EXTERN int Tcl_AsyncInvoke _ANSI_ARGS_((Tcl_Interp * interp, +EXTERN int Tcl_AsyncInvoke _ANSI_ARGS_((Tcl_Interp *interp, int code)); /* 74 */ EXTERN void Tcl_AsyncMark _ANSI_ARGS_((Tcl_AsyncHandler async)); /* 75 */ EXTERN int Tcl_AsyncReady _ANSI_ARGS_((void)); /* 76 */ -EXTERN void Tcl_BackgroundError _ANSI_ARGS_((Tcl_Interp * interp)); +EXTERN void Tcl_BackgroundError _ANSI_ARGS_((Tcl_Interp *interp)); /* 77 */ -EXTERN char Tcl_Backslash _ANSI_ARGS_((CONST char * src, - int * readPtr)); +EXTERN char Tcl_Backslash _ANSI_ARGS_((CONST char *src, + int *readPtr)); /* 78 */ -EXTERN int Tcl_BadChannelOption _ANSI_ARGS_(( - Tcl_Interp * interp, CONST char * optionName, - CONST char * optionList)); +EXTERN int Tcl_BadChannelOption _ANSI_ARGS_((Tcl_Interp *interp, + CONST char *optionName, + CONST char *optionList)); /* 79 */ -EXTERN void Tcl_CallWhenDeleted _ANSI_ARGS_((Tcl_Interp * interp, - Tcl_InterpDeleteProc * proc, +EXTERN void Tcl_CallWhenDeleted _ANSI_ARGS_((Tcl_Interp *interp, + Tcl_InterpDeleteProc *proc, ClientData clientData)); /* 80 */ EXTERN void Tcl_CancelIdleCall _ANSI_ARGS_(( - Tcl_IdleProc * idleProc, + Tcl_IdleProc *idleProc, ClientData clientData)); /* 81 */ -EXTERN int Tcl_Close _ANSI_ARGS_((Tcl_Interp * interp, +EXTERN int Tcl_Close _ANSI_ARGS_((Tcl_Interp *interp, Tcl_Channel chan)); /* 82 */ -EXTERN int Tcl_CommandComplete _ANSI_ARGS_((CONST char * cmd)); +EXTERN int Tcl_CommandComplete _ANSI_ARGS_((CONST char *cmd)); /* 83 */ -EXTERN char * Tcl_Concat _ANSI_ARGS_((int argc, - CONST84 char * CONST * argv)); +EXTERN char * Tcl_Concat _ANSI_ARGS_((int argc, + CONST84 char *CONST *argv)); /* 84 */ -EXTERN int Tcl_ConvertElement _ANSI_ARGS_((CONST char * src, - char * dst, int flags)); +EXTERN int Tcl_ConvertElement _ANSI_ARGS_((CONST char *src, + char *dst, int flags)); /* 85 */ EXTERN int Tcl_ConvertCountedElement _ANSI_ARGS_(( - CONST char * src, int length, char * dst, + CONST char *src, int length, char *dst, int flags)); /* 86 */ -EXTERN int Tcl_CreateAlias _ANSI_ARGS_((Tcl_Interp * slave, - CONST char * slaveCmd, Tcl_Interp * target, - CONST char * targetCmd, int argc, - CONST84 char * CONST * argv)); +EXTERN int Tcl_CreateAlias _ANSI_ARGS_((Tcl_Interp *slave, + CONST char *slaveCmd, Tcl_Interp *target, + CONST char *targetCmd, int argc, + CONST84 char *CONST *argv)); /* 87 */ -EXTERN int Tcl_CreateAliasObj _ANSI_ARGS_((Tcl_Interp * slave, - CONST char * slaveCmd, Tcl_Interp * target, - CONST char * targetCmd, int objc, +EXTERN int Tcl_CreateAliasObj _ANSI_ARGS_((Tcl_Interp *slave, + CONST char *slaveCmd, Tcl_Interp *target, + CONST char *targetCmd, int objc, Tcl_Obj *CONST objv[])); /* 88 */ EXTERN Tcl_Channel Tcl_CreateChannel _ANSI_ARGS_(( - Tcl_ChannelType * typePtr, - CONST char * chanName, + Tcl_ChannelType *typePtr, + CONST char *chanName, ClientData instanceData, int mask)); /* 89 */ EXTERN void Tcl_CreateChannelHandler _ANSI_ARGS_(( - Tcl_Channel chan, int mask, - Tcl_ChannelProc * proc, - ClientData clientData)); + Tcl_Channel chan, int mask, + Tcl_ChannelProc *proc, ClientData clientData)); /* 90 */ -EXTERN void Tcl_CreateCloseHandler _ANSI_ARGS_((Tcl_Channel chan, - Tcl_CloseProc * proc, ClientData clientData)); +EXTERN void Tcl_CreateCloseHandler _ANSI_ARGS_((Tcl_Channel chan, + Tcl_CloseProc *proc, ClientData clientData)); /* 91 */ -EXTERN Tcl_Command Tcl_CreateCommand _ANSI_ARGS_((Tcl_Interp * interp, - CONST char * cmdName, Tcl_CmdProc * proc, - ClientData clientData, - Tcl_CmdDeleteProc * deleteProc)); +EXTERN Tcl_Command Tcl_CreateCommand _ANSI_ARGS_((Tcl_Interp *interp, + CONST char *cmdName, Tcl_CmdProc *proc, + ClientData clientData, + Tcl_CmdDeleteProc *deleteProc)); /* 92 */ EXTERN void Tcl_CreateEventSource _ANSI_ARGS_(( - Tcl_EventSetupProc * setupProc, - Tcl_EventCheckProc * checkProc, + Tcl_EventSetupProc *setupProc, + Tcl_EventCheckProc *checkProc, ClientData clientData)); /* 93 */ EXTERN void Tcl_CreateExitHandler _ANSI_ARGS_(( - Tcl_ExitProc * proc, ClientData clientData)); + Tcl_ExitProc *proc, ClientData clientData)); /* 94 */ EXTERN Tcl_Interp * Tcl_CreateInterp _ANSI_ARGS_((void)); /* 95 */ -EXTERN void Tcl_CreateMathFunc _ANSI_ARGS_((Tcl_Interp * interp, - CONST char * name, int numArgs, - Tcl_ValueType * argTypes, - Tcl_MathProc * proc, ClientData clientData)); +EXTERN void Tcl_CreateMathFunc _ANSI_ARGS_((Tcl_Interp *interp, + CONST char *name, int numArgs, + Tcl_ValueType *argTypes, Tcl_MathProc *proc, + ClientData clientData)); /* 96 */ -EXTERN Tcl_Command Tcl_CreateObjCommand _ANSI_ARGS_(( - Tcl_Interp * interp, CONST char * cmdName, - Tcl_ObjCmdProc * proc, ClientData clientData, - Tcl_CmdDeleteProc * deleteProc)); +EXTERN Tcl_Command Tcl_CreateObjCommand _ANSI_ARGS_((Tcl_Interp *interp, + CONST char *cmdName, Tcl_ObjCmdProc *proc, + ClientData clientData, + Tcl_CmdDeleteProc *deleteProc)); /* 97 */ -EXTERN Tcl_Interp * Tcl_CreateSlave _ANSI_ARGS_((Tcl_Interp * interp, - CONST char * slaveName, int isSafe)); +EXTERN Tcl_Interp * Tcl_CreateSlave _ANSI_ARGS_((Tcl_Interp *interp, + CONST char *slaveName, int isSafe)); /* 98 */ -EXTERN Tcl_TimerToken Tcl_CreateTimerHandler _ANSI_ARGS_((int milliseconds, - Tcl_TimerProc * proc, ClientData clientData)); +EXTERN Tcl_TimerToken Tcl_CreateTimerHandler _ANSI_ARGS_((int milliseconds, + Tcl_TimerProc *proc, ClientData clientData)); /* 99 */ -EXTERN Tcl_Trace Tcl_CreateTrace _ANSI_ARGS_((Tcl_Interp * interp, - int level, Tcl_CmdTraceProc * proc, +EXTERN Tcl_Trace Tcl_CreateTrace _ANSI_ARGS_((Tcl_Interp *interp, + int level, Tcl_CmdTraceProc *proc, ClientData clientData)); /* 100 */ -EXTERN void Tcl_DeleteAssocData _ANSI_ARGS_((Tcl_Interp * interp, - CONST char * name)); +EXTERN void Tcl_DeleteAssocData _ANSI_ARGS_((Tcl_Interp *interp, + CONST char *name)); /* 101 */ EXTERN void Tcl_DeleteChannelHandler _ANSI_ARGS_(( - Tcl_Channel chan, Tcl_ChannelProc * proc, + Tcl_Channel chan, Tcl_ChannelProc *proc, ClientData clientData)); /* 102 */ -EXTERN void Tcl_DeleteCloseHandler _ANSI_ARGS_((Tcl_Channel chan, - Tcl_CloseProc * proc, ClientData clientData)); +EXTERN void Tcl_DeleteCloseHandler _ANSI_ARGS_((Tcl_Channel chan, + Tcl_CloseProc *proc, ClientData clientData)); /* 103 */ -EXTERN int Tcl_DeleteCommand _ANSI_ARGS_((Tcl_Interp * interp, - CONST char * cmdName)); +EXTERN int Tcl_DeleteCommand _ANSI_ARGS_((Tcl_Interp *interp, + CONST char *cmdName)); /* 104 */ EXTERN int Tcl_DeleteCommandFromToken _ANSI_ARGS_(( - Tcl_Interp * interp, Tcl_Command command)); + Tcl_Interp *interp, Tcl_Command command)); /* 105 */ EXTERN void Tcl_DeleteEvents _ANSI_ARGS_(( - Tcl_EventDeleteProc * proc, + Tcl_EventDeleteProc *proc, ClientData clientData)); /* 106 */ EXTERN void Tcl_DeleteEventSource _ANSI_ARGS_(( - Tcl_EventSetupProc * setupProc, - Tcl_EventCheckProc * checkProc, + Tcl_EventSetupProc *setupProc, + Tcl_EventCheckProc *checkProc, ClientData clientData)); /* 107 */ EXTERN void Tcl_DeleteExitHandler _ANSI_ARGS_(( - Tcl_ExitProc * proc, ClientData clientData)); + Tcl_ExitProc *proc, ClientData clientData)); /* 108 */ EXTERN void Tcl_DeleteHashEntry _ANSI_ARGS_(( - Tcl_HashEntry * entryPtr)); + Tcl_HashEntry *entryPtr)); /* 109 */ EXTERN void Tcl_DeleteHashTable _ANSI_ARGS_(( - Tcl_HashTable * tablePtr)); + Tcl_HashTable *tablePtr)); /* 110 */ -EXTERN void Tcl_DeleteInterp _ANSI_ARGS_((Tcl_Interp * interp)); -#if !defined(__WIN32__) && !defined(MAC_TCL) /* UNIX */ -/* 111 */ -EXTERN void Tcl_DetachPids _ANSI_ARGS_((int numPids, - Tcl_Pid * pidPtr)); -#endif /* UNIX */ -#ifdef __WIN32__ +EXTERN void Tcl_DeleteInterp _ANSI_ARGS_((Tcl_Interp *interp)); /* 111 */ -EXTERN void Tcl_DetachPids _ANSI_ARGS_((int numPids, - Tcl_Pid * pidPtr)); -#endif /* __WIN32__ */ +EXTERN void Tcl_DetachPids _ANSI_ARGS_((int numPids, + Tcl_Pid *pidPtr)); /* 112 */ EXTERN void Tcl_DeleteTimerHandler _ANSI_ARGS_(( Tcl_TimerToken token)); /* 113 */ -EXTERN void Tcl_DeleteTrace _ANSI_ARGS_((Tcl_Interp * interp, +EXTERN void Tcl_DeleteTrace _ANSI_ARGS_((Tcl_Interp *interp, Tcl_Trace trace)); /* 114 */ EXTERN void Tcl_DontCallWhenDeleted _ANSI_ARGS_(( - Tcl_Interp * interp, - Tcl_InterpDeleteProc * proc, + Tcl_Interp *interp, + Tcl_InterpDeleteProc *proc, ClientData clientData)); /* 115 */ EXTERN int Tcl_DoOneEvent _ANSI_ARGS_((int flags)); /* 116 */ -EXTERN void Tcl_DoWhenIdle _ANSI_ARGS_((Tcl_IdleProc * proc, +EXTERN void Tcl_DoWhenIdle _ANSI_ARGS_((Tcl_IdleProc *proc, ClientData clientData)); /* 117 */ -EXTERN char * Tcl_DStringAppend _ANSI_ARGS_((Tcl_DString * dsPtr, - CONST char * str, int length)); +EXTERN char * Tcl_DStringAppend _ANSI_ARGS_((Tcl_DString *dsPtr, + CONST char *bytes, int length)); /* 118 */ EXTERN char * Tcl_DStringAppendElement _ANSI_ARGS_(( - Tcl_DString * dsPtr, CONST char * string)); + Tcl_DString *dsPtr, CONST char *element)); /* 119 */ EXTERN void Tcl_DStringEndSublist _ANSI_ARGS_(( - Tcl_DString * dsPtr)); + Tcl_DString *dsPtr)); /* 120 */ -EXTERN void Tcl_DStringFree _ANSI_ARGS_((Tcl_DString * dsPtr)); +EXTERN void Tcl_DStringFree _ANSI_ARGS_((Tcl_DString *dsPtr)); /* 121 */ -EXTERN void Tcl_DStringGetResult _ANSI_ARGS_(( - Tcl_Interp * interp, Tcl_DString * dsPtr)); +EXTERN void Tcl_DStringGetResult _ANSI_ARGS_((Tcl_Interp *interp, + Tcl_DString *dsPtr)); /* 122 */ -EXTERN void Tcl_DStringInit _ANSI_ARGS_((Tcl_DString * dsPtr)); +EXTERN void Tcl_DStringInit _ANSI_ARGS_((Tcl_DString *dsPtr)); /* 123 */ -EXTERN void Tcl_DStringResult _ANSI_ARGS_((Tcl_Interp * interp, - Tcl_DString * dsPtr)); +EXTERN void Tcl_DStringResult _ANSI_ARGS_((Tcl_Interp *interp, + Tcl_DString *dsPtr)); /* 124 */ -EXTERN void Tcl_DStringSetLength _ANSI_ARGS_(( - Tcl_DString * dsPtr, int length)); +EXTERN void Tcl_DStringSetLength _ANSI_ARGS_((Tcl_DString *dsPtr, + int length)); /* 125 */ EXTERN void Tcl_DStringStartSublist _ANSI_ARGS_(( - Tcl_DString * dsPtr)); + Tcl_DString *dsPtr)); /* 126 */ EXTERN int Tcl_Eof _ANSI_ARGS_((Tcl_Channel chan)); /* 127 */ @@ -435,85 +431,85 @@ /* 128 */ EXTERN CONST84_RETURN char * Tcl_ErrnoMsg _ANSI_ARGS_((int err)); /* 129 */ -EXTERN int Tcl_Eval _ANSI_ARGS_((Tcl_Interp * interp, - CONST char * string)); +EXTERN int Tcl_Eval _ANSI_ARGS_((Tcl_Interp *interp, + CONST char *script)); /* 130 */ -EXTERN int Tcl_EvalFile _ANSI_ARGS_((Tcl_Interp * interp, - CONST char * fileName)); +EXTERN int Tcl_EvalFile _ANSI_ARGS_((Tcl_Interp *interp, + CONST char *fileName)); /* 131 */ -EXTERN int Tcl_EvalObj _ANSI_ARGS_((Tcl_Interp * interp, - Tcl_Obj * objPtr)); +EXTERN int Tcl_EvalObj _ANSI_ARGS_((Tcl_Interp *interp, + Tcl_Obj *objPtr)); /* 132 */ EXTERN void Tcl_EventuallyFree _ANSI_ARGS_(( - ClientData clientData, - Tcl_FreeProc * freeProc)); + ClientData clientData, + Tcl_FreeProc *freeProc)); /* 133 */ EXTERN void Tcl_Exit _ANSI_ARGS_((int status)); /* 134 */ -EXTERN int Tcl_ExposeCommand _ANSI_ARGS_((Tcl_Interp * interp, - CONST char * hiddenCmdToken, - CONST char * cmdName)); +EXTERN int Tcl_ExposeCommand _ANSI_ARGS_((Tcl_Interp *interp, + CONST char *hiddenCmdToken, + CONST char *cmdName)); /* 135 */ -EXTERN int Tcl_ExprBoolean _ANSI_ARGS_((Tcl_Interp * interp, - CONST char * str, int * ptr)); +EXTERN int Tcl_ExprBoolean _ANSI_ARGS_((Tcl_Interp *interp, + CONST char *expr, int *ptr)); /* 136 */ -EXTERN int Tcl_ExprBooleanObj _ANSI_ARGS_((Tcl_Interp * interp, - Tcl_Obj * objPtr, int * ptr)); +EXTERN int Tcl_ExprBooleanObj _ANSI_ARGS_((Tcl_Interp *interp, + Tcl_Obj *objPtr, int *ptr)); /* 137 */ -EXTERN int Tcl_ExprDouble _ANSI_ARGS_((Tcl_Interp * interp, - CONST char * str, double * ptr)); +EXTERN int Tcl_ExprDouble _ANSI_ARGS_((Tcl_Interp *interp, + CONST char *expr, double *ptr)); /* 138 */ -EXTERN int Tcl_ExprDoubleObj _ANSI_ARGS_((Tcl_Interp * interp, - Tcl_Obj * objPtr, double * ptr)); +EXTERN int Tcl_ExprDoubleObj _ANSI_ARGS_((Tcl_Interp *interp, + Tcl_Obj *objPtr, double *ptr)); /* 139 */ -EXTERN int Tcl_ExprLong _ANSI_ARGS_((Tcl_Interp * interp, - CONST char * str, long * ptr)); +EXTERN int Tcl_ExprLong _ANSI_ARGS_((Tcl_Interp *interp, + CONST char *expr, long *ptr)); /* 140 */ -EXTERN int Tcl_ExprLongObj _ANSI_ARGS_((Tcl_Interp * interp, - Tcl_Obj * objPtr, long * ptr)); +EXTERN int Tcl_ExprLongObj _ANSI_ARGS_((Tcl_Interp *interp, + Tcl_Obj *objPtr, long *ptr)); /* 141 */ -EXTERN int Tcl_ExprObj _ANSI_ARGS_((Tcl_Interp * interp, - Tcl_Obj * objPtr, Tcl_Obj ** resultPtrPtr)); +EXTERN int Tcl_ExprObj _ANSI_ARGS_((Tcl_Interp *interp, + Tcl_Obj *objPtr, Tcl_Obj **resultPtrPtr)); /* 142 */ -EXTERN int Tcl_ExprString _ANSI_ARGS_((Tcl_Interp * interp, - CONST char * string)); +EXTERN int Tcl_ExprString _ANSI_ARGS_((Tcl_Interp *interp, + CONST char *expr)); /* 143 */ EXTERN void Tcl_Finalize _ANSI_ARGS_((void)); /* 144 */ -EXTERN void Tcl_FindExecutable _ANSI_ARGS_((CONST char * argv0)); +EXTERN void Tcl_FindExecutable _ANSI_ARGS_((CONST char *argv0)); /* 145 */ EXTERN Tcl_HashEntry * Tcl_FirstHashEntry _ANSI_ARGS_(( - Tcl_HashTable * tablePtr, - Tcl_HashSearch * searchPtr)); + Tcl_HashTable *tablePtr, + Tcl_HashSearch *searchPtr)); /* 146 */ EXTERN int Tcl_Flush _ANSI_ARGS_((Tcl_Channel chan)); /* 147 */ -EXTERN void Tcl_FreeResult _ANSI_ARGS_((Tcl_Interp * interp)); +EXTERN void Tcl_FreeResult _ANSI_ARGS_((Tcl_Interp *interp)); /* 148 */ -EXTERN int Tcl_GetAlias _ANSI_ARGS_((Tcl_Interp * interp, - CONST char * slaveCmd, - Tcl_Interp ** targetInterpPtr, - CONST84 char ** targetCmdPtr, int * argcPtr, - CONST84 char *** argvPtr)); +EXTERN int Tcl_GetAlias _ANSI_ARGS_((Tcl_Interp *interp, + CONST char *slaveCmd, + Tcl_Interp **targetInterpPtr, + CONST84 char **targetCmdPtr, int *argcPtr, + CONST84 char ***argvPtr)); /* 149 */ -EXTERN int Tcl_GetAliasObj _ANSI_ARGS_((Tcl_Interp * interp, - CONST char * slaveCmd, - Tcl_Interp ** targetInterpPtr, - CONST84 char ** targetCmdPtr, int * objcPtr, - Tcl_Obj *** objv)); +EXTERN int Tcl_GetAliasObj _ANSI_ARGS_((Tcl_Interp *interp, + CONST char *slaveCmd, + Tcl_Interp **targetInterpPtr, + CONST84 char **targetCmdPtr, int *objcPtr, + Tcl_Obj ***objv)); /* 150 */ -EXTERN ClientData Tcl_GetAssocData _ANSI_ARGS_((Tcl_Interp * interp, - CONST char * name, - Tcl_InterpDeleteProc ** procPtr)); +EXTERN ClientData Tcl_GetAssocData _ANSI_ARGS_((Tcl_Interp *interp, + CONST char *name, + Tcl_InterpDeleteProc **procPtr)); /* 151 */ -EXTERN Tcl_Channel Tcl_GetChannel _ANSI_ARGS_((Tcl_Interp * interp, - CONST char * chanName, int * modePtr)); +EXTERN Tcl_Channel Tcl_GetChannel _ANSI_ARGS_((Tcl_Interp *interp, + CONST char *chanName, int *modePtr)); /* 152 */ EXTERN int Tcl_GetChannelBufferSize _ANSI_ARGS_(( Tcl_Channel chan)); /* 153 */ -EXTERN int Tcl_GetChannelHandle _ANSI_ARGS_((Tcl_Channel chan, - int direction, ClientData * handlePtr)); +EXTERN int Tcl_GetChannelHandle _ANSI_ARGS_((Tcl_Channel chan, + int direction, ClientData *handlePtr)); /* 154 */ EXTERN ClientData Tcl_GetChannelInstanceData _ANSI_ARGS_(( Tcl_Channel chan)); @@ -523,456 +519,443 @@ EXTERN CONST84_RETURN char * Tcl_GetChannelName _ANSI_ARGS_(( Tcl_Channel chan)); /* 157 */ -EXTERN int Tcl_GetChannelOption _ANSI_ARGS_(( - Tcl_Interp * interp, Tcl_Channel chan, - CONST char * optionName, Tcl_DString * dsPtr)); +EXTERN int Tcl_GetChannelOption _ANSI_ARGS_((Tcl_Interp *interp, + Tcl_Channel chan, CONST char *optionName, + Tcl_DString *dsPtr)); /* 158 */ EXTERN Tcl_ChannelType * Tcl_GetChannelType _ANSI_ARGS_((Tcl_Channel chan)); /* 159 */ -EXTERN int Tcl_GetCommandInfo _ANSI_ARGS_((Tcl_Interp * interp, - CONST char * cmdName, Tcl_CmdInfo * infoPtr)); +EXTERN int Tcl_GetCommandInfo _ANSI_ARGS_((Tcl_Interp *interp, + CONST char *cmdName, Tcl_CmdInfo *infoPtr)); /* 160 */ EXTERN CONST84_RETURN char * Tcl_GetCommandName _ANSI_ARGS_(( - Tcl_Interp * interp, Tcl_Command command)); + Tcl_Interp *interp, Tcl_Command command)); /* 161 */ EXTERN int Tcl_GetErrno _ANSI_ARGS_((void)); /* 162 */ EXTERN CONST84_RETURN char * Tcl_GetHostName _ANSI_ARGS_((void)); /* 163 */ -EXTERN int Tcl_GetInterpPath _ANSI_ARGS_(( - Tcl_Interp * askInterp, - Tcl_Interp * slaveInterp)); +EXTERN int Tcl_GetInterpPath _ANSI_ARGS_((Tcl_Interp *askInterp, + Tcl_Interp *slaveInterp)); /* 164 */ -EXTERN Tcl_Interp * Tcl_GetMaster _ANSI_ARGS_((Tcl_Interp * interp)); +EXTERN Tcl_Interp * Tcl_GetMaster _ANSI_ARGS_((Tcl_Interp *interp)); /* 165 */ EXTERN CONST char * Tcl_GetNameOfExecutable _ANSI_ARGS_((void)); /* 166 */ -EXTERN Tcl_Obj * Tcl_GetObjResult _ANSI_ARGS_((Tcl_Interp * interp)); -#if !defined(__WIN32__) && !defined(MAC_TCL) /* UNIX */ +EXTERN Tcl_Obj * Tcl_GetObjResult _ANSI_ARGS_((Tcl_Interp *interp)); +#if !defined(__WIN32__) && !defined(MAC_OSX_TCL) /* UNIX */ /* 167 */ -EXTERN int Tcl_GetOpenFile _ANSI_ARGS_((Tcl_Interp * interp, - CONST char * str, int forWriting, - int checkUsage, ClientData * filePtr)); +EXTERN int Tcl_GetOpenFile _ANSI_ARGS_((Tcl_Interp *interp, + CONST char *chanID, int forWriting, + int checkUsage, ClientData *filePtr)); #endif /* UNIX */ +#ifdef MAC_OSX_TCL /* MACOSX */ +/* 167 */ +EXTERN int Tcl_GetOpenFile _ANSI_ARGS_((Tcl_Interp *interp, + CONST char *chanID, int forWriting, + int checkUsage, ClientData *filePtr)); +#endif /* MACOSX */ /* 168 */ -EXTERN Tcl_PathType Tcl_GetPathType _ANSI_ARGS_((CONST char * path)); +EXTERN Tcl_PathType Tcl_GetPathType _ANSI_ARGS_((CONST char *path)); /* 169 */ -EXTERN int Tcl_Gets _ANSI_ARGS_((Tcl_Channel chan, - Tcl_DString * dsPtr)); +EXTERN int Tcl_Gets _ANSI_ARGS_((Tcl_Channel chan, + Tcl_DString *dsPtr)); /* 170 */ -EXTERN int Tcl_GetsObj _ANSI_ARGS_((Tcl_Channel chan, - Tcl_Obj * objPtr)); +EXTERN int Tcl_GetsObj _ANSI_ARGS_((Tcl_Channel chan, + Tcl_Obj *objPtr)); /* 171 */ EXTERN int Tcl_GetServiceMode _ANSI_ARGS_((void)); /* 172 */ -EXTERN Tcl_Interp * Tcl_GetSlave _ANSI_ARGS_((Tcl_Interp * interp, - CONST char * slaveName)); +EXTERN Tcl_Interp * Tcl_GetSlave _ANSI_ARGS_((Tcl_Interp *interp, + CONST char *slaveName)); /* 173 */ EXTERN Tcl_Channel Tcl_GetStdChannel _ANSI_ARGS_((int type)); /* 174 */ EXTERN CONST84_RETURN char * Tcl_GetStringResult _ANSI_ARGS_(( - Tcl_Interp * interp)); + Tcl_Interp *interp)); /* 175 */ -EXTERN CONST84_RETURN char * Tcl_GetVar _ANSI_ARGS_((Tcl_Interp * interp, - CONST char * varName, int flags)); +EXTERN CONST84_RETURN char * Tcl_GetVar _ANSI_ARGS_((Tcl_Interp *interp, + CONST char *varName, int flags)); /* 176 */ -EXTERN CONST84_RETURN char * Tcl_GetVar2 _ANSI_ARGS_((Tcl_Interp * interp, - CONST char * part1, CONST char * part2, +EXTERN CONST84_RETURN char * Tcl_GetVar2 _ANSI_ARGS_((Tcl_Interp *interp, + CONST char *part1, CONST char *part2, int flags)); /* 177 */ -EXTERN int Tcl_GlobalEval _ANSI_ARGS_((Tcl_Interp * interp, - CONST char * command)); +EXTERN int Tcl_GlobalEval _ANSI_ARGS_((Tcl_Interp *interp, + CONST char *command)); /* 178 */ -EXTERN int Tcl_GlobalEvalObj _ANSI_ARGS_((Tcl_Interp * interp, - Tcl_Obj * objPtr)); +EXTERN int Tcl_GlobalEvalObj _ANSI_ARGS_((Tcl_Interp *interp, + Tcl_Obj *objPtr)); /* 179 */ -EXTERN int Tcl_HideCommand _ANSI_ARGS_((Tcl_Interp * interp, - CONST char * cmdName, - CONST char * hiddenCmdToken)); +EXTERN int Tcl_HideCommand _ANSI_ARGS_((Tcl_Interp *interp, + CONST char *cmdName, + CONST char *hiddenCmdToken)); /* 180 */ -EXTERN int Tcl_Init _ANSI_ARGS_((Tcl_Interp * interp)); +EXTERN int Tcl_Init _ANSI_ARGS_((Tcl_Interp *interp)); /* 181 */ EXTERN void Tcl_InitHashTable _ANSI_ARGS_(( - Tcl_HashTable * tablePtr, int keyType)); + Tcl_HashTable *tablePtr, int keyType)); /* 182 */ EXTERN int Tcl_InputBlocked _ANSI_ARGS_((Tcl_Channel chan)); /* 183 */ EXTERN int Tcl_InputBuffered _ANSI_ARGS_((Tcl_Channel chan)); /* 184 */ -EXTERN int Tcl_InterpDeleted _ANSI_ARGS_((Tcl_Interp * interp)); +EXTERN int Tcl_InterpDeleted _ANSI_ARGS_((Tcl_Interp *interp)); /* 185 */ -EXTERN int Tcl_IsSafe _ANSI_ARGS_((Tcl_Interp * interp)); +EXTERN int Tcl_IsSafe _ANSI_ARGS_((Tcl_Interp *interp)); /* 186 */ -EXTERN char * Tcl_JoinPath _ANSI_ARGS_((int argc, - CONST84 char * CONST * argv, - Tcl_DString * resultPtr)); +EXTERN char * Tcl_JoinPath _ANSI_ARGS_((int argc, + CONST84 char *CONST *argv, + Tcl_DString *resultPtr)); /* 187 */ -EXTERN int Tcl_LinkVar _ANSI_ARGS_((Tcl_Interp * interp, - CONST char * varName, char * addr, int type)); +EXTERN int Tcl_LinkVar _ANSI_ARGS_((Tcl_Interp *interp, + CONST char *varName, char *addr, int type)); /* Slot 188 is reserved */ /* 189 */ -EXTERN Tcl_Channel Tcl_MakeFileChannel _ANSI_ARGS_((ClientData handle, +EXTERN Tcl_Channel Tcl_MakeFileChannel _ANSI_ARGS_((ClientData handle, int mode)); /* 190 */ -EXTERN int Tcl_MakeSafe _ANSI_ARGS_((Tcl_Interp * interp)); +EXTERN int Tcl_MakeSafe _ANSI_ARGS_((Tcl_Interp *interp)); /* 191 */ EXTERN Tcl_Channel Tcl_MakeTcpClientChannel _ANSI_ARGS_(( ClientData tcpSocket)); /* 192 */ -EXTERN char * Tcl_Merge _ANSI_ARGS_((int argc, - CONST84 char * CONST * argv)); +EXTERN char * Tcl_Merge _ANSI_ARGS_((int argc, + CONST84 char *CONST *argv)); /* 193 */ EXTERN Tcl_HashEntry * Tcl_NextHashEntry _ANSI_ARGS_(( - Tcl_HashSearch * searchPtr)); + Tcl_HashSearch *searchPtr)); /* 194 */ -EXTERN void Tcl_NotifyChannel _ANSI_ARGS_((Tcl_Channel channel, +EXTERN void Tcl_NotifyChannel _ANSI_ARGS_((Tcl_Channel channel, int mask)); /* 195 */ -EXTERN Tcl_Obj * Tcl_ObjGetVar2 _ANSI_ARGS_((Tcl_Interp * interp, - Tcl_Obj * part1Ptr, Tcl_Obj * part2Ptr, +EXTERN Tcl_Obj * Tcl_ObjGetVar2 _ANSI_ARGS_((Tcl_Interp *interp, + Tcl_Obj *part1Ptr, Tcl_Obj *part2Ptr, int flags)); /* 196 */ -EXTERN Tcl_Obj * Tcl_ObjSetVar2 _ANSI_ARGS_((Tcl_Interp * interp, - Tcl_Obj * part1Ptr, Tcl_Obj * part2Ptr, - Tcl_Obj * newValuePtr, int flags)); -#if !defined(__WIN32__) && !defined(MAC_TCL) /* UNIX */ -/* 197 */ -EXTERN Tcl_Channel Tcl_OpenCommandChannel _ANSI_ARGS_(( - Tcl_Interp * interp, int argc, - CONST84 char ** argv, int flags)); -#endif /* UNIX */ -#ifdef __WIN32__ +EXTERN Tcl_Obj * Tcl_ObjSetVar2 _ANSI_ARGS_((Tcl_Interp *interp, + Tcl_Obj *part1Ptr, Tcl_Obj *part2Ptr, + Tcl_Obj *newValuePtr, int flags)); /* 197 */ EXTERN Tcl_Channel Tcl_OpenCommandChannel _ANSI_ARGS_(( - Tcl_Interp * interp, int argc, - CONST84 char ** argv, int flags)); -#endif /* __WIN32__ */ + Tcl_Interp *interp, int argc, + CONST84 char **argv, int flags)); /* 198 */ -EXTERN Tcl_Channel Tcl_OpenFileChannel _ANSI_ARGS_((Tcl_Interp * interp, - CONST char * fileName, - CONST char * modeString, int permissions)); +EXTERN Tcl_Channel Tcl_OpenFileChannel _ANSI_ARGS_((Tcl_Interp *interp, + CONST char *fileName, CONST char *modeString, + int permissions)); /* 199 */ -EXTERN Tcl_Channel Tcl_OpenTcpClient _ANSI_ARGS_((Tcl_Interp * interp, - int port, CONST char * address, - CONST char * myaddr, int myport, int async)); +EXTERN Tcl_Channel Tcl_OpenTcpClient _ANSI_ARGS_((Tcl_Interp *interp, + int port, CONST char *address, + CONST char *myaddr, int myport, int async)); /* 200 */ -EXTERN Tcl_Channel Tcl_OpenTcpServer _ANSI_ARGS_((Tcl_Interp * interp, - int port, CONST char * host, - Tcl_TcpAcceptProc * acceptProc, +EXTERN Tcl_Channel Tcl_OpenTcpServer _ANSI_ARGS_((Tcl_Interp *interp, + int port, CONST char *host, + Tcl_TcpAcceptProc *acceptProc, ClientData callbackData)); /* 201 */ EXTERN void Tcl_Preserve _ANSI_ARGS_((ClientData data)); /* 202 */ -EXTERN void Tcl_PrintDouble _ANSI_ARGS_((Tcl_Interp * interp, - double value, char * dst)); +EXTERN void Tcl_PrintDouble _ANSI_ARGS_((Tcl_Interp *interp, + double value, char *dst)); /* 203 */ -EXTERN int Tcl_PutEnv _ANSI_ARGS_((CONST char * string)); +EXTERN int Tcl_PutEnv _ANSI_ARGS_((CONST char *assignment)); /* 204 */ -EXTERN CONST84_RETURN char * Tcl_PosixError _ANSI_ARGS_((Tcl_Interp * interp)); +EXTERN CONST84_RETURN char * Tcl_PosixError _ANSI_ARGS_((Tcl_Interp *interp)); /* 205 */ -EXTERN void Tcl_QueueEvent _ANSI_ARGS_((Tcl_Event * evPtr, +EXTERN void Tcl_QueueEvent _ANSI_ARGS_((Tcl_Event *evPtr, Tcl_QueuePosition position)); /* 206 */ -EXTERN int Tcl_Read _ANSI_ARGS_((Tcl_Channel chan, - char * bufPtr, int toRead)); -#if !defined(__WIN32__) && !defined(MAC_TCL) /* UNIX */ -/* 207 */ -EXTERN void Tcl_ReapDetachedProcs _ANSI_ARGS_((void)); -#endif /* UNIX */ -#ifdef __WIN32__ +EXTERN int Tcl_Read _ANSI_ARGS_((Tcl_Channel chan, char *bufPtr, + int toRead)); /* 207 */ EXTERN void Tcl_ReapDetachedProcs _ANSI_ARGS_((void)); -#endif /* __WIN32__ */ /* 208 */ -EXTERN int Tcl_RecordAndEval _ANSI_ARGS_((Tcl_Interp * interp, - CONST char * cmd, int flags)); +EXTERN int Tcl_RecordAndEval _ANSI_ARGS_((Tcl_Interp *interp, + CONST char *cmd, int flags)); /* 209 */ -EXTERN int Tcl_RecordAndEvalObj _ANSI_ARGS_(( - Tcl_Interp * interp, Tcl_Obj * cmdPtr, - int flags)); +EXTERN int Tcl_RecordAndEvalObj _ANSI_ARGS_((Tcl_Interp *interp, + Tcl_Obj *cmdPtr, int flags)); /* 210 */ -EXTERN void Tcl_RegisterChannel _ANSI_ARGS_((Tcl_Interp * interp, +EXTERN void Tcl_RegisterChannel _ANSI_ARGS_((Tcl_Interp *interp, Tcl_Channel chan)); /* 211 */ EXTERN void Tcl_RegisterObjType _ANSI_ARGS_(( - Tcl_ObjType * typePtr)); + Tcl_ObjType *typePtr)); /* 212 */ -EXTERN Tcl_RegExp Tcl_RegExpCompile _ANSI_ARGS_((Tcl_Interp * interp, - CONST char * string)); +EXTERN Tcl_RegExp Tcl_RegExpCompile _ANSI_ARGS_((Tcl_Interp *interp, + CONST char *pattern)); /* 213 */ -EXTERN int Tcl_RegExpExec _ANSI_ARGS_((Tcl_Interp * interp, - Tcl_RegExp regexp, CONST char * str, - CONST char * start)); +EXTERN int Tcl_RegExpExec _ANSI_ARGS_((Tcl_Interp *interp, + Tcl_RegExp regexp, CONST char *text, + CONST char *start)); /* 214 */ -EXTERN int Tcl_RegExpMatch _ANSI_ARGS_((Tcl_Interp * interp, - CONST char * str, CONST char * pattern)); +EXTERN int Tcl_RegExpMatch _ANSI_ARGS_((Tcl_Interp *interp, + CONST char *text, CONST char *pattern)); /* 215 */ -EXTERN void Tcl_RegExpRange _ANSI_ARGS_((Tcl_RegExp regexp, - int index, CONST84 char ** startPtr, - CONST84 char ** endPtr)); +EXTERN void Tcl_RegExpRange _ANSI_ARGS_((Tcl_RegExp regexp, + int index, CONST84 char **startPtr, + CONST84 char **endPtr)); /* 216 */ EXTERN void Tcl_Release _ANSI_ARGS_((ClientData clientData)); /* 217 */ -EXTERN void Tcl_ResetResult _ANSI_ARGS_((Tcl_Interp * interp)); +EXTERN void Tcl_ResetResult _ANSI_ARGS_((Tcl_Interp *interp)); /* 218 */ -EXTERN int Tcl_ScanElement _ANSI_ARGS_((CONST char * str, - int * flagPtr)); +EXTERN int Tcl_ScanElement _ANSI_ARGS_((CONST char *src, + int *flagPtr)); /* 219 */ -EXTERN int Tcl_ScanCountedElement _ANSI_ARGS_((CONST char * str, - int length, int * flagPtr)); +EXTERN int Tcl_ScanCountedElement _ANSI_ARGS_((CONST char *src, + int length, int *flagPtr)); /* 220 */ -EXTERN int Tcl_SeekOld _ANSI_ARGS_((Tcl_Channel chan, +EXTERN int Tcl_SeekOld _ANSI_ARGS_((Tcl_Channel chan, int offset, int mode)); /* 221 */ EXTERN int Tcl_ServiceAll _ANSI_ARGS_((void)); /* 222 */ EXTERN int Tcl_ServiceEvent _ANSI_ARGS_((int flags)); /* 223 */ -EXTERN void Tcl_SetAssocData _ANSI_ARGS_((Tcl_Interp * interp, - CONST char * name, - Tcl_InterpDeleteProc * proc, +EXTERN void Tcl_SetAssocData _ANSI_ARGS_((Tcl_Interp *interp, + CONST char *name, Tcl_InterpDeleteProc *proc, ClientData clientData)); /* 224 */ EXTERN void Tcl_SetChannelBufferSize _ANSI_ARGS_(( Tcl_Channel chan, int sz)); /* 225 */ -EXTERN int Tcl_SetChannelOption _ANSI_ARGS_(( - Tcl_Interp * interp, Tcl_Channel chan, - CONST char * optionName, - CONST char * newValue)); +EXTERN int Tcl_SetChannelOption _ANSI_ARGS_((Tcl_Interp *interp, + Tcl_Channel chan, CONST char *optionName, + CONST char *newValue)); /* 226 */ -EXTERN int Tcl_SetCommandInfo _ANSI_ARGS_((Tcl_Interp * interp, - CONST char * cmdName, - CONST Tcl_CmdInfo * infoPtr)); +EXTERN int Tcl_SetCommandInfo _ANSI_ARGS_((Tcl_Interp *interp, + CONST char *cmdName, + CONST Tcl_CmdInfo *infoPtr)); /* 227 */ EXTERN void Tcl_SetErrno _ANSI_ARGS_((int err)); /* 228 */ EXTERN void Tcl_SetErrorCode _ANSI_ARGS_(TCL_VARARGS(Tcl_Interp *,interp)); /* 229 */ -EXTERN void Tcl_SetMaxBlockTime _ANSI_ARGS_((Tcl_Time * timePtr)); +EXTERN void Tcl_SetMaxBlockTime _ANSI_ARGS_((Tcl_Time *timePtr)); /* 230 */ EXTERN void Tcl_SetPanicProc _ANSI_ARGS_(( - Tcl_PanicProc * panicProc)); + Tcl_PanicProc *panicProc)); /* 231 */ EXTERN int Tcl_SetRecursionLimit _ANSI_ARGS_(( - Tcl_Interp * interp, int depth)); + Tcl_Interp *interp, int depth)); /* 232 */ -EXTERN void Tcl_SetResult _ANSI_ARGS_((Tcl_Interp * interp, - char * str, Tcl_FreeProc * freeProc)); +EXTERN void Tcl_SetResult _ANSI_ARGS_((Tcl_Interp *interp, + char *result, Tcl_FreeProc *freeProc)); /* 233 */ EXTERN int Tcl_SetServiceMode _ANSI_ARGS_((int mode)); /* 234 */ -EXTERN void Tcl_SetObjErrorCode _ANSI_ARGS_((Tcl_Interp * interp, - Tcl_Obj * errorObjPtr)); +EXTERN void Tcl_SetObjErrorCode _ANSI_ARGS_((Tcl_Interp *interp, + Tcl_Obj *errorObjPtr)); /* 235 */ -EXTERN void Tcl_SetObjResult _ANSI_ARGS_((Tcl_Interp * interp, - Tcl_Obj * resultObjPtr)); +EXTERN void Tcl_SetObjResult _ANSI_ARGS_((Tcl_Interp *interp, + Tcl_Obj *resultObjPtr)); /* 236 */ -EXTERN void Tcl_SetStdChannel _ANSI_ARGS_((Tcl_Channel channel, +EXTERN void Tcl_SetStdChannel _ANSI_ARGS_((Tcl_Channel channel, int type)); /* 237 */ -EXTERN CONST84_RETURN char * Tcl_SetVar _ANSI_ARGS_((Tcl_Interp * interp, - CONST char * varName, CONST char * newValue, +EXTERN CONST84_RETURN char * Tcl_SetVar _ANSI_ARGS_((Tcl_Interp *interp, + CONST char *varName, CONST char *newValue, int flags)); /* 238 */ -EXTERN CONST84_RETURN char * Tcl_SetVar2 _ANSI_ARGS_((Tcl_Interp * interp, - CONST char * part1, CONST char * part2, - CONST char * newValue, int flags)); +EXTERN CONST84_RETURN char * Tcl_SetVar2 _ANSI_ARGS_((Tcl_Interp *interp, + CONST char *part1, CONST char *part2, + CONST char *newValue, int flags)); /* 239 */ EXTERN CONST84_RETURN char * Tcl_SignalId _ANSI_ARGS_((int sig)); /* 240 */ EXTERN CONST84_RETURN char * Tcl_SignalMsg _ANSI_ARGS_((int sig)); /* 241 */ -EXTERN void Tcl_SourceRCFile _ANSI_ARGS_((Tcl_Interp * interp)); +EXTERN void Tcl_SourceRCFile _ANSI_ARGS_((Tcl_Interp *interp)); /* 242 */ -EXTERN int Tcl_SplitList _ANSI_ARGS_((Tcl_Interp * interp, - CONST char * listStr, int * argcPtr, - CONST84 char *** argvPtr)); +EXTERN int Tcl_SplitList _ANSI_ARGS_((Tcl_Interp *interp, + CONST char *listStr, int *argcPtr, + CONST84 char ***argvPtr)); /* 243 */ -EXTERN void Tcl_SplitPath _ANSI_ARGS_((CONST char * path, - int * argcPtr, CONST84 char *** argvPtr)); +EXTERN void Tcl_SplitPath _ANSI_ARGS_((CONST char *path, + int *argcPtr, CONST84 char ***argvPtr)); /* 244 */ -EXTERN void Tcl_StaticPackage _ANSI_ARGS_((Tcl_Interp * interp, - CONST char * pkgName, - Tcl_PackageInitProc * initProc, - Tcl_PackageInitProc * safeInitProc)); +EXTERN void Tcl_StaticPackage _ANSI_ARGS_((Tcl_Interp *interp, + CONST char *pkgName, + Tcl_PackageInitProc *initProc, + Tcl_PackageInitProc *safeInitProc)); /* 245 */ -EXTERN int Tcl_StringMatch _ANSI_ARGS_((CONST char * str, - CONST char * pattern)); +EXTERN int Tcl_StringMatch _ANSI_ARGS_((CONST char *str, + CONST char *pattern)); /* 246 */ EXTERN int Tcl_TellOld _ANSI_ARGS_((Tcl_Channel chan)); /* 247 */ -EXTERN int Tcl_TraceVar _ANSI_ARGS_((Tcl_Interp * interp, - CONST char * varName, int flags, - Tcl_VarTraceProc * proc, +EXTERN int Tcl_TraceVar _ANSI_ARGS_((Tcl_Interp *interp, + CONST char *varName, int flags, + Tcl_VarTraceProc *proc, ClientData clientData)); /* 248 */ -EXTERN int Tcl_TraceVar2 _ANSI_ARGS_((Tcl_Interp * interp, - CONST char * part1, CONST char * part2, - int flags, Tcl_VarTraceProc * proc, +EXTERN int Tcl_TraceVar2 _ANSI_ARGS_((Tcl_Interp *interp, + CONST char *part1, CONST char *part2, + int flags, Tcl_VarTraceProc *proc, ClientData clientData)); /* 249 */ EXTERN char * Tcl_TranslateFileName _ANSI_ARGS_(( - Tcl_Interp * interp, CONST char * name, - Tcl_DString * bufferPtr)); + Tcl_Interp *interp, CONST char *name, + Tcl_DString *bufferPtr)); /* 250 */ -EXTERN int Tcl_Ungets _ANSI_ARGS_((Tcl_Channel chan, - CONST char * str, int len, int atHead)); +EXTERN int Tcl_Ungets _ANSI_ARGS_((Tcl_Channel chan, + CONST char *str, int len, int atHead)); /* 251 */ -EXTERN void Tcl_UnlinkVar _ANSI_ARGS_((Tcl_Interp * interp, - CONST char * varName)); +EXTERN void Tcl_UnlinkVar _ANSI_ARGS_((Tcl_Interp *interp, + CONST char *varName)); /* 252 */ EXTERN int Tcl_UnregisterChannel _ANSI_ARGS_(( - Tcl_Interp * interp, Tcl_Channel chan)); + Tcl_Interp *interp, Tcl_Channel chan)); /* 253 */ -EXTERN int Tcl_UnsetVar _ANSI_ARGS_((Tcl_Interp * interp, - CONST char * varName, int flags)); +EXTERN int Tcl_UnsetVar _ANSI_ARGS_((Tcl_Interp *interp, + CONST char *varName, int flags)); /* 254 */ -EXTERN int Tcl_UnsetVar2 _ANSI_ARGS_((Tcl_Interp * interp, - CONST char * part1, CONST char * part2, +EXTERN int Tcl_UnsetVar2 _ANSI_ARGS_((Tcl_Interp *interp, + CONST char *part1, CONST char *part2, int flags)); /* 255 */ -EXTERN void Tcl_UntraceVar _ANSI_ARGS_((Tcl_Interp * interp, - CONST char * varName, int flags, - Tcl_VarTraceProc * proc, +EXTERN void Tcl_UntraceVar _ANSI_ARGS_((Tcl_Interp *interp, + CONST char *varName, int flags, + Tcl_VarTraceProc *proc, ClientData clientData)); /* 256 */ -EXTERN void Tcl_UntraceVar2 _ANSI_ARGS_((Tcl_Interp * interp, - CONST char * part1, CONST char * part2, - int flags, Tcl_VarTraceProc * proc, +EXTERN void Tcl_UntraceVar2 _ANSI_ARGS_((Tcl_Interp *interp, + CONST char *part1, CONST char *part2, + int flags, Tcl_VarTraceProc *proc, ClientData clientData)); /* 257 */ -EXTERN void Tcl_UpdateLinkedVar _ANSI_ARGS_((Tcl_Interp * interp, - CONST char * varName)); +EXTERN void Tcl_UpdateLinkedVar _ANSI_ARGS_((Tcl_Interp *interp, + CONST char *varName)); /* 258 */ -EXTERN int Tcl_UpVar _ANSI_ARGS_((Tcl_Interp * interp, - CONST char * frameName, CONST char * varName, - CONST char * localName, int flags)); +EXTERN int Tcl_UpVar _ANSI_ARGS_((Tcl_Interp *interp, + CONST char *frameName, CONST char *varName, + CONST char *localName, int flags)); /* 259 */ -EXTERN int Tcl_UpVar2 _ANSI_ARGS_((Tcl_Interp * interp, - CONST char * frameName, CONST char * part1, - CONST char * part2, CONST char * localName, +EXTERN int Tcl_UpVar2 _ANSI_ARGS_((Tcl_Interp *interp, + CONST char *frameName, CONST char *part1, + CONST char *part2, CONST char *localName, int flags)); /* 260 */ EXTERN int Tcl_VarEval _ANSI_ARGS_(TCL_VARARGS(Tcl_Interp *,interp)); /* 261 */ -EXTERN ClientData Tcl_VarTraceInfo _ANSI_ARGS_((Tcl_Interp * interp, - CONST char * varName, int flags, - Tcl_VarTraceProc * procPtr, +EXTERN ClientData Tcl_VarTraceInfo _ANSI_ARGS_((Tcl_Interp *interp, + CONST char *varName, int flags, + Tcl_VarTraceProc *procPtr, ClientData prevClientData)); /* 262 */ -EXTERN ClientData Tcl_VarTraceInfo2 _ANSI_ARGS_((Tcl_Interp * interp, - CONST char * part1, CONST char * part2, - int flags, Tcl_VarTraceProc * procPtr, +EXTERN ClientData Tcl_VarTraceInfo2 _ANSI_ARGS_((Tcl_Interp *interp, + CONST char *part1, CONST char *part2, + int flags, Tcl_VarTraceProc *procPtr, ClientData prevClientData)); /* 263 */ -EXTERN int Tcl_Write _ANSI_ARGS_((Tcl_Channel chan, - CONST char * s, int slen)); +EXTERN int Tcl_Write _ANSI_ARGS_((Tcl_Channel chan, + CONST char *s, int slen)); /* 264 */ -EXTERN void Tcl_WrongNumArgs _ANSI_ARGS_((Tcl_Interp * interp, - int objc, Tcl_Obj *CONST objv[], - CONST char * message)); +EXTERN void Tcl_WrongNumArgs _ANSI_ARGS_((Tcl_Interp *interp, + int objc, Tcl_Obj *CONST objv[], + CONST char *message)); /* 265 */ EXTERN int Tcl_DumpActiveMemory _ANSI_ARGS_(( - CONST char * fileName)); + CONST char *fileName)); /* 266 */ -EXTERN void Tcl_ValidateAllMemory _ANSI_ARGS_((CONST char * file, +EXTERN void Tcl_ValidateAllMemory _ANSI_ARGS_((CONST char *file, int line)); /* 267 */ -EXTERN void Tcl_AppendResultVA _ANSI_ARGS_((Tcl_Interp * interp, +EXTERN void Tcl_AppendResultVA _ANSI_ARGS_((Tcl_Interp *interp, va_list argList)); /* 268 */ EXTERN void Tcl_AppendStringsToObjVA _ANSI_ARGS_(( - Tcl_Obj * objPtr, va_list argList)); + Tcl_Obj *objPtr, va_list argList)); /* 269 */ -EXTERN CONST84_RETURN char * Tcl_HashStats _ANSI_ARGS_(( - Tcl_HashTable * tablePtr)); +EXTERN char * Tcl_HashStats _ANSI_ARGS_((Tcl_HashTable *tablePtr)); /* 270 */ -EXTERN CONST84_RETURN char * Tcl_ParseVar _ANSI_ARGS_((Tcl_Interp * interp, - CONST char * str, CONST84 char ** termPtr)); +EXTERN CONST84_RETURN char * Tcl_ParseVar _ANSI_ARGS_((Tcl_Interp *interp, + CONST char *start, CONST84 char **termPtr)); /* 271 */ -EXTERN CONST84_RETURN char * Tcl_PkgPresent _ANSI_ARGS_((Tcl_Interp * interp, - CONST char * name, CONST char * version, +EXTERN CONST84_RETURN char * Tcl_PkgPresent _ANSI_ARGS_((Tcl_Interp *interp, + CONST char *name, CONST char *version, int exact)); /* 272 */ EXTERN CONST84_RETURN char * Tcl_PkgPresentEx _ANSI_ARGS_(( - Tcl_Interp * interp, CONST char * name, - CONST char * version, int exact, - ClientData * clientDataPtr)); + Tcl_Interp *interp, CONST char *name, + CONST char *version, int exact, + ClientData *clientDataPtr)); /* 273 */ -EXTERN int Tcl_PkgProvide _ANSI_ARGS_((Tcl_Interp * interp, - CONST char * name, CONST char * version)); +EXTERN int Tcl_PkgProvide _ANSI_ARGS_((Tcl_Interp *interp, + CONST char *name, CONST char *version)); /* 274 */ -EXTERN CONST84_RETURN char * Tcl_PkgRequire _ANSI_ARGS_((Tcl_Interp * interp, - CONST char * name, CONST char * version, +EXTERN CONST84_RETURN char * Tcl_PkgRequire _ANSI_ARGS_((Tcl_Interp *interp, + CONST char *name, CONST char *version, int exact)); /* 275 */ -EXTERN void Tcl_SetErrorCodeVA _ANSI_ARGS_((Tcl_Interp * interp, +EXTERN void Tcl_SetErrorCodeVA _ANSI_ARGS_((Tcl_Interp *interp, va_list argList)); /* 276 */ -EXTERN int Tcl_VarEvalVA _ANSI_ARGS_((Tcl_Interp * interp, +EXTERN int Tcl_VarEvalVA _ANSI_ARGS_((Tcl_Interp *interp, va_list argList)); /* 277 */ -EXTERN Tcl_Pid Tcl_WaitPid _ANSI_ARGS_((Tcl_Pid pid, int * statPtr, +EXTERN Tcl_Pid Tcl_WaitPid _ANSI_ARGS_((Tcl_Pid pid, int *statPtr, int options)); /* 278 */ -EXTERN void Tcl_PanicVA _ANSI_ARGS_((CONST char * format, +EXTERN void Tcl_PanicVA _ANSI_ARGS_((CONST char *format, va_list argList)); /* 279 */ -EXTERN void Tcl_GetVersion _ANSI_ARGS_((int * major, int * minor, - int * patchLevel, int * type)); +EXTERN void Tcl_GetVersion _ANSI_ARGS_((int *major, int *minor, + int *patchLevel, int *type)); /* 280 */ -EXTERN void Tcl_InitMemory _ANSI_ARGS_((Tcl_Interp * interp)); +EXTERN void Tcl_InitMemory _ANSI_ARGS_((Tcl_Interp *interp)); /* 281 */ -EXTERN Tcl_Channel Tcl_StackChannel _ANSI_ARGS_((Tcl_Interp * interp, - Tcl_ChannelType * typePtr, - ClientData instanceData, int mask, +EXTERN Tcl_Channel Tcl_StackChannel _ANSI_ARGS_((Tcl_Interp *interp, + Tcl_ChannelType *typePtr, + ClientData instanceData, int mask, Tcl_Channel prevChan)); /* 282 */ -EXTERN int Tcl_UnstackChannel _ANSI_ARGS_((Tcl_Interp * interp, +EXTERN int Tcl_UnstackChannel _ANSI_ARGS_((Tcl_Interp *interp, Tcl_Channel chan)); /* 283 */ EXTERN Tcl_Channel Tcl_GetStackedChannel _ANSI_ARGS_((Tcl_Channel chan)); /* 284 */ -EXTERN void Tcl_SetMainLoop _ANSI_ARGS_((Tcl_MainLoopProc * proc)); +EXTERN void Tcl_SetMainLoop _ANSI_ARGS_((Tcl_MainLoopProc *proc)); /* Slot 285 is reserved */ /* 286 */ -EXTERN void Tcl_AppendObjToObj _ANSI_ARGS_((Tcl_Obj * objPtr, - Tcl_Obj * appendObjPtr)); +EXTERN void Tcl_AppendObjToObj _ANSI_ARGS_((Tcl_Obj *objPtr, + Tcl_Obj *appendObjPtr)); /* 287 */ EXTERN Tcl_Encoding Tcl_CreateEncoding _ANSI_ARGS_(( - Tcl_EncodingType * typePtr)); + Tcl_EncodingType *typePtr)); /* 288 */ EXTERN void Tcl_CreateThreadExitHandler _ANSI_ARGS_(( - Tcl_ExitProc * proc, ClientData clientData)); + Tcl_ExitProc *proc, ClientData clientData)); /* 289 */ EXTERN void Tcl_DeleteThreadExitHandler _ANSI_ARGS_(( - Tcl_ExitProc * proc, ClientData clientData)); + Tcl_ExitProc *proc, ClientData clientData)); /* 290 */ EXTERN void Tcl_DiscardResult _ANSI_ARGS_(( - Tcl_SavedResult * statePtr)); + Tcl_SavedResult *statePtr)); /* 291 */ -EXTERN int Tcl_EvalEx _ANSI_ARGS_((Tcl_Interp * interp, - CONST char * script, int numBytes, int flags)); +EXTERN int Tcl_EvalEx _ANSI_ARGS_((Tcl_Interp *interp, + CONST char *script, int numBytes, int flags)); /* 292 */ -EXTERN int Tcl_EvalObjv _ANSI_ARGS_((Tcl_Interp * interp, +EXTERN int Tcl_EvalObjv _ANSI_ARGS_((Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[], int flags)); /* 293 */ -EXTERN int Tcl_EvalObjEx _ANSI_ARGS_((Tcl_Interp * interp, - Tcl_Obj * objPtr, int flags)); +EXTERN int Tcl_EvalObjEx _ANSI_ARGS_((Tcl_Interp *interp, + Tcl_Obj *objPtr, int flags)); /* 294 */ EXTERN void Tcl_ExitThread _ANSI_ARGS_((int status)); /* 295 */ -EXTERN int Tcl_ExternalToUtf _ANSI_ARGS_((Tcl_Interp * interp, - Tcl_Encoding encoding, CONST char * src, - int srcLen, int flags, - Tcl_EncodingState * statePtr, char * dst, - int dstLen, int * srcReadPtr, - int * dstWrotePtr, int * dstCharsPtr)); +EXTERN int Tcl_ExternalToUtf _ANSI_ARGS_((Tcl_Interp *interp, + Tcl_Encoding encoding, CONST char *src, + int srcLen, int flags, + Tcl_EncodingState *statePtr, char *dst, + int dstLen, int *srcReadPtr, + int *dstWrotePtr, int *dstCharsPtr)); /* 296 */ EXTERN char * Tcl_ExternalToUtfDString _ANSI_ARGS_(( - Tcl_Encoding encoding, CONST char * src, - int srcLen, Tcl_DString * dsPtr)); + Tcl_Encoding encoding, CONST char *src, + int srcLen, Tcl_DString *dsPtr)); /* 297 */ EXTERN void Tcl_FinalizeThread _ANSI_ARGS_((void)); /* 298 */ @@ -983,67 +966,66 @@ /* 300 */ EXTERN Tcl_ThreadId Tcl_GetCurrentThread _ANSI_ARGS_((void)); /* 301 */ -EXTERN Tcl_Encoding Tcl_GetEncoding _ANSI_ARGS_((Tcl_Interp * interp, - CONST char * name)); +EXTERN Tcl_Encoding Tcl_GetEncoding _ANSI_ARGS_((Tcl_Interp *interp, + CONST char *name)); /* 302 */ EXTERN CONST84_RETURN char * Tcl_GetEncodingName _ANSI_ARGS_(( Tcl_Encoding encoding)); /* 303 */ -EXTERN void Tcl_GetEncodingNames _ANSI_ARGS_(( - Tcl_Interp * interp)); +EXTERN void Tcl_GetEncodingNames _ANSI_ARGS_((Tcl_Interp *interp)); /* 304 */ EXTERN int Tcl_GetIndexFromObjStruct _ANSI_ARGS_(( - Tcl_Interp * interp, Tcl_Obj * objPtr, - CONST VOID * tablePtr, int offset, - CONST char * msg, int flags, int * indexPtr)); + Tcl_Interp *interp, Tcl_Obj *objPtr, + CONST VOID *tablePtr, int offset, + CONST char *msg, int flags, int *indexPtr)); /* 305 */ EXTERN VOID * Tcl_GetThreadData _ANSI_ARGS_(( - Tcl_ThreadDataKey * keyPtr, int size)); + Tcl_ThreadDataKey *keyPtr, int size)); /* 306 */ -EXTERN Tcl_Obj * Tcl_GetVar2Ex _ANSI_ARGS_((Tcl_Interp * interp, - CONST char * part1, CONST char * part2, +EXTERN Tcl_Obj * Tcl_GetVar2Ex _ANSI_ARGS_((Tcl_Interp *interp, + CONST char *part1, CONST char *part2, int flags)); /* 307 */ EXTERN ClientData Tcl_InitNotifier _ANSI_ARGS_((void)); /* 308 */ -EXTERN void Tcl_MutexLock _ANSI_ARGS_((Tcl_Mutex * mutexPtr)); +EXTERN void Tcl_MutexLock _ANSI_ARGS_((Tcl_Mutex *mutexPtr)); /* 309 */ -EXTERN void Tcl_MutexUnlock _ANSI_ARGS_((Tcl_Mutex * mutexPtr)); +EXTERN void Tcl_MutexUnlock _ANSI_ARGS_((Tcl_Mutex *mutexPtr)); /* 310 */ EXTERN void Tcl_ConditionNotify _ANSI_ARGS_(( - Tcl_Condition * condPtr)); + Tcl_Condition *condPtr)); /* 311 */ EXTERN void Tcl_ConditionWait _ANSI_ARGS_(( - Tcl_Condition * condPtr, - Tcl_Mutex * mutexPtr, Tcl_Time * timePtr)); + Tcl_Condition *condPtr, Tcl_Mutex *mutexPtr, + Tcl_Time *timePtr)); /* 312 */ -EXTERN int Tcl_NumUtfChars _ANSI_ARGS_((CONST char * src, - int len)); +EXTERN int Tcl_NumUtfChars _ANSI_ARGS_((CONST char *src, + int length)); /* 313 */ -EXTERN int Tcl_ReadChars _ANSI_ARGS_((Tcl_Channel channel, - Tcl_Obj * objPtr, int charsToRead, +EXTERN int Tcl_ReadChars _ANSI_ARGS_((Tcl_Channel channel, + Tcl_Obj *objPtr, int charsToRead, int appendFlag)); /* 314 */ -EXTERN void Tcl_RestoreResult _ANSI_ARGS_((Tcl_Interp * interp, - Tcl_SavedResult * statePtr)); +EXTERN void Tcl_RestoreResult _ANSI_ARGS_((Tcl_Interp *interp, + Tcl_SavedResult *statePtr)); /* 315 */ -EXTERN void Tcl_SaveResult _ANSI_ARGS_((Tcl_Interp * interp, - Tcl_SavedResult * statePtr)); +EXTERN void Tcl_SaveResult _ANSI_ARGS_((Tcl_Interp *interp, + Tcl_SavedResult *statePtr)); /* 316 */ EXTERN int Tcl_SetSystemEncoding _ANSI_ARGS_(( - Tcl_Interp * interp, CONST char * name)); + Tcl_Interp *interp, CONST char *name)); /* 317 */ -EXTERN Tcl_Obj * Tcl_SetVar2Ex _ANSI_ARGS_((Tcl_Interp * interp, - CONST char * part1, CONST char * part2, - Tcl_Obj * newValuePtr, int flags)); +EXTERN Tcl_Obj * Tcl_SetVar2Ex _ANSI_ARGS_((Tcl_Interp *interp, + CONST char *part1, CONST char *part2, + Tcl_Obj *newValuePtr, int flags)); /* 318 */ EXTERN void Tcl_ThreadAlert _ANSI_ARGS_((Tcl_ThreadId threadId)); /* 319 */ EXTERN void Tcl_ThreadQueueEvent _ANSI_ARGS_(( - Tcl_ThreadId threadId, Tcl_Event* evPtr, + Tcl_ThreadId threadId, Tcl_Event *evPtr, Tcl_QueuePosition position)); /* 320 */ -EXTERN Tcl_UniChar Tcl_UniCharAtIndex _ANSI_ARGS_((CONST char * src, +EXTERN Tcl_UniChar Tcl_UniCharAtIndex _ANSI_ARGS_((CONST char *src, int index)); /* 321 */ EXTERN Tcl_UniChar Tcl_UniCharToLower _ANSI_ARGS_((int ch)); @@ -1052,60 +1034,60 @@ /* 323 */ EXTERN Tcl_UniChar Tcl_UniCharToUpper _ANSI_ARGS_((int ch)); /* 324 */ -EXTERN int Tcl_UniCharToUtf _ANSI_ARGS_((int ch, char * buf)); +EXTERN int Tcl_UniCharToUtf _ANSI_ARGS_((int ch, char *buf)); /* 325 */ -EXTERN CONST84_RETURN char * Tcl_UtfAtIndex _ANSI_ARGS_((CONST char * src, +EXTERN CONST84_RETURN char * Tcl_UtfAtIndex _ANSI_ARGS_((CONST char *src, int index)); /* 326 */ -EXTERN int Tcl_UtfCharComplete _ANSI_ARGS_((CONST char * src, - int len)); +EXTERN int Tcl_UtfCharComplete _ANSI_ARGS_((CONST char *src, + int length)); /* 327 */ -EXTERN int Tcl_UtfBackslash _ANSI_ARGS_((CONST char * src, - int * readPtr, char * dst)); +EXTERN int Tcl_UtfBackslash _ANSI_ARGS_((CONST char *src, + int *readPtr, char *dst)); /* 328 */ -EXTERN CONST84_RETURN char * Tcl_UtfFindFirst _ANSI_ARGS_((CONST char * src, +EXTERN CONST84_RETURN char * Tcl_UtfFindFirst _ANSI_ARGS_((CONST char *src, int ch)); /* 329 */ -EXTERN CONST84_RETURN char * Tcl_UtfFindLast _ANSI_ARGS_((CONST char * src, +EXTERN CONST84_RETURN char * Tcl_UtfFindLast _ANSI_ARGS_((CONST char *src, int ch)); /* 330 */ -EXTERN CONST84_RETURN char * Tcl_UtfNext _ANSI_ARGS_((CONST char * src)); +EXTERN CONST84_RETURN char * Tcl_UtfNext _ANSI_ARGS_((CONST char *src)); /* 331 */ -EXTERN CONST84_RETURN char * Tcl_UtfPrev _ANSI_ARGS_((CONST char * src, - CONST char * start)); +EXTERN CONST84_RETURN char * Tcl_UtfPrev _ANSI_ARGS_((CONST char *src, + CONST char *start)); /* 332 */ -EXTERN int Tcl_UtfToExternal _ANSI_ARGS_((Tcl_Interp * interp, - Tcl_Encoding encoding, CONST char * src, - int srcLen, int flags, - Tcl_EncodingState * statePtr, char * dst, - int dstLen, int * srcReadPtr, - int * dstWrotePtr, int * dstCharsPtr)); +EXTERN int Tcl_UtfToExternal _ANSI_ARGS_((Tcl_Interp *interp, + Tcl_Encoding encoding, CONST char *src, + int srcLen, int flags, + Tcl_EncodingState *statePtr, char *dst, + int dstLen, int *srcReadPtr, + int *dstWrotePtr, int *dstCharsPtr)); /* 333 */ EXTERN char * Tcl_UtfToExternalDString _ANSI_ARGS_(( - Tcl_Encoding encoding, CONST char * src, - int srcLen, Tcl_DString * dsPtr)); + Tcl_Encoding encoding, CONST char *src, + int srcLen, Tcl_DString *dsPtr)); /* 334 */ -EXTERN int Tcl_UtfToLower _ANSI_ARGS_((char * src)); +EXTERN int Tcl_UtfToLower _ANSI_ARGS_((char *src)); /* 335 */ -EXTERN int Tcl_UtfToTitle _ANSI_ARGS_((char * src)); +EXTERN int Tcl_UtfToTitle _ANSI_ARGS_((char *src)); /* 336 */ -EXTERN int Tcl_UtfToUniChar _ANSI_ARGS_((CONST char * src, - Tcl_UniChar * chPtr)); +EXTERN int Tcl_UtfToUniChar _ANSI_ARGS_((CONST char *src, + Tcl_UniChar *chPtr)); /* 337 */ -EXTERN int Tcl_UtfToUpper _ANSI_ARGS_((char * src)); +EXTERN int Tcl_UtfToUpper _ANSI_ARGS_((char *src)); /* 338 */ -EXTERN int Tcl_WriteChars _ANSI_ARGS_((Tcl_Channel chan, - CONST char * src, int srcLen)); +EXTERN int Tcl_WriteChars _ANSI_ARGS_((Tcl_Channel chan, + CONST char *src, int srcLen)); /* 339 */ -EXTERN int Tcl_WriteObj _ANSI_ARGS_((Tcl_Channel chan, - Tcl_Obj * objPtr)); +EXTERN int Tcl_WriteObj _ANSI_ARGS_((Tcl_Channel chan, + Tcl_Obj *objPtr)); /* 340 */ -EXTERN char * Tcl_GetString _ANSI_ARGS_((Tcl_Obj * objPtr)); +EXTERN char * Tcl_GetString _ANSI_ARGS_((Tcl_Obj *objPtr)); /* 341 */ EXTERN CONST84_RETURN char * Tcl_GetDefaultEncodingDir _ANSI_ARGS_((void)); /* 342 */ EXTERN void Tcl_SetDefaultEncodingDir _ANSI_ARGS_(( - CONST char * path)); + CONST char *path)); /* 343 */ EXTERN void Tcl_AlertNotifier _ANSI_ARGS_((ClientData clientData)); /* 344 */ @@ -1125,72 +1107,72 @@ /* 351 */ EXTERN int Tcl_UniCharIsWordChar _ANSI_ARGS_((int ch)); /* 352 */ -EXTERN int Tcl_UniCharLen _ANSI_ARGS_((CONST Tcl_UniChar * str)); +EXTERN int Tcl_UniCharLen _ANSI_ARGS_(( + CONST Tcl_UniChar *uniStr)); /* 353 */ -EXTERN int Tcl_UniCharNcmp _ANSI_ARGS_((CONST Tcl_UniChar * cs, - CONST Tcl_UniChar * ct, unsigned long n)); +EXTERN int Tcl_UniCharNcmp _ANSI_ARGS_((CONST Tcl_UniChar *ucs, + CONST Tcl_UniChar *uct, + unsigned long numChars)); /* 354 */ EXTERN char * Tcl_UniCharToUtfDString _ANSI_ARGS_(( - CONST Tcl_UniChar * string, int numChars, - Tcl_DString * dsPtr)); + CONST Tcl_UniChar *uniStr, int uniLength, + Tcl_DString *dsPtr)); /* 355 */ -EXTERN Tcl_UniChar * Tcl_UtfToUniCharDString _ANSI_ARGS_(( - CONST char * string, int length, - Tcl_DString * dsPtr)); +EXTERN Tcl_UniChar * Tcl_UtfToUniCharDString _ANSI_ARGS_((CONST char *src, + int length, Tcl_DString *dsPtr)); /* 356 */ -EXTERN Tcl_RegExp Tcl_GetRegExpFromObj _ANSI_ARGS_(( - Tcl_Interp * interp, Tcl_Obj * patObj, - int flags)); +EXTERN Tcl_RegExp Tcl_GetRegExpFromObj _ANSI_ARGS_((Tcl_Interp *interp, + Tcl_Obj *patObj, int flags)); /* 357 */ -EXTERN Tcl_Obj * Tcl_EvalTokens _ANSI_ARGS_((Tcl_Interp * interp, - Tcl_Token * tokenPtr, int count)); +EXTERN Tcl_Obj * Tcl_EvalTokens _ANSI_ARGS_((Tcl_Interp *interp, + Tcl_Token *tokenPtr, int count)); /* 358 */ -EXTERN void Tcl_FreeParse _ANSI_ARGS_((Tcl_Parse * parsePtr)); +EXTERN void Tcl_FreeParse _ANSI_ARGS_((Tcl_Parse *parsePtr)); /* 359 */ -EXTERN void Tcl_LogCommandInfo _ANSI_ARGS_((Tcl_Interp * interp, - CONST char * script, CONST char * command, +EXTERN void Tcl_LogCommandInfo _ANSI_ARGS_((Tcl_Interp *interp, + CONST char *script, CONST char *command, int length)); /* 360 */ -EXTERN int Tcl_ParseBraces _ANSI_ARGS_((Tcl_Interp * interp, - CONST char * string, int numBytes, - Tcl_Parse * parsePtr, int append, - CONST84 char ** termPtr)); +EXTERN int Tcl_ParseBraces _ANSI_ARGS_((Tcl_Interp *interp, + CONST char *start, int numBytes, + Tcl_Parse *parsePtr, int append, + CONST84 char **termPtr)); /* 361 */ -EXTERN int Tcl_ParseCommand _ANSI_ARGS_((Tcl_Interp * interp, - CONST char * string, int numBytes, - int nested, Tcl_Parse * parsePtr)); +EXTERN int Tcl_ParseCommand _ANSI_ARGS_((Tcl_Interp *interp, + CONST char *start, int numBytes, int nested, + Tcl_Parse *parsePtr)); /* 362 */ -EXTERN int Tcl_ParseExpr _ANSI_ARGS_((Tcl_Interp * interp, - CONST char * string, int numBytes, - Tcl_Parse * parsePtr)); +EXTERN int Tcl_ParseExpr _ANSI_ARGS_((Tcl_Interp *interp, + CONST char *start, int numBytes, + Tcl_Parse *parsePtr)); /* 363 */ EXTERN int Tcl_ParseQuotedString _ANSI_ARGS_(( - Tcl_Interp * interp, CONST char * string, - int numBytes, Tcl_Parse * parsePtr, - int append, CONST84 char ** termPtr)); + Tcl_Interp *interp, CONST char *start, + int numBytes, Tcl_Parse *parsePtr, + int append, CONST84 char **termPtr)); /* 364 */ -EXTERN int Tcl_ParseVarName _ANSI_ARGS_((Tcl_Interp * interp, - CONST char * string, int numBytes, - Tcl_Parse * parsePtr, int append)); +EXTERN int Tcl_ParseVarName _ANSI_ARGS_((Tcl_Interp *interp, + CONST char *start, int numBytes, + Tcl_Parse *parsePtr, int append)); /* 365 */ -EXTERN char * Tcl_GetCwd _ANSI_ARGS_((Tcl_Interp * interp, - Tcl_DString * cwdPtr)); +EXTERN char * Tcl_GetCwd _ANSI_ARGS_((Tcl_Interp *interp, + Tcl_DString *cwdPtr)); /* 366 */ -EXTERN int Tcl_Chdir _ANSI_ARGS_((CONST char * dirName)); +EXTERN int Tcl_Chdir _ANSI_ARGS_((CONST char *dirName)); /* 367 */ -EXTERN int Tcl_Access _ANSI_ARGS_((CONST char * path, int mode)); +EXTERN int Tcl_Access _ANSI_ARGS_((CONST char *path, int mode)); /* 368 */ -EXTERN int Tcl_Stat _ANSI_ARGS_((CONST char * path, - struct stat * bufPtr)); +EXTERN int Tcl_Stat _ANSI_ARGS_((CONST char *path, + struct stat *bufPtr)); /* 369 */ -EXTERN int Tcl_UtfNcmp _ANSI_ARGS_((CONST char * s1, - CONST char * s2, unsigned long n)); +EXTERN int Tcl_UtfNcmp _ANSI_ARGS_((CONST char *s1, + CONST char *s2, unsigned long n)); /* 370 */ -EXTERN int Tcl_UtfNcasecmp _ANSI_ARGS_((CONST char * s1, - CONST char * s2, unsigned long n)); +EXTERN int Tcl_UtfNcasecmp _ANSI_ARGS_((CONST char *s1, + CONST char *s2, unsigned long n)); /* 371 */ -EXTERN int Tcl_StringCaseMatch _ANSI_ARGS_((CONST char * str, - CONST char * pattern, int nocase)); +EXTERN int Tcl_StringCaseMatch _ANSI_ARGS_((CONST char *str, + CONST char *pattern, int nocase)); /* 372 */ EXTERN int Tcl_UniCharIsControl _ANSI_ARGS_((int ch)); /* 373 */ @@ -1200,118 +1182,118 @@ /* 375 */ EXTERN int Tcl_UniCharIsPunct _ANSI_ARGS_((int ch)); /* 376 */ -EXTERN int Tcl_RegExpExecObj _ANSI_ARGS_((Tcl_Interp * interp, - Tcl_RegExp regexp, Tcl_Obj * objPtr, +EXTERN int Tcl_RegExpExecObj _ANSI_ARGS_((Tcl_Interp *interp, + Tcl_RegExp regexp, Tcl_Obj *textObj, int offset, int nmatches, int flags)); /* 377 */ -EXTERN void Tcl_RegExpGetInfo _ANSI_ARGS_((Tcl_RegExp regexp, - Tcl_RegExpInfo * infoPtr)); +EXTERN void Tcl_RegExpGetInfo _ANSI_ARGS_((Tcl_RegExp regexp, + Tcl_RegExpInfo *infoPtr)); /* 378 */ EXTERN Tcl_Obj * Tcl_NewUnicodeObj _ANSI_ARGS_(( - CONST Tcl_UniChar * unicode, int numChars)); + CONST Tcl_UniChar *unicode, int numChars)); /* 379 */ -EXTERN void Tcl_SetUnicodeObj _ANSI_ARGS_((Tcl_Obj * objPtr, - CONST Tcl_UniChar * unicode, int numChars)); +EXTERN void Tcl_SetUnicodeObj _ANSI_ARGS_((Tcl_Obj *objPtr, + CONST Tcl_UniChar *unicode, int numChars)); /* 380 */ -EXTERN int Tcl_GetCharLength _ANSI_ARGS_((Tcl_Obj * objPtr)); +EXTERN int Tcl_GetCharLength _ANSI_ARGS_((Tcl_Obj *objPtr)); /* 381 */ -EXTERN Tcl_UniChar Tcl_GetUniChar _ANSI_ARGS_((Tcl_Obj * objPtr, +EXTERN Tcl_UniChar Tcl_GetUniChar _ANSI_ARGS_((Tcl_Obj *objPtr, int index)); /* 382 */ -EXTERN Tcl_UniChar * Tcl_GetUnicode _ANSI_ARGS_((Tcl_Obj * objPtr)); +EXTERN Tcl_UniChar * Tcl_GetUnicode _ANSI_ARGS_((Tcl_Obj *objPtr)); /* 383 */ -EXTERN Tcl_Obj * Tcl_GetRange _ANSI_ARGS_((Tcl_Obj * objPtr, - int first, int last)); +EXTERN Tcl_Obj * Tcl_GetRange _ANSI_ARGS_((Tcl_Obj *objPtr, int first, + int last)); /* 384 */ -EXTERN void Tcl_AppendUnicodeToObj _ANSI_ARGS_((Tcl_Obj * objPtr, - CONST Tcl_UniChar * unicode, int length)); +EXTERN void Tcl_AppendUnicodeToObj _ANSI_ARGS_((Tcl_Obj *objPtr, + CONST Tcl_UniChar *unicode, int length)); /* 385 */ -EXTERN int Tcl_RegExpMatchObj _ANSI_ARGS_((Tcl_Interp * interp, - Tcl_Obj * stringObj, Tcl_Obj * patternObj)); +EXTERN int Tcl_RegExpMatchObj _ANSI_ARGS_((Tcl_Interp *interp, + Tcl_Obj *textObj, Tcl_Obj *patternObj)); /* 386 */ EXTERN void Tcl_SetNotifier _ANSI_ARGS_(( - Tcl_NotifierProcs * notifierProcPtr)); + Tcl_NotifierProcs *notifierProcPtr)); /* 387 */ EXTERN Tcl_Mutex * Tcl_GetAllocMutex _ANSI_ARGS_((void)); /* 388 */ -EXTERN int Tcl_GetChannelNames _ANSI_ARGS_((Tcl_Interp * interp)); +EXTERN int Tcl_GetChannelNames _ANSI_ARGS_((Tcl_Interp *interp)); /* 389 */ EXTERN int Tcl_GetChannelNamesEx _ANSI_ARGS_(( - Tcl_Interp * interp, CONST char * pattern)); + Tcl_Interp *interp, CONST char *pattern)); /* 390 */ -EXTERN int Tcl_ProcObjCmd _ANSI_ARGS_((ClientData clientData, - Tcl_Interp * interp, int objc, +EXTERN int Tcl_ProcObjCmd _ANSI_ARGS_((ClientData clientData, + Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[])); /* 391 */ EXTERN void Tcl_ConditionFinalize _ANSI_ARGS_(( - Tcl_Condition * condPtr)); + Tcl_Condition *condPtr)); /* 392 */ -EXTERN void Tcl_MutexFinalize _ANSI_ARGS_((Tcl_Mutex * mutex)); +EXTERN void Tcl_MutexFinalize _ANSI_ARGS_((Tcl_Mutex *mutex)); /* 393 */ -EXTERN int Tcl_CreateThread _ANSI_ARGS_((Tcl_ThreadId * idPtr, - Tcl_ThreadCreateProc proc, - ClientData clientData, int stackSize, +EXTERN int Tcl_CreateThread _ANSI_ARGS_((Tcl_ThreadId *idPtr, + Tcl_ThreadCreateProc proc, + ClientData clientData, int stackSize, int flags)); /* 394 */ -EXTERN int Tcl_ReadRaw _ANSI_ARGS_((Tcl_Channel chan, - char * dst, int bytesToRead)); +EXTERN int Tcl_ReadRaw _ANSI_ARGS_((Tcl_Channel chan, char *dst, + int bytesToRead)); /* 395 */ -EXTERN int Tcl_WriteRaw _ANSI_ARGS_((Tcl_Channel chan, - CONST char * src, int srcLen)); +EXTERN int Tcl_WriteRaw _ANSI_ARGS_((Tcl_Channel chan, + CONST char *src, int srcLen)); /* 396 */ EXTERN Tcl_Channel Tcl_GetTopChannel _ANSI_ARGS_((Tcl_Channel chan)); /* 397 */ EXTERN int Tcl_ChannelBuffered _ANSI_ARGS_((Tcl_Channel chan)); /* 398 */ EXTERN CONST84_RETURN char * Tcl_ChannelName _ANSI_ARGS_(( - Tcl_ChannelType * chanTypePtr)); + Tcl_ChannelType *chanTypePtr)); /* 399 */ EXTERN Tcl_ChannelTypeVersion Tcl_ChannelVersion _ANSI_ARGS_(( - Tcl_ChannelType * chanTypePtr)); + Tcl_ChannelType *chanTypePtr)); /* 400 */ EXTERN Tcl_DriverBlockModeProc * Tcl_ChannelBlockModeProc _ANSI_ARGS_(( - Tcl_ChannelType * chanTypePtr)); + Tcl_ChannelType *chanTypePtr)); /* 401 */ EXTERN Tcl_DriverCloseProc * Tcl_ChannelCloseProc _ANSI_ARGS_(( - Tcl_ChannelType * chanTypePtr)); + Tcl_ChannelType *chanTypePtr)); /* 402 */ EXTERN Tcl_DriverClose2Proc * Tcl_ChannelClose2Proc _ANSI_ARGS_(( - Tcl_ChannelType * chanTypePtr)); + Tcl_ChannelType *chanTypePtr)); /* 403 */ EXTERN Tcl_DriverInputProc * Tcl_ChannelInputProc _ANSI_ARGS_(( - Tcl_ChannelType * chanTypePtr)); + Tcl_ChannelType *chanTypePtr)); /* 404 */ EXTERN Tcl_DriverOutputProc * Tcl_ChannelOutputProc _ANSI_ARGS_(( - Tcl_ChannelType * chanTypePtr)); + Tcl_ChannelType *chanTypePtr)); /* 405 */ EXTERN Tcl_DriverSeekProc * Tcl_ChannelSeekProc _ANSI_ARGS_(( - Tcl_ChannelType * chanTypePtr)); + Tcl_ChannelType *chanTypePtr)); /* 406 */ EXTERN Tcl_DriverSetOptionProc * Tcl_ChannelSetOptionProc _ANSI_ARGS_(( - Tcl_ChannelType * chanTypePtr)); + Tcl_ChannelType *chanTypePtr)); /* 407 */ EXTERN Tcl_DriverGetOptionProc * Tcl_ChannelGetOptionProc _ANSI_ARGS_(( - Tcl_ChannelType * chanTypePtr)); + Tcl_ChannelType *chanTypePtr)); /* 408 */ EXTERN Tcl_DriverWatchProc * Tcl_ChannelWatchProc _ANSI_ARGS_(( - Tcl_ChannelType * chanTypePtr)); + Tcl_ChannelType *chanTypePtr)); /* 409 */ EXTERN Tcl_DriverGetHandleProc * Tcl_ChannelGetHandleProc _ANSI_ARGS_(( - Tcl_ChannelType * chanTypePtr)); + Tcl_ChannelType *chanTypePtr)); /* 410 */ EXTERN Tcl_DriverFlushProc * Tcl_ChannelFlushProc _ANSI_ARGS_(( - Tcl_ChannelType * chanTypePtr)); + Tcl_ChannelType *chanTypePtr)); /* 411 */ EXTERN Tcl_DriverHandlerProc * Tcl_ChannelHandlerProc _ANSI_ARGS_(( - Tcl_ChannelType * chanTypePtr)); + Tcl_ChannelType *chanTypePtr)); /* 412 */ -EXTERN int Tcl_JoinThread _ANSI_ARGS_((Tcl_ThreadId threadId, - int* result)); +EXTERN int Tcl_JoinThread _ANSI_ARGS_((Tcl_ThreadId threadId, + int *result)); /* 413 */ EXTERN int Tcl_IsChannelShared _ANSI_ARGS_((Tcl_Channel channel)); /* 414 */ EXTERN int Tcl_IsChannelRegistered _ANSI_ARGS_(( - Tcl_Interp* interp, Tcl_Channel channel)); + Tcl_Interp *interp, Tcl_Channel channel)); /* 415 */ EXTERN void Tcl_CutChannel _ANSI_ARGS_((Tcl_Channel channel)); /* 416 */ @@ -1321,249 +1303,246 @@ Tcl_Channel channel)); /* 418 */ EXTERN int Tcl_IsChannelExisting _ANSI_ARGS_(( - CONST char* channelName)); + CONST char *channelName)); /* 419 */ EXTERN int Tcl_UniCharNcasecmp _ANSI_ARGS_(( - CONST Tcl_UniChar * cs, - CONST Tcl_UniChar * ct, unsigned long n)); + CONST Tcl_UniChar *ucs, + CONST Tcl_UniChar *uct, + unsigned long numChars)); /* 420 */ EXTERN int Tcl_UniCharCaseMatch _ANSI_ARGS_(( - CONST Tcl_UniChar * ustr, - CONST Tcl_UniChar * pattern, int nocase)); + CONST Tcl_UniChar *uniStr, + CONST Tcl_UniChar *uniPattern, int nocase)); /* 421 */ EXTERN Tcl_HashEntry * Tcl_FindHashEntry _ANSI_ARGS_(( - Tcl_HashTable * tablePtr, CONST char * key)); + Tcl_HashTable *tablePtr, CONST char *key)); /* 422 */ EXTERN Tcl_HashEntry * Tcl_CreateHashEntry _ANSI_ARGS_(( - Tcl_HashTable * tablePtr, CONST char * key, - int * newPtr)); + Tcl_HashTable *tablePtr, CONST char *key, + int *newPtr)); /* 423 */ EXTERN void Tcl_InitCustomHashTable _ANSI_ARGS_(( - Tcl_HashTable * tablePtr, int keyType, - Tcl_HashKeyType * typePtr)); + Tcl_HashTable *tablePtr, int keyType, + Tcl_HashKeyType *typePtr)); /* 424 */ EXTERN void Tcl_InitObjHashTable _ANSI_ARGS_(( - Tcl_HashTable * tablePtr)); + Tcl_HashTable *tablePtr)); /* 425 */ -EXTERN ClientData Tcl_CommandTraceInfo _ANSI_ARGS_(( - Tcl_Interp * interp, CONST char * varName, - int flags, Tcl_CommandTraceProc * procPtr, +EXTERN ClientData Tcl_CommandTraceInfo _ANSI_ARGS_((Tcl_Interp *interp, + CONST char *varName, int flags, + Tcl_CommandTraceProc *procPtr, ClientData prevClientData)); /* 426 */ -EXTERN int Tcl_TraceCommand _ANSI_ARGS_((Tcl_Interp * interp, - CONST char * varName, int flags, - Tcl_CommandTraceProc * proc, +EXTERN int Tcl_TraceCommand _ANSI_ARGS_((Tcl_Interp *interp, + CONST char *varName, int flags, + Tcl_CommandTraceProc *proc, ClientData clientData)); /* 427 */ -EXTERN void Tcl_UntraceCommand _ANSI_ARGS_((Tcl_Interp * interp, - CONST char * varName, int flags, - Tcl_CommandTraceProc * proc, +EXTERN void Tcl_UntraceCommand _ANSI_ARGS_((Tcl_Interp *interp, + CONST char *varName, int flags, + Tcl_CommandTraceProc *proc, ClientData clientData)); /* 428 */ EXTERN char * Tcl_AttemptAlloc _ANSI_ARGS_((unsigned int size)); /* 429 */ -EXTERN char * Tcl_AttemptDbCkalloc _ANSI_ARGS_((unsigned int size, - CONST char * file, int line)); +EXTERN char * Tcl_AttemptDbCkalloc _ANSI_ARGS_((unsigned int size, + CONST char *file, int line)); /* 430 */ -EXTERN char * Tcl_AttemptRealloc _ANSI_ARGS_((char * ptr, +EXTERN char * Tcl_AttemptRealloc _ANSI_ARGS_((char *ptr, unsigned int size)); /* 431 */ -EXTERN char * Tcl_AttemptDbCkrealloc _ANSI_ARGS_((char * ptr, - unsigned int size, CONST char * file, +EXTERN char * Tcl_AttemptDbCkrealloc _ANSI_ARGS_((char *ptr, + unsigned int size, CONST char *file, int line)); /* 432 */ -EXTERN int Tcl_AttemptSetObjLength _ANSI_ARGS_(( - Tcl_Obj * objPtr, int length)); +EXTERN int Tcl_AttemptSetObjLength _ANSI_ARGS_((Tcl_Obj *objPtr, + int length)); /* 433 */ EXTERN Tcl_ThreadId Tcl_GetChannelThread _ANSI_ARGS_(( Tcl_Channel channel)); /* 434 */ -EXTERN Tcl_UniChar * Tcl_GetUnicodeFromObj _ANSI_ARGS_((Tcl_Obj * objPtr, - int * lengthPtr)); +EXTERN Tcl_UniChar * Tcl_GetUnicodeFromObj _ANSI_ARGS_((Tcl_Obj *objPtr, + int *lengthPtr)); /* 435 */ -EXTERN int Tcl_GetMathFuncInfo _ANSI_ARGS_((Tcl_Interp * interp, - CONST char * name, int * numArgsPtr, - Tcl_ValueType ** argTypesPtr, - Tcl_MathProc ** procPtr, - ClientData * clientDataPtr)); +EXTERN int Tcl_GetMathFuncInfo _ANSI_ARGS_((Tcl_Interp *interp, + CONST char *name, int *numArgsPtr, + Tcl_ValueType **argTypesPtr, + Tcl_MathProc **procPtr, + ClientData *clientDataPtr)); /* 436 */ -EXTERN Tcl_Obj * Tcl_ListMathFuncs _ANSI_ARGS_((Tcl_Interp * interp, - CONST char * pattern)); +EXTERN Tcl_Obj * Tcl_ListMathFuncs _ANSI_ARGS_((Tcl_Interp *interp, + CONST char *pattern)); /* 437 */ -EXTERN Tcl_Obj * Tcl_SubstObj _ANSI_ARGS_((Tcl_Interp * interp, - Tcl_Obj * objPtr, int flags)); +EXTERN Tcl_Obj * Tcl_SubstObj _ANSI_ARGS_((Tcl_Interp *interp, + Tcl_Obj *objPtr, int flags)); /* 438 */ -EXTERN int Tcl_DetachChannel _ANSI_ARGS_((Tcl_Interp* interp, +EXTERN int Tcl_DetachChannel _ANSI_ARGS_((Tcl_Interp *interp, Tcl_Channel channel)); /* 439 */ EXTERN int Tcl_IsStandardChannel _ANSI_ARGS_(( Tcl_Channel channel)); /* 440 */ -EXTERN int Tcl_FSCopyFile _ANSI_ARGS_((Tcl_Obj * srcPathPtr, - Tcl_Obj * destPathPtr)); +EXTERN int Tcl_FSCopyFile _ANSI_ARGS_((Tcl_Obj *srcPathPtr, + Tcl_Obj *destPathPtr)); /* 441 */ -EXTERN int Tcl_FSCopyDirectory _ANSI_ARGS_(( - Tcl_Obj * srcPathPtr, Tcl_Obj * destPathPtr, - Tcl_Obj ** errorPtr)); +EXTERN int Tcl_FSCopyDirectory _ANSI_ARGS_((Tcl_Obj *srcPathPtr, + Tcl_Obj *destPathPtr, Tcl_Obj **errorPtr)); /* 442 */ -EXTERN int Tcl_FSCreateDirectory _ANSI_ARGS_((Tcl_Obj * pathPtr)); +EXTERN int Tcl_FSCreateDirectory _ANSI_ARGS_((Tcl_Obj *pathPtr)); /* 443 */ -EXTERN int Tcl_FSDeleteFile _ANSI_ARGS_((Tcl_Obj * pathPtr)); +EXTERN int Tcl_FSDeleteFile _ANSI_ARGS_((Tcl_Obj *pathPtr)); /* 444 */ -EXTERN int Tcl_FSLoadFile _ANSI_ARGS_((Tcl_Interp * interp, - Tcl_Obj * pathPtr, CONST char * sym1, - CONST char * sym2, - Tcl_PackageInitProc ** proc1Ptr, - Tcl_PackageInitProc ** proc2Ptr, - Tcl_LoadHandle * handlePtr, - Tcl_FSUnloadFileProc ** unloadProcPtr)); +EXTERN int Tcl_FSLoadFile _ANSI_ARGS_((Tcl_Interp *interp, + Tcl_Obj *pathPtr, CONST char *sym1, + CONST char *sym2, + Tcl_PackageInitProc **proc1Ptr, + Tcl_PackageInitProc **proc2Ptr, + Tcl_LoadHandle *handlePtr, + Tcl_FSUnloadFileProc **unloadProcPtr)); /* 445 */ EXTERN int Tcl_FSMatchInDirectory _ANSI_ARGS_(( - Tcl_Interp * interp, Tcl_Obj * result, - Tcl_Obj * pathPtr, CONST char * pattern, - Tcl_GlobTypeData * types)); + Tcl_Interp *interp, Tcl_Obj *result, + Tcl_Obj *pathPtr, CONST char *pattern, + Tcl_GlobTypeData *types)); /* 446 */ -EXTERN Tcl_Obj * Tcl_FSLink _ANSI_ARGS_((Tcl_Obj * pathPtr, - Tcl_Obj * toPtr, int linkAction)); +EXTERN Tcl_Obj * Tcl_FSLink _ANSI_ARGS_((Tcl_Obj *pathPtr, + Tcl_Obj *toPtr, int linkAction)); /* 447 */ -EXTERN int Tcl_FSRemoveDirectory _ANSI_ARGS_((Tcl_Obj * pathPtr, - int recursive, Tcl_Obj ** errorPtr)); +EXTERN int Tcl_FSRemoveDirectory _ANSI_ARGS_((Tcl_Obj *pathPtr, + int recursive, Tcl_Obj **errorPtr)); /* 448 */ -EXTERN int Tcl_FSRenameFile _ANSI_ARGS_((Tcl_Obj * srcPathPtr, - Tcl_Obj * destPathPtr)); +EXTERN int Tcl_FSRenameFile _ANSI_ARGS_((Tcl_Obj *srcPathPtr, + Tcl_Obj *destPathPtr)); /* 449 */ -EXTERN int Tcl_FSLstat _ANSI_ARGS_((Tcl_Obj * pathPtr, - Tcl_StatBuf * buf)); +EXTERN int Tcl_FSLstat _ANSI_ARGS_((Tcl_Obj *pathPtr, + Tcl_StatBuf *buf)); /* 450 */ -EXTERN int Tcl_FSUtime _ANSI_ARGS_((Tcl_Obj * pathPtr, - struct utimbuf * tval)); +EXTERN int Tcl_FSUtime _ANSI_ARGS_((Tcl_Obj *pathPtr, + struct utimbuf *tval)); /* 451 */ -EXTERN int Tcl_FSFileAttrsGet _ANSI_ARGS_((Tcl_Interp * interp, - int index, Tcl_Obj * pathPtr, - Tcl_Obj ** objPtrRef)); +EXTERN int Tcl_FSFileAttrsGet _ANSI_ARGS_((Tcl_Interp *interp, + int index, Tcl_Obj *pathPtr, + Tcl_Obj **objPtrRef)); /* 452 */ -EXTERN int Tcl_FSFileAttrsSet _ANSI_ARGS_((Tcl_Interp * interp, - int index, Tcl_Obj * pathPtr, - Tcl_Obj * objPtr)); +EXTERN int Tcl_FSFileAttrsSet _ANSI_ARGS_((Tcl_Interp *interp, + int index, Tcl_Obj *pathPtr, Tcl_Obj *objPtr)); /* 453 */ -EXTERN CONST char ** Tcl_FSFileAttrStrings _ANSI_ARGS_((Tcl_Obj * pathPtr, - Tcl_Obj ** objPtrRef)); +EXTERN CONST char ** Tcl_FSFileAttrStrings _ANSI_ARGS_((Tcl_Obj *pathPtr, + Tcl_Obj **objPtrRef)); /* 454 */ -EXTERN int Tcl_FSStat _ANSI_ARGS_((Tcl_Obj * pathPtr, - Tcl_StatBuf * buf)); +EXTERN int Tcl_FSStat _ANSI_ARGS_((Tcl_Obj *pathPtr, + Tcl_StatBuf *buf)); /* 455 */ -EXTERN int Tcl_FSAccess _ANSI_ARGS_((Tcl_Obj * pathPtr, - int mode)); +EXTERN int Tcl_FSAccess _ANSI_ARGS_((Tcl_Obj *pathPtr, int mode)); /* 456 */ EXTERN Tcl_Channel Tcl_FSOpenFileChannel _ANSI_ARGS_(( - Tcl_Interp * interp, Tcl_Obj * pathPtr, - CONST char * modeString, int permissions)); + Tcl_Interp *interp, Tcl_Obj *pathPtr, + CONST char *modeString, int permissions)); /* 457 */ -EXTERN Tcl_Obj* Tcl_FSGetCwd _ANSI_ARGS_((Tcl_Interp * interp)); +EXTERN Tcl_Obj * Tcl_FSGetCwd _ANSI_ARGS_((Tcl_Interp *interp)); /* 458 */ -EXTERN int Tcl_FSChdir _ANSI_ARGS_((Tcl_Obj * pathPtr)); +EXTERN int Tcl_FSChdir _ANSI_ARGS_((Tcl_Obj *pathPtr)); /* 459 */ EXTERN int Tcl_FSConvertToPathType _ANSI_ARGS_(( - Tcl_Interp * interp, Tcl_Obj * pathPtr)); + Tcl_Interp *interp, Tcl_Obj *pathPtr)); /* 460 */ -EXTERN Tcl_Obj* Tcl_FSJoinPath _ANSI_ARGS_((Tcl_Obj * listObj, +EXTERN Tcl_Obj * Tcl_FSJoinPath _ANSI_ARGS_((Tcl_Obj *listObj, int elements)); /* 461 */ -EXTERN Tcl_Obj* Tcl_FSSplitPath _ANSI_ARGS_((Tcl_Obj* pathPtr, - int * lenPtr)); +EXTERN Tcl_Obj * Tcl_FSSplitPath _ANSI_ARGS_((Tcl_Obj *pathPtr, + int *lenPtr)); /* 462 */ -EXTERN int Tcl_FSEqualPaths _ANSI_ARGS_((Tcl_Obj* firstPtr, - Tcl_Obj* secondPtr)); +EXTERN int Tcl_FSEqualPaths _ANSI_ARGS_((Tcl_Obj *firstPtr, + Tcl_Obj *secondPtr)); /* 463 */ -EXTERN Tcl_Obj* Tcl_FSGetNormalizedPath _ANSI_ARGS_(( - Tcl_Interp * interp, Tcl_Obj* pathObjPtr)); +EXTERN Tcl_Obj * Tcl_FSGetNormalizedPath _ANSI_ARGS_(( + Tcl_Interp *interp, Tcl_Obj *pathPtr)); /* 464 */ -EXTERN Tcl_Obj* Tcl_FSJoinToPath _ANSI_ARGS_((Tcl_Obj * basePtr, +EXTERN Tcl_Obj * Tcl_FSJoinToPath _ANSI_ARGS_((Tcl_Obj *pathPtr, int objc, Tcl_Obj *CONST objv[])); /* 465 */ -EXTERN ClientData Tcl_FSGetInternalRep _ANSI_ARGS_(( - Tcl_Obj* pathObjPtr, Tcl_Filesystem * fsPtr)); +EXTERN ClientData Tcl_FSGetInternalRep _ANSI_ARGS_((Tcl_Obj *pathPtr, + Tcl_Filesystem *fsPtr)); /* 466 */ -EXTERN Tcl_Obj* Tcl_FSGetTranslatedPath _ANSI_ARGS_(( - Tcl_Interp * interp, Tcl_Obj* pathPtr)); +EXTERN Tcl_Obj * Tcl_FSGetTranslatedPath _ANSI_ARGS_(( + Tcl_Interp *interp, Tcl_Obj *pathPtr)); /* 467 */ -EXTERN int Tcl_FSEvalFile _ANSI_ARGS_((Tcl_Interp * interp, - Tcl_Obj * fileName)); +EXTERN int Tcl_FSEvalFile _ANSI_ARGS_((Tcl_Interp *interp, + Tcl_Obj *fileName)); /* 468 */ -EXTERN Tcl_Obj* Tcl_FSNewNativePath _ANSI_ARGS_(( - Tcl_Filesystem* fromFilesystem, +EXTERN Tcl_Obj * Tcl_FSNewNativePath _ANSI_ARGS_(( + Tcl_Filesystem *fromFilesystem, ClientData clientData)); /* 469 */ -EXTERN CONST char* Tcl_FSGetNativePath _ANSI_ARGS_((Tcl_Obj* pathObjPtr)); +EXTERN CONST char * Tcl_FSGetNativePath _ANSI_ARGS_((Tcl_Obj *pathPtr)); /* 470 */ -EXTERN Tcl_Obj* Tcl_FSFileSystemInfo _ANSI_ARGS_(( - Tcl_Obj* pathObjPtr)); +EXTERN Tcl_Obj * Tcl_FSFileSystemInfo _ANSI_ARGS_((Tcl_Obj *pathPtr)); /* 471 */ -EXTERN Tcl_Obj* Tcl_FSPathSeparator _ANSI_ARGS_((Tcl_Obj* pathObjPtr)); +EXTERN Tcl_Obj * Tcl_FSPathSeparator _ANSI_ARGS_((Tcl_Obj *pathPtr)); /* 472 */ -EXTERN Tcl_Obj* Tcl_FSListVolumes _ANSI_ARGS_((void)); +EXTERN Tcl_Obj * Tcl_FSListVolumes _ANSI_ARGS_((void)); /* 473 */ -EXTERN int Tcl_FSRegister _ANSI_ARGS_((ClientData clientData, - Tcl_Filesystem * fsPtr)); +EXTERN int Tcl_FSRegister _ANSI_ARGS_((ClientData clientData, + Tcl_Filesystem *fsPtr)); /* 474 */ -EXTERN int Tcl_FSUnregister _ANSI_ARGS_((Tcl_Filesystem * fsPtr)); +EXTERN int Tcl_FSUnregister _ANSI_ARGS_((Tcl_Filesystem *fsPtr)); /* 475 */ -EXTERN ClientData Tcl_FSData _ANSI_ARGS_((Tcl_Filesystem * fsPtr)); +EXTERN ClientData Tcl_FSData _ANSI_ARGS_((Tcl_Filesystem *fsPtr)); /* 476 */ -EXTERN CONST char* Tcl_FSGetTranslatedStringPath _ANSI_ARGS_(( - Tcl_Interp * interp, Tcl_Obj* pathPtr)); +EXTERN CONST char * Tcl_FSGetTranslatedStringPath _ANSI_ARGS_(( + Tcl_Interp *interp, Tcl_Obj *pathPtr)); /* 477 */ -EXTERN Tcl_Filesystem* Tcl_FSGetFileSystemForPath _ANSI_ARGS_(( - Tcl_Obj* pathObjPtr)); +EXTERN Tcl_Filesystem * Tcl_FSGetFileSystemForPath _ANSI_ARGS_(( + Tcl_Obj *pathPtr)); /* 478 */ -EXTERN Tcl_PathType Tcl_FSGetPathType _ANSI_ARGS_((Tcl_Obj * pathObjPtr)); +EXTERN Tcl_PathType Tcl_FSGetPathType _ANSI_ARGS_((Tcl_Obj *pathPtr)); /* 479 */ EXTERN int Tcl_OutputBuffered _ANSI_ARGS_((Tcl_Channel chan)); /* 480 */ EXTERN void Tcl_FSMountsChanged _ANSI_ARGS_(( - Tcl_Filesystem * fsPtr)); + Tcl_Filesystem *fsPtr)); /* 481 */ EXTERN int Tcl_EvalTokensStandard _ANSI_ARGS_(( - Tcl_Interp * interp, Tcl_Token * tokenPtr, + Tcl_Interp *interp, Tcl_Token *tokenPtr, int count)); /* 482 */ -EXTERN void Tcl_GetTime _ANSI_ARGS_((Tcl_Time* timeBuf)); +EXTERN void Tcl_GetTime _ANSI_ARGS_((Tcl_Time *timeBuf)); /* 483 */ -EXTERN Tcl_Trace Tcl_CreateObjTrace _ANSI_ARGS_((Tcl_Interp* interp, - int level, int flags, - Tcl_CmdObjTraceProc* objProc, - ClientData clientData, - Tcl_CmdObjTraceDeleteProc* delProc)); +EXTERN Tcl_Trace Tcl_CreateObjTrace _ANSI_ARGS_((Tcl_Interp *interp, + int level, int flags, + Tcl_CmdObjTraceProc *objProc, + ClientData clientData, + Tcl_CmdObjTraceDeleteProc *delProc)); /* 484 */ EXTERN int Tcl_GetCommandInfoFromToken _ANSI_ARGS_(( - Tcl_Command token, Tcl_CmdInfo* infoPtr)); + Tcl_Command token, Tcl_CmdInfo *infoPtr)); /* 485 */ EXTERN int Tcl_SetCommandInfoFromToken _ANSI_ARGS_(( - Tcl_Command token, - CONST Tcl_CmdInfo* infoPtr)); + Tcl_Command token, + CONST Tcl_CmdInfo *infoPtr)); /* 486 */ EXTERN Tcl_Obj * Tcl_DbNewWideIntObj _ANSI_ARGS_(( - Tcl_WideInt wideValue, CONST char * file, + Tcl_WideInt wideValue, CONST char *file, int line)); /* 487 */ EXTERN int Tcl_GetWideIntFromObj _ANSI_ARGS_(( - Tcl_Interp * interp, Tcl_Obj * objPtr, - Tcl_WideInt * widePtr)); + Tcl_Interp *interp, Tcl_Obj *objPtr, + Tcl_WideInt *widePtr)); /* 488 */ EXTERN Tcl_Obj * Tcl_NewWideIntObj _ANSI_ARGS_((Tcl_WideInt wideValue)); /* 489 */ -EXTERN void Tcl_SetWideIntObj _ANSI_ARGS_((Tcl_Obj * objPtr, +EXTERN void Tcl_SetWideIntObj _ANSI_ARGS_((Tcl_Obj *objPtr, Tcl_WideInt wideValue)); /* 490 */ EXTERN Tcl_StatBuf * Tcl_AllocStatBuf _ANSI_ARGS_((void)); /* 491 */ -EXTERN Tcl_WideInt Tcl_Seek _ANSI_ARGS_((Tcl_Channel chan, +EXTERN Tcl_WideInt Tcl_Seek _ANSI_ARGS_((Tcl_Channel chan, Tcl_WideInt offset, int mode)); /* 492 */ EXTERN Tcl_WideInt Tcl_Tell _ANSI_ARGS_((Tcl_Channel chan)); /* 493 */ EXTERN Tcl_DriverWideSeekProc * Tcl_ChannelWideSeekProc _ANSI_ARGS_(( - Tcl_ChannelType * chanTypePtr)); + Tcl_ChannelType *chanTypePtr)); /* Slot 494 is reserved */ /* Slot 495 is reserved */ /* Slot 496 is reserved */ @@ -1626,7 +1605,7 @@ /* Slot 553 is reserved */ /* 554 */ EXTERN Tcl_DriverThreadActionProc * Tcl_ChannelThreadActionProc _ANSI_ARGS_(( - Tcl_ChannelType * chanTypePtr)); + Tcl_ChannelType *chanTypePtr)); /* Slot 555 is reserved */ /* Slot 556 is reserved */ /* Slot 557 is reserved */ @@ -1646,10 +1625,68 @@ /* Slot 571 is reserved */ /* Slot 572 is reserved */ /* 573 */ -EXTERN int Tcl_PkgRequireProc _ANSI_ARGS_((Tcl_Interp * interp, - CONST char * name, int objc, - Tcl_Obj *CONST objv[], - ClientData * clientDataPtr)); +EXTERN int Tcl_PkgRequireProc _ANSI_ARGS_((Tcl_Interp *interp, + CONST char *name, int objc, + Tcl_Obj *CONST objv[], + ClientData *clientDataPtr)); +/* Slot 574 is reserved */ +/* Slot 575 is reserved */ +/* Slot 576 is reserved */ +/* Slot 577 is reserved */ +/* Slot 578 is reserved */ +/* Slot 579 is reserved */ +/* Slot 580 is reserved */ +/* Slot 581 is reserved */ +/* Slot 582 is reserved */ +/* Slot 583 is reserved */ +/* Slot 584 is reserved */ +/* Slot 585 is reserved */ +/* Slot 586 is reserved */ +/* Slot 587 is reserved */ +/* Slot 588 is reserved */ +/* Slot 589 is reserved */ +/* Slot 590 is reserved */ +/* Slot 591 is reserved */ +/* Slot 592 is reserved */ +/* Slot 593 is reserved */ +/* Slot 594 is reserved */ +/* Slot 595 is reserved */ +/* Slot 596 is reserved */ +/* Slot 597 is reserved */ +/* Slot 598 is reserved */ +/* Slot 599 is reserved */ +/* Slot 600 is reserved */ +/* Slot 601 is reserved */ +/* Slot 602 is reserved */ +/* Slot 603 is reserved */ +/* Slot 604 is reserved */ +/* Slot 605 is reserved */ +/* Slot 606 is reserved */ +/* Slot 607 is reserved */ +/* Slot 608 is reserved */ +/* Slot 609 is reserved */ +/* Slot 610 is reserved */ +/* Slot 611 is reserved */ +/* Slot 612 is reserved */ +/* Slot 613 is reserved */ +/* Slot 614 is reserved */ +/* Slot 615 is reserved */ +/* Slot 616 is reserved */ +/* Slot 617 is reserved */ +/* Slot 618 is reserved */ +/* Slot 619 is reserved */ +/* Slot 620 is reserved */ +/* Slot 621 is reserved */ +/* Slot 622 is reserved */ +/* Slot 623 is reserved */ +/* Slot 624 is reserved */ +/* Slot 625 is reserved */ +/* Slot 626 is reserved */ +/* Slot 627 is reserved */ +/* Slot 628 is reserved */ +/* Slot 629 is reserved */ +/* 630 */ +EXTERN void TclUnusedStubEntry _ANSI_ARGS_((void)); typedef struct TclStubHooks { struct TclPlatStubs *tclPlatStubs; @@ -1661,397 +1698,373 @@ int magic; struct TclStubHooks *hooks; - int (*tcl_PkgProvideEx) _ANSI_ARGS_((Tcl_Interp* interp, CONST char* name, CONST char* version, ClientData clientData)); /* 0 */ - CONST84_RETURN char * (*tcl_PkgRequireEx) _ANSI_ARGS_((Tcl_Interp * interp, CONST char * name, CONST char * version, int exact, ClientData * clientDataPtr)); /* 1 */ - void (*tcl_Panic) _ANSI_ARGS_(TCL_VARARGS(CONST char *,format)); /* 2 */ + int (*tcl_PkgProvideEx) _ANSI_ARGS_((Tcl_Interp *interp, CONST char *name, CONST char *version, ClientData clientData)); /* 0 */ + CONST84_RETURN char * (*tcl_PkgRequireEx) _ANSI_ARGS_((Tcl_Interp *interp, CONST char *name, CONST char *version, int exact, ClientData *clientDataPtr)); /* 1 */ + void (*tcl_Panic) _ANSI_ARGS_((CONST char *format, ...)); /* 2 */ char * (*tcl_Alloc) _ANSI_ARGS_((unsigned int size)); /* 3 */ - void (*tcl_Free) _ANSI_ARGS_((char * ptr)); /* 4 */ - char * (*tcl_Realloc) _ANSI_ARGS_((char * ptr, unsigned int size)); /* 5 */ - char * (*tcl_DbCkalloc) _ANSI_ARGS_((unsigned int size, CONST char * file, int line)); /* 6 */ - int (*tcl_DbCkfree) _ANSI_ARGS_((char * ptr, CONST char * file, int line)); /* 7 */ - char * (*tcl_DbCkrealloc) _ANSI_ARGS_((char * ptr, unsigned int size, CONST char * file, int line)); /* 8 */ -#if !defined(__WIN32__) && !defined(MAC_TCL) /* UNIX */ - void (*tcl_CreateFileHandler) _ANSI_ARGS_((int fd, int mask, Tcl_FileProc * proc, ClientData clientData)); /* 9 */ + void (*tcl_Free) _ANSI_ARGS_((char *ptr)); /* 4 */ + char * (*tcl_Realloc) _ANSI_ARGS_((char *ptr, unsigned int size)); /* 5 */ + char * (*tcl_DbCkalloc) _ANSI_ARGS_((unsigned int size, CONST char *file, int line)); /* 6 */ + void (*tcl_DbCkfree) _ANSI_ARGS_((char *ptr, CONST char *file, int line)); /* 7 */ + char * (*tcl_DbCkrealloc) _ANSI_ARGS_((char *ptr, unsigned int size, CONST char *file, int line)); /* 8 */ +#if !defined(__WIN32__) && !defined(MAC_OSX_TCL) /* UNIX */ + void (*tcl_CreateFileHandler) _ANSI_ARGS_((int fd, int mask, Tcl_FileProc *proc, ClientData clientData)); /* 9 */ #endif /* UNIX */ -#ifdef __WIN32__ - void *reserved9; -#endif /* __WIN32__ */ -#ifdef MAC_TCL - void *reserved9; -#endif /* MAC_TCL */ -#if !defined(__WIN32__) && !defined(MAC_TCL) /* UNIX */ +#if defined(__WIN32__) /* WIN */ + VOID *reserved9; +#endif /* WIN */ +#ifdef MAC_OSX_TCL /* MACOSX */ + void (*tcl_CreateFileHandler) _ANSI_ARGS_((int fd, int mask, Tcl_FileProc *proc, ClientData clientData)); /* 9 */ +#endif /* MACOSX */ +#if !defined(__WIN32__) && !defined(MAC_OSX_TCL) /* UNIX */ void (*tcl_DeleteFileHandler) _ANSI_ARGS_((int fd)); /* 10 */ #endif /* UNIX */ -#ifdef __WIN32__ - void *reserved10; -#endif /* __WIN32__ */ -#ifdef MAC_TCL - void *reserved10; -#endif /* MAC_TCL */ - void (*tcl_SetTimer) _ANSI_ARGS_((Tcl_Time * timePtr)); /* 11 */ +#if defined(__WIN32__) /* WIN */ + VOID *reserved10; +#endif /* WIN */ +#ifdef MAC_OSX_TCL /* MACOSX */ + void (*tcl_DeleteFileHandler) _ANSI_ARGS_((int fd)); /* 10 */ +#endif /* MACOSX */ + void (*tcl_SetTimer) _ANSI_ARGS_((Tcl_Time *timePtr)); /* 11 */ void (*tcl_Sleep) _ANSI_ARGS_((int ms)); /* 12 */ - int (*tcl_WaitForEvent) _ANSI_ARGS_((Tcl_Time * timePtr)); /* 13 */ - int (*tcl_AppendAllObjTypes) _ANSI_ARGS_((Tcl_Interp * interp, Tcl_Obj * objPtr)); /* 14 */ - void (*tcl_AppendStringsToObj) _ANSI_ARGS_(TCL_VARARGS(Tcl_Obj *,objPtr)); /* 15 */ - void (*tcl_AppendToObj) _ANSI_ARGS_((Tcl_Obj* objPtr, CONST char* bytes, int length)); /* 16 */ + int (*tcl_WaitForEvent) _ANSI_ARGS_((Tcl_Time *timePtr)); /* 13 */ + int (*tcl_AppendAllObjTypes) _ANSI_ARGS_((Tcl_Interp *interp, Tcl_Obj *objPtr)); /* 14 */ + void (*tcl_AppendStringsToObj) _ANSI_ARGS_((Tcl_Obj *objPtr, ...)); /* 15 */ + void (*tcl_AppendToObj) _ANSI_ARGS_((Tcl_Obj *objPtr, CONST char *bytes, int length)); /* 16 */ Tcl_Obj * (*tcl_ConcatObj) _ANSI_ARGS_((int objc, Tcl_Obj *CONST objv[])); /* 17 */ - int (*tcl_ConvertToType) _ANSI_ARGS_((Tcl_Interp * interp, Tcl_Obj * objPtr, Tcl_ObjType * typePtr)); /* 18 */ - void (*tcl_DbDecrRefCount) _ANSI_ARGS_((Tcl_Obj * objPtr, CONST char * file, int line)); /* 19 */ - void (*tcl_DbIncrRefCount) _ANSI_ARGS_((Tcl_Obj * objPtr, CONST char * file, int line)); /* 20 */ - int (*tcl_DbIsShared) _ANSI_ARGS_((Tcl_Obj * objPtr, CONST char * file, int line)); /* 21 */ - Tcl_Obj * (*tcl_DbNewBooleanObj) _ANSI_ARGS_((int boolValue, CONST char * file, int line)); /* 22 */ - Tcl_Obj * (*tcl_DbNewByteArrayObj) _ANSI_ARGS_((CONST unsigned char * bytes, int length, CONST char * file, int line)); /* 23 */ - Tcl_Obj * (*tcl_DbNewDoubleObj) _ANSI_ARGS_((double doubleValue, CONST char * file, int line)); /* 24 */ - Tcl_Obj * (*tcl_DbNewListObj) _ANSI_ARGS_((int objc, Tcl_Obj *CONST * objv, CONST char * file, int line)); /* 25 */ - Tcl_Obj * (*tcl_DbNewLongObj) _ANSI_ARGS_((long longValue, CONST char * file, int line)); /* 26 */ - Tcl_Obj * (*tcl_DbNewObj) _ANSI_ARGS_((CONST char * file, int line)); /* 27 */ - Tcl_Obj * (*tcl_DbNewStringObj) _ANSI_ARGS_((CONST char * bytes, int length, CONST char * file, int line)); /* 28 */ - Tcl_Obj * (*tcl_DuplicateObj) _ANSI_ARGS_((Tcl_Obj * objPtr)); /* 29 */ - void (*tclFreeObj) _ANSI_ARGS_((Tcl_Obj * objPtr)); /* 30 */ - int (*tcl_GetBoolean) _ANSI_ARGS_((Tcl_Interp * interp, CONST char * str, int * boolPtr)); /* 31 */ - int (*tcl_GetBooleanFromObj) _ANSI_ARGS_((Tcl_Interp * interp, Tcl_Obj * objPtr, int * boolPtr)); /* 32 */ - unsigned char * (*tcl_GetByteArrayFromObj) _ANSI_ARGS_((Tcl_Obj * objPtr, int * lengthPtr)); /* 33 */ - int (*tcl_GetDouble) _ANSI_ARGS_((Tcl_Interp * interp, CONST char * str, double * doublePtr)); /* 34 */ - int (*tcl_GetDoubleFromObj) _ANSI_ARGS_((Tcl_Interp * interp, Tcl_Obj * objPtr, double * doublePtr)); /* 35 */ - int (*tcl_GetIndexFromObj) _ANSI_ARGS_((Tcl_Interp * interp, Tcl_Obj * objPtr, CONST84 char ** tablePtr, CONST char * msg, int flags, int * indexPtr)); /* 36 */ - int (*tcl_GetInt) _ANSI_ARGS_((Tcl_Interp * interp, CONST char * str, int * intPtr)); /* 37 */ - int (*tcl_GetIntFromObj) _ANSI_ARGS_((Tcl_Interp * interp, Tcl_Obj * objPtr, int * intPtr)); /* 38 */ - int (*tcl_GetLongFromObj) _ANSI_ARGS_((Tcl_Interp * interp, Tcl_Obj * objPtr, long * longPtr)); /* 39 */ - Tcl_ObjType * (*tcl_GetObjType) _ANSI_ARGS_((CONST char * typeName)); /* 40 */ - char * (*tcl_GetStringFromObj) _ANSI_ARGS_((Tcl_Obj * objPtr, int * lengthPtr)); /* 41 */ - void (*tcl_InvalidateStringRep) _ANSI_ARGS_((Tcl_Obj * objPtr)); /* 42 */ - int (*tcl_ListObjAppendList) _ANSI_ARGS_((Tcl_Interp * interp, Tcl_Obj * listPtr, Tcl_Obj * elemListPtr)); /* 43 */ - int (*tcl_ListObjAppendElement) _ANSI_ARGS_((Tcl_Interp * interp, Tcl_Obj * listPtr, Tcl_Obj * objPtr)); /* 44 */ - int (*tcl_ListObjGetElements) _ANSI_ARGS_((Tcl_Interp * interp, Tcl_Obj * listPtr, int * objcPtr, Tcl_Obj *** objvPtr)); /* 45 */ - int (*tcl_ListObjIndex) _ANSI_ARGS_((Tcl_Interp * interp, Tcl_Obj * listPtr, int index, Tcl_Obj ** objPtrPtr)); /* 46 */ - int (*tcl_ListObjLength) _ANSI_ARGS_((Tcl_Interp * interp, Tcl_Obj * listPtr, int * lengthPtr)); /* 47 */ - int (*tcl_ListObjReplace) _ANSI_ARGS_((Tcl_Interp * interp, Tcl_Obj * listPtr, int first, int count, int objc, Tcl_Obj *CONST objv[])); /* 48 */ + int (*tcl_ConvertToType) _ANSI_ARGS_((Tcl_Interp *interp, Tcl_Obj *objPtr, Tcl_ObjType *typePtr)); /* 18 */ + void (*tcl_DbDecrRefCount) _ANSI_ARGS_((Tcl_Obj *objPtr, CONST char *file, int line)); /* 19 */ + void (*tcl_DbIncrRefCount) _ANSI_ARGS_((Tcl_Obj *objPtr, CONST char *file, int line)); /* 20 */ + int (*tcl_DbIsShared) _ANSI_ARGS_((Tcl_Obj *objPtr, CONST char *file, int line)); /* 21 */ + Tcl_Obj * (*tcl_DbNewBooleanObj) _ANSI_ARGS_((int boolValue, CONST char *file, int line)); /* 22 */ + Tcl_Obj * (*tcl_DbNewByteArrayObj) _ANSI_ARGS_((CONST unsigned char *bytes, int length, CONST char *file, int line)); /* 23 */ + Tcl_Obj * (*tcl_DbNewDoubleObj) _ANSI_ARGS_((double doubleValue, CONST char *file, int line)); /* 24 */ + Tcl_Obj * (*tcl_DbNewListObj) _ANSI_ARGS_((int objc, Tcl_Obj *CONST *objv, CONST char *file, int line)); /* 25 */ + Tcl_Obj * (*tcl_DbNewLongObj) _ANSI_ARGS_((long longValue, CONST char *file, int line)); /* 26 */ + Tcl_Obj * (*tcl_DbNewObj) _ANSI_ARGS_((CONST char *file, int line)); /* 27 */ + Tcl_Obj * (*tcl_DbNewStringObj) _ANSI_ARGS_((CONST char *bytes, int length, CONST char *file, int line)); /* 28 */ + Tcl_Obj * (*tcl_DuplicateObj) _ANSI_ARGS_((Tcl_Obj *objPtr)); /* 29 */ + void (*tclFreeObj) _ANSI_ARGS_((Tcl_Obj *objPtr)); /* 30 */ + int (*tcl_GetBoolean) _ANSI_ARGS_((Tcl_Interp *interp, CONST char *src, int *boolPtr)); /* 31 */ + int (*tcl_GetBooleanFromObj) _ANSI_ARGS_((Tcl_Interp *interp, Tcl_Obj *objPtr, int *boolPtr)); /* 32 */ + unsigned char * (*tcl_GetByteArrayFromObj) _ANSI_ARGS_((Tcl_Obj *objPtr, int *lengthPtr)); /* 33 */ + int (*tcl_GetDouble) _ANSI_ARGS_((Tcl_Interp *interp, CONST char *src, double *doublePtr)); /* 34 */ + int (*tcl_GetDoubleFromObj) _ANSI_ARGS_((Tcl_Interp *interp, Tcl_Obj *objPtr, double *doublePtr)); /* 35 */ + int (*tcl_GetIndexFromObj) _ANSI_ARGS_((Tcl_Interp *interp, Tcl_Obj *objPtr, CONST84 char **tablePtr, CONST char *msg, int flags, int *indexPtr)); /* 36 */ + int (*tcl_GetInt) _ANSI_ARGS_((Tcl_Interp *interp, CONST char *src, int *intPtr)); /* 37 */ + int (*tcl_GetIntFromObj) _ANSI_ARGS_((Tcl_Interp *interp, Tcl_Obj *objPtr, int *intPtr)); /* 38 */ + int (*tcl_GetLongFromObj) _ANSI_ARGS_((Tcl_Interp *interp, Tcl_Obj *objPtr, long *longPtr)); /* 39 */ + Tcl_ObjType * (*tcl_GetObjType) _ANSI_ARGS_((CONST char *typeName)); /* 40 */ + char * (*tcl_GetStringFromObj) _ANSI_ARGS_((Tcl_Obj *objPtr, int *lengthPtr)); /* 41 */ + void (*tcl_InvalidateStringRep) _ANSI_ARGS_((Tcl_Obj *objPtr)); /* 42 */ + int (*tcl_ListObjAppendList) _ANSI_ARGS_((Tcl_Interp *interp, Tcl_Obj *listPtr, Tcl_Obj *elemListPtr)); /* 43 */ + int (*tcl_ListObjAppendElement) _ANSI_ARGS_((Tcl_Interp *interp, Tcl_Obj *listPtr, Tcl_Obj *objPtr)); /* 44 */ + int (*tcl_ListObjGetElements) _ANSI_ARGS_((Tcl_Interp *interp, Tcl_Obj *listPtr, int *objcPtr, Tcl_Obj ***objvPtr)); /* 45 */ + int (*tcl_ListObjIndex) _ANSI_ARGS_((Tcl_Interp *interp, Tcl_Obj *listPtr, int index, Tcl_Obj **objPtrPtr)); /* 46 */ + int (*tcl_ListObjLength) _ANSI_ARGS_((Tcl_Interp *interp, Tcl_Obj *listPtr, int *lengthPtr)); /* 47 */ + int (*tcl_ListObjReplace) _ANSI_ARGS_((Tcl_Interp *interp, Tcl_Obj *listPtr, int first, int count, int objc, Tcl_Obj *CONST objv[])); /* 48 */ Tcl_Obj * (*tcl_NewBooleanObj) _ANSI_ARGS_((int boolValue)); /* 49 */ - Tcl_Obj * (*tcl_NewByteArrayObj) _ANSI_ARGS_((CONST unsigned char* bytes, int length)); /* 50 */ + Tcl_Obj * (*tcl_NewByteArrayObj) _ANSI_ARGS_((CONST unsigned char *bytes, int length)); /* 50 */ Tcl_Obj * (*tcl_NewDoubleObj) _ANSI_ARGS_((double doubleValue)); /* 51 */ Tcl_Obj * (*tcl_NewIntObj) _ANSI_ARGS_((int intValue)); /* 52 */ Tcl_Obj * (*tcl_NewListObj) _ANSI_ARGS_((int objc, Tcl_Obj *CONST objv[])); /* 53 */ Tcl_Obj * (*tcl_NewLongObj) _ANSI_ARGS_((long longValue)); /* 54 */ Tcl_Obj * (*tcl_NewObj) _ANSI_ARGS_((void)); /* 55 */ - Tcl_Obj * (*tcl_NewStringObj) _ANSI_ARGS_((CONST char * bytes, int length)); /* 56 */ - void (*tcl_SetBooleanObj) _ANSI_ARGS_((Tcl_Obj * objPtr, int boolValue)); /* 57 */ - unsigned char * (*tcl_SetByteArrayLength) _ANSI_ARGS_((Tcl_Obj * objPtr, int length)); /* 58 */ - void (*tcl_SetByteArrayObj) _ANSI_ARGS_((Tcl_Obj * objPtr, CONST unsigned char * bytes, int length)); /* 59 */ - void (*tcl_SetDoubleObj) _ANSI_ARGS_((Tcl_Obj * objPtr, double doubleValue)); /* 60 */ - void (*tcl_SetIntObj) _ANSI_ARGS_((Tcl_Obj * objPtr, int intValue)); /* 61 */ - void (*tcl_SetListObj) _ANSI_ARGS_((Tcl_Obj * objPtr, int objc, Tcl_Obj *CONST objv[])); /* 62 */ - void (*tcl_SetLongObj) _ANSI_ARGS_((Tcl_Obj * objPtr, long longValue)); /* 63 */ - void (*tcl_SetObjLength) _ANSI_ARGS_((Tcl_Obj * objPtr, int length)); /* 64 */ - void (*tcl_SetStringObj) _ANSI_ARGS_((Tcl_Obj* objPtr, CONST char* bytes, int length)); /* 65 */ - void (*tcl_AddErrorInfo) _ANSI_ARGS_((Tcl_Interp * interp, CONST char * message)); /* 66 */ - void (*tcl_AddObjErrorInfo) _ANSI_ARGS_((Tcl_Interp * interp, CONST char * message, int length)); /* 67 */ - void (*tcl_AllowExceptions) _ANSI_ARGS_((Tcl_Interp * interp)); /* 68 */ - void (*tcl_AppendElement) _ANSI_ARGS_((Tcl_Interp * interp, CONST char * string)); /* 69 */ - void (*tcl_AppendResult) _ANSI_ARGS_(TCL_VARARGS(Tcl_Interp *,interp)); /* 70 */ - Tcl_AsyncHandler (*tcl_AsyncCreate) _ANSI_ARGS_((Tcl_AsyncProc * proc, ClientData clientData)); /* 71 */ + Tcl_Obj * (*tcl_NewStringObj) _ANSI_ARGS_((CONST char *bytes, int length)); /* 56 */ + void (*tcl_SetBooleanObj) _ANSI_ARGS_((Tcl_Obj *objPtr, int boolValue)); /* 57 */ + unsigned char * (*tcl_SetByteArrayLength) _ANSI_ARGS_((Tcl_Obj *objPtr, int length)); /* 58 */ + void (*tcl_SetByteArrayObj) _ANSI_ARGS_((Tcl_Obj *objPtr, CONST unsigned char *bytes, int length)); /* 59 */ + void (*tcl_SetDoubleObj) _ANSI_ARGS_((Tcl_Obj *objPtr, double doubleValue)); /* 60 */ + void (*tcl_SetIntObj) _ANSI_ARGS_((Tcl_Obj *objPtr, int intValue)); /* 61 */ + void (*tcl_SetListObj) _ANSI_ARGS_((Tcl_Obj *objPtr, int objc, Tcl_Obj *CONST objv[])); /* 62 */ + void (*tcl_SetLongObj) _ANSI_ARGS_((Tcl_Obj *objPtr, long longValue)); /* 63 */ + void (*tcl_SetObjLength) _ANSI_ARGS_((Tcl_Obj *objPtr, int length)); /* 64 */ + void (*tcl_SetStringObj) _ANSI_ARGS_((Tcl_Obj *objPtr, CONST char *bytes, int length)); /* 65 */ + void (*tcl_AddErrorInfo) _ANSI_ARGS_((Tcl_Interp *interp, CONST char *message)); /* 66 */ + void (*tcl_AddObjErrorInfo) _ANSI_ARGS_((Tcl_Interp *interp, CONST char *message, int length)); /* 67 */ + void (*tcl_AllowExceptions) _ANSI_ARGS_((Tcl_Interp *interp)); /* 68 */ + void (*tcl_AppendElement) _ANSI_ARGS_((Tcl_Interp *interp, CONST char *element)); /* 69 */ + void (*tcl_AppendResult) _ANSI_ARGS_((Tcl_Interp *interp, ...)); /* 70 */ + Tcl_AsyncHandler (*tcl_AsyncCreate) _ANSI_ARGS_((Tcl_AsyncProc *proc, ClientData clientData)); /* 71 */ void (*tcl_AsyncDelete) _ANSI_ARGS_((Tcl_AsyncHandler async)); /* 72 */ - int (*tcl_AsyncInvoke) _ANSI_ARGS_((Tcl_Interp * interp, int code)); /* 73 */ + int (*tcl_AsyncInvoke) _ANSI_ARGS_((Tcl_Interp *interp, int code)); /* 73 */ void (*tcl_AsyncMark) _ANSI_ARGS_((Tcl_AsyncHandler async)); /* 74 */ int (*tcl_AsyncReady) _ANSI_ARGS_((void)); /* 75 */ - void (*tcl_BackgroundError) _ANSI_ARGS_((Tcl_Interp * interp)); /* 76 */ - char (*tcl_Backslash) _ANSI_ARGS_((CONST char * src, int * readPtr)); /* 77 */ - int (*tcl_BadChannelOption) _ANSI_ARGS_((Tcl_Interp * interp, CONST char * optionName, CONST char * optionList)); /* 78 */ - void (*tcl_CallWhenDeleted) _ANSI_ARGS_((Tcl_Interp * interp, Tcl_InterpDeleteProc * proc, ClientData clientData)); /* 79 */ - void (*tcl_CancelIdleCall) _ANSI_ARGS_((Tcl_IdleProc * idleProc, ClientData clientData)); /* 80 */ - int (*tcl_Close) _ANSI_ARGS_((Tcl_Interp * interp, Tcl_Channel chan)); /* 81 */ - int (*tcl_CommandComplete) _ANSI_ARGS_((CONST char * cmd)); /* 82 */ - char * (*tcl_Concat) _ANSI_ARGS_((int argc, CONST84 char * CONST * argv)); /* 83 */ - int (*tcl_ConvertElement) _ANSI_ARGS_((CONST char * src, char * dst, int flags)); /* 84 */ - int (*tcl_ConvertCountedElement) _ANSI_ARGS_((CONST char * src, int length, char * dst, int flags)); /* 85 */ - int (*tcl_CreateAlias) _ANSI_ARGS_((Tcl_Interp * slave, CONST char * slaveCmd, Tcl_Interp * target, CONST char * targetCmd, int argc, CONST84 char * CONST * argv)); /* 86 */ - int (*tcl_CreateAliasObj) _ANSI_ARGS_((Tcl_Interp * slave, CONST char * slaveCmd, Tcl_Interp * target, CONST char * targetCmd, int objc, Tcl_Obj *CONST objv[])); /* 87 */ - Tcl_Channel (*tcl_CreateChannel) _ANSI_ARGS_((Tcl_ChannelType * typePtr, CONST char * chanName, ClientData instanceData, int mask)); /* 88 */ - void (*tcl_CreateChannelHandler) _ANSI_ARGS_((Tcl_Channel chan, int mask, Tcl_ChannelProc * proc, ClientData clientData)); /* 89 */ - void (*tcl_CreateCloseHandler) _ANSI_ARGS_((Tcl_Channel chan, Tcl_CloseProc * proc, ClientData clientData)); /* 90 */ - Tcl_Command (*tcl_CreateCommand) _ANSI_ARGS_((Tcl_Interp * interp, CONST char * cmdName, Tcl_CmdProc * proc, ClientData clientData, Tcl_CmdDeleteProc * deleteProc)); /* 91 */ - void (*tcl_CreateEventSource) _ANSI_ARGS_((Tcl_EventSetupProc * setupProc, Tcl_EventCheckProc * checkProc, ClientData clientData)); /* 92 */ - void (*tcl_CreateExitHandler) _ANSI_ARGS_((Tcl_ExitProc * proc, ClientData clientData)); /* 93 */ + void (*tcl_BackgroundError) _ANSI_ARGS_((Tcl_Interp *interp)); /* 76 */ + char (*tcl_Backslash) _ANSI_ARGS_((CONST char *src, int *readPtr)); /* 77 */ + int (*tcl_BadChannelOption) _ANSI_ARGS_((Tcl_Interp *interp, CONST char *optionName, CONST char *optionList)); /* 78 */ + void (*tcl_CallWhenDeleted) _ANSI_ARGS_((Tcl_Interp *interp, Tcl_InterpDeleteProc *proc, ClientData clientData)); /* 79 */ + void (*tcl_CancelIdleCall) _ANSI_ARGS_((Tcl_IdleProc *idleProc, ClientData clientData)); /* 80 */ + int (*tcl_Close) _ANSI_ARGS_((Tcl_Interp *interp, Tcl_Channel chan)); /* 81 */ + int (*tcl_CommandComplete) _ANSI_ARGS_((CONST char *cmd)); /* 82 */ + char * (*tcl_Concat) _ANSI_ARGS_((int argc, CONST84 char *CONST *argv)); /* 83 */ + int (*tcl_ConvertElement) _ANSI_ARGS_((CONST char *src, char *dst, int flags)); /* 84 */ + int (*tcl_ConvertCountedElement) _ANSI_ARGS_((CONST char *src, int length, char *dst, int flags)); /* 85 */ + int (*tcl_CreateAlias) _ANSI_ARGS_((Tcl_Interp *slave, CONST char *slaveCmd, Tcl_Interp *target, CONST char *targetCmd, int argc, CONST84 char *CONST *argv)); /* 86 */ + int (*tcl_CreateAliasObj) _ANSI_ARGS_((Tcl_Interp *slave, CONST char *slaveCmd, Tcl_Interp *target, CONST char *targetCmd, int objc, Tcl_Obj *CONST objv[])); /* 87 */ + Tcl_Channel (*tcl_CreateChannel) _ANSI_ARGS_((Tcl_ChannelType *typePtr, CONST char *chanName, ClientData instanceData, int mask)); /* 88 */ + void (*tcl_CreateChannelHandler) _ANSI_ARGS_((Tcl_Channel chan, int mask, Tcl_ChannelProc *proc, ClientData clientData)); /* 89 */ + void (*tcl_CreateCloseHandler) _ANSI_ARGS_((Tcl_Channel chan, Tcl_CloseProc *proc, ClientData clientData)); /* 90 */ + Tcl_Command (*tcl_CreateCommand) _ANSI_ARGS_((Tcl_Interp *interp, CONST char *cmdName, Tcl_CmdProc *proc, ClientData clientData, Tcl_CmdDeleteProc *deleteProc)); /* 91 */ + void (*tcl_CreateEventSource) _ANSI_ARGS_((Tcl_EventSetupProc *setupProc, Tcl_EventCheckProc *checkProc, ClientData clientData)); /* 92 */ + void (*tcl_CreateExitHandler) _ANSI_ARGS_((Tcl_ExitProc *proc, ClientData clientData)); /* 93 */ Tcl_Interp * (*tcl_CreateInterp) _ANSI_ARGS_((void)); /* 94 */ - void (*tcl_CreateMathFunc) _ANSI_ARGS_((Tcl_Interp * interp, CONST char * name, int numArgs, Tcl_ValueType * argTypes, Tcl_MathProc * proc, ClientData clientData)); /* 95 */ - Tcl_Command (*tcl_CreateObjCommand) _ANSI_ARGS_((Tcl_Interp * interp, CONST char * cmdName, Tcl_ObjCmdProc * proc, ClientData clientData, Tcl_CmdDeleteProc * deleteProc)); /* 96 */ - Tcl_Interp * (*tcl_CreateSlave) _ANSI_ARGS_((Tcl_Interp * interp, CONST char * slaveName, int isSafe)); /* 97 */ - Tcl_TimerToken (*tcl_CreateTimerHandler) _ANSI_ARGS_((int milliseconds, Tcl_TimerProc * proc, ClientData clientData)); /* 98 */ - Tcl_Trace (*tcl_CreateTrace) _ANSI_ARGS_((Tcl_Interp * interp, int level, Tcl_CmdTraceProc * proc, ClientData clientData)); /* 99 */ - void (*tcl_DeleteAssocData) _ANSI_ARGS_((Tcl_Interp * interp, CONST char * name)); /* 100 */ - void (*tcl_DeleteChannelHandler) _ANSI_ARGS_((Tcl_Channel chan, Tcl_ChannelProc * proc, ClientData clientData)); /* 101 */ - void (*tcl_DeleteCloseHandler) _ANSI_ARGS_((Tcl_Channel chan, Tcl_CloseProc * proc, ClientData clientData)); /* 102 */ - int (*tcl_DeleteCommand) _ANSI_ARGS_((Tcl_Interp * interp, CONST char * cmdName)); /* 103 */ - int (*tcl_DeleteCommandFromToken) _ANSI_ARGS_((Tcl_Interp * interp, Tcl_Command command)); /* 104 */ - void (*tcl_DeleteEvents) _ANSI_ARGS_((Tcl_EventDeleteProc * proc, ClientData clientData)); /* 105 */ - void (*tcl_DeleteEventSource) _ANSI_ARGS_((Tcl_EventSetupProc * setupProc, Tcl_EventCheckProc * checkProc, ClientData clientData)); /* 106 */ - void (*tcl_DeleteExitHandler) _ANSI_ARGS_((Tcl_ExitProc * proc, ClientData clientData)); /* 107 */ - void (*tcl_DeleteHashEntry) _ANSI_ARGS_((Tcl_HashEntry * entryPtr)); /* 108 */ - void (*tcl_DeleteHashTable) _ANSI_ARGS_((Tcl_HashTable * tablePtr)); /* 109 */ - void (*tcl_DeleteInterp) _ANSI_ARGS_((Tcl_Interp * interp)); /* 110 */ -#if !defined(__WIN32__) && !defined(MAC_TCL) /* UNIX */ - void (*tcl_DetachPids) _ANSI_ARGS_((int numPids, Tcl_Pid * pidPtr)); /* 111 */ -#endif /* UNIX */ -#ifdef __WIN32__ - void (*tcl_DetachPids) _ANSI_ARGS_((int numPids, Tcl_Pid * pidPtr)); /* 111 */ -#endif /* __WIN32__ */ -#ifdef MAC_TCL - void *reserved111; -#endif /* MAC_TCL */ + void (*tcl_CreateMathFunc) _ANSI_ARGS_((Tcl_Interp *interp, CONST char *name, int numArgs, Tcl_ValueType *argTypes, Tcl_MathProc *proc, ClientData clientData)); /* 95 */ + Tcl_Command (*tcl_CreateObjCommand) _ANSI_ARGS_((Tcl_Interp *interp, CONST char *cmdName, Tcl_ObjCmdProc *proc, ClientData clientData, Tcl_CmdDeleteProc *deleteProc)); /* 96 */ + Tcl_Interp * (*tcl_CreateSlave) _ANSI_ARGS_((Tcl_Interp *interp, CONST char *slaveName, int isSafe)); /* 97 */ + Tcl_TimerToken (*tcl_CreateTimerHandler) _ANSI_ARGS_((int milliseconds, Tcl_TimerProc *proc, ClientData clientData)); /* 98 */ + Tcl_Trace (*tcl_CreateTrace) _ANSI_ARGS_((Tcl_Interp *interp, int level, Tcl_CmdTraceProc *proc, ClientData clientData)); /* 99 */ + void (*tcl_DeleteAssocData) _ANSI_ARGS_((Tcl_Interp *interp, CONST char *name)); /* 100 */ + void (*tcl_DeleteChannelHandler) _ANSI_ARGS_((Tcl_Channel chan, Tcl_ChannelProc *proc, ClientData clientData)); /* 101 */ + void (*tcl_DeleteCloseHandler) _ANSI_ARGS_((Tcl_Channel chan, Tcl_CloseProc *proc, ClientData clientData)); /* 102 */ + int (*tcl_DeleteCommand) _ANSI_ARGS_((Tcl_Interp *interp, CONST char *cmdName)); /* 103 */ + int (*tcl_DeleteCommandFromToken) _ANSI_ARGS_((Tcl_Interp *interp, Tcl_Command command)); /* 104 */ + void (*tcl_DeleteEvents) _ANSI_ARGS_((Tcl_EventDeleteProc *proc, ClientData clientData)); /* 105 */ + void (*tcl_DeleteEventSource) _ANSI_ARGS_((Tcl_EventSetupProc *setupProc, Tcl_EventCheckProc *checkProc, ClientData clientData)); /* 106 */ + void (*tcl_DeleteExitHandler) _ANSI_ARGS_((Tcl_ExitProc *proc, ClientData clientData)); /* 107 */ + void (*tcl_DeleteHashEntry) _ANSI_ARGS_((Tcl_HashEntry *entryPtr)); /* 108 */ + void (*tcl_DeleteHashTable) _ANSI_ARGS_((Tcl_HashTable *tablePtr)); /* 109 */ + void (*tcl_DeleteInterp) _ANSI_ARGS_((Tcl_Interp *interp)); /* 110 */ + void (*tcl_DetachPids) _ANSI_ARGS_((int numPids, Tcl_Pid *pidPtr)); /* 111 */ void (*tcl_DeleteTimerHandler) _ANSI_ARGS_((Tcl_TimerToken token)); /* 112 */ - void (*tcl_DeleteTrace) _ANSI_ARGS_((Tcl_Interp * interp, Tcl_Trace trace)); /* 113 */ - void (*tcl_DontCallWhenDeleted) _ANSI_ARGS_((Tcl_Interp * interp, Tcl_InterpDeleteProc * proc, ClientData clientData)); /* 114 */ + void (*tcl_DeleteTrace) _ANSI_ARGS_((Tcl_Interp *interp, Tcl_Trace trace)); /* 113 */ + void (*tcl_DontCallWhenDeleted) _ANSI_ARGS_((Tcl_Interp *interp, Tcl_InterpDeleteProc *proc, ClientData clientData)); /* 114 */ int (*tcl_DoOneEvent) _ANSI_ARGS_((int flags)); /* 115 */ - void (*tcl_DoWhenIdle) _ANSI_ARGS_((Tcl_IdleProc * proc, ClientData clientData)); /* 116 */ - char * (*tcl_DStringAppend) _ANSI_ARGS_((Tcl_DString * dsPtr, CONST char * str, int length)); /* 117 */ - char * (*tcl_DStringAppendElement) _ANSI_ARGS_((Tcl_DString * dsPtr, CONST char * string)); /* 118 */ - void (*tcl_DStringEndSublist) _ANSI_ARGS_((Tcl_DString * dsPtr)); /* 119 */ - void (*tcl_DStringFree) _ANSI_ARGS_((Tcl_DString * dsPtr)); /* 120 */ - void (*tcl_DStringGetResult) _ANSI_ARGS_((Tcl_Interp * interp, Tcl_DString * dsPtr)); /* 121 */ - void (*tcl_DStringInit) _ANSI_ARGS_((Tcl_DString * dsPtr)); /* 122 */ - void (*tcl_DStringResult) _ANSI_ARGS_((Tcl_Interp * interp, Tcl_DString * dsPtr)); /* 123 */ - void (*tcl_DStringSetLength) _ANSI_ARGS_((Tcl_DString * dsPtr, int length)); /* 124 */ - void (*tcl_DStringStartSublist) _ANSI_ARGS_((Tcl_DString * dsPtr)); /* 125 */ + void (*tcl_DoWhenIdle) _ANSI_ARGS_((Tcl_IdleProc *proc, ClientData clientData)); /* 116 */ + char * (*tcl_DStringAppend) _ANSI_ARGS_((Tcl_DString *dsPtr, CONST char *bytes, int length)); /* 117 */ + char * (*tcl_DStringAppendElement) _ANSI_ARGS_((Tcl_DString *dsPtr, CONST char *element)); /* 118 */ + void (*tcl_DStringEndSublist) _ANSI_ARGS_((Tcl_DString *dsPtr)); /* 119 */ + void (*tcl_DStringFree) _ANSI_ARGS_((Tcl_DString *dsPtr)); /* 120 */ + void (*tcl_DStringGetResult) _ANSI_ARGS_((Tcl_Interp *interp, Tcl_DString *dsPtr)); /* 121 */ + void (*tcl_DStringInit) _ANSI_ARGS_((Tcl_DString *dsPtr)); /* 122 */ + void (*tcl_DStringResult) _ANSI_ARGS_((Tcl_Interp *interp, Tcl_DString *dsPtr)); /* 123 */ + void (*tcl_DStringSetLength) _ANSI_ARGS_((Tcl_DString *dsPtr, int length)); /* 124 */ + void (*tcl_DStringStartSublist) _ANSI_ARGS_((Tcl_DString *dsPtr)); /* 125 */ int (*tcl_Eof) _ANSI_ARGS_((Tcl_Channel chan)); /* 126 */ CONST84_RETURN char * (*tcl_ErrnoId) _ANSI_ARGS_((void)); /* 127 */ CONST84_RETURN char * (*tcl_ErrnoMsg) _ANSI_ARGS_((int err)); /* 128 */ - int (*tcl_Eval) _ANSI_ARGS_((Tcl_Interp * interp, CONST char * string)); /* 129 */ - int (*tcl_EvalFile) _ANSI_ARGS_((Tcl_Interp * interp, CONST char * fileName)); /* 130 */ - int (*tcl_EvalObj) _ANSI_ARGS_((Tcl_Interp * interp, Tcl_Obj * objPtr)); /* 131 */ - void (*tcl_EventuallyFree) _ANSI_ARGS_((ClientData clientData, Tcl_FreeProc * freeProc)); /* 132 */ + int (*tcl_Eval) _ANSI_ARGS_((Tcl_Interp *interp, CONST char *script)); /* 129 */ + int (*tcl_EvalFile) _ANSI_ARGS_((Tcl_Interp *interp, CONST char *fileName)); /* 130 */ + int (*tcl_EvalObj) _ANSI_ARGS_((Tcl_Interp *interp, Tcl_Obj *objPtr)); /* 131 */ + void (*tcl_EventuallyFree) _ANSI_ARGS_((ClientData clientData, Tcl_FreeProc *freeProc)); /* 132 */ void (*tcl_Exit) _ANSI_ARGS_((int status)); /* 133 */ - int (*tcl_ExposeCommand) _ANSI_ARGS_((Tcl_Interp * interp, CONST char * hiddenCmdToken, CONST char * cmdName)); /* 134 */ - int (*tcl_ExprBoolean) _ANSI_ARGS_((Tcl_Interp * interp, CONST char * str, int * ptr)); /* 135 */ - int (*tcl_ExprBooleanObj) _ANSI_ARGS_((Tcl_Interp * interp, Tcl_Obj * objPtr, int * ptr)); /* 136 */ - int (*tcl_ExprDouble) _ANSI_ARGS_((Tcl_Interp * interp, CONST char * str, double * ptr)); /* 137 */ - int (*tcl_ExprDoubleObj) _ANSI_ARGS_((Tcl_Interp * interp, Tcl_Obj * objPtr, double * ptr)); /* 138 */ - int (*tcl_ExprLong) _ANSI_ARGS_((Tcl_Interp * interp, CONST char * str, long * ptr)); /* 139 */ - int (*tcl_ExprLongObj) _ANSI_ARGS_((Tcl_Interp * interp, Tcl_Obj * objPtr, long * ptr)); /* 140 */ - int (*tcl_ExprObj) _ANSI_ARGS_((Tcl_Interp * interp, Tcl_Obj * objPtr, Tcl_Obj ** resultPtrPtr)); /* 141 */ - int (*tcl_ExprString) _ANSI_ARGS_((Tcl_Interp * interp, CONST char * string)); /* 142 */ + int (*tcl_ExposeCommand) _ANSI_ARGS_((Tcl_Interp *interp, CONST char *hiddenCmdToken, CONST char *cmdName)); /* 134 */ + int (*tcl_ExprBoolean) _ANSI_ARGS_((Tcl_Interp *interp, CONST char *expr, int *ptr)); /* 135 */ + int (*tcl_ExprBooleanObj) _ANSI_ARGS_((Tcl_Interp *interp, Tcl_Obj *objPtr, int *ptr)); /* 136 */ + int (*tcl_ExprDouble) _ANSI_ARGS_((Tcl_Interp *interp, CONST char *expr, double *ptr)); /* 137 */ + int (*tcl_ExprDoubleObj) _ANSI_ARGS_((Tcl_Interp *interp, Tcl_Obj *objPtr, double *ptr)); /* 138 */ + int (*tcl_ExprLong) _ANSI_ARGS_((Tcl_Interp *interp, CONST char *expr, long *ptr)); /* 139 */ + int (*tcl_ExprLongObj) _ANSI_ARGS_((Tcl_Interp *interp, Tcl_Obj *objPtr, long *ptr)); /* 140 */ + int (*tcl_ExprObj) _ANSI_ARGS_((Tcl_Interp *interp, Tcl_Obj *objPtr, Tcl_Obj **resultPtrPtr)); /* 141 */ + int (*tcl_ExprString) _ANSI_ARGS_((Tcl_Interp *interp, CONST char *expr)); /* 142 */ void (*tcl_Finalize) _ANSI_ARGS_((void)); /* 143 */ - void (*tcl_FindExecutable) _ANSI_ARGS_((CONST char * argv0)); /* 144 */ - Tcl_HashEntry * (*tcl_FirstHashEntry) _ANSI_ARGS_((Tcl_HashTable * tablePtr, Tcl_HashSearch * searchPtr)); /* 145 */ + void (*tcl_FindExecutable) _ANSI_ARGS_((CONST char *argv0)); /* 144 */ + Tcl_HashEntry * (*tcl_FirstHashEntry) _ANSI_ARGS_((Tcl_HashTable *tablePtr, Tcl_HashSearch *searchPtr)); /* 145 */ int (*tcl_Flush) _ANSI_ARGS_((Tcl_Channel chan)); /* 146 */ - void (*tcl_FreeResult) _ANSI_ARGS_((Tcl_Interp * interp)); /* 147 */ - int (*tcl_GetAlias) _ANSI_ARGS_((Tcl_Interp * interp, CONST char * slaveCmd, Tcl_Interp ** targetInterpPtr, CONST84 char ** targetCmdPtr, int * argcPtr, CONST84 char *** argvPtr)); /* 148 */ - int (*tcl_GetAliasObj) _ANSI_ARGS_((Tcl_Interp * interp, CONST char * slaveCmd, Tcl_Interp ** targetInterpPtr, CONST84 char ** targetCmdPtr, int * objcPtr, Tcl_Obj *** objv)); /* 149 */ - ClientData (*tcl_GetAssocData) _ANSI_ARGS_((Tcl_Interp * interp, CONST char * name, Tcl_InterpDeleteProc ** procPtr)); /* 150 */ - Tcl_Channel (*tcl_GetChannel) _ANSI_ARGS_((Tcl_Interp * interp, CONST char * chanName, int * modePtr)); /* 151 */ + void (*tcl_FreeResult) _ANSI_ARGS_((Tcl_Interp *interp)); /* 147 */ + int (*tcl_GetAlias) _ANSI_ARGS_((Tcl_Interp *interp, CONST char *slaveCmd, Tcl_Interp **targetInterpPtr, CONST84 char **targetCmdPtr, int *argcPtr, CONST84 char ***argvPtr)); /* 148 */ + int (*tcl_GetAliasObj) _ANSI_ARGS_((Tcl_Interp *interp, CONST char *slaveCmd, Tcl_Interp **targetInterpPtr, CONST84 char **targetCmdPtr, int *objcPtr, Tcl_Obj ***objv)); /* 149 */ + ClientData (*tcl_GetAssocData) _ANSI_ARGS_((Tcl_Interp *interp, CONST char *name, Tcl_InterpDeleteProc **procPtr)); /* 150 */ + Tcl_Channel (*tcl_GetChannel) _ANSI_ARGS_((Tcl_Interp *interp, CONST char *chanName, int *modePtr)); /* 151 */ int (*tcl_GetChannelBufferSize) _ANSI_ARGS_((Tcl_Channel chan)); /* 152 */ - int (*tcl_GetChannelHandle) _ANSI_ARGS_((Tcl_Channel chan, int direction, ClientData * handlePtr)); /* 153 */ + int (*tcl_GetChannelHandle) _ANSI_ARGS_((Tcl_Channel chan, int direction, ClientData *handlePtr)); /* 153 */ ClientData (*tcl_GetChannelInstanceData) _ANSI_ARGS_((Tcl_Channel chan)); /* 154 */ int (*tcl_GetChannelMode) _ANSI_ARGS_((Tcl_Channel chan)); /* 155 */ CONST84_RETURN char * (*tcl_GetChannelName) _ANSI_ARGS_((Tcl_Channel chan)); /* 156 */ - int (*tcl_GetChannelOption) _ANSI_ARGS_((Tcl_Interp * interp, Tcl_Channel chan, CONST char * optionName, Tcl_DString * dsPtr)); /* 157 */ + int (*tcl_GetChannelOption) _ANSI_ARGS_((Tcl_Interp *interp, Tcl_Channel chan, CONST char *optionName, Tcl_DString *dsPtr)); /* 157 */ Tcl_ChannelType * (*tcl_GetChannelType) _ANSI_ARGS_((Tcl_Channel chan)); /* 158 */ - int (*tcl_GetCommandInfo) _ANSI_ARGS_((Tcl_Interp * interp, CONST char * cmdName, Tcl_CmdInfo * infoPtr)); /* 159 */ - CONST84_RETURN char * (*tcl_GetCommandName) _ANSI_ARGS_((Tcl_Interp * interp, Tcl_Command command)); /* 160 */ + int (*tcl_GetCommandInfo) _ANSI_ARGS_((Tcl_Interp *interp, CONST char *cmdName, Tcl_CmdInfo *infoPtr)); /* 159 */ + CONST84_RETURN char * (*tcl_GetCommandName) _ANSI_ARGS_((Tcl_Interp *interp, Tcl_Command command)); /* 160 */ int (*tcl_GetErrno) _ANSI_ARGS_((void)); /* 161 */ CONST84_RETURN char * (*tcl_GetHostName) _ANSI_ARGS_((void)); /* 162 */ - int (*tcl_GetInterpPath) _ANSI_ARGS_((Tcl_Interp * askInterp, Tcl_Interp * slaveInterp)); /* 163 */ - Tcl_Interp * (*tcl_GetMaster) _ANSI_ARGS_((Tcl_Interp * interp)); /* 164 */ + int (*tcl_GetInterpPath) _ANSI_ARGS_((Tcl_Interp *askInterp, Tcl_Interp *slaveInterp)); /* 163 */ + Tcl_Interp * (*tcl_GetMaster) _ANSI_ARGS_((Tcl_Interp *interp)); /* 164 */ CONST char * (*tcl_GetNameOfExecutable) _ANSI_ARGS_((void)); /* 165 */ - Tcl_Obj * (*tcl_GetObjResult) _ANSI_ARGS_((Tcl_Interp * interp)); /* 166 */ -#if !defined(__WIN32__) && !defined(MAC_TCL) /* UNIX */ - int (*tcl_GetOpenFile) _ANSI_ARGS_((Tcl_Interp * interp, CONST char * str, int forWriting, int checkUsage, ClientData * filePtr)); /* 167 */ + Tcl_Obj * (*tcl_GetObjResult) _ANSI_ARGS_((Tcl_Interp *interp)); /* 166 */ +#if !defined(__WIN32__) && !defined(MAC_OSX_TCL) /* UNIX */ + int (*tcl_GetOpenFile) _ANSI_ARGS_((Tcl_Interp *interp, CONST char *chanID, int forWriting, int checkUsage, ClientData *filePtr)); /* 167 */ #endif /* UNIX */ -#ifdef __WIN32__ - void *reserved167; -#endif /* __WIN32__ */ -#ifdef MAC_TCL - void *reserved167; -#endif /* MAC_TCL */ - Tcl_PathType (*tcl_GetPathType) _ANSI_ARGS_((CONST char * path)); /* 168 */ - int (*tcl_Gets) _ANSI_ARGS_((Tcl_Channel chan, Tcl_DString * dsPtr)); /* 169 */ - int (*tcl_GetsObj) _ANSI_ARGS_((Tcl_Channel chan, Tcl_Obj * objPtr)); /* 170 */ +#if defined(__WIN32__) /* WIN */ + VOID *reserved167; +#endif /* WIN */ +#ifdef MAC_OSX_TCL /* MACOSX */ + int (*tcl_GetOpenFile) _ANSI_ARGS_((Tcl_Interp *interp, CONST char *chanID, int forWriting, int checkUsage, ClientData *filePtr)); /* 167 */ +#endif /* MACOSX */ + Tcl_PathType (*tcl_GetPathType) _ANSI_ARGS_((CONST char *path)); /* 168 */ + int (*tcl_Gets) _ANSI_ARGS_((Tcl_Channel chan, Tcl_DString *dsPtr)); /* 169 */ + int (*tcl_GetsObj) _ANSI_ARGS_((Tcl_Channel chan, Tcl_Obj *objPtr)); /* 170 */ int (*tcl_GetServiceMode) _ANSI_ARGS_((void)); /* 171 */ - Tcl_Interp * (*tcl_GetSlave) _ANSI_ARGS_((Tcl_Interp * interp, CONST char * slaveName)); /* 172 */ + Tcl_Interp * (*tcl_GetSlave) _ANSI_ARGS_((Tcl_Interp *interp, CONST char *slaveName)); /* 172 */ Tcl_Channel (*tcl_GetStdChannel) _ANSI_ARGS_((int type)); /* 173 */ - CONST84_RETURN char * (*tcl_GetStringResult) _ANSI_ARGS_((Tcl_Interp * interp)); /* 174 */ - CONST84_RETURN char * (*tcl_GetVar) _ANSI_ARGS_((Tcl_Interp * interp, CONST char * varName, int flags)); /* 175 */ - CONST84_RETURN char * (*tcl_GetVar2) _ANSI_ARGS_((Tcl_Interp * interp, CONST char * part1, CONST char * part2, int flags)); /* 176 */ - int (*tcl_GlobalEval) _ANSI_ARGS_((Tcl_Interp * interp, CONST char * command)); /* 177 */ - int (*tcl_GlobalEvalObj) _ANSI_ARGS_((Tcl_Interp * interp, Tcl_Obj * objPtr)); /* 178 */ - int (*tcl_HideCommand) _ANSI_ARGS_((Tcl_Interp * interp, CONST char * cmdName, CONST char * hiddenCmdToken)); /* 179 */ - int (*tcl_Init) _ANSI_ARGS_((Tcl_Interp * interp)); /* 180 */ - void (*tcl_InitHashTable) _ANSI_ARGS_((Tcl_HashTable * tablePtr, int keyType)); /* 181 */ + CONST84_RETURN char * (*tcl_GetStringResult) _ANSI_ARGS_((Tcl_Interp *interp)); /* 174 */ + CONST84_RETURN char * (*tcl_GetVar) _ANSI_ARGS_((Tcl_Interp *interp, CONST char *varName, int flags)); /* 175 */ + CONST84_RETURN char * (*tcl_GetVar2) _ANSI_ARGS_((Tcl_Interp *interp, CONST char *part1, CONST char *part2, int flags)); /* 176 */ + int (*tcl_GlobalEval) _ANSI_ARGS_((Tcl_Interp *interp, CONST char *command)); /* 177 */ + int (*tcl_GlobalEvalObj) _ANSI_ARGS_((Tcl_Interp *interp, Tcl_Obj *objPtr)); /* 178 */ + int (*tcl_HideCommand) _ANSI_ARGS_((Tcl_Interp *interp, CONST char *cmdName, CONST char *hiddenCmdToken)); /* 179 */ + int (*tcl_Init) _ANSI_ARGS_((Tcl_Interp *interp)); /* 180 */ + void (*tcl_InitHashTable) _ANSI_ARGS_((Tcl_HashTable *tablePtr, int keyType)); /* 181 */ int (*tcl_InputBlocked) _ANSI_ARGS_((Tcl_Channel chan)); /* 182 */ int (*tcl_InputBuffered) _ANSI_ARGS_((Tcl_Channel chan)); /* 183 */ - int (*tcl_InterpDeleted) _ANSI_ARGS_((Tcl_Interp * interp)); /* 184 */ - int (*tcl_IsSafe) _ANSI_ARGS_((Tcl_Interp * interp)); /* 185 */ - char * (*tcl_JoinPath) _ANSI_ARGS_((int argc, CONST84 char * CONST * argv, Tcl_DString * resultPtr)); /* 186 */ - int (*tcl_LinkVar) _ANSI_ARGS_((Tcl_Interp * interp, CONST char * varName, char * addr, int type)); /* 187 */ - void *reserved188; + int (*tcl_InterpDeleted) _ANSI_ARGS_((Tcl_Interp *interp)); /* 184 */ + int (*tcl_IsSafe) _ANSI_ARGS_((Tcl_Interp *interp)); /* 185 */ + char * (*tcl_JoinPath) _ANSI_ARGS_((int argc, CONST84 char *CONST *argv, Tcl_DString *resultPtr)); /* 186 */ + int (*tcl_LinkVar) _ANSI_ARGS_((Tcl_Interp *interp, CONST char *varName, char *addr, int type)); /* 187 */ + VOID *reserved188; Tcl_Channel (*tcl_MakeFileChannel) _ANSI_ARGS_((ClientData handle, int mode)); /* 189 */ - int (*tcl_MakeSafe) _ANSI_ARGS_((Tcl_Interp * interp)); /* 190 */ + int (*tcl_MakeSafe) _ANSI_ARGS_((Tcl_Interp *interp)); /* 190 */ Tcl_Channel (*tcl_MakeTcpClientChannel) _ANSI_ARGS_((ClientData tcpSocket)); /* 191 */ - char * (*tcl_Merge) _ANSI_ARGS_((int argc, CONST84 char * CONST * argv)); /* 192 */ - Tcl_HashEntry * (*tcl_NextHashEntry) _ANSI_ARGS_((Tcl_HashSearch * searchPtr)); /* 193 */ + char * (*tcl_Merge) _ANSI_ARGS_((int argc, CONST84 char *CONST *argv)); /* 192 */ + Tcl_HashEntry * (*tcl_NextHashEntry) _ANSI_ARGS_((Tcl_HashSearch *searchPtr)); /* 193 */ void (*tcl_NotifyChannel) _ANSI_ARGS_((Tcl_Channel channel, int mask)); /* 194 */ - Tcl_Obj * (*tcl_ObjGetVar2) _ANSI_ARGS_((Tcl_Interp * interp, Tcl_Obj * part1Ptr, Tcl_Obj * part2Ptr, int flags)); /* 195 */ - Tcl_Obj * (*tcl_ObjSetVar2) _ANSI_ARGS_((Tcl_Interp * interp, Tcl_Obj * part1Ptr, Tcl_Obj * part2Ptr, Tcl_Obj * newValuePtr, int flags)); /* 196 */ -#if !defined(__WIN32__) && !defined(MAC_TCL) /* UNIX */ - Tcl_Channel (*tcl_OpenCommandChannel) _ANSI_ARGS_((Tcl_Interp * interp, int argc, CONST84 char ** argv, int flags)); /* 197 */ -#endif /* UNIX */ -#ifdef __WIN32__ - Tcl_Channel (*tcl_OpenCommandChannel) _ANSI_ARGS_((Tcl_Interp * interp, int argc, CONST84 char ** argv, int flags)); /* 197 */ -#endif /* __WIN32__ */ -#ifdef MAC_TCL - void *reserved197; -#endif /* MAC_TCL */ - Tcl_Channel (*tcl_OpenFileChannel) _ANSI_ARGS_((Tcl_Interp * interp, CONST char * fileName, CONST char * modeString, int permissions)); /* 198 */ - Tcl_Channel (*tcl_OpenTcpClient) _ANSI_ARGS_((Tcl_Interp * interp, int port, CONST char * address, CONST char * myaddr, int myport, int async)); /* 199 */ - Tcl_Channel (*tcl_OpenTcpServer) _ANSI_ARGS_((Tcl_Interp * interp, int port, CONST char * host, Tcl_TcpAcceptProc * acceptProc, ClientData callbackData)); /* 200 */ + Tcl_Obj * (*tcl_ObjGetVar2) _ANSI_ARGS_((Tcl_Interp *interp, Tcl_Obj *part1Ptr, Tcl_Obj *part2Ptr, int flags)); /* 195 */ + Tcl_Obj * (*tcl_ObjSetVar2) _ANSI_ARGS_((Tcl_Interp *interp, Tcl_Obj *part1Ptr, Tcl_Obj *part2Ptr, Tcl_Obj *newValuePtr, int flags)); /* 196 */ + Tcl_Channel (*tcl_OpenCommandChannel) _ANSI_ARGS_((Tcl_Interp *interp, int argc, CONST84 char **argv, int flags)); /* 197 */ + Tcl_Channel (*tcl_OpenFileChannel) _ANSI_ARGS_((Tcl_Interp *interp, CONST char *fileName, CONST char *modeString, int permissions)); /* 198 */ + Tcl_Channel (*tcl_OpenTcpClient) _ANSI_ARGS_((Tcl_Interp *interp, int port, CONST char *address, CONST char *myaddr, int myport, int async)); /* 199 */ + Tcl_Channel (*tcl_OpenTcpServer) _ANSI_ARGS_((Tcl_Interp *interp, int port, CONST char *host, Tcl_TcpAcceptProc *acceptProc, ClientData callbackData)); /* 200 */ void (*tcl_Preserve) _ANSI_ARGS_((ClientData data)); /* 201 */ - void (*tcl_PrintDouble) _ANSI_ARGS_((Tcl_Interp * interp, double value, char * dst)); /* 202 */ - int (*tcl_PutEnv) _ANSI_ARGS_((CONST char * string)); /* 203 */ - CONST84_RETURN char * (*tcl_PosixError) _ANSI_ARGS_((Tcl_Interp * interp)); /* 204 */ - void (*tcl_QueueEvent) _ANSI_ARGS_((Tcl_Event * evPtr, Tcl_QueuePosition position)); /* 205 */ - int (*tcl_Read) _ANSI_ARGS_((Tcl_Channel chan, char * bufPtr, int toRead)); /* 206 */ -#if !defined(__WIN32__) && !defined(MAC_TCL) /* UNIX */ - void (*tcl_ReapDetachedProcs) _ANSI_ARGS_((void)); /* 207 */ -#endif /* UNIX */ -#ifdef __WIN32__ + void (*tcl_PrintDouble) _ANSI_ARGS_((Tcl_Interp *interp, double value, char *dst)); /* 202 */ + int (*tcl_PutEnv) _ANSI_ARGS_((CONST char *assignment)); /* 203 */ + CONST84_RETURN char * (*tcl_PosixError) _ANSI_ARGS_((Tcl_Interp *interp)); /* 204 */ + void (*tcl_QueueEvent) _ANSI_ARGS_((Tcl_Event *evPtr, Tcl_QueuePosition position)); /* 205 */ + int (*tcl_Read) _ANSI_ARGS_((Tcl_Channel chan, char *bufPtr, int toRead)); /* 206 */ void (*tcl_ReapDetachedProcs) _ANSI_ARGS_((void)); /* 207 */ -#endif /* __WIN32__ */ -#ifdef MAC_TCL - void *reserved207; -#endif /* MAC_TCL */ - int (*tcl_RecordAndEval) _ANSI_ARGS_((Tcl_Interp * interp, CONST char * cmd, int flags)); /* 208 */ - int (*tcl_RecordAndEvalObj) _ANSI_ARGS_((Tcl_Interp * interp, Tcl_Obj * cmdPtr, int flags)); /* 209 */ - void (*tcl_RegisterChannel) _ANSI_ARGS_((Tcl_Interp * interp, Tcl_Channel chan)); /* 210 */ - void (*tcl_RegisterObjType) _ANSI_ARGS_((Tcl_ObjType * typePtr)); /* 211 */ - Tcl_RegExp (*tcl_RegExpCompile) _ANSI_ARGS_((Tcl_Interp * interp, CONST char * string)); /* 212 */ - int (*tcl_RegExpExec) _ANSI_ARGS_((Tcl_Interp * interp, Tcl_RegExp regexp, CONST char * str, CONST char * start)); /* 213 */ - int (*tcl_RegExpMatch) _ANSI_ARGS_((Tcl_Interp * interp, CONST char * str, CONST char * pattern)); /* 214 */ - void (*tcl_RegExpRange) _ANSI_ARGS_((Tcl_RegExp regexp, int index, CONST84 char ** startPtr, CONST84 char ** endPtr)); /* 215 */ + int (*tcl_RecordAndEval) _ANSI_ARGS_((Tcl_Interp *interp, CONST char *cmd, int flags)); /* 208 */ + int (*tcl_RecordAndEvalObj) _ANSI_ARGS_((Tcl_Interp *interp, Tcl_Obj *cmdPtr, int flags)); /* 209 */ + void (*tcl_RegisterChannel) _ANSI_ARGS_((Tcl_Interp *interp, Tcl_Channel chan)); /* 210 */ + void (*tcl_RegisterObjType) _ANSI_ARGS_((Tcl_ObjType *typePtr)); /* 211 */ + Tcl_RegExp (*tcl_RegExpCompile) _ANSI_ARGS_((Tcl_Interp *interp, CONST char *pattern)); /* 212 */ + int (*tcl_RegExpExec) _ANSI_ARGS_((Tcl_Interp *interp, Tcl_RegExp regexp, CONST char *text, CONST char *start)); /* 213 */ + int (*tcl_RegExpMatch) _ANSI_ARGS_((Tcl_Interp *interp, CONST char *text, CONST char *pattern)); /* 214 */ + void (*tcl_RegExpRange) _ANSI_ARGS_((Tcl_RegExp regexp, int index, CONST84 char **startPtr, CONST84 char **endPtr)); /* 215 */ void (*tcl_Release) _ANSI_ARGS_((ClientData clientData)); /* 216 */ - void (*tcl_ResetResult) _ANSI_ARGS_((Tcl_Interp * interp)); /* 217 */ - int (*tcl_ScanElement) _ANSI_ARGS_((CONST char * str, int * flagPtr)); /* 218 */ - int (*tcl_ScanCountedElement) _ANSI_ARGS_((CONST char * str, int length, int * flagPtr)); /* 219 */ + void (*tcl_ResetResult) _ANSI_ARGS_((Tcl_Interp *interp)); /* 217 */ + int (*tcl_ScanElement) _ANSI_ARGS_((CONST char *src, int *flagPtr)); /* 218 */ + int (*tcl_ScanCountedElement) _ANSI_ARGS_((CONST char *src, int length, int *flagPtr)); /* 219 */ int (*tcl_SeekOld) _ANSI_ARGS_((Tcl_Channel chan, int offset, int mode)); /* 220 */ int (*tcl_ServiceAll) _ANSI_ARGS_((void)); /* 221 */ int (*tcl_ServiceEvent) _ANSI_ARGS_((int flags)); /* 222 */ - void (*tcl_SetAssocData) _ANSI_ARGS_((Tcl_Interp * interp, CONST char * name, Tcl_InterpDeleteProc * proc, ClientData clientData)); /* 223 */ + void (*tcl_SetAssocData) _ANSI_ARGS_((Tcl_Interp *interp, CONST char *name, Tcl_InterpDeleteProc *proc, ClientData clientData)); /* 223 */ void (*tcl_SetChannelBufferSize) _ANSI_ARGS_((Tcl_Channel chan, int sz)); /* 224 */ - int (*tcl_SetChannelOption) _ANSI_ARGS_((Tcl_Interp * interp, Tcl_Channel chan, CONST char * optionName, CONST char * newValue)); /* 225 */ - int (*tcl_SetCommandInfo) _ANSI_ARGS_((Tcl_Interp * interp, CONST char * cmdName, CONST Tcl_CmdInfo * infoPtr)); /* 226 */ + int (*tcl_SetChannelOption) _ANSI_ARGS_((Tcl_Interp *interp, Tcl_Channel chan, CONST char *optionName, CONST char *newValue)); /* 225 */ + int (*tcl_SetCommandInfo) _ANSI_ARGS_((Tcl_Interp *interp, CONST char *cmdName, CONST Tcl_CmdInfo *infoPtr)); /* 226 */ void (*tcl_SetErrno) _ANSI_ARGS_((int err)); /* 227 */ - void (*tcl_SetErrorCode) _ANSI_ARGS_(TCL_VARARGS(Tcl_Interp *,interp)); /* 228 */ - void (*tcl_SetMaxBlockTime) _ANSI_ARGS_((Tcl_Time * timePtr)); /* 229 */ - void (*tcl_SetPanicProc) _ANSI_ARGS_((Tcl_PanicProc * panicProc)); /* 230 */ - int (*tcl_SetRecursionLimit) _ANSI_ARGS_((Tcl_Interp * interp, int depth)); /* 231 */ - void (*tcl_SetResult) _ANSI_ARGS_((Tcl_Interp * interp, char * str, Tcl_FreeProc * freeProc)); /* 232 */ + void (*tcl_SetErrorCode) _ANSI_ARGS_((Tcl_Interp *interp, ...)); /* 228 */ + void (*tcl_SetMaxBlockTime) _ANSI_ARGS_((Tcl_Time *timePtr)); /* 229 */ + void (*tcl_SetPanicProc) _ANSI_ARGS_((Tcl_PanicProc *panicProc)); /* 230 */ + int (*tcl_SetRecursionLimit) _ANSI_ARGS_((Tcl_Interp *interp, int depth)); /* 231 */ + void (*tcl_SetResult) _ANSI_ARGS_((Tcl_Interp *interp, char *result, Tcl_FreeProc *freeProc)); /* 232 */ int (*tcl_SetServiceMode) _ANSI_ARGS_((int mode)); /* 233 */ - void (*tcl_SetObjErrorCode) _ANSI_ARGS_((Tcl_Interp * interp, Tcl_Obj * errorObjPtr)); /* 234 */ - void (*tcl_SetObjResult) _ANSI_ARGS_((Tcl_Interp * interp, Tcl_Obj * resultObjPtr)); /* 235 */ + void (*tcl_SetObjErrorCode) _ANSI_ARGS_((Tcl_Interp *interp, Tcl_Obj *errorObjPtr)); /* 234 */ + void (*tcl_SetObjResult) _ANSI_ARGS_((Tcl_Interp *interp, Tcl_Obj *resultObjPtr)); /* 235 */ void (*tcl_SetStdChannel) _ANSI_ARGS_((Tcl_Channel channel, int type)); /* 236 */ - CONST84_RETURN char * (*tcl_SetVar) _ANSI_ARGS_((Tcl_Interp * interp, CONST char * varName, CONST char * newValue, int flags)); /* 237 */ - CONST84_RETURN char * (*tcl_SetVar2) _ANSI_ARGS_((Tcl_Interp * interp, CONST char * part1, CONST char * part2, CONST char * newValue, int flags)); /* 238 */ + CONST84_RETURN char * (*tcl_SetVar) _ANSI_ARGS_((Tcl_Interp *interp, CONST char *varName, CONST char *newValue, int flags)); /* 237 */ + CONST84_RETURN char * (*tcl_SetVar2) _ANSI_ARGS_((Tcl_Interp *interp, CONST char *part1, CONST char *part2, CONST char *newValue, int flags)); /* 238 */ CONST84_RETURN char * (*tcl_SignalId) _ANSI_ARGS_((int sig)); /* 239 */ CONST84_RETURN char * (*tcl_SignalMsg) _ANSI_ARGS_((int sig)); /* 240 */ - void (*tcl_SourceRCFile) _ANSI_ARGS_((Tcl_Interp * interp)); /* 241 */ - int (*tcl_SplitList) _ANSI_ARGS_((Tcl_Interp * interp, CONST char * listStr, int * argcPtr, CONST84 char *** argvPtr)); /* 242 */ - void (*tcl_SplitPath) _ANSI_ARGS_((CONST char * path, int * argcPtr, CONST84 char *** argvPtr)); /* 243 */ - void (*tcl_StaticPackage) _ANSI_ARGS_((Tcl_Interp * interp, CONST char * pkgName, Tcl_PackageInitProc * initProc, Tcl_PackageInitProc * safeInitProc)); /* 244 */ - int (*tcl_StringMatch) _ANSI_ARGS_((CONST char * str, CONST char * pattern)); /* 245 */ + void (*tcl_SourceRCFile) _ANSI_ARGS_((Tcl_Interp *interp)); /* 241 */ + int (*tcl_SplitList) _ANSI_ARGS_((Tcl_Interp *interp, CONST char *listStr, int *argcPtr, CONST84 char ***argvPtr)); /* 242 */ + void (*tcl_SplitPath) _ANSI_ARGS_((CONST char *path, int *argcPtr, CONST84 char ***argvPtr)); /* 243 */ + void (*tcl_StaticPackage) _ANSI_ARGS_((Tcl_Interp *interp, CONST char *pkgName, Tcl_PackageInitProc *initProc, Tcl_PackageInitProc *safeInitProc)); /* 244 */ + int (*tcl_StringMatch) _ANSI_ARGS_((CONST char *str, CONST char *pattern)); /* 245 */ int (*tcl_TellOld) _ANSI_ARGS_((Tcl_Channel chan)); /* 246 */ - int (*tcl_TraceVar) _ANSI_ARGS_((Tcl_Interp * interp, CONST char * varName, int flags, Tcl_VarTraceProc * proc, ClientData clientData)); /* 247 */ - int (*tcl_TraceVar2) _ANSI_ARGS_((Tcl_Interp * interp, CONST char * part1, CONST char * part2, int flags, Tcl_VarTraceProc * proc, ClientData clientData)); /* 248 */ - char * (*tcl_TranslateFileName) _ANSI_ARGS_((Tcl_Interp * interp, CONST char * name, Tcl_DString * bufferPtr)); /* 249 */ - int (*tcl_Ungets) _ANSI_ARGS_((Tcl_Channel chan, CONST char * str, int len, int atHead)); /* 250 */ - void (*tcl_UnlinkVar) _ANSI_ARGS_((Tcl_Interp * interp, CONST char * varName)); /* 251 */ - int (*tcl_UnregisterChannel) _ANSI_ARGS_((Tcl_Interp * interp, Tcl_Channel chan)); /* 252 */ - int (*tcl_UnsetVar) _ANSI_ARGS_((Tcl_Interp * interp, CONST char * varName, int flags)); /* 253 */ - int (*tcl_UnsetVar2) _ANSI_ARGS_((Tcl_Interp * interp, CONST char * part1, CONST char * part2, int flags)); /* 254 */ - void (*tcl_UntraceVar) _ANSI_ARGS_((Tcl_Interp * interp, CONST char * varName, int flags, Tcl_VarTraceProc * proc, ClientData clientData)); /* 255 */ - void (*tcl_UntraceVar2) _ANSI_ARGS_((Tcl_Interp * interp, CONST char * part1, CONST char * part2, int flags, Tcl_VarTraceProc * proc, ClientData clientData)); /* 256 */ - void (*tcl_UpdateLinkedVar) _ANSI_ARGS_((Tcl_Interp * interp, CONST char * varName)); /* 257 */ - int (*tcl_UpVar) _ANSI_ARGS_((Tcl_Interp * interp, CONST char * frameName, CONST char * varName, CONST char * localName, int flags)); /* 258 */ - int (*tcl_UpVar2) _ANSI_ARGS_((Tcl_Interp * interp, CONST char * frameName, CONST char * part1, CONST char * part2, CONST char * localName, int flags)); /* 259 */ - int (*tcl_VarEval) _ANSI_ARGS_(TCL_VARARGS(Tcl_Interp *,interp)); /* 260 */ - ClientData (*tcl_VarTraceInfo) _ANSI_ARGS_((Tcl_Interp * interp, CONST char * varName, int flags, Tcl_VarTraceProc * procPtr, ClientData prevClientData)); /* 261 */ - ClientData (*tcl_VarTraceInfo2) _ANSI_ARGS_((Tcl_Interp * interp, CONST char * part1, CONST char * part2, int flags, Tcl_VarTraceProc * procPtr, ClientData prevClientData)); /* 262 */ - int (*tcl_Write) _ANSI_ARGS_((Tcl_Channel chan, CONST char * s, int slen)); /* 263 */ - void (*tcl_WrongNumArgs) _ANSI_ARGS_((Tcl_Interp * interp, int objc, Tcl_Obj *CONST objv[], CONST char * message)); /* 264 */ - int (*tcl_DumpActiveMemory) _ANSI_ARGS_((CONST char * fileName)); /* 265 */ - void (*tcl_ValidateAllMemory) _ANSI_ARGS_((CONST char * file, int line)); /* 266 */ - void (*tcl_AppendResultVA) _ANSI_ARGS_((Tcl_Interp * interp, va_list argList)); /* 267 */ - void (*tcl_AppendStringsToObjVA) _ANSI_ARGS_((Tcl_Obj * objPtr, va_list argList)); /* 268 */ - CONST84_RETURN char * (*tcl_HashStats) _ANSI_ARGS_((Tcl_HashTable * tablePtr)); /* 269 */ - CONST84_RETURN char * (*tcl_ParseVar) _ANSI_ARGS_((Tcl_Interp * interp, CONST char * str, CONST84 char ** termPtr)); /* 270 */ - CONST84_RETURN char * (*tcl_PkgPresent) _ANSI_ARGS_((Tcl_Interp * interp, CONST char * name, CONST char * version, int exact)); /* 271 */ - CONST84_RETURN char * (*tcl_PkgPresentEx) _ANSI_ARGS_((Tcl_Interp * interp, CONST char * name, CONST char * version, int exact, ClientData * clientDataPtr)); /* 272 */ - int (*tcl_PkgProvide) _ANSI_ARGS_((Tcl_Interp * interp, CONST char * name, CONST char * version)); /* 273 */ - CONST84_RETURN char * (*tcl_PkgRequire) _ANSI_ARGS_((Tcl_Interp * interp, CONST char * name, CONST char * version, int exact)); /* 274 */ - void (*tcl_SetErrorCodeVA) _ANSI_ARGS_((Tcl_Interp * interp, va_list argList)); /* 275 */ - int (*tcl_VarEvalVA) _ANSI_ARGS_((Tcl_Interp * interp, va_list argList)); /* 276 */ - Tcl_Pid (*tcl_WaitPid) _ANSI_ARGS_((Tcl_Pid pid, int * statPtr, int options)); /* 277 */ - void (*tcl_PanicVA) _ANSI_ARGS_((CONST char * format, va_list argList)); /* 278 */ - void (*tcl_GetVersion) _ANSI_ARGS_((int * major, int * minor, int * patchLevel, int * type)); /* 279 */ - void (*tcl_InitMemory) _ANSI_ARGS_((Tcl_Interp * interp)); /* 280 */ - Tcl_Channel (*tcl_StackChannel) _ANSI_ARGS_((Tcl_Interp * interp, Tcl_ChannelType * typePtr, ClientData instanceData, int mask, Tcl_Channel prevChan)); /* 281 */ - int (*tcl_UnstackChannel) _ANSI_ARGS_((Tcl_Interp * interp, Tcl_Channel chan)); /* 282 */ + int (*tcl_TraceVar) _ANSI_ARGS_((Tcl_Interp *interp, CONST char *varName, int flags, Tcl_VarTraceProc *proc, ClientData clientData)); /* 247 */ + int (*tcl_TraceVar2) _ANSI_ARGS_((Tcl_Interp *interp, CONST char *part1, CONST char *part2, int flags, Tcl_VarTraceProc *proc, ClientData clientData)); /* 248 */ + char * (*tcl_TranslateFileName) _ANSI_ARGS_((Tcl_Interp *interp, CONST char *name, Tcl_DString *bufferPtr)); /* 249 */ + int (*tcl_Ungets) _ANSI_ARGS_((Tcl_Channel chan, CONST char *str, int len, int atHead)); /* 250 */ + void (*tcl_UnlinkVar) _ANSI_ARGS_((Tcl_Interp *interp, CONST char *varName)); /* 251 */ + int (*tcl_UnregisterChannel) _ANSI_ARGS_((Tcl_Interp *interp, Tcl_Channel chan)); /* 252 */ + int (*tcl_UnsetVar) _ANSI_ARGS_((Tcl_Interp *interp, CONST char *varName, int flags)); /* 253 */ + int (*tcl_UnsetVar2) _ANSI_ARGS_((Tcl_Interp *interp, CONST char *part1, CONST char *part2, int flags)); /* 254 */ + void (*tcl_UntraceVar) _ANSI_ARGS_((Tcl_Interp *interp, CONST char *varName, int flags, Tcl_VarTraceProc *proc, ClientData clientData)); /* 255 */ + void (*tcl_UntraceVar2) _ANSI_ARGS_((Tcl_Interp *interp, CONST char *part1, CONST char *part2, int flags, Tcl_VarTraceProc *proc, ClientData clientData)); /* 256 */ + void (*tcl_UpdateLinkedVar) _ANSI_ARGS_((Tcl_Interp *interp, CONST char *varName)); /* 257 */ + int (*tcl_UpVar) _ANSI_ARGS_((Tcl_Interp *interp, CONST char *frameName, CONST char *varName, CONST char *localName, int flags)); /* 258 */ + int (*tcl_UpVar2) _ANSI_ARGS_((Tcl_Interp *interp, CONST char *frameName, CONST char *part1, CONST char *part2, CONST char *localName, int flags)); /* 259 */ + int (*tcl_VarEval) _ANSI_ARGS_((Tcl_Interp *interp, ...)); /* 260 */ + ClientData (*tcl_VarTraceInfo) _ANSI_ARGS_((Tcl_Interp *interp, CONST char *varName, int flags, Tcl_VarTraceProc *procPtr, ClientData prevClientData)); /* 261 */ + ClientData (*tcl_VarTraceInfo2) _ANSI_ARGS_((Tcl_Interp *interp, CONST char *part1, CONST char *part2, int flags, Tcl_VarTraceProc *procPtr, ClientData prevClientData)); /* 262 */ + int (*tcl_Write) _ANSI_ARGS_((Tcl_Channel chan, CONST char *s, int slen)); /* 263 */ + void (*tcl_WrongNumArgs) _ANSI_ARGS_((Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[], CONST char *message)); /* 264 */ + int (*tcl_DumpActiveMemory) _ANSI_ARGS_((CONST char *fileName)); /* 265 */ + void (*tcl_ValidateAllMemory) _ANSI_ARGS_((CONST char *file, int line)); /* 266 */ + void (*tcl_AppendResultVA) _ANSI_ARGS_((Tcl_Interp *interp, va_list argList)); /* 267 */ + void (*tcl_AppendStringsToObjVA) _ANSI_ARGS_((Tcl_Obj *objPtr, va_list argList)); /* 268 */ + char * (*tcl_HashStats) _ANSI_ARGS_((Tcl_HashTable *tablePtr)); /* 269 */ + CONST84_RETURN char * (*tcl_ParseVar) _ANSI_ARGS_((Tcl_Interp *interp, CONST char *start, CONST84 char **termPtr)); /* 270 */ + CONST84_RETURN char * (*tcl_PkgPresent) _ANSI_ARGS_((Tcl_Interp *interp, CONST char *name, CONST char *version, int exact)); /* 271 */ + CONST84_RETURN char * (*tcl_PkgPresentEx) _ANSI_ARGS_((Tcl_Interp *interp, CONST char *name, CONST char *version, int exact, ClientData *clientDataPtr)); /* 272 */ + int (*tcl_PkgProvide) _ANSI_ARGS_((Tcl_Interp *interp, CONST char *name, CONST char *version)); /* 273 */ + CONST84_RETURN char * (*tcl_PkgRequire) _ANSI_ARGS_((Tcl_Interp *interp, CONST char *name, CONST char *version, int exact)); /* 274 */ + void (*tcl_SetErrorCodeVA) _ANSI_ARGS_((Tcl_Interp *interp, va_list argList)); /* 275 */ + int (*tcl_VarEvalVA) _ANSI_ARGS_((Tcl_Interp *interp, va_list argList)); /* 276 */ + Tcl_Pid (*tcl_WaitPid) _ANSI_ARGS_((Tcl_Pid pid, int *statPtr, int options)); /* 277 */ + void (*tcl_PanicVA) _ANSI_ARGS_((CONST char *format, va_list argList)); /* 278 */ + void (*tcl_GetVersion) _ANSI_ARGS_((int *major, int *minor, int *patchLevel, int *type)); /* 279 */ + void (*tcl_InitMemory) _ANSI_ARGS_((Tcl_Interp *interp)); /* 280 */ + Tcl_Channel (*tcl_StackChannel) _ANSI_ARGS_((Tcl_Interp *interp, Tcl_ChannelType *typePtr, ClientData instanceData, int mask, Tcl_Channel prevChan)); /* 281 */ + int (*tcl_UnstackChannel) _ANSI_ARGS_((Tcl_Interp *interp, Tcl_Channel chan)); /* 282 */ Tcl_Channel (*tcl_GetStackedChannel) _ANSI_ARGS_((Tcl_Channel chan)); /* 283 */ - void (*tcl_SetMainLoop) _ANSI_ARGS_((Tcl_MainLoopProc * proc)); /* 284 */ - void *reserved285; - void (*tcl_AppendObjToObj) _ANSI_ARGS_((Tcl_Obj * objPtr, Tcl_Obj * appendObjPtr)); /* 286 */ - Tcl_Encoding (*tcl_CreateEncoding) _ANSI_ARGS_((Tcl_EncodingType * typePtr)); /* 287 */ - void (*tcl_CreateThreadExitHandler) _ANSI_ARGS_((Tcl_ExitProc * proc, ClientData clientData)); /* 288 */ - void (*tcl_DeleteThreadExitHandler) _ANSI_ARGS_((Tcl_ExitProc * proc, ClientData clientData)); /* 289 */ - void (*tcl_DiscardResult) _ANSI_ARGS_((Tcl_SavedResult * statePtr)); /* 290 */ - int (*tcl_EvalEx) _ANSI_ARGS_((Tcl_Interp * interp, CONST char * script, int numBytes, int flags)); /* 291 */ - int (*tcl_EvalObjv) _ANSI_ARGS_((Tcl_Interp * interp, int objc, Tcl_Obj *CONST objv[], int flags)); /* 292 */ - int (*tcl_EvalObjEx) _ANSI_ARGS_((Tcl_Interp * interp, Tcl_Obj * objPtr, int flags)); /* 293 */ + void (*tcl_SetMainLoop) _ANSI_ARGS_((Tcl_MainLoopProc *proc)); /* 284 */ + VOID *reserved285; + void (*tcl_AppendObjToObj) _ANSI_ARGS_((Tcl_Obj *objPtr, Tcl_Obj *appendObjPtr)); /* 286 */ + Tcl_Encoding (*tcl_CreateEncoding) _ANSI_ARGS_((Tcl_EncodingType *typePtr)); /* 287 */ + void (*tcl_CreateThreadExitHandler) _ANSI_ARGS_((Tcl_ExitProc *proc, ClientData clientData)); /* 288 */ + void (*tcl_DeleteThreadExitHandler) _ANSI_ARGS_((Tcl_ExitProc *proc, ClientData clientData)); /* 289 */ + void (*tcl_DiscardResult) _ANSI_ARGS_((Tcl_SavedResult *statePtr)); /* 290 */ + int (*tcl_EvalEx) _ANSI_ARGS_((Tcl_Interp *interp, CONST char *script, int numBytes, int flags)); /* 291 */ + int (*tcl_EvalObjv) _ANSI_ARGS_((Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[], int flags)); /* 292 */ + int (*tcl_EvalObjEx) _ANSI_ARGS_((Tcl_Interp *interp, Tcl_Obj *objPtr, int flags)); /* 293 */ void (*tcl_ExitThread) _ANSI_ARGS_((int status)); /* 294 */ - int (*tcl_ExternalToUtf) _ANSI_ARGS_((Tcl_Interp * interp, Tcl_Encoding encoding, CONST char * src, int srcLen, int flags, Tcl_EncodingState * statePtr, char * dst, int dstLen, int * srcReadPtr, int * dstWrotePtr, int * dstCharsPtr)); /* 295 */ - char * (*tcl_ExternalToUtfDString) _ANSI_ARGS_((Tcl_Encoding encoding, CONST char * src, int srcLen, Tcl_DString * dsPtr)); /* 296 */ + int (*tcl_ExternalToUtf) _ANSI_ARGS_((Tcl_Interp *interp, Tcl_Encoding encoding, CONST char *src, int srcLen, int flags, Tcl_EncodingState *statePtr, char *dst, int dstLen, int *srcReadPtr, int *dstWrotePtr, int *dstCharsPtr)); /* 295 */ + char * (*tcl_ExternalToUtfDString) _ANSI_ARGS_((Tcl_Encoding encoding, CONST char *src, int srcLen, Tcl_DString *dsPtr)); /* 296 */ void (*tcl_FinalizeThread) _ANSI_ARGS_((void)); /* 297 */ void (*tcl_FinalizeNotifier) _ANSI_ARGS_((ClientData clientData)); /* 298 */ void (*tcl_FreeEncoding) _ANSI_ARGS_((Tcl_Encoding encoding)); /* 299 */ Tcl_ThreadId (*tcl_GetCurrentThread) _ANSI_ARGS_((void)); /* 300 */ - Tcl_Encoding (*tcl_GetEncoding) _ANSI_ARGS_((Tcl_Interp * interp, CONST char * name)); /* 301 */ + Tcl_Encoding (*tcl_GetEncoding) _ANSI_ARGS_((Tcl_Interp *interp, CONST char *name)); /* 301 */ CONST84_RETURN char * (*tcl_GetEncodingName) _ANSI_ARGS_((Tcl_Encoding encoding)); /* 302 */ - void (*tcl_GetEncodingNames) _ANSI_ARGS_((Tcl_Interp * interp)); /* 303 */ - int (*tcl_GetIndexFromObjStruct) _ANSI_ARGS_((Tcl_Interp * interp, Tcl_Obj * objPtr, CONST VOID * tablePtr, int offset, CONST char * msg, int flags, int * indexPtr)); /* 304 */ - VOID * (*tcl_GetThreadData) _ANSI_ARGS_((Tcl_ThreadDataKey * keyPtr, int size)); /* 305 */ - Tcl_Obj * (*tcl_GetVar2Ex) _ANSI_ARGS_((Tcl_Interp * interp, CONST char * part1, CONST char * part2, int flags)); /* 306 */ + void (*tcl_GetEncodingNames) _ANSI_ARGS_((Tcl_Interp *interp)); /* 303 */ + int (*tcl_GetIndexFromObjStruct) _ANSI_ARGS_((Tcl_Interp *interp, Tcl_Obj *objPtr, CONST VOID *tablePtr, int offset, CONST char *msg, int flags, int *indexPtr)); /* 304 */ + VOID * (*tcl_GetThreadData) _ANSI_ARGS_((Tcl_ThreadDataKey *keyPtr, int size)); /* 305 */ + Tcl_Obj * (*tcl_GetVar2Ex) _ANSI_ARGS_((Tcl_Interp *interp, CONST char *part1, CONST char *part2, int flags)); /* 306 */ ClientData (*tcl_InitNotifier) _ANSI_ARGS_((void)); /* 307 */ - void (*tcl_MutexLock) _ANSI_ARGS_((Tcl_Mutex * mutexPtr)); /* 308 */ - void (*tcl_MutexUnlock) _ANSI_ARGS_((Tcl_Mutex * mutexPtr)); /* 309 */ - void (*tcl_ConditionNotify) _ANSI_ARGS_((Tcl_Condition * condPtr)); /* 310 */ - void (*tcl_ConditionWait) _ANSI_ARGS_((Tcl_Condition * condPtr, Tcl_Mutex * mutexPtr, Tcl_Time * timePtr)); /* 311 */ - int (*tcl_NumUtfChars) _ANSI_ARGS_((CONST char * src, int len)); /* 312 */ - int (*tcl_ReadChars) _ANSI_ARGS_((Tcl_Channel channel, Tcl_Obj * objPtr, int charsToRead, int appendFlag)); /* 313 */ - void (*tcl_RestoreResult) _ANSI_ARGS_((Tcl_Interp * interp, Tcl_SavedResult * statePtr)); /* 314 */ - void (*tcl_SaveResult) _ANSI_ARGS_((Tcl_Interp * interp, Tcl_SavedResult * statePtr)); /* 315 */ - int (*tcl_SetSystemEncoding) _ANSI_ARGS_((Tcl_Interp * interp, CONST char * name)); /* 316 */ - Tcl_Obj * (*tcl_SetVar2Ex) _ANSI_ARGS_((Tcl_Interp * interp, CONST char * part1, CONST char * part2, Tcl_Obj * newValuePtr, int flags)); /* 317 */ + void (*tcl_MutexLock) _ANSI_ARGS_((Tcl_Mutex *mutexPtr)); /* 308 */ + void (*tcl_MutexUnlock) _ANSI_ARGS_((Tcl_Mutex *mutexPtr)); /* 309 */ + void (*tcl_ConditionNotify) _ANSI_ARGS_((Tcl_Condition *condPtr)); /* 310 */ + void (*tcl_ConditionWait) _ANSI_ARGS_((Tcl_Condition *condPtr, Tcl_Mutex *mutexPtr, Tcl_Time *timePtr)); /* 311 */ + int (*tcl_NumUtfChars) _ANSI_ARGS_((CONST char *src, int length)); /* 312 */ + int (*tcl_ReadChars) _ANSI_ARGS_((Tcl_Channel channel, Tcl_Obj *objPtr, int charsToRead, int appendFlag)); /* 313 */ + void (*tcl_RestoreResult) _ANSI_ARGS_((Tcl_Interp *interp, Tcl_SavedResult *statePtr)); /* 314 */ + void (*tcl_SaveResult) _ANSI_ARGS_((Tcl_Interp *interp, Tcl_SavedResult *statePtr)); /* 315 */ + int (*tcl_SetSystemEncoding) _ANSI_ARGS_((Tcl_Interp *interp, CONST char *name)); /* 316 */ + Tcl_Obj * (*tcl_SetVar2Ex) _ANSI_ARGS_((Tcl_Interp *interp, CONST char *part1, CONST char *part2, Tcl_Obj *newValuePtr, int flags)); /* 317 */ void (*tcl_ThreadAlert) _ANSI_ARGS_((Tcl_ThreadId threadId)); /* 318 */ - void (*tcl_ThreadQueueEvent) _ANSI_ARGS_((Tcl_ThreadId threadId, Tcl_Event* evPtr, Tcl_QueuePosition position)); /* 319 */ - Tcl_UniChar (*tcl_UniCharAtIndex) _ANSI_ARGS_((CONST char * src, int index)); /* 320 */ + void (*tcl_ThreadQueueEvent) _ANSI_ARGS_((Tcl_ThreadId threadId, Tcl_Event *evPtr, Tcl_QueuePosition position)); /* 319 */ + Tcl_UniChar (*tcl_UniCharAtIndex) _ANSI_ARGS_((CONST char *src, int index)); /* 320 */ Tcl_UniChar (*tcl_UniCharToLower) _ANSI_ARGS_((int ch)); /* 321 */ Tcl_UniChar (*tcl_UniCharToTitle) _ANSI_ARGS_((int ch)); /* 322 */ Tcl_UniChar (*tcl_UniCharToUpper) _ANSI_ARGS_((int ch)); /* 323 */ - int (*tcl_UniCharToUtf) _ANSI_ARGS_((int ch, char * buf)); /* 324 */ - CONST84_RETURN char * (*tcl_UtfAtIndex) _ANSI_ARGS_((CONST char * src, int index)); /* 325 */ - int (*tcl_UtfCharComplete) _ANSI_ARGS_((CONST char * src, int len)); /* 326 */ - int (*tcl_UtfBackslash) _ANSI_ARGS_((CONST char * src, int * readPtr, char * dst)); /* 327 */ - CONST84_RETURN char * (*tcl_UtfFindFirst) _ANSI_ARGS_((CONST char * src, int ch)); /* 328 */ - CONST84_RETURN char * (*tcl_UtfFindLast) _ANSI_ARGS_((CONST char * src, int ch)); /* 329 */ - CONST84_RETURN char * (*tcl_UtfNext) _ANSI_ARGS_((CONST char * src)); /* 330 */ - CONST84_RETURN char * (*tcl_UtfPrev) _ANSI_ARGS_((CONST char * src, CONST char * start)); /* 331 */ - int (*tcl_UtfToExternal) _ANSI_ARGS_((Tcl_Interp * interp, Tcl_Encoding encoding, CONST char * src, int srcLen, int flags, Tcl_EncodingState * statePtr, char * dst, int dstLen, int * srcReadPtr, int * dstWrotePtr, int * dstCharsPtr)); /* 332 */ - char * (*tcl_UtfToExternalDString) _ANSI_ARGS_((Tcl_Encoding encoding, CONST char * src, int srcLen, Tcl_DString * dsPtr)); /* 333 */ - int (*tcl_UtfToLower) _ANSI_ARGS_((char * src)); /* 334 */ - int (*tcl_UtfToTitle) _ANSI_ARGS_((char * src)); /* 335 */ - int (*tcl_UtfToUniChar) _ANSI_ARGS_((CONST char * src, Tcl_UniChar * chPtr)); /* 336 */ - int (*tcl_UtfToUpper) _ANSI_ARGS_((char * src)); /* 337 */ - int (*tcl_WriteChars) _ANSI_ARGS_((Tcl_Channel chan, CONST char * src, int srcLen)); /* 338 */ - int (*tcl_WriteObj) _ANSI_ARGS_((Tcl_Channel chan, Tcl_Obj * objPtr)); /* 339 */ - char * (*tcl_GetString) _ANSI_ARGS_((Tcl_Obj * objPtr)); /* 340 */ + int (*tcl_UniCharToUtf) _ANSI_ARGS_((int ch, char *buf)); /* 324 */ + CONST84_RETURN char * (*tcl_UtfAtIndex) _ANSI_ARGS_((CONST char *src, int index)); /* 325 */ + int (*tcl_UtfCharComplete) _ANSI_ARGS_((CONST char *src, int length)); /* 326 */ + int (*tcl_UtfBackslash) _ANSI_ARGS_((CONST char *src, int *readPtr, char *dst)); /* 327 */ + CONST84_RETURN char * (*tcl_UtfFindFirst) _ANSI_ARGS_((CONST char *src, int ch)); /* 328 */ + CONST84_RETURN char * (*tcl_UtfFindLast) _ANSI_ARGS_((CONST char *src, int ch)); /* 329 */ + CONST84_RETURN char * (*tcl_UtfNext) _ANSI_ARGS_((CONST char *src)); /* 330 */ + CONST84_RETURN char * (*tcl_UtfPrev) _ANSI_ARGS_((CONST char *src, CONST char *start)); /* 331 */ + int (*tcl_UtfToExternal) _ANSI_ARGS_((Tcl_Interp *interp, Tcl_Encoding encoding, CONST char *src, int srcLen, int flags, Tcl_EncodingState *statePtr, char *dst, int dstLen, int *srcReadPtr, int *dstWrotePtr, int *dstCharsPtr)); /* 332 */ + char * (*tcl_UtfToExternalDString) _ANSI_ARGS_((Tcl_Encoding encoding, CONST char *src, int srcLen, Tcl_DString *dsPtr)); /* 333 */ + int (*tcl_UtfToLower) _ANSI_ARGS_((char *src)); /* 334 */ + int (*tcl_UtfToTitle) _ANSI_ARGS_((char *src)); /* 335 */ + int (*tcl_UtfToUniChar) _ANSI_ARGS_((CONST char *src, Tcl_UniChar *chPtr)); /* 336 */ + int (*tcl_UtfToUpper) _ANSI_ARGS_((char *src)); /* 337 */ + int (*tcl_WriteChars) _ANSI_ARGS_((Tcl_Channel chan, CONST char *src, int srcLen)); /* 338 */ + int (*tcl_WriteObj) _ANSI_ARGS_((Tcl_Channel chan, Tcl_Obj *objPtr)); /* 339 */ + char * (*tcl_GetString) _ANSI_ARGS_((Tcl_Obj *objPtr)); /* 340 */ CONST84_RETURN char * (*tcl_GetDefaultEncodingDir) _ANSI_ARGS_((void)); /* 341 */ - void (*tcl_SetDefaultEncodingDir) _ANSI_ARGS_((CONST char * path)); /* 342 */ + void (*tcl_SetDefaultEncodingDir) _ANSI_ARGS_((CONST char *path)); /* 342 */ void (*tcl_AlertNotifier) _ANSI_ARGS_((ClientData clientData)); /* 343 */ void (*tcl_ServiceModeHook) _ANSI_ARGS_((int mode)); /* 344 */ int (*tcl_UniCharIsAlnum) _ANSI_ARGS_((int ch)); /* 345 */ @@ -2061,234 +2074,291 @@ int (*tcl_UniCharIsSpace) _ANSI_ARGS_((int ch)); /* 349 */ int (*tcl_UniCharIsUpper) _ANSI_ARGS_((int ch)); /* 350 */ int (*tcl_UniCharIsWordChar) _ANSI_ARGS_((int ch)); /* 351 */ - int (*tcl_UniCharLen) _ANSI_ARGS_((CONST Tcl_UniChar * str)); /* 352 */ - int (*tcl_UniCharNcmp) _ANSI_ARGS_((CONST Tcl_UniChar * cs, CONST Tcl_UniChar * ct, unsigned long n)); /* 353 */ - char * (*tcl_UniCharToUtfDString) _ANSI_ARGS_((CONST Tcl_UniChar * string, int numChars, Tcl_DString * dsPtr)); /* 354 */ - Tcl_UniChar * (*tcl_UtfToUniCharDString) _ANSI_ARGS_((CONST char * string, int length, Tcl_DString * dsPtr)); /* 355 */ - Tcl_RegExp (*tcl_GetRegExpFromObj) _ANSI_ARGS_((Tcl_Interp * interp, Tcl_Obj * patObj, int flags)); /* 356 */ - Tcl_Obj * (*tcl_EvalTokens) _ANSI_ARGS_((Tcl_Interp * interp, Tcl_Token * tokenPtr, int count)); /* 357 */ - void (*tcl_FreeParse) _ANSI_ARGS_((Tcl_Parse * parsePtr)); /* 358 */ - void (*tcl_LogCommandInfo) _ANSI_ARGS_((Tcl_Interp * interp, CONST char * script, CONST char * command, int length)); /* 359 */ - int (*tcl_ParseBraces) _ANSI_ARGS_((Tcl_Interp * interp, CONST char * string, int numBytes, Tcl_Parse * parsePtr, int append, CONST84 char ** termPtr)); /* 360 */ - int (*tcl_ParseCommand) _ANSI_ARGS_((Tcl_Interp * interp, CONST char * string, int numBytes, int nested, Tcl_Parse * parsePtr)); /* 361 */ - int (*tcl_ParseExpr) _ANSI_ARGS_((Tcl_Interp * interp, CONST char * string, int numBytes, Tcl_Parse * parsePtr)); /* 362 */ - int (*tcl_ParseQuotedString) _ANSI_ARGS_((Tcl_Interp * interp, CONST char * string, int numBytes, Tcl_Parse * parsePtr, int append, CONST84 char ** termPtr)); /* 363 */ - int (*tcl_ParseVarName) _ANSI_ARGS_((Tcl_Interp * interp, CONST char * string, int numBytes, Tcl_Parse * parsePtr, int append)); /* 364 */ - char * (*tcl_GetCwd) _ANSI_ARGS_((Tcl_Interp * interp, Tcl_DString * cwdPtr)); /* 365 */ - int (*tcl_Chdir) _ANSI_ARGS_((CONST char * dirName)); /* 366 */ - int (*tcl_Access) _ANSI_ARGS_((CONST char * path, int mode)); /* 367 */ - int (*tcl_Stat) _ANSI_ARGS_((CONST char * path, struct stat * bufPtr)); /* 368 */ - int (*tcl_UtfNcmp) _ANSI_ARGS_((CONST char * s1, CONST char * s2, unsigned long n)); /* 369 */ - int (*tcl_UtfNcasecmp) _ANSI_ARGS_((CONST char * s1, CONST char * s2, unsigned long n)); /* 370 */ - int (*tcl_StringCaseMatch) _ANSI_ARGS_((CONST char * str, CONST char * pattern, int nocase)); /* 371 */ + int (*tcl_UniCharLen) _ANSI_ARGS_((CONST Tcl_UniChar *uniStr)); /* 352 */ + int (*tcl_UniCharNcmp) _ANSI_ARGS_((CONST Tcl_UniChar *ucs, CONST Tcl_UniChar *uct, unsigned long numChars)); /* 353 */ + char * (*tcl_UniCharToUtfDString) _ANSI_ARGS_((CONST Tcl_UniChar *uniStr, int uniLength, Tcl_DString *dsPtr)); /* 354 */ + Tcl_UniChar * (*tcl_UtfToUniCharDString) _ANSI_ARGS_((CONST char *src, int length, Tcl_DString *dsPtr)); /* 355 */ + Tcl_RegExp (*tcl_GetRegExpFromObj) _ANSI_ARGS_((Tcl_Interp *interp, Tcl_Obj *patObj, int flags)); /* 356 */ + Tcl_Obj * (*tcl_EvalTokens) _ANSI_ARGS_((Tcl_Interp *interp, Tcl_Token *tokenPtr, int count)); /* 357 */ + void (*tcl_FreeParse) _ANSI_ARGS_((Tcl_Parse *parsePtr)); /* 358 */ + void (*tcl_LogCommandInfo) _ANSI_ARGS_((Tcl_Interp *interp, CONST char *script, CONST char *command, int length)); /* 359 */ + int (*tcl_ParseBraces) _ANSI_ARGS_((Tcl_Interp *interp, CONST char *start, int numBytes, Tcl_Parse *parsePtr, int append, CONST84 char **termPtr)); /* 360 */ + int (*tcl_ParseCommand) _ANSI_ARGS_((Tcl_Interp *interp, CONST char *start, int numBytes, int nested, Tcl_Parse *parsePtr)); /* 361 */ + int (*tcl_ParseExpr) _ANSI_ARGS_((Tcl_Interp *interp, CONST char *start, int numBytes, Tcl_Parse *parsePtr)); /* 362 */ + int (*tcl_ParseQuotedString) _ANSI_ARGS_((Tcl_Interp *interp, CONST char *start, int numBytes, Tcl_Parse *parsePtr, int append, CONST84 char **termPtr)); /* 363 */ + int (*tcl_ParseVarName) _ANSI_ARGS_((Tcl_Interp *interp, CONST char *start, int numBytes, Tcl_Parse *parsePtr, int append)); /* 364 */ + char * (*tcl_GetCwd) _ANSI_ARGS_((Tcl_Interp *interp, Tcl_DString *cwdPtr)); /* 365 */ + int (*tcl_Chdir) _ANSI_ARGS_((CONST char *dirName)); /* 366 */ + int (*tcl_Access) _ANSI_ARGS_((CONST char *path, int mode)); /* 367 */ + int (*tcl_Stat) _ANSI_ARGS_((CONST char *path, struct stat *bufPtr)); /* 368 */ + int (*tcl_UtfNcmp) _ANSI_ARGS_((CONST char *s1, CONST char *s2, unsigned long n)); /* 369 */ + int (*tcl_UtfNcasecmp) _ANSI_ARGS_((CONST char *s1, CONST char *s2, unsigned long n)); /* 370 */ + int (*tcl_StringCaseMatch) _ANSI_ARGS_((CONST char *str, CONST char *pattern, int nocase)); /* 371 */ int (*tcl_UniCharIsControl) _ANSI_ARGS_((int ch)); /* 372 */ int (*tcl_UniCharIsGraph) _ANSI_ARGS_((int ch)); /* 373 */ int (*tcl_UniCharIsPrint) _ANSI_ARGS_((int ch)); /* 374 */ int (*tcl_UniCharIsPunct) _ANSI_ARGS_((int ch)); /* 375 */ - int (*tcl_RegExpExecObj) _ANSI_ARGS_((Tcl_Interp * interp, Tcl_RegExp regexp, Tcl_Obj * objPtr, int offset, int nmatches, int flags)); /* 376 */ - void (*tcl_RegExpGetInfo) _ANSI_ARGS_((Tcl_RegExp regexp, Tcl_RegExpInfo * infoPtr)); /* 377 */ - Tcl_Obj * (*tcl_NewUnicodeObj) _ANSI_ARGS_((CONST Tcl_UniChar * unicode, int numChars)); /* 378 */ - void (*tcl_SetUnicodeObj) _ANSI_ARGS_((Tcl_Obj * objPtr, CONST Tcl_UniChar * unicode, int numChars)); /* 379 */ - int (*tcl_GetCharLength) _ANSI_ARGS_((Tcl_Obj * objPtr)); /* 380 */ - Tcl_UniChar (*tcl_GetUniChar) _ANSI_ARGS_((Tcl_Obj * objPtr, int index)); /* 381 */ - Tcl_UniChar * (*tcl_GetUnicode) _ANSI_ARGS_((Tcl_Obj * objPtr)); /* 382 */ - Tcl_Obj * (*tcl_GetRange) _ANSI_ARGS_((Tcl_Obj * objPtr, int first, int last)); /* 383 */ - void (*tcl_AppendUnicodeToObj) _ANSI_ARGS_((Tcl_Obj * objPtr, CONST Tcl_UniChar * unicode, int length)); /* 384 */ - int (*tcl_RegExpMatchObj) _ANSI_ARGS_((Tcl_Interp * interp, Tcl_Obj * stringObj, Tcl_Obj * patternObj)); /* 385 */ - void (*tcl_SetNotifier) _ANSI_ARGS_((Tcl_NotifierProcs * notifierProcPtr)); /* 386 */ + int (*tcl_RegExpExecObj) _ANSI_ARGS_((Tcl_Interp *interp, Tcl_RegExp regexp, Tcl_Obj *textObj, int offset, int nmatches, int flags)); /* 376 */ + void (*tcl_RegExpGetInfo) _ANSI_ARGS_((Tcl_RegExp regexp, Tcl_RegExpInfo *infoPtr)); /* 377 */ + Tcl_Obj * (*tcl_NewUnicodeObj) _ANSI_ARGS_((CONST Tcl_UniChar *unicode, int numChars)); /* 378 */ + void (*tcl_SetUnicodeObj) _ANSI_ARGS_((Tcl_Obj *objPtr, CONST Tcl_UniChar *unicode, int numChars)); /* 379 */ + int (*tcl_GetCharLength) _ANSI_ARGS_((Tcl_Obj *objPtr)); /* 380 */ + Tcl_UniChar (*tcl_GetUniChar) _ANSI_ARGS_((Tcl_Obj *objPtr, int index)); /* 381 */ + Tcl_UniChar * (*tcl_GetUnicode) _ANSI_ARGS_((Tcl_Obj *objPtr)); /* 382 */ + Tcl_Obj * (*tcl_GetRange) _ANSI_ARGS_((Tcl_Obj *objPtr, int first, int last)); /* 383 */ + void (*tcl_AppendUnicodeToObj) _ANSI_ARGS_((Tcl_Obj *objPtr, CONST Tcl_UniChar *unicode, int length)); /* 384 */ + int (*tcl_RegExpMatchObj) _ANSI_ARGS_((Tcl_Interp *interp, Tcl_Obj *textObj, Tcl_Obj *patternObj)); /* 385 */ + void (*tcl_SetNotifier) _ANSI_ARGS_((Tcl_NotifierProcs *notifierProcPtr)); /* 386 */ Tcl_Mutex * (*tcl_GetAllocMutex) _ANSI_ARGS_((void)); /* 387 */ - int (*tcl_GetChannelNames) _ANSI_ARGS_((Tcl_Interp * interp)); /* 388 */ - int (*tcl_GetChannelNamesEx) _ANSI_ARGS_((Tcl_Interp * interp, CONST char * pattern)); /* 389 */ - int (*tcl_ProcObjCmd) _ANSI_ARGS_((ClientData clientData, Tcl_Interp * interp, int objc, Tcl_Obj *CONST objv[])); /* 390 */ - void (*tcl_ConditionFinalize) _ANSI_ARGS_((Tcl_Condition * condPtr)); /* 391 */ - void (*tcl_MutexFinalize) _ANSI_ARGS_((Tcl_Mutex * mutex)); /* 392 */ - int (*tcl_CreateThread) _ANSI_ARGS_((Tcl_ThreadId * idPtr, Tcl_ThreadCreateProc proc, ClientData clientData, int stackSize, int flags)); /* 393 */ - int (*tcl_ReadRaw) _ANSI_ARGS_((Tcl_Channel chan, char * dst, int bytesToRead)); /* 394 */ - int (*tcl_WriteRaw) _ANSI_ARGS_((Tcl_Channel chan, CONST char * src, int srcLen)); /* 395 */ + int (*tcl_GetChannelNames) _ANSI_ARGS_((Tcl_Interp *interp)); /* 388 */ + int (*tcl_GetChannelNamesEx) _ANSI_ARGS_((Tcl_Interp *interp, CONST char *pattern)); /* 389 */ + int (*tcl_ProcObjCmd) _ANSI_ARGS_((ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[])); /* 390 */ + void (*tcl_ConditionFinalize) _ANSI_ARGS_((Tcl_Condition *condPtr)); /* 391 */ + void (*tcl_MutexFinalize) _ANSI_ARGS_((Tcl_Mutex *mutex)); /* 392 */ + int (*tcl_CreateThread) _ANSI_ARGS_((Tcl_ThreadId *idPtr, Tcl_ThreadCreateProc proc, ClientData clientData, int stackSize, int flags)); /* 393 */ + int (*tcl_ReadRaw) _ANSI_ARGS_((Tcl_Channel chan, char *dst, int bytesToRead)); /* 394 */ + int (*tcl_WriteRaw) _ANSI_ARGS_((Tcl_Channel chan, CONST char *src, int srcLen)); /* 395 */ Tcl_Channel (*tcl_GetTopChannel) _ANSI_ARGS_((Tcl_Channel chan)); /* 396 */ int (*tcl_ChannelBuffered) _ANSI_ARGS_((Tcl_Channel chan)); /* 397 */ - CONST84_RETURN char * (*tcl_ChannelName) _ANSI_ARGS_((Tcl_ChannelType * chanTypePtr)); /* 398 */ - Tcl_ChannelTypeVersion (*tcl_ChannelVersion) _ANSI_ARGS_((Tcl_ChannelType * chanTypePtr)); /* 399 */ - Tcl_DriverBlockModeProc * (*tcl_ChannelBlockModeProc) _ANSI_ARGS_((Tcl_ChannelType * chanTypePtr)); /* 400 */ - Tcl_DriverCloseProc * (*tcl_ChannelCloseProc) _ANSI_ARGS_((Tcl_ChannelType * chanTypePtr)); /* 401 */ - Tcl_DriverClose2Proc * (*tcl_ChannelClose2Proc) _ANSI_ARGS_((Tcl_ChannelType * chanTypePtr)); /* 402 */ - Tcl_DriverInputProc * (*tcl_ChannelInputProc) _ANSI_ARGS_((Tcl_ChannelType * chanTypePtr)); /* 403 */ - Tcl_DriverOutputProc * (*tcl_ChannelOutputProc) _ANSI_ARGS_((Tcl_ChannelType * chanTypePtr)); /* 404 */ - Tcl_DriverSeekProc * (*tcl_ChannelSeekProc) _ANSI_ARGS_((Tcl_ChannelType * chanTypePtr)); /* 405 */ - Tcl_DriverSetOptionProc * (*tcl_ChannelSetOptionProc) _ANSI_ARGS_((Tcl_ChannelType * chanTypePtr)); /* 406 */ - Tcl_DriverGetOptionProc * (*tcl_ChannelGetOptionProc) _ANSI_ARGS_((Tcl_ChannelType * chanTypePtr)); /* 407 */ - Tcl_DriverWatchProc * (*tcl_ChannelWatchProc) _ANSI_ARGS_((Tcl_ChannelType * chanTypePtr)); /* 408 */ - Tcl_DriverGetHandleProc * (*tcl_ChannelGetHandleProc) _ANSI_ARGS_((Tcl_ChannelType * chanTypePtr)); /* 409 */ - Tcl_DriverFlushProc * (*tcl_ChannelFlushProc) _ANSI_ARGS_((Tcl_ChannelType * chanTypePtr)); /* 410 */ - Tcl_DriverHandlerProc * (*tcl_ChannelHandlerProc) _ANSI_ARGS_((Tcl_ChannelType * chanTypePtr)); /* 411 */ - int (*tcl_JoinThread) _ANSI_ARGS_((Tcl_ThreadId threadId, int* result)); /* 412 */ + CONST84_RETURN char * (*tcl_ChannelName) _ANSI_ARGS_((Tcl_ChannelType *chanTypePtr)); /* 398 */ + Tcl_ChannelTypeVersion (*tcl_ChannelVersion) _ANSI_ARGS_((Tcl_ChannelType *chanTypePtr)); /* 399 */ + Tcl_DriverBlockModeProc * (*tcl_ChannelBlockModeProc) _ANSI_ARGS_((Tcl_ChannelType *chanTypePtr)); /* 400 */ + Tcl_DriverCloseProc * (*tcl_ChannelCloseProc) _ANSI_ARGS_((Tcl_ChannelType *chanTypePtr)); /* 401 */ + Tcl_DriverClose2Proc * (*tcl_ChannelClose2Proc) _ANSI_ARGS_((Tcl_ChannelType *chanTypePtr)); /* 402 */ + Tcl_DriverInputProc * (*tcl_ChannelInputProc) _ANSI_ARGS_((Tcl_ChannelType *chanTypePtr)); /* 403 */ + Tcl_DriverOutputProc * (*tcl_ChannelOutputProc) _ANSI_ARGS_((Tcl_ChannelType *chanTypePtr)); /* 404 */ + Tcl_DriverSeekProc * (*tcl_ChannelSeekProc) _ANSI_ARGS_((Tcl_ChannelType *chanTypePtr)); /* 405 */ + Tcl_DriverSetOptionProc * (*tcl_ChannelSetOptionProc) _ANSI_ARGS_((Tcl_ChannelType *chanTypePtr)); /* 406 */ + Tcl_DriverGetOptionProc * (*tcl_ChannelGetOptionProc) _ANSI_ARGS_((Tcl_ChannelType *chanTypePtr)); /* 407 */ + Tcl_DriverWatchProc * (*tcl_ChannelWatchProc) _ANSI_ARGS_((Tcl_ChannelType *chanTypePtr)); /* 408 */ + Tcl_DriverGetHandleProc * (*tcl_ChannelGetHandleProc) _ANSI_ARGS_((Tcl_ChannelType *chanTypePtr)); /* 409 */ + Tcl_DriverFlushProc * (*tcl_ChannelFlushProc) _ANSI_ARGS_((Tcl_ChannelType *chanTypePtr)); /* 410 */ + Tcl_DriverHandlerProc * (*tcl_ChannelHandlerProc) _ANSI_ARGS_((Tcl_ChannelType *chanTypePtr)); /* 411 */ + int (*tcl_JoinThread) _ANSI_ARGS_((Tcl_ThreadId threadId, int *result)); /* 412 */ int (*tcl_IsChannelShared) _ANSI_ARGS_((Tcl_Channel channel)); /* 413 */ - int (*tcl_IsChannelRegistered) _ANSI_ARGS_((Tcl_Interp* interp, Tcl_Channel channel)); /* 414 */ + int (*tcl_IsChannelRegistered) _ANSI_ARGS_((Tcl_Interp *interp, Tcl_Channel channel)); /* 414 */ void (*tcl_CutChannel) _ANSI_ARGS_((Tcl_Channel channel)); /* 415 */ void (*tcl_SpliceChannel) _ANSI_ARGS_((Tcl_Channel channel)); /* 416 */ void (*tcl_ClearChannelHandlers) _ANSI_ARGS_((Tcl_Channel channel)); /* 417 */ - int (*tcl_IsChannelExisting) _ANSI_ARGS_((CONST char* channelName)); /* 418 */ - int (*tcl_UniCharNcasecmp) _ANSI_ARGS_((CONST Tcl_UniChar * cs, CONST Tcl_UniChar * ct, unsigned long n)); /* 419 */ - int (*tcl_UniCharCaseMatch) _ANSI_ARGS_((CONST Tcl_UniChar * ustr, CONST Tcl_UniChar * pattern, int nocase)); /* 420 */ - Tcl_HashEntry * (*tcl_FindHashEntry) _ANSI_ARGS_((Tcl_HashTable * tablePtr, CONST char * key)); /* 421 */ - Tcl_HashEntry * (*tcl_CreateHashEntry) _ANSI_ARGS_((Tcl_HashTable * tablePtr, CONST char * key, int * newPtr)); /* 422 */ - void (*tcl_InitCustomHashTable) _ANSI_ARGS_((Tcl_HashTable * tablePtr, int keyType, Tcl_HashKeyType * typePtr)); /* 423 */ - void (*tcl_InitObjHashTable) _ANSI_ARGS_((Tcl_HashTable * tablePtr)); /* 424 */ - ClientData (*tcl_CommandTraceInfo) _ANSI_ARGS_((Tcl_Interp * interp, CONST char * varName, int flags, Tcl_CommandTraceProc * procPtr, ClientData prevClientData)); /* 425 */ - int (*tcl_TraceCommand) _ANSI_ARGS_((Tcl_Interp * interp, CONST char * varName, int flags, Tcl_CommandTraceProc * proc, ClientData clientData)); /* 426 */ - void (*tcl_UntraceCommand) _ANSI_ARGS_((Tcl_Interp * interp, CONST char * varName, int flags, Tcl_CommandTraceProc * proc, ClientData clientData)); /* 427 */ + int (*tcl_IsChannelExisting) _ANSI_ARGS_((CONST char *channelName)); /* 418 */ + int (*tcl_UniCharNcasecmp) _ANSI_ARGS_((CONST Tcl_UniChar *ucs, CONST Tcl_UniChar *uct, unsigned long numChars)); /* 419 */ + int (*tcl_UniCharCaseMatch) _ANSI_ARGS_((CONST Tcl_UniChar *uniStr, CONST Tcl_UniChar *uniPattern, int nocase)); /* 420 */ + Tcl_HashEntry * (*tcl_FindHashEntry) _ANSI_ARGS_((Tcl_HashTable *tablePtr, CONST char *key)); /* 421 */ + Tcl_HashEntry * (*tcl_CreateHashEntry) _ANSI_ARGS_((Tcl_HashTable *tablePtr, CONST char *key, int *newPtr)); /* 422 */ + void (*tcl_InitCustomHashTable) _ANSI_ARGS_((Tcl_HashTable *tablePtr, int keyType, Tcl_HashKeyType *typePtr)); /* 423 */ + void (*tcl_InitObjHashTable) _ANSI_ARGS_((Tcl_HashTable *tablePtr)); /* 424 */ + ClientData (*tcl_CommandTraceInfo) _ANSI_ARGS_((Tcl_Interp *interp, CONST char *varName, int flags, Tcl_CommandTraceProc *procPtr, ClientData prevClientData)); /* 425 */ + int (*tcl_TraceCommand) _ANSI_ARGS_((Tcl_Interp *interp, CONST char *varName, int flags, Tcl_CommandTraceProc *proc, ClientData clientData)); /* 426 */ + void (*tcl_UntraceCommand) _ANSI_ARGS_((Tcl_Interp *interp, CONST char *varName, int flags, Tcl_CommandTraceProc *proc, ClientData clientData)); /* 427 */ char * (*tcl_AttemptAlloc) _ANSI_ARGS_((unsigned int size)); /* 428 */ - char * (*tcl_AttemptDbCkalloc) _ANSI_ARGS_((unsigned int size, CONST char * file, int line)); /* 429 */ - char * (*tcl_AttemptRealloc) _ANSI_ARGS_((char * ptr, unsigned int size)); /* 430 */ - char * (*tcl_AttemptDbCkrealloc) _ANSI_ARGS_((char * ptr, unsigned int size, CONST char * file, int line)); /* 431 */ - int (*tcl_AttemptSetObjLength) _ANSI_ARGS_((Tcl_Obj * objPtr, int length)); /* 432 */ + char * (*tcl_AttemptDbCkalloc) _ANSI_ARGS_((unsigned int size, CONST char *file, int line)); /* 429 */ + char * (*tcl_AttemptRealloc) _ANSI_ARGS_((char *ptr, unsigned int size)); /* 430 */ + char * (*tcl_AttemptDbCkrealloc) _ANSI_ARGS_((char *ptr, unsigned int size, CONST char *file, int line)); /* 431 */ + int (*tcl_AttemptSetObjLength) _ANSI_ARGS_((Tcl_Obj *objPtr, int length)); /* 432 */ Tcl_ThreadId (*tcl_GetChannelThread) _ANSI_ARGS_((Tcl_Channel channel)); /* 433 */ - Tcl_UniChar * (*tcl_GetUnicodeFromObj) _ANSI_ARGS_((Tcl_Obj * objPtr, int * lengthPtr)); /* 434 */ - int (*tcl_GetMathFuncInfo) _ANSI_ARGS_((Tcl_Interp * interp, CONST char * name, int * numArgsPtr, Tcl_ValueType ** argTypesPtr, Tcl_MathProc ** procPtr, ClientData * clientDataPtr)); /* 435 */ - Tcl_Obj * (*tcl_ListMathFuncs) _ANSI_ARGS_((Tcl_Interp * interp, CONST char * pattern)); /* 436 */ - Tcl_Obj * (*tcl_SubstObj) _ANSI_ARGS_((Tcl_Interp * interp, Tcl_Obj * objPtr, int flags)); /* 437 */ - int (*tcl_DetachChannel) _ANSI_ARGS_((Tcl_Interp* interp, Tcl_Channel channel)); /* 438 */ + Tcl_UniChar * (*tcl_GetUnicodeFromObj) _ANSI_ARGS_((Tcl_Obj *objPtr, int *lengthPtr)); /* 434 */ + int (*tcl_GetMathFuncInfo) _ANSI_ARGS_((Tcl_Interp *interp, CONST char *name, int *numArgsPtr, Tcl_ValueType **argTypesPtr, Tcl_MathProc **procPtr, ClientData *clientDataPtr)); /* 435 */ + Tcl_Obj * (*tcl_ListMathFuncs) _ANSI_ARGS_((Tcl_Interp *interp, CONST char *pattern)); /* 436 */ + Tcl_Obj * (*tcl_SubstObj) _ANSI_ARGS_((Tcl_Interp *interp, Tcl_Obj *objPtr, int flags)); /* 437 */ + int (*tcl_DetachChannel) _ANSI_ARGS_((Tcl_Interp *interp, Tcl_Channel channel)); /* 438 */ int (*tcl_IsStandardChannel) _ANSI_ARGS_((Tcl_Channel channel)); /* 439 */ - int (*tcl_FSCopyFile) _ANSI_ARGS_((Tcl_Obj * srcPathPtr, Tcl_Obj * destPathPtr)); /* 440 */ - int (*tcl_FSCopyDirectory) _ANSI_ARGS_((Tcl_Obj * srcPathPtr, Tcl_Obj * destPathPtr, Tcl_Obj ** errorPtr)); /* 441 */ - int (*tcl_FSCreateDirectory) _ANSI_ARGS_((Tcl_Obj * pathPtr)); /* 442 */ - int (*tcl_FSDeleteFile) _ANSI_ARGS_((Tcl_Obj * pathPtr)); /* 443 */ - int (*tcl_FSLoadFile) _ANSI_ARGS_((Tcl_Interp * interp, Tcl_Obj * pathPtr, CONST char * sym1, CONST char * sym2, Tcl_PackageInitProc ** proc1Ptr, Tcl_PackageInitProc ** proc2Ptr, Tcl_LoadHandle * handlePtr, Tcl_FSUnloadFileProc ** unloadProcPtr)); /* 444 */ - int (*tcl_FSMatchInDirectory) _ANSI_ARGS_((Tcl_Interp * interp, Tcl_Obj * result, Tcl_Obj * pathPtr, CONST char * pattern, Tcl_GlobTypeData * types)); /* 445 */ - Tcl_Obj * (*tcl_FSLink) _ANSI_ARGS_((Tcl_Obj * pathPtr, Tcl_Obj * toPtr, int linkAction)); /* 446 */ - int (*tcl_FSRemoveDirectory) _ANSI_ARGS_((Tcl_Obj * pathPtr, int recursive, Tcl_Obj ** errorPtr)); /* 447 */ - int (*tcl_FSRenameFile) _ANSI_ARGS_((Tcl_Obj * srcPathPtr, Tcl_Obj * destPathPtr)); /* 448 */ - int (*tcl_FSLstat) _ANSI_ARGS_((Tcl_Obj * pathPtr, Tcl_StatBuf * buf)); /* 449 */ - int (*tcl_FSUtime) _ANSI_ARGS_((Tcl_Obj * pathPtr, struct utimbuf * tval)); /* 450 */ - int (*tcl_FSFileAttrsGet) _ANSI_ARGS_((Tcl_Interp * interp, int index, Tcl_Obj * pathPtr, Tcl_Obj ** objPtrRef)); /* 451 */ - int (*tcl_FSFileAttrsSet) _ANSI_ARGS_((Tcl_Interp * interp, int index, Tcl_Obj * pathPtr, Tcl_Obj * objPtr)); /* 452 */ - CONST char ** (*tcl_FSFileAttrStrings) _ANSI_ARGS_((Tcl_Obj * pathPtr, Tcl_Obj ** objPtrRef)); /* 453 */ - int (*tcl_FSStat) _ANSI_ARGS_((Tcl_Obj * pathPtr, Tcl_StatBuf * buf)); /* 454 */ - int (*tcl_FSAccess) _ANSI_ARGS_((Tcl_Obj * pathPtr, int mode)); /* 455 */ - Tcl_Channel (*tcl_FSOpenFileChannel) _ANSI_ARGS_((Tcl_Interp * interp, Tcl_Obj * pathPtr, CONST char * modeString, int permissions)); /* 456 */ - Tcl_Obj* (*tcl_FSGetCwd) _ANSI_ARGS_((Tcl_Interp * interp)); /* 457 */ - int (*tcl_FSChdir) _ANSI_ARGS_((Tcl_Obj * pathPtr)); /* 458 */ - int (*tcl_FSConvertToPathType) _ANSI_ARGS_((Tcl_Interp * interp, Tcl_Obj * pathPtr)); /* 459 */ - Tcl_Obj* (*tcl_FSJoinPath) _ANSI_ARGS_((Tcl_Obj * listObj, int elements)); /* 460 */ - Tcl_Obj* (*tcl_FSSplitPath) _ANSI_ARGS_((Tcl_Obj* pathPtr, int * lenPtr)); /* 461 */ - int (*tcl_FSEqualPaths) _ANSI_ARGS_((Tcl_Obj* firstPtr, Tcl_Obj* secondPtr)); /* 462 */ - Tcl_Obj* (*tcl_FSGetNormalizedPath) _ANSI_ARGS_((Tcl_Interp * interp, Tcl_Obj* pathObjPtr)); /* 463 */ - Tcl_Obj* (*tcl_FSJoinToPath) _ANSI_ARGS_((Tcl_Obj * basePtr, int objc, Tcl_Obj *CONST objv[])); /* 464 */ - ClientData (*tcl_FSGetInternalRep) _ANSI_ARGS_((Tcl_Obj* pathObjPtr, Tcl_Filesystem * fsPtr)); /* 465 */ - Tcl_Obj* (*tcl_FSGetTranslatedPath) _ANSI_ARGS_((Tcl_Interp * interp, Tcl_Obj* pathPtr)); /* 466 */ - int (*tcl_FSEvalFile) _ANSI_ARGS_((Tcl_Interp * interp, Tcl_Obj * fileName)); /* 467 */ - Tcl_Obj* (*tcl_FSNewNativePath) _ANSI_ARGS_((Tcl_Filesystem* fromFilesystem, ClientData clientData)); /* 468 */ - CONST char* (*tcl_FSGetNativePath) _ANSI_ARGS_((Tcl_Obj* pathObjPtr)); /* 469 */ - Tcl_Obj* (*tcl_FSFileSystemInfo) _ANSI_ARGS_((Tcl_Obj* pathObjPtr)); /* 470 */ - Tcl_Obj* (*tcl_FSPathSeparator) _ANSI_ARGS_((Tcl_Obj* pathObjPtr)); /* 471 */ - Tcl_Obj* (*tcl_FSListVolumes) _ANSI_ARGS_((void)); /* 472 */ - int (*tcl_FSRegister) _ANSI_ARGS_((ClientData clientData, Tcl_Filesystem * fsPtr)); /* 473 */ - int (*tcl_FSUnregister) _ANSI_ARGS_((Tcl_Filesystem * fsPtr)); /* 474 */ - ClientData (*tcl_FSData) _ANSI_ARGS_((Tcl_Filesystem * fsPtr)); /* 475 */ - CONST char* (*tcl_FSGetTranslatedStringPath) _ANSI_ARGS_((Tcl_Interp * interp, Tcl_Obj* pathPtr)); /* 476 */ - Tcl_Filesystem* (*tcl_FSGetFileSystemForPath) _ANSI_ARGS_((Tcl_Obj* pathObjPtr)); /* 477 */ - Tcl_PathType (*tcl_FSGetPathType) _ANSI_ARGS_((Tcl_Obj * pathObjPtr)); /* 478 */ + int (*tcl_FSCopyFile) _ANSI_ARGS_((Tcl_Obj *srcPathPtr, Tcl_Obj *destPathPtr)); /* 440 */ + int (*tcl_FSCopyDirectory) _ANSI_ARGS_((Tcl_Obj *srcPathPtr, Tcl_Obj *destPathPtr, Tcl_Obj **errorPtr)); /* 441 */ + int (*tcl_FSCreateDirectory) _ANSI_ARGS_((Tcl_Obj *pathPtr)); /* 442 */ + int (*tcl_FSDeleteFile) _ANSI_ARGS_((Tcl_Obj *pathPtr)); /* 443 */ + int (*tcl_FSLoadFile) _ANSI_ARGS_((Tcl_Interp *interp, Tcl_Obj *pathPtr, CONST char *sym1, CONST char *sym2, Tcl_PackageInitProc **proc1Ptr, Tcl_PackageInitProc **proc2Ptr, Tcl_LoadHandle *handlePtr, Tcl_FSUnloadFileProc **unloadProcPtr)); /* 444 */ + int (*tcl_FSMatchInDirectory) _ANSI_ARGS_((Tcl_Interp *interp, Tcl_Obj *result, Tcl_Obj *pathPtr, CONST char *pattern, Tcl_GlobTypeData *types)); /* 445 */ + Tcl_Obj * (*tcl_FSLink) _ANSI_ARGS_((Tcl_Obj *pathPtr, Tcl_Obj *toPtr, int linkAction)); /* 446 */ + int (*tcl_FSRemoveDirectory) _ANSI_ARGS_((Tcl_Obj *pathPtr, int recursive, Tcl_Obj **errorPtr)); /* 447 */ + int (*tcl_FSRenameFile) _ANSI_ARGS_((Tcl_Obj *srcPathPtr, Tcl_Obj *destPathPtr)); /* 448 */ + int (*tcl_FSLstat) _ANSI_ARGS_((Tcl_Obj *pathPtr, Tcl_StatBuf *buf)); /* 449 */ + int (*tcl_FSUtime) _ANSI_ARGS_((Tcl_Obj *pathPtr, struct utimbuf *tval)); /* 450 */ + int (*tcl_FSFileAttrsGet) _ANSI_ARGS_((Tcl_Interp *interp, int index, Tcl_Obj *pathPtr, Tcl_Obj **objPtrRef)); /* 451 */ + int (*tcl_FSFileAttrsSet) _ANSI_ARGS_((Tcl_Interp *interp, int index, Tcl_Obj *pathPtr, Tcl_Obj *objPtr)); /* 452 */ + CONST char ** (*tcl_FSFileAttrStrings) _ANSI_ARGS_((Tcl_Obj *pathPtr, Tcl_Obj **objPtrRef)); /* 453 */ + int (*tcl_FSStat) _ANSI_ARGS_((Tcl_Obj *pathPtr, Tcl_StatBuf *buf)); /* 454 */ + int (*tcl_FSAccess) _ANSI_ARGS_((Tcl_Obj *pathPtr, int mode)); /* 455 */ + Tcl_Channel (*tcl_FSOpenFileChannel) _ANSI_ARGS_((Tcl_Interp *interp, Tcl_Obj *pathPtr, CONST char *modeString, int permissions)); /* 456 */ + Tcl_Obj * (*tcl_FSGetCwd) _ANSI_ARGS_((Tcl_Interp *interp)); /* 457 */ + int (*tcl_FSChdir) _ANSI_ARGS_((Tcl_Obj *pathPtr)); /* 458 */ + int (*tcl_FSConvertToPathType) _ANSI_ARGS_((Tcl_Interp *interp, Tcl_Obj *pathPtr)); /* 459 */ + Tcl_Obj * (*tcl_FSJoinPath) _ANSI_ARGS_((Tcl_Obj *listObj, int elements)); /* 460 */ + Tcl_Obj * (*tcl_FSSplitPath) _ANSI_ARGS_((Tcl_Obj *pathPtr, int *lenPtr)); /* 461 */ + int (*tcl_FSEqualPaths) _ANSI_ARGS_((Tcl_Obj *firstPtr, Tcl_Obj *secondPtr)); /* 462 */ + Tcl_Obj * (*tcl_FSGetNormalizedPath) _ANSI_ARGS_((Tcl_Interp *interp, Tcl_Obj *pathPtr)); /* 463 */ + Tcl_Obj * (*tcl_FSJoinToPath) _ANSI_ARGS_((Tcl_Obj *pathPtr, int objc, Tcl_Obj *CONST objv[])); /* 464 */ + ClientData (*tcl_FSGetInternalRep) _ANSI_ARGS_((Tcl_Obj *pathPtr, Tcl_Filesystem *fsPtr)); /* 465 */ + Tcl_Obj * (*tcl_FSGetTranslatedPath) _ANSI_ARGS_((Tcl_Interp *interp, Tcl_Obj *pathPtr)); /* 466 */ + int (*tcl_FSEvalFile) _ANSI_ARGS_((Tcl_Interp *interp, Tcl_Obj *fileName)); /* 467 */ + Tcl_Obj * (*tcl_FSNewNativePath) _ANSI_ARGS_((Tcl_Filesystem *fromFilesystem, ClientData clientData)); /* 468 */ + CONST char * (*tcl_FSGetNativePath) _ANSI_ARGS_((Tcl_Obj *pathPtr)); /* 469 */ + Tcl_Obj * (*tcl_FSFileSystemInfo) _ANSI_ARGS_((Tcl_Obj *pathPtr)); /* 470 */ + Tcl_Obj * (*tcl_FSPathSeparator) _ANSI_ARGS_((Tcl_Obj *pathPtr)); /* 471 */ + Tcl_Obj * (*tcl_FSListVolumes) _ANSI_ARGS_((void)); /* 472 */ + int (*tcl_FSRegister) _ANSI_ARGS_((ClientData clientData, Tcl_Filesystem *fsPtr)); /* 473 */ + int (*tcl_FSUnregister) _ANSI_ARGS_((Tcl_Filesystem *fsPtr)); /* 474 */ + ClientData (*tcl_FSData) _ANSI_ARGS_((Tcl_Filesystem *fsPtr)); /* 475 */ + CONST char * (*tcl_FSGetTranslatedStringPath) _ANSI_ARGS_((Tcl_Interp *interp, Tcl_Obj *pathPtr)); /* 476 */ + Tcl_Filesystem * (*tcl_FSGetFileSystemForPath) _ANSI_ARGS_((Tcl_Obj *pathPtr)); /* 477 */ + Tcl_PathType (*tcl_FSGetPathType) _ANSI_ARGS_((Tcl_Obj *pathPtr)); /* 478 */ int (*tcl_OutputBuffered) _ANSI_ARGS_((Tcl_Channel chan)); /* 479 */ - void (*tcl_FSMountsChanged) _ANSI_ARGS_((Tcl_Filesystem * fsPtr)); /* 480 */ - int (*tcl_EvalTokensStandard) _ANSI_ARGS_((Tcl_Interp * interp, Tcl_Token * tokenPtr, int count)); /* 481 */ - void (*tcl_GetTime) _ANSI_ARGS_((Tcl_Time* timeBuf)); /* 482 */ - Tcl_Trace (*tcl_CreateObjTrace) _ANSI_ARGS_((Tcl_Interp* interp, int level, int flags, Tcl_CmdObjTraceProc* objProc, ClientData clientData, Tcl_CmdObjTraceDeleteProc* delProc)); /* 483 */ - int (*tcl_GetCommandInfoFromToken) _ANSI_ARGS_((Tcl_Command token, Tcl_CmdInfo* infoPtr)); /* 484 */ - int (*tcl_SetCommandInfoFromToken) _ANSI_ARGS_((Tcl_Command token, CONST Tcl_CmdInfo* infoPtr)); /* 485 */ - Tcl_Obj * (*tcl_DbNewWideIntObj) _ANSI_ARGS_((Tcl_WideInt wideValue, CONST char * file, int line)); /* 486 */ - int (*tcl_GetWideIntFromObj) _ANSI_ARGS_((Tcl_Interp * interp, Tcl_Obj * objPtr, Tcl_WideInt * widePtr)); /* 487 */ + void (*tcl_FSMountsChanged) _ANSI_ARGS_((Tcl_Filesystem *fsPtr)); /* 480 */ + int (*tcl_EvalTokensStandard) _ANSI_ARGS_((Tcl_Interp *interp, Tcl_Token *tokenPtr, int count)); /* 481 */ + void (*tcl_GetTime) _ANSI_ARGS_((Tcl_Time *timeBuf)); /* 482 */ + Tcl_Trace (*tcl_CreateObjTrace) _ANSI_ARGS_((Tcl_Interp *interp, int level, int flags, Tcl_CmdObjTraceProc *objProc, ClientData clientData, Tcl_CmdObjTraceDeleteProc *delProc)); /* 483 */ + int (*tcl_GetCommandInfoFromToken) _ANSI_ARGS_((Tcl_Command token, Tcl_CmdInfo *infoPtr)); /* 484 */ + int (*tcl_SetCommandInfoFromToken) _ANSI_ARGS_((Tcl_Command token, CONST Tcl_CmdInfo *infoPtr)); /* 485 */ + Tcl_Obj * (*tcl_DbNewWideIntObj) _ANSI_ARGS_((Tcl_WideInt wideValue, CONST char *file, int line)); /* 486 */ + int (*tcl_GetWideIntFromObj) _ANSI_ARGS_((Tcl_Interp *interp, Tcl_Obj *objPtr, Tcl_WideInt *widePtr)); /* 487 */ Tcl_Obj * (*tcl_NewWideIntObj) _ANSI_ARGS_((Tcl_WideInt wideValue)); /* 488 */ - void (*tcl_SetWideIntObj) _ANSI_ARGS_((Tcl_Obj * objPtr, Tcl_WideInt wideValue)); /* 489 */ + void (*tcl_SetWideIntObj) _ANSI_ARGS_((Tcl_Obj *objPtr, Tcl_WideInt wideValue)); /* 489 */ Tcl_StatBuf * (*tcl_AllocStatBuf) _ANSI_ARGS_((void)); /* 490 */ Tcl_WideInt (*tcl_Seek) _ANSI_ARGS_((Tcl_Channel chan, Tcl_WideInt offset, int mode)); /* 491 */ Tcl_WideInt (*tcl_Tell) _ANSI_ARGS_((Tcl_Channel chan)); /* 492 */ - Tcl_DriverWideSeekProc * (*tcl_ChannelWideSeekProc) _ANSI_ARGS_((Tcl_ChannelType * chanTypePtr)); /* 493 */ - void *reserved494; - void *reserved495; - void *reserved496; - void *reserved497; - void *reserved498; - void *reserved499; - void *reserved500; - void *reserved501; - void *reserved502; - void *reserved503; - void *reserved504; - void *reserved505; - void *reserved506; - void *reserved507; - void *reserved508; - void *reserved509; - void *reserved510; - void *reserved511; - void *reserved512; - void *reserved513; - void *reserved514; - void *reserved515; - void *reserved516; - void *reserved517; - void *reserved518; - void *reserved519; - void *reserved520; - void *reserved521; - void *reserved522; - void *reserved523; - void *reserved524; - void *reserved525; - void *reserved526; - void *reserved527; - void *reserved528; - void *reserved529; - void *reserved530; - void *reserved531; - void *reserved532; - void *reserved533; - void *reserved534; - void *reserved535; - void *reserved536; - void *reserved537; - void *reserved538; - void *reserved539; - void *reserved540; - void *reserved541; - void *reserved542; - void *reserved543; - void *reserved544; - void *reserved545; - void *reserved546; - void *reserved547; - void *reserved548; - void *reserved549; - void *reserved550; - void *reserved551; - void *reserved552; - void *reserved553; - Tcl_DriverThreadActionProc * (*tcl_ChannelThreadActionProc) _ANSI_ARGS_((Tcl_ChannelType * chanTypePtr)); /* 554 */ - void *reserved555; - void *reserved556; - void *reserved557; - void *reserved558; - void *reserved559; - void *reserved560; - void *reserved561; - void *reserved562; - void *reserved563; - void *reserved564; - void *reserved565; - void *reserved566; - void *reserved567; - void *reserved568; - void *reserved569; - void *reserved570; - void *reserved571; - void *reserved572; - int (*tcl_PkgRequireProc) _ANSI_ARGS_((Tcl_Interp * interp, CONST char * name, int objc, Tcl_Obj *CONST objv[], ClientData * clientDataPtr)); /* 573 */ + Tcl_DriverWideSeekProc * (*tcl_ChannelWideSeekProc) _ANSI_ARGS_((Tcl_ChannelType *chanTypePtr)); /* 493 */ + VOID *reserved494; + VOID *reserved495; + VOID *reserved496; + VOID *reserved497; + VOID *reserved498; + VOID *reserved499; + VOID *reserved500; + VOID *reserved501; + VOID *reserved502; + VOID *reserved503; + VOID *reserved504; + VOID *reserved505; + VOID *reserved506; + VOID *reserved507; + VOID *reserved508; + VOID *reserved509; + VOID *reserved510; + VOID *reserved511; + VOID *reserved512; + VOID *reserved513; + VOID *reserved514; + VOID *reserved515; + VOID *reserved516; + VOID *reserved517; + VOID *reserved518; + VOID *reserved519; + VOID *reserved520; + VOID *reserved521; + VOID *reserved522; + VOID *reserved523; + VOID *reserved524; + VOID *reserved525; + VOID *reserved526; + VOID *reserved527; + VOID *reserved528; + VOID *reserved529; + VOID *reserved530; + VOID *reserved531; + VOID *reserved532; + VOID *reserved533; + VOID *reserved534; + VOID *reserved535; + VOID *reserved536; + VOID *reserved537; + VOID *reserved538; + VOID *reserved539; + VOID *reserved540; + VOID *reserved541; + VOID *reserved542; + VOID *reserved543; + VOID *reserved544; + VOID *reserved545; + VOID *reserved546; + VOID *reserved547; + VOID *reserved548; + VOID *reserved549; + VOID *reserved550; + VOID *reserved551; + VOID *reserved552; + VOID *reserved553; + Tcl_DriverThreadActionProc * (*tcl_ChannelThreadActionProc) _ANSI_ARGS_((Tcl_ChannelType *chanTypePtr)); /* 554 */ + VOID *reserved555; + VOID *reserved556; + VOID *reserved557; + VOID *reserved558; + VOID *reserved559; + VOID *reserved560; + VOID *reserved561; + VOID *reserved562; + VOID *reserved563; + VOID *reserved564; + VOID *reserved565; + VOID *reserved566; + VOID *reserved567; + VOID *reserved568; + VOID *reserved569; + VOID *reserved570; + VOID *reserved571; + VOID *reserved572; + int (*tcl_PkgRequireProc) _ANSI_ARGS_((Tcl_Interp *interp, CONST char *name, int objc, Tcl_Obj *CONST objv[], ClientData *clientDataPtr)); /* 573 */ + VOID *reserved574; + VOID *reserved575; + VOID *reserved576; + VOID *reserved577; + VOID *reserved578; + VOID *reserved579; + VOID *reserved580; + VOID *reserved581; + VOID *reserved582; + VOID *reserved583; + VOID *reserved584; + VOID *reserved585; + VOID *reserved586; + VOID *reserved587; + VOID *reserved588; + VOID *reserved589; + VOID *reserved590; + VOID *reserved591; + VOID *reserved592; + VOID *reserved593; + VOID *reserved594; + VOID *reserved595; + VOID *reserved596; + VOID *reserved597; + VOID *reserved598; + VOID *reserved599; + VOID *reserved600; + VOID *reserved601; + VOID *reserved602; + VOID *reserved603; + VOID *reserved604; + VOID *reserved605; + VOID *reserved606; + VOID *reserved607; + VOID *reserved608; + VOID *reserved609; + VOID *reserved610; + VOID *reserved611; + VOID *reserved612; + VOID *reserved613; + VOID *reserved614; + VOID *reserved615; + VOID *reserved616; + VOID *reserved617; + VOID *reserved618; + VOID *reserved619; + VOID *reserved620; + VOID *reserved621; + VOID *reserved622; + VOID *reserved623; + VOID *reserved624; + VOID *reserved625; + VOID *reserved626; + VOID *reserved627; + VOID *reserved628; + VOID *reserved629; + void (*tclUnusedStubEntry) _ANSI_ARGS_((void)); /* 630 */ } TclStubs; #ifdef __cplusplus extern "C" { #endif -extern const TclStubs *tclStubsPtr; +extern TclStubs *tclStubsPtr; #ifdef __cplusplus } #endif @@ -2335,18 +2405,30 @@ #define Tcl_DbCkrealloc \ (tclStubsPtr->tcl_DbCkrealloc) /* 8 */ #endif -#if !defined(__WIN32__) && !defined(MAC_TCL) /* UNIX */ +#if !defined(__WIN32__) && !defined(MAC_OSX_TCL) /* UNIX */ #ifndef Tcl_CreateFileHandler #define Tcl_CreateFileHandler \ (tclStubsPtr->tcl_CreateFileHandler) /* 9 */ #endif #endif /* UNIX */ -#if !defined(__WIN32__) && !defined(MAC_TCL) /* UNIX */ +#ifdef MAC_OSX_TCL /* MACOSX */ +#ifndef Tcl_CreateFileHandler +#define Tcl_CreateFileHandler \ + (tclStubsPtr->tcl_CreateFileHandler) /* 9 */ +#endif +#endif /* MACOSX */ +#if !defined(__WIN32__) && !defined(MAC_OSX_TCL) /* UNIX */ #ifndef Tcl_DeleteFileHandler #define Tcl_DeleteFileHandler \ (tclStubsPtr->tcl_DeleteFileHandler) /* 10 */ #endif #endif /* UNIX */ +#ifdef MAC_OSX_TCL /* MACOSX */ +#ifndef Tcl_DeleteFileHandler +#define Tcl_DeleteFileHandler \ + (tclStubsPtr->tcl_DeleteFileHandler) /* 10 */ +#endif +#endif /* MACOSX */ #ifndef Tcl_SetTimer #define Tcl_SetTimer \ (tclStubsPtr->tcl_SetTimer) /* 11 */ @@ -2747,18 +2829,10 @@ #define Tcl_DeleteInterp \ (tclStubsPtr->tcl_DeleteInterp) /* 110 */ #endif -#if !defined(__WIN32__) && !defined(MAC_TCL) /* UNIX */ -#ifndef Tcl_DetachPids -#define Tcl_DetachPids \ - (tclStubsPtr->tcl_DetachPids) /* 111 */ -#endif -#endif /* UNIX */ -#ifdef __WIN32__ #ifndef Tcl_DetachPids #define Tcl_DetachPids \ (tclStubsPtr->tcl_DetachPids) /* 111 */ #endif -#endif /* __WIN32__ */ #ifndef Tcl_DeleteTimerHandler #define Tcl_DeleteTimerHandler \ (tclStubsPtr->tcl_DeleteTimerHandler) /* 112 */ @@ -2979,12 +3053,18 @@ #define Tcl_GetObjResult \ (tclStubsPtr->tcl_GetObjResult) /* 166 */ #endif -#if !defined(__WIN32__) && !defined(MAC_TCL) /* UNIX */ +#if !defined(__WIN32__) && !defined(MAC_OSX_TCL) /* UNIX */ #ifndef Tcl_GetOpenFile #define Tcl_GetOpenFile \ (tclStubsPtr->tcl_GetOpenFile) /* 167 */ #endif #endif /* UNIX */ +#ifdef MAC_OSX_TCL /* MACOSX */ +#ifndef Tcl_GetOpenFile +#define Tcl_GetOpenFile \ + (tclStubsPtr->tcl_GetOpenFile) /* 167 */ +#endif +#endif /* MACOSX */ #ifndef Tcl_GetPathType #define Tcl_GetPathType \ (tclStubsPtr->tcl_GetPathType) /* 168 */ @@ -3098,18 +3178,10 @@ #define Tcl_ObjSetVar2 \ (tclStubsPtr->tcl_ObjSetVar2) /* 196 */ #endif -#if !defined(__WIN32__) && !defined(MAC_TCL) /* UNIX */ -#ifndef Tcl_OpenCommandChannel -#define Tcl_OpenCommandChannel \ - (tclStubsPtr->tcl_OpenCommandChannel) /* 197 */ -#endif -#endif /* UNIX */ -#ifdef __WIN32__ #ifndef Tcl_OpenCommandChannel #define Tcl_OpenCommandChannel \ (tclStubsPtr->tcl_OpenCommandChannel) /* 197 */ #endif -#endif /* __WIN32__ */ #ifndef Tcl_OpenFileChannel #define Tcl_OpenFileChannel \ (tclStubsPtr->tcl_OpenFileChannel) /* 198 */ @@ -3146,18 +3218,10 @@ #define Tcl_Read \ (tclStubsPtr->tcl_Read) /* 206 */ #endif -#if !defined(__WIN32__) && !defined(MAC_TCL) /* UNIX */ -#ifndef Tcl_ReapDetachedProcs -#define Tcl_ReapDetachedProcs \ - (tclStubsPtr->tcl_ReapDetachedProcs) /* 207 */ -#endif -#endif /* UNIX */ -#ifdef __WIN32__ #ifndef Tcl_ReapDetachedProcs #define Tcl_ReapDetachedProcs \ (tclStubsPtr->tcl_ReapDetachedProcs) /* 207 */ #endif -#endif /* __WIN32__ */ #ifndef Tcl_RecordAndEval #define Tcl_RecordAndEval \ (tclStubsPtr->tcl_RecordAndEval) /* 208 */ @@ -4385,10 +4449,165 @@ #define Tcl_PkgRequireProc \ (tclStubsPtr->tcl_PkgRequireProc) /* 573 */ #endif +/* Slot 574 is reserved */ +/* Slot 575 is reserved */ +/* Slot 576 is reserved */ +/* Slot 577 is reserved */ +/* Slot 578 is reserved */ +/* Slot 579 is reserved */ +/* Slot 580 is reserved */ +/* Slot 581 is reserved */ +/* Slot 582 is reserved */ +/* Slot 583 is reserved */ +/* Slot 584 is reserved */ +/* Slot 585 is reserved */ +/* Slot 586 is reserved */ +/* Slot 587 is reserved */ +/* Slot 588 is reserved */ +/* Slot 589 is reserved */ +/* Slot 590 is reserved */ +/* Slot 591 is reserved */ +/* Slot 592 is reserved */ +/* Slot 593 is reserved */ +/* Slot 594 is reserved */ +/* Slot 595 is reserved */ +/* Slot 596 is reserved */ +/* Slot 597 is reserved */ +/* Slot 598 is reserved */ +/* Slot 599 is reserved */ +/* Slot 600 is reserved */ +/* Slot 601 is reserved */ +/* Slot 602 is reserved */ +/* Slot 603 is reserved */ +/* Slot 604 is reserved */ +/* Slot 605 is reserved */ +/* Slot 606 is reserved */ +/* Slot 607 is reserved */ +/* Slot 608 is reserved */ +/* Slot 609 is reserved */ +/* Slot 610 is reserved */ +/* Slot 611 is reserved */ +/* Slot 612 is reserved */ +/* Slot 613 is reserved */ +/* Slot 614 is reserved */ +/* Slot 615 is reserved */ +/* Slot 616 is reserved */ +/* Slot 617 is reserved */ +/* Slot 618 is reserved */ +/* Slot 619 is reserved */ +/* Slot 620 is reserved */ +/* Slot 621 is reserved */ +/* Slot 622 is reserved */ +/* Slot 623 is reserved */ +/* Slot 624 is reserved */ +/* Slot 625 is reserved */ +/* Slot 626 is reserved */ +/* Slot 627 is reserved */ +/* Slot 628 is reserved */ +/* Slot 629 is reserved */ +#ifndef TclUnusedStubEntry +#define TclUnusedStubEntry \ + (tclStubsPtr->tclUnusedStubEntry) /* 630 */ +#endif #endif /* defined(USE_TCL_STUBS) && !defined(USE_TCL_STUB_PROCS) */ /* !END!: Do not edit above this line. */ +#undef TclUnusedStubEntry + +#undef Tcl_PkgPresent +#define Tcl_PkgPresent(interp, name, version, exact) \ + Tcl_PkgPresentEx(interp, name, version, exact, NULL) +#undef Tcl_PkgProvide +#define Tcl_PkgProvide(interp, name, version) \ + Tcl_PkgProvideEx(interp, name, version, NULL) +#undef Tcl_PkgRequire +#define Tcl_PkgRequire(interp, name, version, exact) \ + Tcl_PkgRequireEx(interp, name, version, exact, NULL) +#undef Tcl_GetIndexFromObj +#define Tcl_GetIndexFromObj(interp, objPtr, tablePtr, msg, flags, indexPtr) \ + Tcl_GetIndexFromObjStruct(interp, objPtr, tablePtr, \ + sizeof(char *), msg, flags, indexPtr) +#undef Tcl_SetVar +#define Tcl_SetVar(interp, varName, newValue, flags) \ + Tcl_SetVar2(interp, varName, NULL, newValue, flags) +#undef Tcl_UnsetVar +#define Tcl_UnsetVar(interp, varName, flags) \ + Tcl_UnsetVar2(interp, varName, NULL, flags) +#undef Tcl_GetVar +#define Tcl_GetVar(interp, varName, flags) \ + Tcl_GetVar2(interp, varName, NULL, flags) +#undef Tcl_TraceVar +#define Tcl_TraceVar(interp, varName, flags, proc, clientData) \ + Tcl_TraceVar2(interp, varName, NULL, flags, proc, clientData) +#undef Tcl_UntraceVar +#define Tcl_UntraceVar(interp, varName, flags, proc, clientData) \ + Tcl_UntraceVar2(interp, varName, NULL, flags, proc, clientData) +#undef Tcl_VarTraceInfo +#define Tcl_VarTraceInfo(interp, varName, flags, proc, prevClientData) \ + Tcl_VarTraceInfo2(interp, varName, NULL, flags, proc, prevClientData) +#undef Tcl_UpVar +#define Tcl_UpVar(interp, frameName, varName, localName, flags) \ + Tcl_UpVar2(interp, frameName, varName, NULL, localName, flags) + +#if defined(USE_TCL_STUBS) && !defined(USE_TCL_STUB_PROCS) +# if defined(__CYGWIN__) && defined(TCL_WIDE_INT_IS_LONG) +/* On Cygwin64, long is 64-bit while on Win64 long is 32-bit. Therefore + * we have to make sure that all stub entries on Cygwin64 follow the + * Win64 signature. Cygwin64 stubbed extensions cannot use those stub + * entries any more, they should use the 64-bit alternatives where + * possible. Tcl 9 must find a better solution, but that cannot be done + * without introducing a binary incompatibility. + */ +# undef Tcl_DbNewLongObj +# undef Tcl_GetLongFromObj +# undef Tcl_NewLongObj +# undef Tcl_SetLongObj +# undef Tcl_ExprLong +# undef Tcl_ExprLongObj +# undef Tcl_UniCharNcmp +# undef Tcl_UtfNcmp +# undef Tcl_UtfNcasecmp +# undef Tcl_UniCharNcasecmp +# define Tcl_DbNewLongObj ((Tcl_Obj*(*)(long,const char*,int))Tcl_DbNewWideIntObj) +# define Tcl_GetLongFromObj ((int(*)(Tcl_Interp*,Tcl_Obj*,long*))Tcl_GetWideIntFromObj) +# define Tcl_NewLongObj ((Tcl_Obj*(*)(long))Tcl_NewWideIntObj) +# define Tcl_SetLongObj ((void(*)(Tcl_Obj*,long))Tcl_SetWideIntObj) +# define Tcl_ExprLong TclExprLong + static inline int TclExprLong(Tcl_Interp *interp, const char *string, long *ptr){ + int intValue; + int result = tclStubsPtr->tcl_ExprLong(interp, string, (long *)&intValue); + if (result == TCL_OK) *ptr = (long)intValue; + return result; + } +# define Tcl_ExprLongObj TclExprLongObj + static inline int TclExprLongObj(Tcl_Interp *interp, Tcl_Obj *obj, long *ptr){ + int intValue; + int result = tclStubsPtr->tcl_ExprLongObj(interp, obj, (long *)&intValue); + if (result == TCL_OK) *ptr = (long)intValue; + return result; + } +# define Tcl_UniCharNcmp(ucs,uct,n) \ + ((int(*)(const Tcl_UniChar*,const Tcl_UniChar*,unsigned int))tclStubsPtr->tcl_UniCharNcmp)(ucs,uct,(unsigned int)(n)) +# define Tcl_UtfNcmp(s1,s2,n) \ + ((int(*)(const char*,const char*,unsigned int))tclStubsPtr->tcl_UtfNcmp)(s1,s2,(unsigned int)(n)) +# define Tcl_UtfNcasecmp(s1,s2,n) \ + ((int(*)(const char*,const char*,unsigned int))tclStubsPtr->tcl_UtfNcasecmp)(s1,s2,(unsigned int)(n)) +# define Tcl_UniCharNcasecmp(ucs,uct,n) \ + ((int(*)(const Tcl_UniChar*,const Tcl_UniChar*,unsigned int))tclStubsPtr->tcl_UniCharNcasecmp)(ucs,uct,(unsigned int)(n)) +# endif +#endif + +/* + * Deprecated Tcl procedures: + */ +#undef Tcl_EvalObj +#define Tcl_EvalObj(interp,objPtr) \ + Tcl_EvalObjEx((interp),(objPtr),0) +#undef Tcl_GlobalEvalObj +#define Tcl_GlobalEvalObj(interp,objPtr) \ + Tcl_EvalObjEx((interp),(objPtr),TCL_EVAL_GLOBAL) + #endif /* _TCLDECLS */ diff -Nru critcl-3.1.9/lib/critcl/critcl_c/tcl8.4/tcl.h critcl-3.1.17+dfsg/lib/critcl/critcl_c/tcl8.4/tcl.h --- critcl-3.1.9/lib/critcl/critcl_c/tcl8.4/tcl.h 2013-05-10 05:57:04.000000000 +0000 +++ critcl-3.1.17+dfsg/lib/critcl/critcl_c/tcl8.4/tcl.h 2017-10-14 02:48:11.000000000 +0000 @@ -12,8 +12,6 @@ * * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tcl.h,v 1.153.2.39 2010/07/18 21:39:19 nijtmans Exp $ */ #ifndef _TCL @@ -59,10 +57,10 @@ #define TCL_MAJOR_VERSION 8 #define TCL_MINOR_VERSION 4 #define TCL_RELEASE_LEVEL TCL_FINAL_RELEASE -#define TCL_RELEASE_SERIAL 19 +#define TCL_RELEASE_SERIAL 20 #define TCL_VERSION "8.4" -#define TCL_PATCH_LEVEL "8.4.19" +#define TCL_PATCH_LEVEL "8.4.20" /* * The following definitions set up the proper options for Windows @@ -84,6 +82,7 @@ /* * STRICT: See MSDN Article Q83456 */ + #ifdef __WIN32__ # ifndef STRICT # define STRICT @@ -91,23 +90,6 @@ #endif /* __WIN32__ */ /* - * The following definitions set up the proper options for Macintosh - * compilers. We use this method because there is no autoconf equivalent. - */ - -#ifdef MAC_TCL -#include -# ifndef USE_TCLALLOC -# define USE_TCLALLOC 1 -# endif -# ifndef NO_STRERROR -# define NO_STRERROR 1 -# endif -# define INLINE -#endif - - -/* * Utility macros: STRINGIFY takes an argument and wraps it in "" (double * quotation marks), JOIN joins two arguments. */ @@ -122,9 +104,8 @@ /* * A special definition used to allow this header file to be included - * from windows or mac resource files so that they can obtain version - * information. RC_INVOKED is defined by default by the windows RC tool - * and manually set for macintosh. + * from windows resource files so that they can obtain version + * information. RC_INVOKED is defined by default by the windows RC tool. * * Resource compilers don't like all the C stuff, like typedefs and * procedure declarations, that occur below, so block them out. @@ -184,11 +165,6 @@ # define TCL_VARARGS_START(type, name, list) \ (va_start(list), va_arg(list, type)) #endif -#if defined(__GNUC__) && (__GNUC__ > 2) -# define TCL_FORMAT_PRINTF(a,b) __attribute__ ((__format__ (__printf__, a, b))) -#else -# define TCL_FORMAT_PRINTF(a,b) -#endif /* * Macros used to declare a function to be exported by a DLL. @@ -241,11 +217,11 @@ # endif #endif - /* * Definitions that allow this header file to be used either with or * without ANSI C features like function prototypes. */ + #undef _ANSI_ARGS_ #undef CONST #ifndef INLINE @@ -272,7 +248,7 @@ # define CONST84_RETURN #else # ifdef USE_COMPAT_CONST -# define CONST84 +# define CONST84 # define CONST84_RETURN CONST # else # define CONST84 CONST @@ -280,10 +256,10 @@ # endif #endif - /* * Make sure EXTERN isn't defined elsewhere */ + #ifdef EXTERN # undef EXTERN #endif /* EXTERN */ @@ -294,15 +270,15 @@ # define EXTERN extern TCL_STORAGE_CLASS #endif - /* * The following code is copied from winnt.h. - * If we don't replicate it here, then can't be included + * If we don't replicate it here, then can't be included * after tcl.h, since tcl.h also defines VOID. * This block is skipped under Cygwin and Mingw. * * */ + #if defined(__WIN32__) && !defined(HAVE_WINNT_IGNORE_VOID) #ifndef VOID #define VOID void @@ -318,10 +294,12 @@ * non-ANSI systems. */ -#ifndef NO_VOID -# define VOID void -#else -# define VOID char +#ifndef __VXWORKS__ +# ifndef NO_VOID +# define VOID void +# else +# define VOID char +# endif #endif /* @@ -379,32 +357,20 @@ */ #if !defined(TCL_WIDE_INT_TYPE)&&!defined(TCL_WIDE_INT_IS_LONG) -# if defined(__GNUC__) -# define TCL_WIDE_INT_TYPE long long -# if defined(__WIN32__) && !defined(__CYGWIN__) -# define TCL_LL_MODIFIER "I64" -# define TCL_LL_MODIFIER_SIZE 3 -# else -# define TCL_LL_MODIFIER "ll" -# define TCL_LL_MODIFIER_SIZE 2 -# endif -typedef struct stat Tcl_StatBuf; -# elif defined(__WIN32__) +# if defined(__WIN32__) # define TCL_WIDE_INT_TYPE __int64 # ifdef __BORLANDC__ -typedef struct stati64 Tcl_StatBuf; # define TCL_LL_MODIFIER "L" # define TCL_LL_MODIFIER_SIZE 1 # else /* __BORLANDC__ */ -# if _MSC_VER < 1400 || !defined(_M_IX86) -typedef struct _stati64 Tcl_StatBuf; -# else -typedef struct _stat64 Tcl_StatBuf; -# endif /* _MSC_VER < 1400 */ # define TCL_LL_MODIFIER "I64" # define TCL_LL_MODIFIER_SIZE 3 # endif /* __BORLANDC__ */ -# else /* __WIN32__ */ +# elif defined(__GNUC__) +# define TCL_WIDE_INT_TYPE long long +# define TCL_LL_MODIFIER "ll" +# define TCL_LL_MODIFIER_SIZE 2 +# else /* ! __WIN32__ && ! __GNUC__ */ /* * Don't know what platform it is and configure hasn't discovered what * is going on for us. Try to guess... @@ -430,7 +396,6 @@ typedef unsigned TCL_WIDE_INT_TYPE Tcl_WideUInt; #ifdef TCL_WIDE_INT_IS_LONG -typedef struct stat Tcl_StatBuf; # define Tcl_WideAsLong(val) ((long)(val)) # define Tcl_LongAsWide(val) ((long)(val)) # define Tcl_WideAsDouble(val) ((double)((long)(val))) @@ -445,11 +410,6 @@ * Windows or some other strange platform. */ # ifndef TCL_LL_MODIFIER -# ifdef HAVE_STRUCT_STAT64 -typedef struct stat64 Tcl_StatBuf; -# else -typedef struct stat Tcl_StatBuf; -# endif /* HAVE_STRUCT_STAT64 */ # define TCL_LL_MODIFIER "ll" # define TCL_LL_MODIFIER_SIZE 2 # endif /* !TCL_LL_MODIFIER */ @@ -458,6 +418,39 @@ # define Tcl_WideAsDouble(val) ((double)((Tcl_WideInt)(val))) # define Tcl_DoubleAsWide(val) ((Tcl_WideInt)((double)(val))) #endif /* TCL_WIDE_INT_IS_LONG */ + +#if defined(__WIN32__) +# ifdef __BORLANDC__ + typedef struct stati64 Tcl_StatBuf; +# elif defined(_WIN64) + typedef struct __stat64 Tcl_StatBuf; +# elif (defined(_MSC_VER) && (_MSC_VER < 1400)) || defined(_USE_32BIT_TIME_T) + typedef struct _stati64 Tcl_StatBuf; +# else + typedef struct _stat32i64 Tcl_StatBuf; +# endif /* _MSC_VER < 1400 */ +#elif defined(__CYGWIN__) + typedef struct _stat32i64 { + dev_t st_dev; + unsigned short st_ino; + unsigned short st_mode; + short st_nlink; + short st_uid; + short st_gid; + /* Here is a 2-byte gap */ + dev_t st_rdev; + /* Here is a 4-byte gap */ + long long st_size; + struct {long tv_sec;} st_atim; + struct {long tv_sec;} st_mtim; + struct {long tv_sec;} st_ctim; + /* Here is a 4-byte gap */ + } Tcl_StatBuf; +#elif defined(HAVE_STRUCT_STAT64) + typedef struct stat64 Tcl_StatBuf; +#else + typedef struct stat Tcl_StatBuf; +#endif /* @@ -529,36 +522,30 @@ * 'Tcl_CreateThread' and will be called as the main fuction of * the new thread created by that call. */ -#ifdef MAC_TCL -typedef pascal void *(Tcl_ThreadCreateProc) _ANSI_ARGS_((ClientData clientData)); -#elif defined __WIN32__ +#if defined __WIN32__ typedef unsigned (__stdcall Tcl_ThreadCreateProc) _ANSI_ARGS_((ClientData clientData)); #else typedef void (Tcl_ThreadCreateProc) _ANSI_ARGS_((ClientData clientData)); #endif - /* * Threading function return types used for abstracting away platform * differences when writing a Tcl_ThreadCreateProc. See the NewThread * function in generic/tclThreadTest.c for it's usage. */ -#ifdef MAC_TCL -# define Tcl_ThreadCreateType pascal void * -# define TCL_THREAD_CREATE_RETURN return NULL -#elif defined __WIN32__ +#ifdef __WIN32__ # define Tcl_ThreadCreateType unsigned __stdcall # define TCL_THREAD_CREATE_RETURN return 0 #else # define Tcl_ThreadCreateType void -# define TCL_THREAD_CREATE_RETURN +# define TCL_THREAD_CREATE_RETURN #endif - /* * Definition of values for default stacksize and the possible flags to be * given to Tcl_CreateThread. */ + #define TCL_THREAD_STACK_DEFAULT (0) /* Use default size for stack */ #define TCL_THREAD_NOFLAGS (0000) /* Standard flags, default behaviour */ #define TCL_THREAD_JOINABLE (0001) /* Mark the thread as joinable */ @@ -585,6 +572,7 @@ * The following flag is experimental and only intended for use by Expect. It * will probably go away in a later release. */ + #define TCL_REG_BOSONLY 002000 /* prepend \A to pattern so it only * matches at the beginning of the * string. */ @@ -600,6 +588,7 @@ * relative to the start of the match string, not the beginning of the * entire string. */ + typedef struct Tcl_RegExpIndices { long start; /* character offset of first character in match */ long end; /* character offset of first character after the @@ -620,6 +609,7 @@ * Picky compilers complain if this typdef doesn't appear before the * struct's reference in tclDecls.h. */ + typedef Tcl_StatBuf *Tcl_Stat_; typedef struct stat *Tcl_OldStat_; @@ -643,6 +633,7 @@ * TCL_CONTINUE Go on to the next iteration of the current loop; * the interpreter's result is meaningless. */ + #define TCL_OK 0 #define TCL_ERROR 1 #define TCL_RETURN 2 @@ -654,6 +645,7 @@ /* * Flags to control what substitutions are performed by Tcl_SubstObj(): */ + #define TCL_SUBST_COMMANDS 001 #define TCL_SUBST_VARIABLES 002 #define TCL_SUBST_BACKSLASHES 004 @@ -681,7 +673,6 @@ */ struct Tcl_Obj; - /* * Procedure types defined by Tcl: */ @@ -701,8 +692,8 @@ Tcl_Interp *interp, int level, CONST char *command, Tcl_Command commandInfo, int objc, struct Tcl_Obj * CONST * objv)); typedef void (Tcl_CmdObjTraceDeleteProc) _ANSI_ARGS_((ClientData clientData)); -typedef void (Tcl_DupInternalRepProc) _ANSI_ARGS_((struct Tcl_Obj *srcPtr, - struct Tcl_Obj *dupPtr)); +typedef void (Tcl_DupInternalRepProc) _ANSI_ARGS_((struct Tcl_Obj *srcPtr, + struct Tcl_Obj *dupPtr)); typedef int (Tcl_EncodingConvertProc)_ANSI_ARGS_((ClientData clientData, CONST char *src, int srcLen, int flags, Tcl_EncodingState *statePtr, char *dst, int dstLen, int *srcReadPtr, int *dstWrotePtr, @@ -712,7 +703,7 @@ typedef void (Tcl_EventCheckProc) _ANSI_ARGS_((ClientData clientData, int flags)); typedef int (Tcl_EventDeleteProc) _ANSI_ARGS_((Tcl_Event *evPtr, - ClientData clientData)); + ClientData clientData)); typedef void (Tcl_EventSetupProc) _ANSI_ARGS_((ClientData clientData, int flags)); typedef void (Tcl_ExitProc) _ANSI_ARGS_((ClientData clientData)); @@ -731,13 +722,14 @@ typedef int (Tcl_PackageInitProc) _ANSI_ARGS_((Tcl_Interp *interp)); typedef void (Tcl_PanicProc) _ANSI_ARGS_(TCL_VARARGS(CONST char *, format)); typedef void (Tcl_TcpAcceptProc) _ANSI_ARGS_((ClientData callbackData, - Tcl_Channel chan, char *address, int port)); + Tcl_Channel chan, char *address, int port)); typedef void (Tcl_TimerProc) _ANSI_ARGS_((ClientData clientData)); typedef int (Tcl_SetFromAnyProc) _ANSI_ARGS_((Tcl_Interp *interp, struct Tcl_Obj *objPtr)); typedef void (Tcl_UpdateStringProc) _ANSI_ARGS_((struct Tcl_Obj *objPtr)); typedef char *(Tcl_VarTraceProc) _ANSI_ARGS_((ClientData clientData, - Tcl_Interp *interp, CONST84 char *part1, CONST84 char *part2, int flags)); + Tcl_Interp *interp, CONST84 char *part1, CONST84 char *part2, + int flags)); typedef void (Tcl_CommandTraceProc) _ANSI_ARGS_((ClientData clientData, Tcl_Interp *interp, CONST char *oldName, CONST char *newName, int flags)); @@ -820,9 +812,7 @@ * Note: clients should use Tcl_DecrRefCount() when they are finished using * an object, and should never call TclFreeObj() directly. TclFreeObj() is * only defined and made public in tcl.h to support Tcl_DecrRefCount's macro - * definition. Note also that Tcl_DecrRefCount() refers to the parameter - * "obj" twice. This means that you should avoid calling it with an - * expression that is expensive to compute or has side effects. + * definition. */ void Tcl_IncrRefCount _ANSI_ARGS_((Tcl_Obj *objPtr)); void Tcl_DecrRefCount _ANSI_ARGS_((Tcl_Obj *objPtr)); @@ -843,7 +833,12 @@ * http://c2.com/cgi/wiki?TrivialDoWhileLoop */ # define Tcl_DecrRefCount(objPtr) \ - do { if (--(objPtr)->refCount <= 0) TclFreeObj(objPtr); } while(0) + do { \ + Tcl_Obj *_objPtr = (objPtr); \ + if (--(_objPtr)->refCount <= 0) { \ + TclFreeObj(_objPtr); \ + } \ + } while(0) # define Tcl_IsShared(objPtr) \ ((objPtr)->refCount > 1) #endif @@ -891,7 +886,6 @@ char resultSpace[TCL_RESULT_SIZE+1]; } Tcl_SavedResult; - /* * The following definitions support Tcl's namespace facility. * Note: the first five fields must match exactly the fields in a @@ -916,7 +910,6 @@ * namespace. */ } Tcl_Namespace; - /* * The following structure represents a call frame, or activation record. * A call frame defines a naming context for a procedure call: its local @@ -956,7 +949,6 @@ VOID *dummy13; } Tcl_CallFrame; - /* * Information about commands that is returned by Tcl_GetCommandInfo and * passed to Tcl_SetCommandInfo. objProc is an objc/objv object-based @@ -998,6 +990,7 @@ * field that clients should use is the string field, accessible via the * macro Tcl_DStringValue. */ + #define TCL_DSTRING_STATIC_SIZE 200 typedef struct Tcl_DString { char *string; /* Points to beginning of string: either @@ -1020,6 +1013,7 @@ * be specified in the "tcl_precision" variable, and the number of * bytes of buffer space required by Tcl_PrintDouble. */ + #define TCL_MAX_PREC 17 #define TCL_DOUBLE_SPACE (TCL_MAX_PREC+10) @@ -1028,6 +1022,7 @@ * string representation of an integer in base 10 (assuming the existence * of 64-bit integers). */ + #define TCL_INTEGER_SPACE 24 /* @@ -1035,12 +1030,14 @@ * output braces (careful! if you change this flag be sure to change * the definitions at the front of tclUtil.c). */ + #define TCL_DONT_USE_BRACES 1 /* * Flag that may be passed to Tcl_GetIndexFromObj to force it to disallow * abbreviated strings. */ + #define TCL_EXACT 1 /* @@ -1057,6 +1054,7 @@ * Special freeProc values that may be passed to Tcl_SetResult (see * the man page for details): */ + #define TCL_VOLATILE ((Tcl_FreeProc *) 1) #define TCL_STATIC ((Tcl_FreeProc *) 0) #define TCL_DYNAMIC ((Tcl_FreeProc *) 3) @@ -1064,6 +1062,7 @@ /* * Flag values passed to variable-related procedures. */ + #define TCL_GLOBAL_ONLY 1 #define TCL_NAMESPACE_ONLY 2 #define TCL_APPEND_VALUE 4 @@ -1111,7 +1110,6 @@ # define TCL_PARSE_PART1 0x400 #endif - /* * Types for linked variables: */ @@ -1122,10 +1120,10 @@ #define TCL_LINK_WIDE_INT 5 #define TCL_LINK_READ_ONLY 0x80 - /* * Forward declarations of Tcl_HashTable and related types. */ + typedef struct Tcl_HashKeyType Tcl_HashKeyType; typedef struct Tcl_HashTable Tcl_HashTable; typedef struct Tcl_HashEntry Tcl_HashEntry; @@ -1145,6 +1143,7 @@ * access the bucketPtr member of the Tcl_HashTableEntry structure. This * member has been removed and the space used to store the hash value. */ + #ifndef TCL_HASH_KEY_STORE_HASH # define TCL_HASH_KEY_STORE_HASH 1 #endif @@ -1390,6 +1389,7 @@ * a Tcl_Event header followed by additional information specific to that * event. */ + struct Tcl_Event { Tcl_EventProc *proc; /* Procedure to call to service this event. */ struct Tcl_Event *nextPtr; /* Next in list of pending events, or NULL. */ @@ -1398,6 +1398,7 @@ /* * Positions to pass to Tcl_QueueEvent: */ + typedef enum { TCL_QUEUE_TAIL, TCL_QUEUE_HEAD, TCL_QUEUE_MARK } Tcl_QueuePosition; @@ -1406,16 +1407,16 @@ * Values to pass to Tcl_SetServiceMode to specify the behavior of notifier * event routines. */ + #define TCL_SERVICE_NONE 0 #define TCL_SERVICE_ALL 1 - /* * The following structure keeps is used to hold a time value, either as * an absolute time (the number of seconds from the epoch) or as an * elapsed time. On Unix systems the epoch is Midnight Jan 1, 1970 GMT. - * On Macintosh systems the epoch is Midnight Jan 1, 1904 GMT. */ + typedef struct Tcl_Time { long sec; /* Seconds. */ long usec; /* Microseconds. */ @@ -1424,7 +1425,6 @@ typedef void (Tcl_SetTimerProc) _ANSI_ARGS_((Tcl_Time *timePtr)); typedef int (Tcl_WaitForEventProc) _ANSI_ARGS_((Tcl_Time *timePtr)); - /* * Bits to pass to Tcl_CreateFileHandler and Tcl_CreateChannelHandler * to indicate what sorts of events are of interest: @@ -1438,6 +1438,7 @@ * disposition of the stdio handles. TCL_STDIN, TCL_STDOUT, TCL_STDERR, * are also used in Tcl_GetStdChannel. */ + #define TCL_STDIN (1<<1) #define TCL_STDOUT (1<<2) #define TCL_STDERR (1<<3) @@ -1454,11 +1455,13 @@ * Value to use as the closeProc for a channel that supports the * close2Proc interface. */ + #define TCL_CLOSE2PROC ((Tcl_DriverCloseProc *)1) /* * Channel version tag. This was introduced in 8.3.2/8.4. */ + #define TCL_CHANNEL_VERSION_1 ((Tcl_ChannelTypeVersion) 0x1) #define TCL_CHANNEL_VERSION_2 ((Tcl_ChannelTypeVersion) 0x2) #define TCL_CHANNEL_VERSION_3 ((Tcl_ChannelTypeVersion) 0x3) @@ -1474,6 +1477,7 @@ /* * Typedefs for the various operations in a channel type: */ + typedef int (Tcl_DriverBlockModeProc) _ANSI_ARGS_(( ClientData instanceData, int mode)); typedef int (Tcl_DriverCloseProc) _ANSI_ARGS_((ClientData instanceData, @@ -1550,6 +1554,7 @@ * It is recommend that the Tcl_Channel* functions are used to access * elements of this structure, instead of direct accessing. */ + typedef struct Tcl_ChannelType { char *typeName; /* The name of the channel type in Tcl * commands. This storage is owned by @@ -1622,13 +1627,13 @@ /* * Enum for different types of file paths. */ + typedef enum Tcl_PathType { TCL_PATH_ABSOLUTE, TCL_PATH_RELATIVE, TCL_PATH_VOLUME_RELATIVE } Tcl_PathType; - /* * The following structure is used to pass glob type data amongst * the various glob routines and Tcl_FSMatchInDirectory. @@ -1647,6 +1652,7 @@ /* * type and permission definitions for glob command */ + #define TCL_GLOB_TYPE_BLOCK (1<<0) #define TCL_GLOB_TYPE_CHAR (1<<1) #define TCL_GLOB_TYPE_DIR (1<<2) @@ -1662,10 +1668,10 @@ #define TCL_GLOB_PERM_W (1<<3) #define TCL_GLOB_PERM_X (1<<4) - /* * Typedefs for the various filesystem operations: */ + typedef int (Tcl_FSStatProc) _ANSI_ARGS_((Tcl_Obj *pathPtr, Tcl_StatBuf *buf)); typedef int (Tcl_FSAccessProc) _ANSI_ARGS_((Tcl_Obj *pathPtr, int mode)); typedef Tcl_Channel (Tcl_FSOpenFileChannelProc) @@ -1933,6 +1939,7 @@ * TCL_CREATE_SYMBOLIC_LINK: Create a symbolic or soft link. * TCL_CREATE_HARD_LINK: Create a hard link. */ + #define TCL_CREATE_SYMBOLIC_LINK 0x01 #define TCL_CREATE_HARD_LINK 0x02 @@ -1940,6 +1947,7 @@ * The following structure represents the Notifier functions that * you can override with the Tcl_SetNotifier call. */ + typedef struct Tcl_NotifierProcs { Tcl_SetTimerProc *setTimerProc; Tcl_WaitForEventProc *waitForEventProc; @@ -1951,11 +1959,11 @@ Tcl_ServiceModeHookProc *serviceModeHookProc; } Tcl_NotifierProcs; - /* * The following structure represents a user-defined encoding. It collects * together all the functions that are used by the specific encoding. */ + typedef struct Tcl_EncodingType { CONST char *encodingName; /* The name of the encoding, e.g. "euc-jp". * This name is the unique key for this @@ -2013,7 +2021,6 @@ #define TCL_ENCODING_END 0x02 #define TCL_ENCODING_STOPONERROR 0x04 - /* * The following data structures and declarations are for the new Tcl * parser. @@ -2024,6 +2031,7 @@ * variable reference, one of the following structures is created to * describe the token. */ + typedef struct Tcl_Token { int type; /* Type of token, such as TCL_TOKEN_WORD; * see below for valid types. */ @@ -2123,6 +2131,7 @@ * will be stored in the error field of the Tcl_Parse structure * defined below. */ + #define TCL_PARSE_SUCCESS 0 #define TCL_PARSE_QUOTE_EXTRA 1 #define TCL_PARSE_BRACE_EXTRA 2 @@ -2138,6 +2147,7 @@ * A structure of the following type is filled in by Tcl_ParseCommand. * It describes a single command parsed from an input string. */ + #define NUM_STATIC_TOKENS 20 typedef struct Tcl_Parse { @@ -2221,12 +2231,13 @@ * encoding method was misidentified. This error * is reported only if TCL_ENCODING_STOPONERROR * was specified. - * + * * TCL_CONVERT_UNKNOWN: The source string contained a character * that could not be represented in the target * encoding. This error is reported only if * TCL_ENCODING_STOPONERROR was specified. */ + #define TCL_CONVERT_MULTIBYTE -1 #define TCL_CONVERT_SYNTAX -2 #define TCL_CONVERT_UNKNOWN -3 @@ -2242,6 +2253,7 @@ * UCS-4 is experimental and not recommended. It works for the core, * but most extensions expect UCS-2. */ + #ifndef TCL_UTF_MAX #define TCL_UTF_MAX 3 #endif @@ -2250,7 +2262,8 @@ * This represents a Unicode character. Any changes to this should * also be reflected in regcustom.h. */ -#if TCL_UTF_MAX > 3 + +#if TCL_UTF_MAX > 4 /* * unsigned int isn't 100% accurate as it should be a strict 4-byte * value (perhaps wchar_t). 64-bit systems may have troubles. The @@ -2267,17 +2280,6 @@ /* - * Deprecated Tcl procedures: - */ -#ifndef TCL_NO_DEPRECATED -# define Tcl_EvalObj(interp,objPtr) \ - Tcl_EvalObjEx((interp),(objPtr),0) -# define Tcl_GlobalEvalObj(interp,objPtr) \ - Tcl_EvalObjEx((interp),(objPtr),TCL_EVAL_GLOBAL) -#endif - - -/* * These function have been renamed. The old names are deprecated, but we * define these macros for backwards compatibilty. */ @@ -2289,7 +2291,6 @@ #define panic Tcl_Panic #define panicVA Tcl_PanicVA - /* * The following constant is used to test for older versions of Tcl * in the stubs tables. @@ -2335,20 +2336,7 @@ * accessible via the stubs table. */ -/* - * tclPlatDecls.h can't be included here on the Mac, as we need - * Mac specific headers to define the Mac types used in this file, - * but these Mac haders conflict with a number of tk types - * and thus can't be included in the globally read tcl.h - * This header was originally added here as a fix for bug 5241 - * (stub link error for symbols in TclPlatStubs table), as a work- - * around for the bug on the mac, tclMac.h is included immediately - * after tcl.h in the tcl precompiled header (with DLLEXPORT set). - */ - -#if !defined(MAC_TCL) #include "tclPlatDecls.h" -#endif /* * Public functions that are not accessible via the stubs table. @@ -2362,6 +2350,7 @@ * This function is not *implemented* by the tcl library, so the storage * class is neither DLLEXPORT nor DLLIMPORT */ + #undef TCL_STORAGE_CLASS #define TCL_STORAGE_CLASS @@ -2375,8 +2364,17 @@ /* * end block for C++ */ + #ifdef __cplusplus } #endif #endif /* _TCL */ + +/* + * Local Variables: + * mode: c + * c-basic-offset: 4 + * fill-column: 78 + * End: + */ diff -Nru critcl-3.1.9/lib/critcl/critcl_c/tcl8.4/tclPlatDecls.h critcl-3.1.17+dfsg/lib/critcl/critcl_c/tcl8.4/tclPlatDecls.h --- critcl-3.1.9/lib/critcl/critcl_c/tcl8.4/tclPlatDecls.h 2013-05-10 05:57:04.000000000 +0000 +++ critcl-3.1.17+dfsg/lib/critcl/critcl_c/tcl8.4/tclPlatDecls.h 2017-10-14 02:48:11.000000000 +0000 @@ -5,29 +5,22 @@ * * Copyright (c) 1998-1999 by Scriptics Corporation. * All rights reserved. - * - * RCS: @(#) $Id: tclPlatDecls.h,v 1.18.2.5 2004/06/10 17:17:45 andreas_kupries Exp $ */ #ifndef _TCLPLATDECLS #define _TCLPLATDECLS /* - * Pull in the typedef of TCHAR for windows. + * TCHAR is needed here for win32, so if it is not defined yet do it here. + * This way, we don't need to include just for one define. */ -#if defined(__CYGWIN__) - typedef char TCHAR; -#elif defined(__WIN32__) && !defined(_TCHAR_DEFINED) -# include -# ifndef _TCHAR_DEFINED - /* Borland seems to forget to set this. */ - typedef _TCHAR TCHAR; -# define _TCHAR_DEFINED -# endif -# if defined(_MSC_VER) && defined(__STDC__) - /* MSVC++ misses this. */ - typedef _TCHAR TCHAR; +#if (defined(_WIN32) || defined(__CYGWIN__)) && !defined(_TCHAR_DEFINED) +# if defined(_UNICODE) + typedef wchar_t TCHAR; +# else + typedef char TCHAR; # endif +# define _TCHAR_DEFINED #endif /* !BEGIN!: Do not edit below this line. */ @@ -36,89 +29,46 @@ * Exported function declarations: */ -#ifdef __WIN32__ +#if defined(__WIN32__) || defined(__CYGWIN__) /* WIN */ /* 0 */ -EXTERN TCHAR * Tcl_WinUtfToTChar _ANSI_ARGS_((CONST char * str, - int len, Tcl_DString * dsPtr)); +EXTERN TCHAR * Tcl_WinUtfToTChar _ANSI_ARGS_((CONST char *str, + int len, Tcl_DString *dsPtr)); /* 1 */ -EXTERN char * Tcl_WinTCharToUtf _ANSI_ARGS_((CONST TCHAR * str, - int len, Tcl_DString * dsPtr)); -#endif /* __WIN32__ */ -#ifdef MAC_TCL -/* 0 */ -EXTERN void Tcl_MacSetEventProc _ANSI_ARGS_(( - Tcl_MacConvertEventPtr procPtr)); -/* 1 */ -EXTERN char * Tcl_MacConvertTextResource _ANSI_ARGS_(( - Handle resource)); -/* 2 */ -EXTERN int Tcl_MacEvalResource _ANSI_ARGS_((Tcl_Interp * interp, - CONST char * resourceName, - int resourceNumber, CONST char * fileName)); -/* 3 */ -EXTERN Handle Tcl_MacFindResource _ANSI_ARGS_((Tcl_Interp * interp, - long resourceType, CONST char * resourceName, - int resourceNumber, CONST char * resFileRef, - int * releaseIt)); -/* 4 */ -EXTERN int Tcl_GetOSTypeFromObj _ANSI_ARGS_(( - Tcl_Interp * interp, Tcl_Obj * objPtr, - OSType * osTypePtr)); -/* 5 */ -EXTERN void Tcl_SetOSTypeObj _ANSI_ARGS_((Tcl_Obj * objPtr, - OSType osType)); -/* 6 */ -EXTERN Tcl_Obj * Tcl_NewOSTypeObj _ANSI_ARGS_((OSType osType)); -/* 7 */ -EXTERN int strncasecmp _ANSI_ARGS_((CONST char * s1, - CONST char * s2, size_t n)); -/* 8 */ -EXTERN int strcasecmp _ANSI_ARGS_((CONST char * s1, - CONST char * s2)); -#endif /* MAC_TCL */ -#ifdef MAC_OSX_TCL +EXTERN char * Tcl_WinTCharToUtf _ANSI_ARGS_((CONST TCHAR *str, + int len, Tcl_DString *dsPtr)); +#endif /* WIN */ +#ifdef MAC_OSX_TCL /* MACOSX */ /* 0 */ EXTERN int Tcl_MacOSXOpenBundleResources _ANSI_ARGS_(( - Tcl_Interp * interp, CONST char * bundleName, - int hasResourceFile, int maxPathLen, - char * libraryPath)); + Tcl_Interp *interp, CONST char *bundleName, + int hasResourceFile, int maxPathLen, + char *libraryPath)); /* 1 */ EXTERN int Tcl_MacOSXOpenVersionedBundleResources _ANSI_ARGS_(( - Tcl_Interp * interp, CONST char * bundleName, - CONST char * bundleVersion, - int hasResourceFile, int maxPathLen, - char * libraryPath)); -#endif /* MAC_OSX_TCL */ + Tcl_Interp *interp, CONST char *bundleName, + CONST char *bundleVersion, + int hasResourceFile, int maxPathLen, + char *libraryPath)); +#endif /* MACOSX */ typedef struct TclPlatStubs { int magic; struct TclPlatStubHooks *hooks; -#ifdef __WIN32__ - TCHAR * (*tcl_WinUtfToTChar) _ANSI_ARGS_((CONST char * str, int len, Tcl_DString * dsPtr)); /* 0 */ - char * (*tcl_WinTCharToUtf) _ANSI_ARGS_((CONST TCHAR * str, int len, Tcl_DString * dsPtr)); /* 1 */ -#endif /* __WIN32__ */ -#ifdef MAC_TCL - void (*tcl_MacSetEventProc) _ANSI_ARGS_((Tcl_MacConvertEventPtr procPtr)); /* 0 */ - char * (*tcl_MacConvertTextResource) _ANSI_ARGS_((Handle resource)); /* 1 */ - int (*tcl_MacEvalResource) _ANSI_ARGS_((Tcl_Interp * interp, CONST char * resourceName, int resourceNumber, CONST char * fileName)); /* 2 */ - Handle (*tcl_MacFindResource) _ANSI_ARGS_((Tcl_Interp * interp, long resourceType, CONST char * resourceName, int resourceNumber, CONST char * resFileRef, int * releaseIt)); /* 3 */ - int (*tcl_GetOSTypeFromObj) _ANSI_ARGS_((Tcl_Interp * interp, Tcl_Obj * objPtr, OSType * osTypePtr)); /* 4 */ - void (*tcl_SetOSTypeObj) _ANSI_ARGS_((Tcl_Obj * objPtr, OSType osType)); /* 5 */ - Tcl_Obj * (*tcl_NewOSTypeObj) _ANSI_ARGS_((OSType osType)); /* 6 */ - int (*strncasecmp) _ANSI_ARGS_((CONST char * s1, CONST char * s2, size_t n)); /* 7 */ - int (*strcasecmp) _ANSI_ARGS_((CONST char * s1, CONST char * s2)); /* 8 */ -#endif /* MAC_TCL */ -#ifdef MAC_OSX_TCL - int (*tcl_MacOSXOpenBundleResources) _ANSI_ARGS_((Tcl_Interp * interp, CONST char * bundleName, int hasResourceFile, int maxPathLen, char * libraryPath)); /* 0 */ - int (*tcl_MacOSXOpenVersionedBundleResources) _ANSI_ARGS_((Tcl_Interp * interp, CONST char * bundleName, CONST char * bundleVersion, int hasResourceFile, int maxPathLen, char * libraryPath)); /* 1 */ -#endif /* MAC_OSX_TCL */ +#if defined(__WIN32__) || defined(__CYGWIN__) /* WIN */ + TCHAR * (*tcl_WinUtfToTChar) _ANSI_ARGS_((CONST char *str, int len, Tcl_DString *dsPtr)); /* 0 */ + char * (*tcl_WinTCharToUtf) _ANSI_ARGS_((CONST TCHAR *str, int len, Tcl_DString *dsPtr)); /* 1 */ +#endif /* WIN */ +#ifdef MAC_OSX_TCL /* MACOSX */ + int (*tcl_MacOSXOpenBundleResources) _ANSI_ARGS_((Tcl_Interp *interp, CONST char *bundleName, int hasResourceFile, int maxPathLen, char *libraryPath)); /* 0 */ + int (*tcl_MacOSXOpenVersionedBundleResources) _ANSI_ARGS_((Tcl_Interp *interp, CONST char *bundleName, CONST char *bundleVersion, int hasResourceFile, int maxPathLen, char *libraryPath)); /* 1 */ +#endif /* MACOSX */ } TclPlatStubs; #ifdef __cplusplus extern "C" { #endif -extern const TclPlatStubs *tclPlatStubsPtr; +extern TclPlatStubs *tclPlatStubsPtr; #ifdef __cplusplus } #endif @@ -129,7 +79,7 @@ * Inline function declarations: */ -#ifdef __WIN32__ +#if defined(__WIN32__) || defined(__CYGWIN__) /* WIN */ #ifndef Tcl_WinUtfToTChar #define Tcl_WinUtfToTChar \ (tclPlatStubsPtr->tcl_WinUtfToTChar) /* 0 */ @@ -138,46 +88,8 @@ #define Tcl_WinTCharToUtf \ (tclPlatStubsPtr->tcl_WinTCharToUtf) /* 1 */ #endif -#endif /* __WIN32__ */ -#ifdef MAC_TCL -#ifndef Tcl_MacSetEventProc -#define Tcl_MacSetEventProc \ - (tclPlatStubsPtr->tcl_MacSetEventProc) /* 0 */ -#endif -#ifndef Tcl_MacConvertTextResource -#define Tcl_MacConvertTextResource \ - (tclPlatStubsPtr->tcl_MacConvertTextResource) /* 1 */ -#endif -#ifndef Tcl_MacEvalResource -#define Tcl_MacEvalResource \ - (tclPlatStubsPtr->tcl_MacEvalResource) /* 2 */ -#endif -#ifndef Tcl_MacFindResource -#define Tcl_MacFindResource \ - (tclPlatStubsPtr->tcl_MacFindResource) /* 3 */ -#endif -#ifndef Tcl_GetOSTypeFromObj -#define Tcl_GetOSTypeFromObj \ - (tclPlatStubsPtr->tcl_GetOSTypeFromObj) /* 4 */ -#endif -#ifndef Tcl_SetOSTypeObj -#define Tcl_SetOSTypeObj \ - (tclPlatStubsPtr->tcl_SetOSTypeObj) /* 5 */ -#endif -#ifndef Tcl_NewOSTypeObj -#define Tcl_NewOSTypeObj \ - (tclPlatStubsPtr->tcl_NewOSTypeObj) /* 6 */ -#endif -#ifndef strncasecmp -#define strncasecmp \ - (tclPlatStubsPtr->strncasecmp) /* 7 */ -#endif -#ifndef strcasecmp -#define strcasecmp \ - (tclPlatStubsPtr->strcasecmp) /* 8 */ -#endif -#endif /* MAC_TCL */ -#ifdef MAC_OSX_TCL +#endif /* WIN */ +#ifdef MAC_OSX_TCL /* MACOSX */ #ifndef Tcl_MacOSXOpenBundleResources #define Tcl_MacOSXOpenBundleResources \ (tclPlatStubsPtr->tcl_MacOSXOpenBundleResources) /* 0 */ @@ -186,7 +98,7 @@ #define Tcl_MacOSXOpenVersionedBundleResources \ (tclPlatStubsPtr->tcl_MacOSXOpenVersionedBundleResources) /* 1 */ #endif -#endif /* MAC_OSX_TCL */ +#endif /* MACOSX */ #endif /* defined(USE_TCL_STUBS) && !defined(USE_TCL_STUB_PROCS) */ diff -Nru critcl-3.1.9/lib/critcl/critcl_c/tcl8.4/tkDecls.h critcl-3.1.17+dfsg/lib/critcl/critcl_c/tcl8.4/tkDecls.h --- critcl-3.1.9/lib/critcl/critcl_c/tcl8.4/tkDecls.h 2013-05-10 05:57:04.000000000 +0000 +++ critcl-3.1.17+dfsg/lib/critcl/critcl_c/tcl8.4/tkDecls.h 2017-10-14 02:48:11.000000000 +0000 @@ -7,8 +7,6 @@ * * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tkDecls.h,v 1.23 2002/08/05 04:30:38 dgp Exp $ */ #ifndef _TKDECLS @@ -36,58 +34,58 @@ /* 1 */ EXTERN XColor * Tk_3DBorderColor _ANSI_ARGS_((Tk_3DBorder border)); /* 2 */ -EXTERN GC Tk_3DBorderGC _ANSI_ARGS_((Tk_Window tkwin, +EXTERN GC Tk_3DBorderGC _ANSI_ARGS_((Tk_Window tkwin, Tk_3DBorder border, int which)); /* 3 */ -EXTERN void Tk_3DHorizontalBevel _ANSI_ARGS_((Tk_Window tkwin, - Drawable drawable, Tk_3DBorder border, int x, - int y, int width, int height, int leftIn, +EXTERN void Tk_3DHorizontalBevel _ANSI_ARGS_((Tk_Window tkwin, + Drawable drawable, Tk_3DBorder border, int x, + int y, int width, int height, int leftIn, int rightIn, int topBevel, int relief)); /* 4 */ -EXTERN void Tk_3DVerticalBevel _ANSI_ARGS_((Tk_Window tkwin, - Drawable drawable, Tk_3DBorder border, int x, - int y, int width, int height, int leftBevel, +EXTERN void Tk_3DVerticalBevel _ANSI_ARGS_((Tk_Window tkwin, + Drawable drawable, Tk_3DBorder border, int x, + int y, int width, int height, int leftBevel, int relief)); /* 5 */ -EXTERN void Tk_AddOption _ANSI_ARGS_((Tk_Window tkwin, - CONST char * name, CONST char * value, +EXTERN void Tk_AddOption _ANSI_ARGS_((Tk_Window tkwin, + CONST char *name, CONST char *value, int priority)); /* 6 */ EXTERN void Tk_BindEvent _ANSI_ARGS_(( - Tk_BindingTable bindingTable, - XEvent * eventPtr, Tk_Window tkwin, - int numObjects, ClientData * objectPtr)); + Tk_BindingTable bindingTable, + XEvent *eventPtr, Tk_Window tkwin, + int numObjects, ClientData *objectPtr)); /* 7 */ EXTERN void Tk_CanvasDrawableCoords _ANSI_ARGS_(( - Tk_Canvas canvas, double x, double y, - short * drawableXPtr, short * drawableYPtr)); + Tk_Canvas canvas, double x, double y, + short *drawableXPtr, short *drawableYPtr)); /* 8 */ EXTERN void Tk_CanvasEventuallyRedraw _ANSI_ARGS_(( - Tk_Canvas canvas, int x1, int y1, int x2, + Tk_Canvas canvas, int x1, int y1, int x2, int y2)); /* 9 */ -EXTERN int Tk_CanvasGetCoord _ANSI_ARGS_((Tcl_Interp * interp, - Tk_Canvas canvas, CONST char * str, - double * doublePtr)); +EXTERN int Tk_CanvasGetCoord _ANSI_ARGS_((Tcl_Interp *interp, + Tk_Canvas canvas, CONST char *str, + double *doublePtr)); /* 10 */ EXTERN Tk_CanvasTextInfo * Tk_CanvasGetTextInfo _ANSI_ARGS_(( Tk_Canvas canvas)); /* 11 */ -EXTERN int Tk_CanvasPsBitmap _ANSI_ARGS_((Tcl_Interp * interp, - Tk_Canvas canvas, Pixmap bitmap, int x, +EXTERN int Tk_CanvasPsBitmap _ANSI_ARGS_((Tcl_Interp *interp, + Tk_Canvas canvas, Pixmap bitmap, int x, int y, int width, int height)); /* 12 */ -EXTERN int Tk_CanvasPsColor _ANSI_ARGS_((Tcl_Interp * interp, - Tk_Canvas canvas, XColor * colorPtr)); +EXTERN int Tk_CanvasPsColor _ANSI_ARGS_((Tcl_Interp *interp, + Tk_Canvas canvas, XColor *colorPtr)); /* 13 */ -EXTERN int Tk_CanvasPsFont _ANSI_ARGS_((Tcl_Interp * interp, +EXTERN int Tk_CanvasPsFont _ANSI_ARGS_((Tcl_Interp *interp, Tk_Canvas canvas, Tk_Font font)); /* 14 */ -EXTERN void Tk_CanvasPsPath _ANSI_ARGS_((Tcl_Interp * interp, - Tk_Canvas canvas, double * coordPtr, +EXTERN void Tk_CanvasPsPath _ANSI_ARGS_((Tcl_Interp *interp, + Tk_Canvas canvas, double *coordPtr, int numPoints)); /* 15 */ -EXTERN int Tk_CanvasPsStipple _ANSI_ARGS_((Tcl_Interp * interp, +EXTERN int Tk_CanvasPsStipple _ANSI_ARGS_((Tcl_Interp *interp, Tk_Canvas canvas, Pixmap bitmap)); /* 16 */ EXTERN double Tk_CanvasPsY _ANSI_ARGS_((Tk_Canvas canvas, double y)); @@ -96,122 +94,121 @@ Tk_Canvas canvas, GC gc)); /* 18 */ EXTERN int Tk_CanvasTagsParseProc _ANSI_ARGS_(( - ClientData clientData, Tcl_Interp * interp, - Tk_Window tkwin, CONST char * value, - char * widgRec, int offset)); + ClientData clientData, Tcl_Interp *interp, + Tk_Window tkwin, CONST char *value, + char *widgRec, int offset)); /* 19 */ EXTERN char * Tk_CanvasTagsPrintProc _ANSI_ARGS_(( - ClientData clientData, Tk_Window tkwin, - char * widgRec, int offset, - Tcl_FreeProc ** freeProcPtr)); + ClientData clientData, Tk_Window tkwin, + char *widgRec, int offset, + Tcl_FreeProc **freeProcPtr)); /* 20 */ EXTERN Tk_Window Tk_CanvasTkwin _ANSI_ARGS_((Tk_Canvas canvas)); /* 21 */ -EXTERN void Tk_CanvasWindowCoords _ANSI_ARGS_((Tk_Canvas canvas, - double x, double y, short * screenXPtr, - short * screenYPtr)); +EXTERN void Tk_CanvasWindowCoords _ANSI_ARGS_((Tk_Canvas canvas, + double x, double y, short *screenXPtr, + short *screenYPtr)); /* 22 */ EXTERN void Tk_ChangeWindowAttributes _ANSI_ARGS_(( - Tk_Window tkwin, unsigned long valueMask, - XSetWindowAttributes * attsPtr)); + Tk_Window tkwin, unsigned long valueMask, + XSetWindowAttributes *attsPtr)); /* 23 */ -EXTERN int Tk_CharBbox _ANSI_ARGS_((Tk_TextLayout layout, - int index, int * xPtr, int * yPtr, - int * widthPtr, int * heightPtr)); +EXTERN int Tk_CharBbox _ANSI_ARGS_((Tk_TextLayout layout, + int index, int *xPtr, int *yPtr, + int *widthPtr, int *heightPtr)); /* 24 */ -EXTERN void Tk_ClearSelection _ANSI_ARGS_((Tk_Window tkwin, +EXTERN void Tk_ClearSelection _ANSI_ARGS_((Tk_Window tkwin, Atom selection)); /* 25 */ -EXTERN int Tk_ClipboardAppend _ANSI_ARGS_((Tcl_Interp * interp, - Tk_Window tkwin, Atom target, Atom format, - char* buffer)); +EXTERN int Tk_ClipboardAppend _ANSI_ARGS_((Tcl_Interp *interp, + Tk_Window tkwin, Atom target, Atom format, + char *buffer)); /* 26 */ -EXTERN int Tk_ClipboardClear _ANSI_ARGS_((Tcl_Interp * interp, +EXTERN int Tk_ClipboardClear _ANSI_ARGS_((Tcl_Interp *interp, Tk_Window tkwin)); /* 27 */ -EXTERN int Tk_ConfigureInfo _ANSI_ARGS_((Tcl_Interp * interp, - Tk_Window tkwin, Tk_ConfigSpec * specs, - char * widgRec, CONST char * argvName, +EXTERN int Tk_ConfigureInfo _ANSI_ARGS_((Tcl_Interp *interp, + Tk_Window tkwin, Tk_ConfigSpec *specs, + char *widgRec, CONST char *argvName, int flags)); /* 28 */ -EXTERN int Tk_ConfigureValue _ANSI_ARGS_((Tcl_Interp * interp, - Tk_Window tkwin, Tk_ConfigSpec * specs, - char * widgRec, CONST char * argvName, +EXTERN int Tk_ConfigureValue _ANSI_ARGS_((Tcl_Interp *interp, + Tk_Window tkwin, Tk_ConfigSpec *specs, + char *widgRec, CONST char *argvName, int flags)); /* 29 */ -EXTERN int Tk_ConfigureWidget _ANSI_ARGS_((Tcl_Interp * interp, - Tk_Window tkwin, Tk_ConfigSpec * specs, - int argc, CONST84 char ** argv, - char * widgRec, int flags)); +EXTERN int Tk_ConfigureWidget _ANSI_ARGS_((Tcl_Interp *interp, + Tk_Window tkwin, Tk_ConfigSpec *specs, + int argc, CONST84 char **argv, char *widgRec, + int flags)); /* 30 */ -EXTERN void Tk_ConfigureWindow _ANSI_ARGS_((Tk_Window tkwin, - unsigned int valueMask, - XWindowChanges * valuePtr)); +EXTERN void Tk_ConfigureWindow _ANSI_ARGS_((Tk_Window tkwin, + unsigned int valueMask, + XWindowChanges *valuePtr)); /* 31 */ -EXTERN Tk_TextLayout Tk_ComputeTextLayout _ANSI_ARGS_((Tk_Font font, - CONST char * str, int numChars, - int wrapLength, Tk_Justify justify, - int flags, int * widthPtr, int * heightPtr)); +EXTERN Tk_TextLayout Tk_ComputeTextLayout _ANSI_ARGS_((Tk_Font font, + CONST char *str, int numChars, + int wrapLength, Tk_Justify justify, + int flags, int *widthPtr, int *heightPtr)); /* 32 */ -EXTERN Tk_Window Tk_CoordsToWindow _ANSI_ARGS_((int rootX, int rootY, +EXTERN Tk_Window Tk_CoordsToWindow _ANSI_ARGS_((int rootX, int rootY, Tk_Window tkwin)); /* 33 */ -EXTERN unsigned long Tk_CreateBinding _ANSI_ARGS_((Tcl_Interp * interp, - Tk_BindingTable bindingTable, - ClientData object, CONST char * eventStr, - CONST char * command, int append)); +EXTERN unsigned long Tk_CreateBinding _ANSI_ARGS_((Tcl_Interp *interp, + Tk_BindingTable bindingTable, + ClientData object, CONST char *eventStr, + CONST char *script, int append)); /* 34 */ EXTERN Tk_BindingTable Tk_CreateBindingTable _ANSI_ARGS_(( - Tcl_Interp * interp)); + Tcl_Interp *interp)); /* 35 */ -EXTERN Tk_ErrorHandler Tk_CreateErrorHandler _ANSI_ARGS_((Display * display, - int errNum, int request, int minorCode, - Tk_ErrorProc * errorProc, +EXTERN Tk_ErrorHandler Tk_CreateErrorHandler _ANSI_ARGS_((Display *display, + int errNum, int request, int minorCode, + Tk_ErrorProc *errorProc, ClientData clientData)); /* 36 */ -EXTERN void Tk_CreateEventHandler _ANSI_ARGS_((Tk_Window token, - unsigned long mask, Tk_EventProc * proc, +EXTERN void Tk_CreateEventHandler _ANSI_ARGS_((Tk_Window token, + unsigned long mask, Tk_EventProc *proc, ClientData clientData)); /* 37 */ EXTERN void Tk_CreateGenericHandler _ANSI_ARGS_(( - Tk_GenericProc * proc, ClientData clientData)); + Tk_GenericProc *proc, ClientData clientData)); /* 38 */ EXTERN void Tk_CreateImageType _ANSI_ARGS_(( - Tk_ImageType * typePtr)); + Tk_ImageType *typePtr)); /* 39 */ -EXTERN void Tk_CreateItemType _ANSI_ARGS_((Tk_ItemType * typePtr)); +EXTERN void Tk_CreateItemType _ANSI_ARGS_((Tk_ItemType *typePtr)); /* 40 */ EXTERN void Tk_CreatePhotoImageFormat _ANSI_ARGS_(( - Tk_PhotoImageFormat * formatPtr)); + Tk_PhotoImageFormat *formatPtr)); /* 41 */ -EXTERN void Tk_CreateSelHandler _ANSI_ARGS_((Tk_Window tkwin, - Atom selection, Atom target, - Tk_SelectionProc * proc, +EXTERN void Tk_CreateSelHandler _ANSI_ARGS_((Tk_Window tkwin, + Atom selection, Atom target, + Tk_SelectionProc *proc, ClientData clientData, Atom format)); /* 42 */ -EXTERN Tk_Window Tk_CreateWindow _ANSI_ARGS_((Tcl_Interp * interp, - Tk_Window parent, CONST char * name, - CONST char * screenName)); +EXTERN Tk_Window Tk_CreateWindow _ANSI_ARGS_((Tcl_Interp *interp, + Tk_Window parent, CONST char *name, + CONST char *screenName)); /* 43 */ EXTERN Tk_Window Tk_CreateWindowFromPath _ANSI_ARGS_(( - Tcl_Interp * interp, Tk_Window tkwin, - CONST char * pathName, - CONST char * screenName)); + Tcl_Interp *interp, Tk_Window tkwin, + CONST char *pathName, CONST char *screenName)); /* 44 */ -EXTERN int Tk_DefineBitmap _ANSI_ARGS_((Tcl_Interp * interp, - CONST char * name, CONST char * source, +EXTERN int Tk_DefineBitmap _ANSI_ARGS_((Tcl_Interp *interp, + CONST char *name, CONST char *source, int width, int height)); /* 45 */ -EXTERN void Tk_DefineCursor _ANSI_ARGS_((Tk_Window window, +EXTERN void Tk_DefineCursor _ANSI_ARGS_((Tk_Window window, Tk_Cursor cursor)); /* 46 */ EXTERN void Tk_DeleteAllBindings _ANSI_ARGS_(( - Tk_BindingTable bindingTable, + Tk_BindingTable bindingTable, ClientData object)); /* 47 */ -EXTERN int Tk_DeleteBinding _ANSI_ARGS_((Tcl_Interp * interp, - Tk_BindingTable bindingTable, - ClientData object, CONST char * eventStr)); +EXTERN int Tk_DeleteBinding _ANSI_ARGS_((Tcl_Interp *interp, + Tk_BindingTable bindingTable, + ClientData object, CONST char *eventStr)); /* 48 */ EXTERN void Tk_DeleteBindingTable _ANSI_ARGS_(( Tk_BindingTable bindingTable)); @@ -219,17 +216,17 @@ EXTERN void Tk_DeleteErrorHandler _ANSI_ARGS_(( Tk_ErrorHandler handler)); /* 50 */ -EXTERN void Tk_DeleteEventHandler _ANSI_ARGS_((Tk_Window token, - unsigned long mask, Tk_EventProc * proc, +EXTERN void Tk_DeleteEventHandler _ANSI_ARGS_((Tk_Window token, + unsigned long mask, Tk_EventProc *proc, ClientData clientData)); /* 51 */ EXTERN void Tk_DeleteGenericHandler _ANSI_ARGS_(( - Tk_GenericProc * proc, ClientData clientData)); + Tk_GenericProc *proc, ClientData clientData)); /* 52 */ -EXTERN void Tk_DeleteImage _ANSI_ARGS_((Tcl_Interp * interp, - CONST char * name)); +EXTERN void Tk_DeleteImage _ANSI_ARGS_((Tcl_Interp *interp, + CONST char *name)); /* 53 */ -EXTERN void Tk_DeleteSelHandler _ANSI_ARGS_((Tk_Window tkwin, +EXTERN void Tk_DeleteSelHandler _ANSI_ARGS_((Tk_Window tkwin, Atom selection, Atom target)); /* 54 */ EXTERN void Tk_DestroyWindow _ANSI_ARGS_((Tk_Window tkwin)); @@ -239,241 +236,239 @@ EXTERN int Tk_DistanceToTextLayout _ANSI_ARGS_(( Tk_TextLayout layout, int x, int y)); /* 57 */ -EXTERN void Tk_Draw3DPolygon _ANSI_ARGS_((Tk_Window tkwin, - Drawable drawable, Tk_3DBorder border, - XPoint * pointPtr, int numPoints, +EXTERN void Tk_Draw3DPolygon _ANSI_ARGS_((Tk_Window tkwin, + Drawable drawable, Tk_3DBorder border, + XPoint *pointPtr, int numPoints, int borderWidth, int leftRelief)); /* 58 */ -EXTERN void Tk_Draw3DRectangle _ANSI_ARGS_((Tk_Window tkwin, - Drawable drawable, Tk_3DBorder border, int x, - int y, int width, int height, +EXTERN void Tk_Draw3DRectangle _ANSI_ARGS_((Tk_Window tkwin, + Drawable drawable, Tk_3DBorder border, int x, + int y, int width, int height, int borderWidth, int relief)); /* 59 */ -EXTERN void Tk_DrawChars _ANSI_ARGS_((Display * display, - Drawable drawable, GC gc, Tk_Font tkfont, - CONST char * source, int numBytes, int x, +EXTERN void Tk_DrawChars _ANSI_ARGS_((Display *display, + Drawable drawable, GC gc, Tk_Font tkfont, + CONST char *source, int numBytes, int x, int y)); /* 60 */ -EXTERN void Tk_DrawFocusHighlight _ANSI_ARGS_((Tk_Window tkwin, +EXTERN void Tk_DrawFocusHighlight _ANSI_ARGS_((Tk_Window tkwin, GC gc, int width, Drawable drawable)); /* 61 */ -EXTERN void Tk_DrawTextLayout _ANSI_ARGS_((Display * display, - Drawable drawable, GC gc, - Tk_TextLayout layout, int x, int y, +EXTERN void Tk_DrawTextLayout _ANSI_ARGS_((Display *display, + Drawable drawable, GC gc, + Tk_TextLayout layout, int x, int y, int firstChar, int lastChar)); /* 62 */ -EXTERN void Tk_Fill3DPolygon _ANSI_ARGS_((Tk_Window tkwin, - Drawable drawable, Tk_3DBorder border, - XPoint * pointPtr, int numPoints, +EXTERN void Tk_Fill3DPolygon _ANSI_ARGS_((Tk_Window tkwin, + Drawable drawable, Tk_3DBorder border, + XPoint *pointPtr, int numPoints, int borderWidth, int leftRelief)); /* 63 */ -EXTERN void Tk_Fill3DRectangle _ANSI_ARGS_((Tk_Window tkwin, - Drawable drawable, Tk_3DBorder border, int x, - int y, int width, int height, +EXTERN void Tk_Fill3DRectangle _ANSI_ARGS_((Tk_Window tkwin, + Drawable drawable, Tk_3DBorder border, int x, + int y, int width, int height, int borderWidth, int relief)); /* 64 */ -EXTERN Tk_PhotoHandle Tk_FindPhoto _ANSI_ARGS_((Tcl_Interp * interp, - CONST char * imageName)); +EXTERN Tk_PhotoHandle Tk_FindPhoto _ANSI_ARGS_((Tcl_Interp *interp, + CONST char *imageName)); /* 65 */ EXTERN Font Tk_FontId _ANSI_ARGS_((Tk_Font font)); /* 66 */ EXTERN void Tk_Free3DBorder _ANSI_ARGS_((Tk_3DBorder border)); /* 67 */ -EXTERN void Tk_FreeBitmap _ANSI_ARGS_((Display * display, +EXTERN void Tk_FreeBitmap _ANSI_ARGS_((Display *display, Pixmap bitmap)); /* 68 */ -EXTERN void Tk_FreeColor _ANSI_ARGS_((XColor * colorPtr)); +EXTERN void Tk_FreeColor _ANSI_ARGS_((XColor *colorPtr)); /* 69 */ -EXTERN void Tk_FreeColormap _ANSI_ARGS_((Display * display, +EXTERN void Tk_FreeColormap _ANSI_ARGS_((Display *display, Colormap colormap)); /* 70 */ -EXTERN void Tk_FreeCursor _ANSI_ARGS_((Display * display, +EXTERN void Tk_FreeCursor _ANSI_ARGS_((Display *display, Tk_Cursor cursor)); /* 71 */ EXTERN void Tk_FreeFont _ANSI_ARGS_((Tk_Font f)); /* 72 */ -EXTERN void Tk_FreeGC _ANSI_ARGS_((Display * display, GC gc)); +EXTERN void Tk_FreeGC _ANSI_ARGS_((Display *display, GC gc)); /* 73 */ EXTERN void Tk_FreeImage _ANSI_ARGS_((Tk_Image image)); /* 74 */ -EXTERN void Tk_FreeOptions _ANSI_ARGS_((Tk_ConfigSpec * specs, - char * widgRec, Display * display, +EXTERN void Tk_FreeOptions _ANSI_ARGS_((Tk_ConfigSpec *specs, + char *widgRec, Display *display, int needFlags)); /* 75 */ -EXTERN void Tk_FreePixmap _ANSI_ARGS_((Display * display, +EXTERN void Tk_FreePixmap _ANSI_ARGS_((Display *display, Pixmap pixmap)); /* 76 */ EXTERN void Tk_FreeTextLayout _ANSI_ARGS_(( Tk_TextLayout textLayout)); /* 77 */ -EXTERN void Tk_FreeXId _ANSI_ARGS_((Display * display, XID xid)); +EXTERN void Tk_FreeXId _ANSI_ARGS_((Display *display, XID xid)); /* 78 */ -EXTERN GC Tk_GCForColor _ANSI_ARGS_((XColor * colorPtr, +EXTERN GC Tk_GCForColor _ANSI_ARGS_((XColor *colorPtr, Drawable drawable)); /* 79 */ -EXTERN void Tk_GeometryRequest _ANSI_ARGS_((Tk_Window tkwin, +EXTERN void Tk_GeometryRequest _ANSI_ARGS_((Tk_Window tkwin, int reqWidth, int reqHeight)); /* 80 */ -EXTERN Tk_3DBorder Tk_Get3DBorder _ANSI_ARGS_((Tcl_Interp * interp, +EXTERN Tk_3DBorder Tk_Get3DBorder _ANSI_ARGS_((Tcl_Interp *interp, Tk_Window tkwin, Tk_Uid colorName)); /* 81 */ -EXTERN void Tk_GetAllBindings _ANSI_ARGS_((Tcl_Interp * interp, - Tk_BindingTable bindingTable, +EXTERN void Tk_GetAllBindings _ANSI_ARGS_((Tcl_Interp *interp, + Tk_BindingTable bindingTable, ClientData object)); /* 82 */ -EXTERN int Tk_GetAnchor _ANSI_ARGS_((Tcl_Interp * interp, - CONST char * str, Tk_Anchor * anchorPtr)); +EXTERN int Tk_GetAnchor _ANSI_ARGS_((Tcl_Interp *interp, + CONST char *str, Tk_Anchor *anchorPtr)); /* 83 */ -EXTERN CONST84_RETURN char * Tk_GetAtomName _ANSI_ARGS_((Tk_Window tkwin, +EXTERN CONST84_RETURN char * Tk_GetAtomName _ANSI_ARGS_((Tk_Window tkwin, Atom atom)); /* 84 */ -EXTERN CONST84_RETURN char * Tk_GetBinding _ANSI_ARGS_((Tcl_Interp * interp, - Tk_BindingTable bindingTable, - ClientData object, CONST char * eventStr)); +EXTERN CONST84_RETURN char * Tk_GetBinding _ANSI_ARGS_((Tcl_Interp *interp, + Tk_BindingTable bindingTable, + ClientData object, CONST char *eventStr)); /* 85 */ -EXTERN Pixmap Tk_GetBitmap _ANSI_ARGS_((Tcl_Interp * interp, - Tk_Window tkwin, CONST char * str)); +EXTERN Pixmap Tk_GetBitmap _ANSI_ARGS_((Tcl_Interp *interp, + Tk_Window tkwin, CONST char *str)); /* 86 */ -EXTERN Pixmap Tk_GetBitmapFromData _ANSI_ARGS_(( - Tcl_Interp * interp, Tk_Window tkwin, - CONST char * source, int width, int height)); +EXTERN Pixmap Tk_GetBitmapFromData _ANSI_ARGS_((Tcl_Interp *interp, + Tk_Window tkwin, CONST char *source, + int width, int height)); /* 87 */ -EXTERN int Tk_GetCapStyle _ANSI_ARGS_((Tcl_Interp * interp, - CONST char * str, int * capPtr)); +EXTERN int Tk_GetCapStyle _ANSI_ARGS_((Tcl_Interp *interp, + CONST char *str, int *capPtr)); /* 88 */ -EXTERN XColor * Tk_GetColor _ANSI_ARGS_((Tcl_Interp * interp, +EXTERN XColor * Tk_GetColor _ANSI_ARGS_((Tcl_Interp *interp, Tk_Window tkwin, Tk_Uid name)); /* 89 */ -EXTERN XColor * Tk_GetColorByValue _ANSI_ARGS_((Tk_Window tkwin, - XColor * colorPtr)); +EXTERN XColor * Tk_GetColorByValue _ANSI_ARGS_((Tk_Window tkwin, + XColor *colorPtr)); /* 90 */ -EXTERN Colormap Tk_GetColormap _ANSI_ARGS_((Tcl_Interp * interp, - Tk_Window tkwin, CONST char * str)); +EXTERN Colormap Tk_GetColormap _ANSI_ARGS_((Tcl_Interp *interp, + Tk_Window tkwin, CONST char *str)); /* 91 */ -EXTERN Tk_Cursor Tk_GetCursor _ANSI_ARGS_((Tcl_Interp * interp, +EXTERN Tk_Cursor Tk_GetCursor _ANSI_ARGS_((Tcl_Interp *interp, Tk_Window tkwin, Tk_Uid str)); /* 92 */ -EXTERN Tk_Cursor Tk_GetCursorFromData _ANSI_ARGS_(( - Tcl_Interp * interp, Tk_Window tkwin, - CONST char * source, CONST char * mask, - int width, int height, int xHot, int yHot, - Tk_Uid fg, Tk_Uid bg)); +EXTERN Tk_Cursor Tk_GetCursorFromData _ANSI_ARGS_((Tcl_Interp *interp, + Tk_Window tkwin, CONST char *source, + CONST char *mask, int width, int height, + int xHot, int yHot, Tk_Uid fg, Tk_Uid bg)); /* 93 */ -EXTERN Tk_Font Tk_GetFont _ANSI_ARGS_((Tcl_Interp * interp, - Tk_Window tkwin, CONST char * str)); +EXTERN Tk_Font Tk_GetFont _ANSI_ARGS_((Tcl_Interp *interp, + Tk_Window tkwin, CONST char *str)); /* 94 */ -EXTERN Tk_Font Tk_GetFontFromObj _ANSI_ARGS_((Tk_Window tkwin, - Tcl_Obj * objPtr)); +EXTERN Tk_Font Tk_GetFontFromObj _ANSI_ARGS_((Tk_Window tkwin, + Tcl_Obj *objPtr)); /* 95 */ -EXTERN void Tk_GetFontMetrics _ANSI_ARGS_((Tk_Font font, - Tk_FontMetrics * fmPtr)); +EXTERN void Tk_GetFontMetrics _ANSI_ARGS_((Tk_Font font, + Tk_FontMetrics *fmPtr)); /* 96 */ -EXTERN GC Tk_GetGC _ANSI_ARGS_((Tk_Window tkwin, - unsigned long valueMask, - XGCValues * valuePtr)); +EXTERN GC Tk_GetGC _ANSI_ARGS_((Tk_Window tkwin, + unsigned long valueMask, XGCValues *valuePtr)); /* 97 */ -EXTERN Tk_Image Tk_GetImage _ANSI_ARGS_((Tcl_Interp * interp, - Tk_Window tkwin, CONST char * name, - Tk_ImageChangedProc * changeProc, +EXTERN Tk_Image Tk_GetImage _ANSI_ARGS_((Tcl_Interp *interp, + Tk_Window tkwin, CONST char *name, + Tk_ImageChangedProc *changeProc, ClientData clientData)); /* 98 */ EXTERN ClientData Tk_GetImageMasterData _ANSI_ARGS_(( - Tcl_Interp * interp, CONST char * name, - Tk_ImageType ** typePtrPtr)); + Tcl_Interp *interp, CONST char *name, + Tk_ImageType **typePtrPtr)); /* 99 */ EXTERN Tk_ItemType * Tk_GetItemTypes _ANSI_ARGS_((void)); /* 100 */ -EXTERN int Tk_GetJoinStyle _ANSI_ARGS_((Tcl_Interp * interp, - CONST char * str, int * joinPtr)); +EXTERN int Tk_GetJoinStyle _ANSI_ARGS_((Tcl_Interp *interp, + CONST char *str, int *joinPtr)); /* 101 */ -EXTERN int Tk_GetJustify _ANSI_ARGS_((Tcl_Interp * interp, - CONST char * str, Tk_Justify * justifyPtr)); +EXTERN int Tk_GetJustify _ANSI_ARGS_((Tcl_Interp *interp, + CONST char *str, Tk_Justify *justifyPtr)); /* 102 */ EXTERN int Tk_GetNumMainWindows _ANSI_ARGS_((void)); /* 103 */ -EXTERN Tk_Uid Tk_GetOption _ANSI_ARGS_((Tk_Window tkwin, - CONST char * name, CONST char * className)); +EXTERN Tk_Uid Tk_GetOption _ANSI_ARGS_((Tk_Window tkwin, + CONST char *name, CONST char *className)); /* 104 */ -EXTERN int Tk_GetPixels _ANSI_ARGS_((Tcl_Interp * interp, - Tk_Window tkwin, CONST char * str, - int * intPtr)); +EXTERN int Tk_GetPixels _ANSI_ARGS_((Tcl_Interp *interp, + Tk_Window tkwin, CONST char *str, + int *intPtr)); /* 105 */ -EXTERN Pixmap Tk_GetPixmap _ANSI_ARGS_((Display * display, +EXTERN Pixmap Tk_GetPixmap _ANSI_ARGS_((Display *display, Drawable d, int width, int height, int depth)); /* 106 */ -EXTERN int Tk_GetRelief _ANSI_ARGS_((Tcl_Interp * interp, - CONST char * name, int * reliefPtr)); +EXTERN int Tk_GetRelief _ANSI_ARGS_((Tcl_Interp *interp, + CONST char *name, int *reliefPtr)); /* 107 */ -EXTERN void Tk_GetRootCoords _ANSI_ARGS_((Tk_Window tkwin, - int * xPtr, int * yPtr)); +EXTERN void Tk_GetRootCoords _ANSI_ARGS_((Tk_Window tkwin, + int *xPtr, int *yPtr)); /* 108 */ -EXTERN int Tk_GetScrollInfo _ANSI_ARGS_((Tcl_Interp * interp, - int argc, CONST84 char ** argv, - double * dblPtr, int * intPtr)); +EXTERN int Tk_GetScrollInfo _ANSI_ARGS_((Tcl_Interp *interp, + int argc, CONST84 char **argv, + double *dblPtr, int *intPtr)); /* 109 */ -EXTERN int Tk_GetScreenMM _ANSI_ARGS_((Tcl_Interp * interp, - Tk_Window tkwin, CONST char * str, - double * doublePtr)); +EXTERN int Tk_GetScreenMM _ANSI_ARGS_((Tcl_Interp *interp, + Tk_Window tkwin, CONST char *str, + double *doublePtr)); /* 110 */ -EXTERN int Tk_GetSelection _ANSI_ARGS_((Tcl_Interp * interp, - Tk_Window tkwin, Atom selection, Atom target, - Tk_GetSelProc * proc, ClientData clientData)); +EXTERN int Tk_GetSelection _ANSI_ARGS_((Tcl_Interp *interp, + Tk_Window tkwin, Atom selection, Atom target, + Tk_GetSelProc *proc, ClientData clientData)); /* 111 */ -EXTERN Tk_Uid Tk_GetUid _ANSI_ARGS_((CONST char * str)); +EXTERN Tk_Uid Tk_GetUid _ANSI_ARGS_((CONST char *str)); /* 112 */ -EXTERN Visual * Tk_GetVisual _ANSI_ARGS_((Tcl_Interp * interp, - Tk_Window tkwin, CONST char * str, - int * depthPtr, Colormap * colormapPtr)); +EXTERN Visual * Tk_GetVisual _ANSI_ARGS_((Tcl_Interp *interp, + Tk_Window tkwin, CONST char *str, + int *depthPtr, Colormap *colormapPtr)); /* 113 */ -EXTERN void Tk_GetVRootGeometry _ANSI_ARGS_((Tk_Window tkwin, - int * xPtr, int * yPtr, int * widthPtr, - int * heightPtr)); +EXTERN void Tk_GetVRootGeometry _ANSI_ARGS_((Tk_Window tkwin, + int *xPtr, int *yPtr, int *widthPtr, + int *heightPtr)); /* 114 */ -EXTERN int Tk_Grab _ANSI_ARGS_((Tcl_Interp * interp, +EXTERN int Tk_Grab _ANSI_ARGS_((Tcl_Interp *interp, Tk_Window tkwin, int grabGlobal)); /* 115 */ -EXTERN void Tk_HandleEvent _ANSI_ARGS_((XEvent * eventPtr)); +EXTERN void Tk_HandleEvent _ANSI_ARGS_((XEvent *eventPtr)); /* 116 */ -EXTERN Tk_Window Tk_IdToWindow _ANSI_ARGS_((Display * display, +EXTERN Tk_Window Tk_IdToWindow _ANSI_ARGS_((Display *display, Window window)); /* 117 */ -EXTERN void Tk_ImageChanged _ANSI_ARGS_((Tk_ImageMaster master, - int x, int y, int width, int height, +EXTERN void Tk_ImageChanged _ANSI_ARGS_((Tk_ImageMaster master, + int x, int y, int width, int height, int imageWidth, int imageHeight)); /* 118 */ -EXTERN int Tk_Init _ANSI_ARGS_((Tcl_Interp * interp)); +EXTERN int Tk_Init _ANSI_ARGS_((Tcl_Interp *interp)); /* 119 */ -EXTERN Atom Tk_InternAtom _ANSI_ARGS_((Tk_Window tkwin, - CONST char * name)); +EXTERN Atom Tk_InternAtom _ANSI_ARGS_((Tk_Window tkwin, + CONST char *name)); /* 120 */ EXTERN int Tk_IntersectTextLayout _ANSI_ARGS_(( - Tk_TextLayout layout, int x, int y, + Tk_TextLayout layout, int x, int y, int width, int height)); /* 121 */ -EXTERN void Tk_MaintainGeometry _ANSI_ARGS_((Tk_Window slave, - Tk_Window master, int x, int y, int width, +EXTERN void Tk_MaintainGeometry _ANSI_ARGS_((Tk_Window slave, + Tk_Window master, int x, int y, int width, int height)); /* 122 */ -EXTERN Tk_Window Tk_MainWindow _ANSI_ARGS_((Tcl_Interp * interp)); +EXTERN Tk_Window Tk_MainWindow _ANSI_ARGS_((Tcl_Interp *interp)); /* 123 */ EXTERN void Tk_MakeWindowExist _ANSI_ARGS_((Tk_Window tkwin)); /* 124 */ -EXTERN void Tk_ManageGeometry _ANSI_ARGS_((Tk_Window tkwin, - Tk_GeomMgr * mgrPtr, ClientData clientData)); +EXTERN void Tk_ManageGeometry _ANSI_ARGS_((Tk_Window tkwin, + Tk_GeomMgr *mgrPtr, ClientData clientData)); /* 125 */ EXTERN void Tk_MapWindow _ANSI_ARGS_((Tk_Window tkwin)); /* 126 */ -EXTERN int Tk_MeasureChars _ANSI_ARGS_((Tk_Font tkfont, - CONST char * source, int numBytes, - int maxPixels, int flags, int * lengthPtr)); +EXTERN int Tk_MeasureChars _ANSI_ARGS_((Tk_Font tkfont, + CONST char *source, int numBytes, + int maxPixels, int flags, int *lengthPtr)); /* 127 */ -EXTERN void Tk_MoveResizeWindow _ANSI_ARGS_((Tk_Window tkwin, +EXTERN void Tk_MoveResizeWindow _ANSI_ARGS_((Tk_Window tkwin, int x, int y, int width, int height)); /* 128 */ -EXTERN void Tk_MoveWindow _ANSI_ARGS_((Tk_Window tkwin, int x, +EXTERN void Tk_MoveWindow _ANSI_ARGS_((Tk_Window tkwin, int x, int y)); /* 129 */ -EXTERN void Tk_MoveToplevelWindow _ANSI_ARGS_((Tk_Window tkwin, +EXTERN void Tk_MoveToplevelWindow _ANSI_ARGS_((Tk_Window tkwin, int x, int y)); /* 130 */ EXTERN CONST84_RETURN char * Tk_NameOf3DBorder _ANSI_ARGS_(( @@ -481,14 +476,14 @@ /* 131 */ EXTERN CONST84_RETURN char * Tk_NameOfAnchor _ANSI_ARGS_((Tk_Anchor anchor)); /* 132 */ -EXTERN CONST84_RETURN char * Tk_NameOfBitmap _ANSI_ARGS_((Display * display, +EXTERN CONST84_RETURN char * Tk_NameOfBitmap _ANSI_ARGS_((Display *display, Pixmap bitmap)); /* 133 */ EXTERN CONST84_RETURN char * Tk_NameOfCapStyle _ANSI_ARGS_((int cap)); /* 134 */ -EXTERN CONST84_RETURN char * Tk_NameOfColor _ANSI_ARGS_((XColor * colorPtr)); +EXTERN CONST84_RETURN char * Tk_NameOfColor _ANSI_ARGS_((XColor *colorPtr)); /* 135 */ -EXTERN CONST84_RETURN char * Tk_NameOfCursor _ANSI_ARGS_((Display * display, +EXTERN CONST84_RETURN char * Tk_NameOfCursor _ANSI_ARGS_((Display *display, Tk_Cursor cursor)); /* 136 */ EXTERN CONST84_RETURN char * Tk_NameOfFont _ANSI_ARGS_((Tk_Font font)); @@ -503,419 +498,425 @@ /* 140 */ EXTERN CONST84_RETURN char * Tk_NameOfRelief _ANSI_ARGS_((int relief)); /* 141 */ -EXTERN Tk_Window Tk_NameToWindow _ANSI_ARGS_((Tcl_Interp * interp, - CONST char * pathName, Tk_Window tkwin)); +EXTERN Tk_Window Tk_NameToWindow _ANSI_ARGS_((Tcl_Interp *interp, + CONST char *pathName, Tk_Window tkwin)); /* 142 */ -EXTERN void Tk_OwnSelection _ANSI_ARGS_((Tk_Window tkwin, - Atom selection, Tk_LostSelProc * proc, +EXTERN void Tk_OwnSelection _ANSI_ARGS_((Tk_Window tkwin, + Atom selection, Tk_LostSelProc *proc, ClientData clientData)); /* 143 */ -EXTERN int Tk_ParseArgv _ANSI_ARGS_((Tcl_Interp * interp, - Tk_Window tkwin, int * argcPtr, - CONST84 char ** argv, Tk_ArgvInfo * argTable, +EXTERN int Tk_ParseArgv _ANSI_ARGS_((Tcl_Interp *interp, + Tk_Window tkwin, int *argcPtr, + CONST84 char **argv, Tk_ArgvInfo *argTable, int flags)); /* 144 */ EXTERN void Tk_PhotoPutBlock_NoComposite _ANSI_ARGS_(( - Tk_PhotoHandle handle, - Tk_PhotoImageBlock * blockPtr, int x, int y, + Tk_PhotoHandle handle, + Tk_PhotoImageBlock *blockPtr, int x, int y, int width, int height)); /* 145 */ EXTERN void Tk_PhotoPutZoomedBlock_NoComposite _ANSI_ARGS_(( - Tk_PhotoHandle handle, - Tk_PhotoImageBlock * blockPtr, int x, int y, - int width, int height, int zoomX, int zoomY, + Tk_PhotoHandle handle, + Tk_PhotoImageBlock *blockPtr, int x, int y, + int width, int height, int zoomX, int zoomY, int subsampleX, int subsampleY)); /* 146 */ -EXTERN int Tk_PhotoGetImage _ANSI_ARGS_((Tk_PhotoHandle handle, - Tk_PhotoImageBlock * blockPtr)); +EXTERN int Tk_PhotoGetImage _ANSI_ARGS_((Tk_PhotoHandle handle, + Tk_PhotoImageBlock *blockPtr)); /* 147 */ EXTERN void Tk_PhotoBlank _ANSI_ARGS_((Tk_PhotoHandle handle)); /* 148 */ -EXTERN void Tk_PhotoExpand _ANSI_ARGS_((Tk_PhotoHandle handle, +EXTERN void Tk_PhotoExpand _ANSI_ARGS_((Tk_PhotoHandle handle, int width, int height)); /* 149 */ -EXTERN void Tk_PhotoGetSize _ANSI_ARGS_((Tk_PhotoHandle handle, - int * widthPtr, int * heightPtr)); +EXTERN void Tk_PhotoGetSize _ANSI_ARGS_((Tk_PhotoHandle handle, + int *widthPtr, int *heightPtr)); /* 150 */ -EXTERN void Tk_PhotoSetSize _ANSI_ARGS_((Tk_PhotoHandle handle, +EXTERN void Tk_PhotoSetSize _ANSI_ARGS_((Tk_PhotoHandle handle, int width, int height)); /* 151 */ -EXTERN int Tk_PointToChar _ANSI_ARGS_((Tk_TextLayout layout, +EXTERN int Tk_PointToChar _ANSI_ARGS_((Tk_TextLayout layout, int x, int y)); /* 152 */ -EXTERN int Tk_PostscriptFontName _ANSI_ARGS_((Tk_Font tkfont, - Tcl_DString * dsPtr)); +EXTERN int Tk_PostscriptFontName _ANSI_ARGS_((Tk_Font tkfont, + Tcl_DString *dsPtr)); /* 153 */ -EXTERN void Tk_PreserveColormap _ANSI_ARGS_((Display * display, +EXTERN void Tk_PreserveColormap _ANSI_ARGS_((Display *display, Colormap colormap)); /* 154 */ -EXTERN void Tk_QueueWindowEvent _ANSI_ARGS_((XEvent * eventPtr, +EXTERN void Tk_QueueWindowEvent _ANSI_ARGS_((XEvent *eventPtr, Tcl_QueuePosition position)); /* 155 */ -EXTERN void Tk_RedrawImage _ANSI_ARGS_((Tk_Image image, - int imageX, int imageY, int width, - int height, Drawable drawable, int drawableX, +EXTERN void Tk_RedrawImage _ANSI_ARGS_((Tk_Image image, + int imageX, int imageY, int width, + int height, Drawable drawable, int drawableX, int drawableY)); /* 156 */ -EXTERN void Tk_ResizeWindow _ANSI_ARGS_((Tk_Window tkwin, +EXTERN void Tk_ResizeWindow _ANSI_ARGS_((Tk_Window tkwin, int width, int height)); /* 157 */ -EXTERN int Tk_RestackWindow _ANSI_ARGS_((Tk_Window tkwin, +EXTERN int Tk_RestackWindow _ANSI_ARGS_((Tk_Window tkwin, int aboveBelow, Tk_Window other)); /* 158 */ EXTERN Tk_RestrictProc * Tk_RestrictEvents _ANSI_ARGS_(( - Tk_RestrictProc * proc, ClientData arg, - ClientData * prevArgPtr)); + Tk_RestrictProc *proc, ClientData arg, + ClientData *prevArgPtr)); /* 159 */ -EXTERN int Tk_SafeInit _ANSI_ARGS_((Tcl_Interp * interp)); +EXTERN int Tk_SafeInit _ANSI_ARGS_((Tcl_Interp *interp)); /* 160 */ -EXTERN CONST char * Tk_SetAppName _ANSI_ARGS_((Tk_Window tkwin, - CONST char * name)); +EXTERN CONST char * Tk_SetAppName _ANSI_ARGS_((Tk_Window tkwin, + CONST char *name)); /* 161 */ EXTERN void Tk_SetBackgroundFromBorder _ANSI_ARGS_(( Tk_Window tkwin, Tk_3DBorder border)); /* 162 */ -EXTERN void Tk_SetClass _ANSI_ARGS_((Tk_Window tkwin, - CONST char * className)); +EXTERN void Tk_SetClass _ANSI_ARGS_((Tk_Window tkwin, + CONST char *className)); /* 163 */ -EXTERN void Tk_SetGrid _ANSI_ARGS_((Tk_Window tkwin, - int reqWidth, int reqHeight, int gridWidth, +EXTERN void Tk_SetGrid _ANSI_ARGS_((Tk_Window tkwin, + int reqWidth, int reqHeight, int gridWidth, int gridHeight)); /* 164 */ -EXTERN void Tk_SetInternalBorder _ANSI_ARGS_((Tk_Window tkwin, +EXTERN void Tk_SetInternalBorder _ANSI_ARGS_((Tk_Window tkwin, int width)); /* 165 */ -EXTERN void Tk_SetWindowBackground _ANSI_ARGS_((Tk_Window tkwin, +EXTERN void Tk_SetWindowBackground _ANSI_ARGS_((Tk_Window tkwin, unsigned long pixel)); /* 166 */ EXTERN void Tk_SetWindowBackgroundPixmap _ANSI_ARGS_(( Tk_Window tkwin, Pixmap pixmap)); /* 167 */ -EXTERN void Tk_SetWindowBorder _ANSI_ARGS_((Tk_Window tkwin, +EXTERN void Tk_SetWindowBorder _ANSI_ARGS_((Tk_Window tkwin, unsigned long pixel)); /* 168 */ -EXTERN void Tk_SetWindowBorderWidth _ANSI_ARGS_((Tk_Window tkwin, +EXTERN void Tk_SetWindowBorderWidth _ANSI_ARGS_((Tk_Window tkwin, int width)); /* 169 */ EXTERN void Tk_SetWindowBorderPixmap _ANSI_ARGS_(( Tk_Window tkwin, Pixmap pixmap)); /* 170 */ -EXTERN void Tk_SetWindowColormap _ANSI_ARGS_((Tk_Window tkwin, +EXTERN void Tk_SetWindowColormap _ANSI_ARGS_((Tk_Window tkwin, Colormap colormap)); /* 171 */ -EXTERN int Tk_SetWindowVisual _ANSI_ARGS_((Tk_Window tkwin, - Visual * visual, int depth, - Colormap colormap)); +EXTERN int Tk_SetWindowVisual _ANSI_ARGS_((Tk_Window tkwin, + Visual *visual, int depth, Colormap colormap)); /* 172 */ -EXTERN void Tk_SizeOfBitmap _ANSI_ARGS_((Display * display, - Pixmap bitmap, int * widthPtr, - int * heightPtr)); +EXTERN void Tk_SizeOfBitmap _ANSI_ARGS_((Display *display, + Pixmap bitmap, int *widthPtr, int *heightPtr)); /* 173 */ -EXTERN void Tk_SizeOfImage _ANSI_ARGS_((Tk_Image image, - int * widthPtr, int * heightPtr)); +EXTERN void Tk_SizeOfImage _ANSI_ARGS_((Tk_Image image, + int *widthPtr, int *heightPtr)); /* 174 */ EXTERN int Tk_StrictMotif _ANSI_ARGS_((Tk_Window tkwin)); /* 175 */ EXTERN void Tk_TextLayoutToPostscript _ANSI_ARGS_(( - Tcl_Interp * interp, Tk_TextLayout layout)); + Tcl_Interp *interp, Tk_TextLayout layout)); /* 176 */ -EXTERN int Tk_TextWidth _ANSI_ARGS_((Tk_Font font, - CONST char * str, int numBytes)); +EXTERN int Tk_TextWidth _ANSI_ARGS_((Tk_Font font, + CONST char *str, int numBytes)); /* 177 */ EXTERN void Tk_UndefineCursor _ANSI_ARGS_((Tk_Window window)); /* 178 */ -EXTERN void Tk_UnderlineChars _ANSI_ARGS_((Display * display, - Drawable drawable, GC gc, Tk_Font tkfont, - CONST char * source, int x, int y, +EXTERN void Tk_UnderlineChars _ANSI_ARGS_((Display *display, + Drawable drawable, GC gc, Tk_Font tkfont, + CONST char *source, int x, int y, int firstByte, int lastByte)); /* 179 */ -EXTERN void Tk_UnderlineTextLayout _ANSI_ARGS_(( - Display * display, Drawable drawable, GC gc, - Tk_TextLayout layout, int x, int y, +EXTERN void Tk_UnderlineTextLayout _ANSI_ARGS_((Display *display, + Drawable drawable, GC gc, + Tk_TextLayout layout, int x, int y, int underline)); /* 180 */ EXTERN void Tk_Ungrab _ANSI_ARGS_((Tk_Window tkwin)); /* 181 */ -EXTERN void Tk_UnmaintainGeometry _ANSI_ARGS_((Tk_Window slave, +EXTERN void Tk_UnmaintainGeometry _ANSI_ARGS_((Tk_Window slave, Tk_Window master)); /* 182 */ EXTERN void Tk_UnmapWindow _ANSI_ARGS_((Tk_Window tkwin)); /* 183 */ EXTERN void Tk_UnsetGrid _ANSI_ARGS_((Tk_Window tkwin)); /* 184 */ -EXTERN void Tk_UpdatePointer _ANSI_ARGS_((Tk_Window tkwin, int x, +EXTERN void Tk_UpdatePointer _ANSI_ARGS_((Tk_Window tkwin, int x, int y, int state)); /* 185 */ EXTERN Pixmap Tk_AllocBitmapFromObj _ANSI_ARGS_(( - Tcl_Interp * interp, Tk_Window tkwin, - Tcl_Obj * objPtr)); + Tcl_Interp *interp, Tk_Window tkwin, + Tcl_Obj *objPtr)); /* 186 */ EXTERN Tk_3DBorder Tk_Alloc3DBorderFromObj _ANSI_ARGS_(( - Tcl_Interp * interp, Tk_Window tkwin, - Tcl_Obj * objPtr)); + Tcl_Interp *interp, Tk_Window tkwin, + Tcl_Obj *objPtr)); /* 187 */ -EXTERN XColor * Tk_AllocColorFromObj _ANSI_ARGS_(( - Tcl_Interp * interp, Tk_Window tkwin, - Tcl_Obj * objPtr)); +EXTERN XColor * Tk_AllocColorFromObj _ANSI_ARGS_((Tcl_Interp *interp, + Tk_Window tkwin, Tcl_Obj *objPtr)); /* 188 */ EXTERN Tk_Cursor Tk_AllocCursorFromObj _ANSI_ARGS_(( - Tcl_Interp * interp, Tk_Window tkwin, - Tcl_Obj * objPtr)); + Tcl_Interp *interp, Tk_Window tkwin, + Tcl_Obj *objPtr)); /* 189 */ -EXTERN Tk_Font Tk_AllocFontFromObj _ANSI_ARGS_((Tcl_Interp * interp, - Tk_Window tkwin, Tcl_Obj * objPtr)); +EXTERN Tk_Font Tk_AllocFontFromObj _ANSI_ARGS_((Tcl_Interp *interp, + Tk_Window tkwin, Tcl_Obj *objPtr)); /* 190 */ -EXTERN Tk_OptionTable Tk_CreateOptionTable _ANSI_ARGS_(( - Tcl_Interp * interp, - CONST Tk_OptionSpec * templatePtr)); +EXTERN Tk_OptionTable Tk_CreateOptionTable _ANSI_ARGS_((Tcl_Interp *interp, + CONST Tk_OptionSpec *templatePtr)); /* 191 */ EXTERN void Tk_DeleteOptionTable _ANSI_ARGS_(( Tk_OptionTable optionTable)); /* 192 */ -EXTERN void Tk_Free3DBorderFromObj _ANSI_ARGS_((Tk_Window tkwin, - Tcl_Obj * objPtr)); +EXTERN void Tk_Free3DBorderFromObj _ANSI_ARGS_((Tk_Window tkwin, + Tcl_Obj *objPtr)); /* 193 */ -EXTERN void Tk_FreeBitmapFromObj _ANSI_ARGS_((Tk_Window tkwin, - Tcl_Obj * objPtr)); +EXTERN void Tk_FreeBitmapFromObj _ANSI_ARGS_((Tk_Window tkwin, + Tcl_Obj *objPtr)); /* 194 */ -EXTERN void Tk_FreeColorFromObj _ANSI_ARGS_((Tk_Window tkwin, - Tcl_Obj * objPtr)); +EXTERN void Tk_FreeColorFromObj _ANSI_ARGS_((Tk_Window tkwin, + Tcl_Obj *objPtr)); /* 195 */ -EXTERN void Tk_FreeConfigOptions _ANSI_ARGS_((char * recordPtr, +EXTERN void Tk_FreeConfigOptions _ANSI_ARGS_((char *recordPtr, Tk_OptionTable optionToken, Tk_Window tkwin)); /* 196 */ EXTERN void Tk_FreeSavedOptions _ANSI_ARGS_(( - Tk_SavedOptions * savePtr)); + Tk_SavedOptions *savePtr)); /* 197 */ -EXTERN void Tk_FreeCursorFromObj _ANSI_ARGS_((Tk_Window tkwin, - Tcl_Obj * objPtr)); +EXTERN void Tk_FreeCursorFromObj _ANSI_ARGS_((Tk_Window tkwin, + Tcl_Obj *objPtr)); /* 198 */ -EXTERN void Tk_FreeFontFromObj _ANSI_ARGS_((Tk_Window tkwin, - Tcl_Obj * objPtr)); +EXTERN void Tk_FreeFontFromObj _ANSI_ARGS_((Tk_Window tkwin, + Tcl_Obj *objPtr)); /* 199 */ -EXTERN Tk_3DBorder Tk_Get3DBorderFromObj _ANSI_ARGS_((Tk_Window tkwin, - Tcl_Obj * objPtr)); +EXTERN Tk_3DBorder Tk_Get3DBorderFromObj _ANSI_ARGS_((Tk_Window tkwin, + Tcl_Obj *objPtr)); /* 200 */ -EXTERN int Tk_GetAnchorFromObj _ANSI_ARGS_((Tcl_Interp * interp, - Tcl_Obj * objPtr, Tk_Anchor * anchorPtr)); +EXTERN int Tk_GetAnchorFromObj _ANSI_ARGS_((Tcl_Interp *interp, + Tcl_Obj *objPtr, Tk_Anchor *anchorPtr)); /* 201 */ -EXTERN Pixmap Tk_GetBitmapFromObj _ANSI_ARGS_((Tk_Window tkwin, - Tcl_Obj * objPtr)); +EXTERN Pixmap Tk_GetBitmapFromObj _ANSI_ARGS_((Tk_Window tkwin, + Tcl_Obj *objPtr)); /* 202 */ -EXTERN XColor * Tk_GetColorFromObj _ANSI_ARGS_((Tk_Window tkwin, - Tcl_Obj * objPtr)); +EXTERN XColor * Tk_GetColorFromObj _ANSI_ARGS_((Tk_Window tkwin, + Tcl_Obj *objPtr)); /* 203 */ -EXTERN Tk_Cursor Tk_GetCursorFromObj _ANSI_ARGS_((Tk_Window tkwin, - Tcl_Obj * objPtr)); +EXTERN Tk_Cursor Tk_GetCursorFromObj _ANSI_ARGS_((Tk_Window tkwin, + Tcl_Obj *objPtr)); /* 204 */ -EXTERN Tcl_Obj * Tk_GetOptionInfo _ANSI_ARGS_((Tcl_Interp * interp, - char * recordPtr, Tk_OptionTable optionTable, - Tcl_Obj * namePtr, Tk_Window tkwin)); +EXTERN Tcl_Obj * Tk_GetOptionInfo _ANSI_ARGS_((Tcl_Interp *interp, + char *recordPtr, Tk_OptionTable optionTable, + Tcl_Obj *namePtr, Tk_Window tkwin)); /* 205 */ -EXTERN Tcl_Obj * Tk_GetOptionValue _ANSI_ARGS_((Tcl_Interp * interp, - char * recordPtr, Tk_OptionTable optionTable, - Tcl_Obj * namePtr, Tk_Window tkwin)); +EXTERN Tcl_Obj * Tk_GetOptionValue _ANSI_ARGS_((Tcl_Interp *interp, + char *recordPtr, Tk_OptionTable optionTable, + Tcl_Obj *namePtr, Tk_Window tkwin)); /* 206 */ -EXTERN int Tk_GetJustifyFromObj _ANSI_ARGS_(( - Tcl_Interp * interp, Tcl_Obj * objPtr, - Tk_Justify * justifyPtr)); +EXTERN int Tk_GetJustifyFromObj _ANSI_ARGS_((Tcl_Interp *interp, + Tcl_Obj *objPtr, Tk_Justify *justifyPtr)); /* 207 */ -EXTERN int Tk_GetMMFromObj _ANSI_ARGS_((Tcl_Interp * interp, - Tk_Window tkwin, Tcl_Obj * objPtr, - double * doublePtr)); +EXTERN int Tk_GetMMFromObj _ANSI_ARGS_((Tcl_Interp *interp, + Tk_Window tkwin, Tcl_Obj *objPtr, + double *doublePtr)); /* 208 */ -EXTERN int Tk_GetPixelsFromObj _ANSI_ARGS_((Tcl_Interp * interp, - Tk_Window tkwin, Tcl_Obj * objPtr, - int * intPtr)); +EXTERN int Tk_GetPixelsFromObj _ANSI_ARGS_((Tcl_Interp *interp, + Tk_Window tkwin, Tcl_Obj *objPtr, + int *intPtr)); /* 209 */ -EXTERN int Tk_GetReliefFromObj _ANSI_ARGS_((Tcl_Interp * interp, - Tcl_Obj * objPtr, int * resultPtr)); +EXTERN int Tk_GetReliefFromObj _ANSI_ARGS_((Tcl_Interp *interp, + Tcl_Obj *objPtr, int *resultPtr)); /* 210 */ -EXTERN int Tk_GetScrollInfoObj _ANSI_ARGS_((Tcl_Interp * interp, - int objc, Tcl_Obj *CONST objv[], - double * dblPtr, int * intPtr)); +EXTERN int Tk_GetScrollInfoObj _ANSI_ARGS_((Tcl_Interp *interp, + int objc, Tcl_Obj *CONST objv[], + double *dblPtr, int *intPtr)); /* 211 */ -EXTERN int Tk_InitOptions _ANSI_ARGS_((Tcl_Interp * interp, - char * recordPtr, Tk_OptionTable optionToken, +EXTERN int Tk_InitOptions _ANSI_ARGS_((Tcl_Interp *interp, + char *recordPtr, Tk_OptionTable optionToken, Tk_Window tkwin)); /* 212 */ -EXTERN void Tk_MainEx _ANSI_ARGS_((int argc, char ** argv, - Tcl_AppInitProc * appInitProc, - Tcl_Interp * interp)); +EXTERN void Tk_MainEx _ANSI_ARGS_((int argc, char **argv, + Tcl_AppInitProc *appInitProc, + Tcl_Interp *interp)); /* 213 */ EXTERN void Tk_RestoreSavedOptions _ANSI_ARGS_(( - Tk_SavedOptions * savePtr)); + Tk_SavedOptions *savePtr)); /* 214 */ -EXTERN int Tk_SetOptions _ANSI_ARGS_((Tcl_Interp * interp, - char * recordPtr, Tk_OptionTable optionTable, - int objc, Tcl_Obj *CONST objv[], - Tk_Window tkwin, Tk_SavedOptions * savePtr, - int * maskPtr)); +EXTERN int Tk_SetOptions _ANSI_ARGS_((Tcl_Interp *interp, + char *recordPtr, Tk_OptionTable optionTable, + int objc, Tcl_Obj *CONST objv[], + Tk_Window tkwin, Tk_SavedOptions *savePtr, + int *maskPtr)); /* 215 */ EXTERN void Tk_InitConsoleChannels _ANSI_ARGS_(( - Tcl_Interp * interp)); + Tcl_Interp *interp)); /* 216 */ EXTERN int Tk_CreateConsoleWindow _ANSI_ARGS_(( - Tcl_Interp * interp)); + Tcl_Interp *interp)); /* 217 */ EXTERN void Tk_CreateSmoothMethod _ANSI_ARGS_(( - Tcl_Interp * interp, - Tk_SmoothMethod * method)); + Tcl_Interp *interp, Tk_SmoothMethod *method)); /* Slot 218 is reserved */ /* Slot 219 is reserved */ /* 220 */ -EXTERN int Tk_GetDash _ANSI_ARGS_((Tcl_Interp * interp, - CONST char * value, Tk_Dash * dash)); +EXTERN int Tk_GetDash _ANSI_ARGS_((Tcl_Interp *interp, + CONST char *value, Tk_Dash *dash)); /* 221 */ -EXTERN void Tk_CreateOutline _ANSI_ARGS_((Tk_Outline * outline)); +EXTERN void Tk_CreateOutline _ANSI_ARGS_((Tk_Outline *outline)); /* 222 */ -EXTERN void Tk_DeleteOutline _ANSI_ARGS_((Display * display, - Tk_Outline * outline)); +EXTERN void Tk_DeleteOutline _ANSI_ARGS_((Display *display, + Tk_Outline *outline)); /* 223 */ -EXTERN int Tk_ConfigOutlineGC _ANSI_ARGS_((XGCValues * gcValues, - Tk_Canvas canvas, Tk_Item * item, - Tk_Outline * outline)); +EXTERN int Tk_ConfigOutlineGC _ANSI_ARGS_((XGCValues *gcValues, + Tk_Canvas canvas, Tk_Item *item, + Tk_Outline *outline)); /* 224 */ -EXTERN int Tk_ChangeOutlineGC _ANSI_ARGS_((Tk_Canvas canvas, - Tk_Item * item, Tk_Outline * outline)); +EXTERN int Tk_ChangeOutlineGC _ANSI_ARGS_((Tk_Canvas canvas, + Tk_Item *item, Tk_Outline *outline)); /* 225 */ -EXTERN int Tk_ResetOutlineGC _ANSI_ARGS_((Tk_Canvas canvas, - Tk_Item * item, Tk_Outline * outline)); +EXTERN int Tk_ResetOutlineGC _ANSI_ARGS_((Tk_Canvas canvas, + Tk_Item *item, Tk_Outline *outline)); /* 226 */ -EXTERN int Tk_CanvasPsOutline _ANSI_ARGS_((Tk_Canvas canvas, - Tk_Item * item, Tk_Outline * outline)); +EXTERN int Tk_CanvasPsOutline _ANSI_ARGS_((Tk_Canvas canvas, + Tk_Item *item, Tk_Outline *outline)); /* 227 */ -EXTERN void Tk_SetTSOrigin _ANSI_ARGS_((Tk_Window tkwin, GC gc, +EXTERN void Tk_SetTSOrigin _ANSI_ARGS_((Tk_Window tkwin, GC gc, int x, int y)); /* 228 */ EXTERN int Tk_CanvasGetCoordFromObj _ANSI_ARGS_(( - Tcl_Interp * interp, Tk_Canvas canvas, - Tcl_Obj * obj, double * doublePtr)); + Tcl_Interp *interp, Tk_Canvas canvas, + Tcl_Obj *obj, double *doublePtr)); /* 229 */ -EXTERN void Tk_CanvasSetOffset _ANSI_ARGS_((Tk_Canvas canvas, - GC gc, Tk_TSOffset * offset)); +EXTERN void Tk_CanvasSetOffset _ANSI_ARGS_((Tk_Canvas canvas, + GC gc, Tk_TSOffset *offset)); /* 230 */ -EXTERN void Tk_DitherPhoto _ANSI_ARGS_((Tk_PhotoHandle handle, +EXTERN void Tk_DitherPhoto _ANSI_ARGS_((Tk_PhotoHandle handle, int x, int y, int width, int height)); /* 231 */ -EXTERN int Tk_PostscriptBitmap _ANSI_ARGS_((Tcl_Interp * interp, - Tk_Window tkwin, Tk_PostscriptInfo psInfo, - Pixmap bitmap, int startX, int startY, +EXTERN int Tk_PostscriptBitmap _ANSI_ARGS_((Tcl_Interp *interp, + Tk_Window tkwin, Tk_PostscriptInfo psInfo, + Pixmap bitmap, int startX, int startY, int width, int height)); /* 232 */ -EXTERN int Tk_PostscriptColor _ANSI_ARGS_((Tcl_Interp * interp, - Tk_PostscriptInfo psInfo, XColor * colorPtr)); +EXTERN int Tk_PostscriptColor _ANSI_ARGS_((Tcl_Interp *interp, + Tk_PostscriptInfo psInfo, XColor *colorPtr)); /* 233 */ -EXTERN int Tk_PostscriptFont _ANSI_ARGS_((Tcl_Interp * interp, +EXTERN int Tk_PostscriptFont _ANSI_ARGS_((Tcl_Interp *interp, Tk_PostscriptInfo psInfo, Tk_Font font)); /* 234 */ -EXTERN int Tk_PostscriptImage _ANSI_ARGS_((Tk_Image image, - Tcl_Interp * interp, Tk_Window tkwin, - Tk_PostscriptInfo psinfo, int x, int y, +EXTERN int Tk_PostscriptImage _ANSI_ARGS_((Tk_Image image, + Tcl_Interp *interp, Tk_Window tkwin, + Tk_PostscriptInfo psinfo, int x, int y, int width, int height, int prepass)); /* 235 */ -EXTERN void Tk_PostscriptPath _ANSI_ARGS_((Tcl_Interp * interp, - Tk_PostscriptInfo psInfo, double * coordPtr, +EXTERN void Tk_PostscriptPath _ANSI_ARGS_((Tcl_Interp *interp, + Tk_PostscriptInfo psInfo, double *coordPtr, int numPoints)); /* 236 */ -EXTERN int Tk_PostscriptStipple _ANSI_ARGS_(( - Tcl_Interp * interp, Tk_Window tkwin, - Tk_PostscriptInfo psInfo, Pixmap bitmap)); +EXTERN int Tk_PostscriptStipple _ANSI_ARGS_((Tcl_Interp *interp, + Tk_Window tkwin, Tk_PostscriptInfo psInfo, + Pixmap bitmap)); /* 237 */ -EXTERN double Tk_PostscriptY _ANSI_ARGS_((double y, +EXTERN double Tk_PostscriptY _ANSI_ARGS_((double y, Tk_PostscriptInfo psInfo)); /* 238 */ -EXTERN int Tk_PostscriptPhoto _ANSI_ARGS_((Tcl_Interp * interp, - Tk_PhotoImageBlock * blockPtr, - Tk_PostscriptInfo psInfo, int width, +EXTERN int Tk_PostscriptPhoto _ANSI_ARGS_((Tcl_Interp *interp, + Tk_PhotoImageBlock *blockPtr, + Tk_PostscriptInfo psInfo, int width, int height)); /* 239 */ EXTERN void Tk_CreateClientMessageHandler _ANSI_ARGS_(( - Tk_ClientMessageProc * proc)); + Tk_ClientMessageProc *proc)); /* 240 */ EXTERN void Tk_DeleteClientMessageHandler _ANSI_ARGS_(( - Tk_ClientMessageProc * proc)); + Tk_ClientMessageProc *proc)); /* 241 */ EXTERN Tk_Window Tk_CreateAnonymousWindow _ANSI_ARGS_(( - Tcl_Interp * interp, Tk_Window parent, - CONST char * screenName)); + Tcl_Interp *interp, Tk_Window parent, + CONST char *screenName)); /* 242 */ -EXTERN void Tk_SetClassProcs _ANSI_ARGS_((Tk_Window tkwin, - Tk_ClassProcs * procs, +EXTERN void Tk_SetClassProcs _ANSI_ARGS_((Tk_Window tkwin, + Tk_ClassProcs *procs, ClientData instanceData)); /* 243 */ -EXTERN void Tk_SetInternalBorderEx _ANSI_ARGS_((Tk_Window tkwin, +EXTERN void Tk_SetInternalBorderEx _ANSI_ARGS_((Tk_Window tkwin, int left, int right, int top, int bottom)); /* 244 */ EXTERN void Tk_SetMinimumRequestSize _ANSI_ARGS_(( Tk_Window tkwin, int minWidth, int minHeight)); /* 245 */ -EXTERN void Tk_SetCaretPos _ANSI_ARGS_((Tk_Window tkwin, int x, +EXTERN void Tk_SetCaretPos _ANSI_ARGS_((Tk_Window tkwin, int x, int y, int height)); /* 246 */ -EXTERN void Tk_PhotoPutBlock _ANSI_ARGS_((Tk_PhotoHandle handle, - Tk_PhotoImageBlock * blockPtr, int x, int y, +EXTERN void Tk_PhotoPutBlock _ANSI_ARGS_((Tk_PhotoHandle handle, + Tk_PhotoImageBlock *blockPtr, int x, int y, int width, int height, int compRule)); /* 247 */ EXTERN void Tk_PhotoPutZoomedBlock _ANSI_ARGS_(( - Tk_PhotoHandle handle, - Tk_PhotoImageBlock * blockPtr, int x, int y, - int width, int height, int zoomX, int zoomY, + Tk_PhotoHandle handle, + Tk_PhotoImageBlock *blockPtr, int x, int y, + int width, int height, int zoomX, int zoomY, int subsampleX, int subsampleY, int compRule)); /* 248 */ EXTERN int Tk_CollapseMotionEvents _ANSI_ARGS_(( - Display * display, int collapse)); + Display *display, int collapse)); /* 249 */ -EXTERN Tk_StyleEngine Tk_RegisterStyleEngine _ANSI_ARGS_(( - CONST char * name, Tk_StyleEngine parent)); +EXTERN Tk_StyleEngine Tk_RegisterStyleEngine _ANSI_ARGS_((CONST char *name, + Tk_StyleEngine parent)); /* 250 */ -EXTERN Tk_StyleEngine Tk_GetStyleEngine _ANSI_ARGS_((CONST char * name)); +EXTERN Tk_StyleEngine Tk_GetStyleEngine _ANSI_ARGS_((CONST char *name)); /* 251 */ EXTERN int Tk_RegisterStyledElement _ANSI_ARGS_(( - Tk_StyleEngine engine, - Tk_ElementSpec * templatePtr)); + Tk_StyleEngine engine, + Tk_ElementSpec *templatePtr)); /* 252 */ -EXTERN int Tk_GetElementId _ANSI_ARGS_((CONST char * name)); +EXTERN int Tk_GetElementId _ANSI_ARGS_((CONST char *name)); /* 253 */ -EXTERN Tk_Style Tk_CreateStyle _ANSI_ARGS_((CONST char * name, +EXTERN Tk_Style Tk_CreateStyle _ANSI_ARGS_((CONST char *name, Tk_StyleEngine engine, ClientData clientData)); /* 254 */ -EXTERN Tk_Style Tk_GetStyle _ANSI_ARGS_((Tcl_Interp * interp, - CONST char * name)); +EXTERN Tk_Style Tk_GetStyle _ANSI_ARGS_((Tcl_Interp *interp, + CONST char *name)); /* 255 */ EXTERN void Tk_FreeStyle _ANSI_ARGS_((Tk_Style style)); /* 256 */ EXTERN CONST char * Tk_NameOfStyle _ANSI_ARGS_((Tk_Style style)); /* 257 */ -EXTERN Tk_Style Tk_AllocStyleFromObj _ANSI_ARGS_(( - Tcl_Interp * interp, Tcl_Obj * objPtr)); +EXTERN Tk_Style Tk_AllocStyleFromObj _ANSI_ARGS_((Tcl_Interp *interp, + Tcl_Obj *objPtr)); /* 258 */ -EXTERN Tk_Style Tk_GetStyleFromObj _ANSI_ARGS_((Tcl_Obj * objPtr)); +EXTERN Tk_Style Tk_GetStyleFromObj _ANSI_ARGS_((Tcl_Obj *objPtr)); /* 259 */ -EXTERN void Tk_FreeStyleFromObj _ANSI_ARGS_((Tcl_Obj * objPtr)); +EXTERN void Tk_FreeStyleFromObj _ANSI_ARGS_((Tcl_Obj *objPtr)); /* 260 */ -EXTERN Tk_StyledElement Tk_GetStyledElement _ANSI_ARGS_((Tk_Style style, +EXTERN Tk_StyledElement Tk_GetStyledElement _ANSI_ARGS_((Tk_Style style, int elementId, Tk_OptionTable optionTable)); /* 261 */ -EXTERN void Tk_GetElementSize _ANSI_ARGS_((Tk_Style style, - Tk_StyledElement element, char * recordPtr, - Tk_Window tkwin, int width, int height, - int inner, int * widthPtr, int * heightPtr)); +EXTERN void Tk_GetElementSize _ANSI_ARGS_((Tk_Style style, + Tk_StyledElement element, char *recordPtr, + Tk_Window tkwin, int width, int height, + int inner, int *widthPtr, int *heightPtr)); /* 262 */ -EXTERN void Tk_GetElementBox _ANSI_ARGS_((Tk_Style style, - Tk_StyledElement element, char * recordPtr, - Tk_Window tkwin, int x, int y, int width, - int height, int inner, int * xPtr, - int * yPtr, int * widthPtr, int * heightPtr)); +EXTERN void Tk_GetElementBox _ANSI_ARGS_((Tk_Style style, + Tk_StyledElement element, char *recordPtr, + Tk_Window tkwin, int x, int y, int width, + int height, int inner, int *xPtr, int *yPtr, + int *widthPtr, int *heightPtr)); /* 263 */ -EXTERN int Tk_GetElementBorderWidth _ANSI_ARGS_((Tk_Style style, - Tk_StyledElement element, char * recordPtr, +EXTERN int Tk_GetElementBorderWidth _ANSI_ARGS_((Tk_Style style, + Tk_StyledElement element, char *recordPtr, Tk_Window tkwin)); /* 264 */ -EXTERN void Tk_DrawElement _ANSI_ARGS_((Tk_Style style, - Tk_StyledElement element, char * recordPtr, - Tk_Window tkwin, Drawable d, int x, int y, +EXTERN void Tk_DrawElement _ANSI_ARGS_((Tk_Style style, + Tk_StyledElement element, char *recordPtr, + Tk_Window tkwin, Drawable d, int x, int y, int width, int height, int state)); +/* Slot 265 is reserved */ +/* Slot 266 is reserved */ +/* Slot 267 is reserved */ +/* Slot 268 is reserved */ +/* Slot 269 is reserved */ +/* Slot 270 is reserved */ +/* Slot 271 is reserved */ +/* Slot 272 is reserved */ +/* Slot 273 is reserved */ +/* Slot 274 is reserved */ +/* 275 */ +EXTERN void TkUnusedStubEntry _ANSI_ARGS_((void)); typedef struct TkStubHooks { struct TkPlatStubs *tkPlatStubs; @@ -933,164 +934,164 @@ GC (*tk_3DBorderGC) _ANSI_ARGS_((Tk_Window tkwin, Tk_3DBorder border, int which)); /* 2 */ void (*tk_3DHorizontalBevel) _ANSI_ARGS_((Tk_Window tkwin, Drawable drawable, Tk_3DBorder border, int x, int y, int width, int height, int leftIn, int rightIn, int topBevel, int relief)); /* 3 */ void (*tk_3DVerticalBevel) _ANSI_ARGS_((Tk_Window tkwin, Drawable drawable, Tk_3DBorder border, int x, int y, int width, int height, int leftBevel, int relief)); /* 4 */ - void (*tk_AddOption) _ANSI_ARGS_((Tk_Window tkwin, CONST char * name, CONST char * value, int priority)); /* 5 */ - void (*tk_BindEvent) _ANSI_ARGS_((Tk_BindingTable bindingTable, XEvent * eventPtr, Tk_Window tkwin, int numObjects, ClientData * objectPtr)); /* 6 */ - void (*tk_CanvasDrawableCoords) _ANSI_ARGS_((Tk_Canvas canvas, double x, double y, short * drawableXPtr, short * drawableYPtr)); /* 7 */ + void (*tk_AddOption) _ANSI_ARGS_((Tk_Window tkwin, CONST char *name, CONST char *value, int priority)); /* 5 */ + void (*tk_BindEvent) _ANSI_ARGS_((Tk_BindingTable bindingTable, XEvent *eventPtr, Tk_Window tkwin, int numObjects, ClientData *objectPtr)); /* 6 */ + void (*tk_CanvasDrawableCoords) _ANSI_ARGS_((Tk_Canvas canvas, double x, double y, short *drawableXPtr, short *drawableYPtr)); /* 7 */ void (*tk_CanvasEventuallyRedraw) _ANSI_ARGS_((Tk_Canvas canvas, int x1, int y1, int x2, int y2)); /* 8 */ - int (*tk_CanvasGetCoord) _ANSI_ARGS_((Tcl_Interp * interp, Tk_Canvas canvas, CONST char * str, double * doublePtr)); /* 9 */ + int (*tk_CanvasGetCoord) _ANSI_ARGS_((Tcl_Interp *interp, Tk_Canvas canvas, CONST char *str, double *doublePtr)); /* 9 */ Tk_CanvasTextInfo * (*tk_CanvasGetTextInfo) _ANSI_ARGS_((Tk_Canvas canvas)); /* 10 */ - int (*tk_CanvasPsBitmap) _ANSI_ARGS_((Tcl_Interp * interp, Tk_Canvas canvas, Pixmap bitmap, int x, int y, int width, int height)); /* 11 */ - int (*tk_CanvasPsColor) _ANSI_ARGS_((Tcl_Interp * interp, Tk_Canvas canvas, XColor * colorPtr)); /* 12 */ - int (*tk_CanvasPsFont) _ANSI_ARGS_((Tcl_Interp * interp, Tk_Canvas canvas, Tk_Font font)); /* 13 */ - void (*tk_CanvasPsPath) _ANSI_ARGS_((Tcl_Interp * interp, Tk_Canvas canvas, double * coordPtr, int numPoints)); /* 14 */ - int (*tk_CanvasPsStipple) _ANSI_ARGS_((Tcl_Interp * interp, Tk_Canvas canvas, Pixmap bitmap)); /* 15 */ + int (*tk_CanvasPsBitmap) _ANSI_ARGS_((Tcl_Interp *interp, Tk_Canvas canvas, Pixmap bitmap, int x, int y, int width, int height)); /* 11 */ + int (*tk_CanvasPsColor) _ANSI_ARGS_((Tcl_Interp *interp, Tk_Canvas canvas, XColor *colorPtr)); /* 12 */ + int (*tk_CanvasPsFont) _ANSI_ARGS_((Tcl_Interp *interp, Tk_Canvas canvas, Tk_Font font)); /* 13 */ + void (*tk_CanvasPsPath) _ANSI_ARGS_((Tcl_Interp *interp, Tk_Canvas canvas, double *coordPtr, int numPoints)); /* 14 */ + int (*tk_CanvasPsStipple) _ANSI_ARGS_((Tcl_Interp *interp, Tk_Canvas canvas, Pixmap bitmap)); /* 15 */ double (*tk_CanvasPsY) _ANSI_ARGS_((Tk_Canvas canvas, double y)); /* 16 */ void (*tk_CanvasSetStippleOrigin) _ANSI_ARGS_((Tk_Canvas canvas, GC gc)); /* 17 */ - int (*tk_CanvasTagsParseProc) _ANSI_ARGS_((ClientData clientData, Tcl_Interp * interp, Tk_Window tkwin, CONST char * value, char * widgRec, int offset)); /* 18 */ - char * (*tk_CanvasTagsPrintProc) _ANSI_ARGS_((ClientData clientData, Tk_Window tkwin, char * widgRec, int offset, Tcl_FreeProc ** freeProcPtr)); /* 19 */ + int (*tk_CanvasTagsParseProc) _ANSI_ARGS_((ClientData clientData, Tcl_Interp *interp, Tk_Window tkwin, CONST char *value, char *widgRec, int offset)); /* 18 */ + char * (*tk_CanvasTagsPrintProc) _ANSI_ARGS_((ClientData clientData, Tk_Window tkwin, char *widgRec, int offset, Tcl_FreeProc **freeProcPtr)); /* 19 */ Tk_Window (*tk_CanvasTkwin) _ANSI_ARGS_((Tk_Canvas canvas)); /* 20 */ - void (*tk_CanvasWindowCoords) _ANSI_ARGS_((Tk_Canvas canvas, double x, double y, short * screenXPtr, short * screenYPtr)); /* 21 */ - void (*tk_ChangeWindowAttributes) _ANSI_ARGS_((Tk_Window tkwin, unsigned long valueMask, XSetWindowAttributes * attsPtr)); /* 22 */ - int (*tk_CharBbox) _ANSI_ARGS_((Tk_TextLayout layout, int index, int * xPtr, int * yPtr, int * widthPtr, int * heightPtr)); /* 23 */ + void (*tk_CanvasWindowCoords) _ANSI_ARGS_((Tk_Canvas canvas, double x, double y, short *screenXPtr, short *screenYPtr)); /* 21 */ + void (*tk_ChangeWindowAttributes) _ANSI_ARGS_((Tk_Window tkwin, unsigned long valueMask, XSetWindowAttributes *attsPtr)); /* 22 */ + int (*tk_CharBbox) _ANSI_ARGS_((Tk_TextLayout layout, int index, int *xPtr, int *yPtr, int *widthPtr, int *heightPtr)); /* 23 */ void (*tk_ClearSelection) _ANSI_ARGS_((Tk_Window tkwin, Atom selection)); /* 24 */ - int (*tk_ClipboardAppend) _ANSI_ARGS_((Tcl_Interp * interp, Tk_Window tkwin, Atom target, Atom format, char* buffer)); /* 25 */ - int (*tk_ClipboardClear) _ANSI_ARGS_((Tcl_Interp * interp, Tk_Window tkwin)); /* 26 */ - int (*tk_ConfigureInfo) _ANSI_ARGS_((Tcl_Interp * interp, Tk_Window tkwin, Tk_ConfigSpec * specs, char * widgRec, CONST char * argvName, int flags)); /* 27 */ - int (*tk_ConfigureValue) _ANSI_ARGS_((Tcl_Interp * interp, Tk_Window tkwin, Tk_ConfigSpec * specs, char * widgRec, CONST char * argvName, int flags)); /* 28 */ - int (*tk_ConfigureWidget) _ANSI_ARGS_((Tcl_Interp * interp, Tk_Window tkwin, Tk_ConfigSpec * specs, int argc, CONST84 char ** argv, char * widgRec, int flags)); /* 29 */ - void (*tk_ConfigureWindow) _ANSI_ARGS_((Tk_Window tkwin, unsigned int valueMask, XWindowChanges * valuePtr)); /* 30 */ - Tk_TextLayout (*tk_ComputeTextLayout) _ANSI_ARGS_((Tk_Font font, CONST char * str, int numChars, int wrapLength, Tk_Justify justify, int flags, int * widthPtr, int * heightPtr)); /* 31 */ + int (*tk_ClipboardAppend) _ANSI_ARGS_((Tcl_Interp *interp, Tk_Window tkwin, Atom target, Atom format, char *buffer)); /* 25 */ + int (*tk_ClipboardClear) _ANSI_ARGS_((Tcl_Interp *interp, Tk_Window tkwin)); /* 26 */ + int (*tk_ConfigureInfo) _ANSI_ARGS_((Tcl_Interp *interp, Tk_Window tkwin, Tk_ConfigSpec *specs, char *widgRec, CONST char *argvName, int flags)); /* 27 */ + int (*tk_ConfigureValue) _ANSI_ARGS_((Tcl_Interp *interp, Tk_Window tkwin, Tk_ConfigSpec *specs, char *widgRec, CONST char *argvName, int flags)); /* 28 */ + int (*tk_ConfigureWidget) _ANSI_ARGS_((Tcl_Interp *interp, Tk_Window tkwin, Tk_ConfigSpec *specs, int argc, CONST84 char **argv, char *widgRec, int flags)); /* 29 */ + void (*tk_ConfigureWindow) _ANSI_ARGS_((Tk_Window tkwin, unsigned int valueMask, XWindowChanges *valuePtr)); /* 30 */ + Tk_TextLayout (*tk_ComputeTextLayout) _ANSI_ARGS_((Tk_Font font, CONST char *str, int numChars, int wrapLength, Tk_Justify justify, int flags, int *widthPtr, int *heightPtr)); /* 31 */ Tk_Window (*tk_CoordsToWindow) _ANSI_ARGS_((int rootX, int rootY, Tk_Window tkwin)); /* 32 */ - unsigned long (*tk_CreateBinding) _ANSI_ARGS_((Tcl_Interp * interp, Tk_BindingTable bindingTable, ClientData object, CONST char * eventStr, CONST char * command, int append)); /* 33 */ - Tk_BindingTable (*tk_CreateBindingTable) _ANSI_ARGS_((Tcl_Interp * interp)); /* 34 */ - Tk_ErrorHandler (*tk_CreateErrorHandler) _ANSI_ARGS_((Display * display, int errNum, int request, int minorCode, Tk_ErrorProc * errorProc, ClientData clientData)); /* 35 */ - void (*tk_CreateEventHandler) _ANSI_ARGS_((Tk_Window token, unsigned long mask, Tk_EventProc * proc, ClientData clientData)); /* 36 */ - void (*tk_CreateGenericHandler) _ANSI_ARGS_((Tk_GenericProc * proc, ClientData clientData)); /* 37 */ - void (*tk_CreateImageType) _ANSI_ARGS_((Tk_ImageType * typePtr)); /* 38 */ - void (*tk_CreateItemType) _ANSI_ARGS_((Tk_ItemType * typePtr)); /* 39 */ - void (*tk_CreatePhotoImageFormat) _ANSI_ARGS_((Tk_PhotoImageFormat * formatPtr)); /* 40 */ - void (*tk_CreateSelHandler) _ANSI_ARGS_((Tk_Window tkwin, Atom selection, Atom target, Tk_SelectionProc * proc, ClientData clientData, Atom format)); /* 41 */ - Tk_Window (*tk_CreateWindow) _ANSI_ARGS_((Tcl_Interp * interp, Tk_Window parent, CONST char * name, CONST char * screenName)); /* 42 */ - Tk_Window (*tk_CreateWindowFromPath) _ANSI_ARGS_((Tcl_Interp * interp, Tk_Window tkwin, CONST char * pathName, CONST char * screenName)); /* 43 */ - int (*tk_DefineBitmap) _ANSI_ARGS_((Tcl_Interp * interp, CONST char * name, CONST char * source, int width, int height)); /* 44 */ + unsigned long (*tk_CreateBinding) _ANSI_ARGS_((Tcl_Interp *interp, Tk_BindingTable bindingTable, ClientData object, CONST char *eventStr, CONST char *script, int append)); /* 33 */ + Tk_BindingTable (*tk_CreateBindingTable) _ANSI_ARGS_((Tcl_Interp *interp)); /* 34 */ + Tk_ErrorHandler (*tk_CreateErrorHandler) _ANSI_ARGS_((Display *display, int errNum, int request, int minorCode, Tk_ErrorProc *errorProc, ClientData clientData)); /* 35 */ + void (*tk_CreateEventHandler) _ANSI_ARGS_((Tk_Window token, unsigned long mask, Tk_EventProc *proc, ClientData clientData)); /* 36 */ + void (*tk_CreateGenericHandler) _ANSI_ARGS_((Tk_GenericProc *proc, ClientData clientData)); /* 37 */ + void (*tk_CreateImageType) _ANSI_ARGS_((Tk_ImageType *typePtr)); /* 38 */ + void (*tk_CreateItemType) _ANSI_ARGS_((Tk_ItemType *typePtr)); /* 39 */ + void (*tk_CreatePhotoImageFormat) _ANSI_ARGS_((Tk_PhotoImageFormat *formatPtr)); /* 40 */ + void (*tk_CreateSelHandler) _ANSI_ARGS_((Tk_Window tkwin, Atom selection, Atom target, Tk_SelectionProc *proc, ClientData clientData, Atom format)); /* 41 */ + Tk_Window (*tk_CreateWindow) _ANSI_ARGS_((Tcl_Interp *interp, Tk_Window parent, CONST char *name, CONST char *screenName)); /* 42 */ + Tk_Window (*tk_CreateWindowFromPath) _ANSI_ARGS_((Tcl_Interp *interp, Tk_Window tkwin, CONST char *pathName, CONST char *screenName)); /* 43 */ + int (*tk_DefineBitmap) _ANSI_ARGS_((Tcl_Interp *interp, CONST char *name, CONST char *source, int width, int height)); /* 44 */ void (*tk_DefineCursor) _ANSI_ARGS_((Tk_Window window, Tk_Cursor cursor)); /* 45 */ void (*tk_DeleteAllBindings) _ANSI_ARGS_((Tk_BindingTable bindingTable, ClientData object)); /* 46 */ - int (*tk_DeleteBinding) _ANSI_ARGS_((Tcl_Interp * interp, Tk_BindingTable bindingTable, ClientData object, CONST char * eventStr)); /* 47 */ + int (*tk_DeleteBinding) _ANSI_ARGS_((Tcl_Interp *interp, Tk_BindingTable bindingTable, ClientData object, CONST char *eventStr)); /* 47 */ void (*tk_DeleteBindingTable) _ANSI_ARGS_((Tk_BindingTable bindingTable)); /* 48 */ void (*tk_DeleteErrorHandler) _ANSI_ARGS_((Tk_ErrorHandler handler)); /* 49 */ - void (*tk_DeleteEventHandler) _ANSI_ARGS_((Tk_Window token, unsigned long mask, Tk_EventProc * proc, ClientData clientData)); /* 50 */ - void (*tk_DeleteGenericHandler) _ANSI_ARGS_((Tk_GenericProc * proc, ClientData clientData)); /* 51 */ - void (*tk_DeleteImage) _ANSI_ARGS_((Tcl_Interp * interp, CONST char * name)); /* 52 */ + void (*tk_DeleteEventHandler) _ANSI_ARGS_((Tk_Window token, unsigned long mask, Tk_EventProc *proc, ClientData clientData)); /* 50 */ + void (*tk_DeleteGenericHandler) _ANSI_ARGS_((Tk_GenericProc *proc, ClientData clientData)); /* 51 */ + void (*tk_DeleteImage) _ANSI_ARGS_((Tcl_Interp *interp, CONST char *name)); /* 52 */ void (*tk_DeleteSelHandler) _ANSI_ARGS_((Tk_Window tkwin, Atom selection, Atom target)); /* 53 */ void (*tk_DestroyWindow) _ANSI_ARGS_((Tk_Window tkwin)); /* 54 */ CONST84_RETURN char * (*tk_DisplayName) _ANSI_ARGS_((Tk_Window tkwin)); /* 55 */ int (*tk_DistanceToTextLayout) _ANSI_ARGS_((Tk_TextLayout layout, int x, int y)); /* 56 */ - void (*tk_Draw3DPolygon) _ANSI_ARGS_((Tk_Window tkwin, Drawable drawable, Tk_3DBorder border, XPoint * pointPtr, int numPoints, int borderWidth, int leftRelief)); /* 57 */ + void (*tk_Draw3DPolygon) _ANSI_ARGS_((Tk_Window tkwin, Drawable drawable, Tk_3DBorder border, XPoint *pointPtr, int numPoints, int borderWidth, int leftRelief)); /* 57 */ void (*tk_Draw3DRectangle) _ANSI_ARGS_((Tk_Window tkwin, Drawable drawable, Tk_3DBorder border, int x, int y, int width, int height, int borderWidth, int relief)); /* 58 */ - void (*tk_DrawChars) _ANSI_ARGS_((Display * display, Drawable drawable, GC gc, Tk_Font tkfont, CONST char * source, int numBytes, int x, int y)); /* 59 */ + void (*tk_DrawChars) _ANSI_ARGS_((Display *display, Drawable drawable, GC gc, Tk_Font tkfont, CONST char *source, int numBytes, int x, int y)); /* 59 */ void (*tk_DrawFocusHighlight) _ANSI_ARGS_((Tk_Window tkwin, GC gc, int width, Drawable drawable)); /* 60 */ - void (*tk_DrawTextLayout) _ANSI_ARGS_((Display * display, Drawable drawable, GC gc, Tk_TextLayout layout, int x, int y, int firstChar, int lastChar)); /* 61 */ - void (*tk_Fill3DPolygon) _ANSI_ARGS_((Tk_Window tkwin, Drawable drawable, Tk_3DBorder border, XPoint * pointPtr, int numPoints, int borderWidth, int leftRelief)); /* 62 */ + void (*tk_DrawTextLayout) _ANSI_ARGS_((Display *display, Drawable drawable, GC gc, Tk_TextLayout layout, int x, int y, int firstChar, int lastChar)); /* 61 */ + void (*tk_Fill3DPolygon) _ANSI_ARGS_((Tk_Window tkwin, Drawable drawable, Tk_3DBorder border, XPoint *pointPtr, int numPoints, int borderWidth, int leftRelief)); /* 62 */ void (*tk_Fill3DRectangle) _ANSI_ARGS_((Tk_Window tkwin, Drawable drawable, Tk_3DBorder border, int x, int y, int width, int height, int borderWidth, int relief)); /* 63 */ - Tk_PhotoHandle (*tk_FindPhoto) _ANSI_ARGS_((Tcl_Interp * interp, CONST char * imageName)); /* 64 */ + Tk_PhotoHandle (*tk_FindPhoto) _ANSI_ARGS_((Tcl_Interp *interp, CONST char *imageName)); /* 64 */ Font (*tk_FontId) _ANSI_ARGS_((Tk_Font font)); /* 65 */ void (*tk_Free3DBorder) _ANSI_ARGS_((Tk_3DBorder border)); /* 66 */ - void (*tk_FreeBitmap) _ANSI_ARGS_((Display * display, Pixmap bitmap)); /* 67 */ - void (*tk_FreeColor) _ANSI_ARGS_((XColor * colorPtr)); /* 68 */ - void (*tk_FreeColormap) _ANSI_ARGS_((Display * display, Colormap colormap)); /* 69 */ - void (*tk_FreeCursor) _ANSI_ARGS_((Display * display, Tk_Cursor cursor)); /* 70 */ + void (*tk_FreeBitmap) _ANSI_ARGS_((Display *display, Pixmap bitmap)); /* 67 */ + void (*tk_FreeColor) _ANSI_ARGS_((XColor *colorPtr)); /* 68 */ + void (*tk_FreeColormap) _ANSI_ARGS_((Display *display, Colormap colormap)); /* 69 */ + void (*tk_FreeCursor) _ANSI_ARGS_((Display *display, Tk_Cursor cursor)); /* 70 */ void (*tk_FreeFont) _ANSI_ARGS_((Tk_Font f)); /* 71 */ - void (*tk_FreeGC) _ANSI_ARGS_((Display * display, GC gc)); /* 72 */ + void (*tk_FreeGC) _ANSI_ARGS_((Display *display, GC gc)); /* 72 */ void (*tk_FreeImage) _ANSI_ARGS_((Tk_Image image)); /* 73 */ - void (*tk_FreeOptions) _ANSI_ARGS_((Tk_ConfigSpec * specs, char * widgRec, Display * display, int needFlags)); /* 74 */ - void (*tk_FreePixmap) _ANSI_ARGS_((Display * display, Pixmap pixmap)); /* 75 */ + void (*tk_FreeOptions) _ANSI_ARGS_((Tk_ConfigSpec *specs, char *widgRec, Display *display, int needFlags)); /* 74 */ + void (*tk_FreePixmap) _ANSI_ARGS_((Display *display, Pixmap pixmap)); /* 75 */ void (*tk_FreeTextLayout) _ANSI_ARGS_((Tk_TextLayout textLayout)); /* 76 */ - void (*tk_FreeXId) _ANSI_ARGS_((Display * display, XID xid)); /* 77 */ - GC (*tk_GCForColor) _ANSI_ARGS_((XColor * colorPtr, Drawable drawable)); /* 78 */ + void (*tk_FreeXId) _ANSI_ARGS_((Display *display, XID xid)); /* 77 */ + GC (*tk_GCForColor) _ANSI_ARGS_((XColor *colorPtr, Drawable drawable)); /* 78 */ void (*tk_GeometryRequest) _ANSI_ARGS_((Tk_Window tkwin, int reqWidth, int reqHeight)); /* 79 */ - Tk_3DBorder (*tk_Get3DBorder) _ANSI_ARGS_((Tcl_Interp * interp, Tk_Window tkwin, Tk_Uid colorName)); /* 80 */ - void (*tk_GetAllBindings) _ANSI_ARGS_((Tcl_Interp * interp, Tk_BindingTable bindingTable, ClientData object)); /* 81 */ - int (*tk_GetAnchor) _ANSI_ARGS_((Tcl_Interp * interp, CONST char * str, Tk_Anchor * anchorPtr)); /* 82 */ + Tk_3DBorder (*tk_Get3DBorder) _ANSI_ARGS_((Tcl_Interp *interp, Tk_Window tkwin, Tk_Uid colorName)); /* 80 */ + void (*tk_GetAllBindings) _ANSI_ARGS_((Tcl_Interp *interp, Tk_BindingTable bindingTable, ClientData object)); /* 81 */ + int (*tk_GetAnchor) _ANSI_ARGS_((Tcl_Interp *interp, CONST char *str, Tk_Anchor *anchorPtr)); /* 82 */ CONST84_RETURN char * (*tk_GetAtomName) _ANSI_ARGS_((Tk_Window tkwin, Atom atom)); /* 83 */ - CONST84_RETURN char * (*tk_GetBinding) _ANSI_ARGS_((Tcl_Interp * interp, Tk_BindingTable bindingTable, ClientData object, CONST char * eventStr)); /* 84 */ - Pixmap (*tk_GetBitmap) _ANSI_ARGS_((Tcl_Interp * interp, Tk_Window tkwin, CONST char * str)); /* 85 */ - Pixmap (*tk_GetBitmapFromData) _ANSI_ARGS_((Tcl_Interp * interp, Tk_Window tkwin, CONST char * source, int width, int height)); /* 86 */ - int (*tk_GetCapStyle) _ANSI_ARGS_((Tcl_Interp * interp, CONST char * str, int * capPtr)); /* 87 */ - XColor * (*tk_GetColor) _ANSI_ARGS_((Tcl_Interp * interp, Tk_Window tkwin, Tk_Uid name)); /* 88 */ - XColor * (*tk_GetColorByValue) _ANSI_ARGS_((Tk_Window tkwin, XColor * colorPtr)); /* 89 */ - Colormap (*tk_GetColormap) _ANSI_ARGS_((Tcl_Interp * interp, Tk_Window tkwin, CONST char * str)); /* 90 */ - Tk_Cursor (*tk_GetCursor) _ANSI_ARGS_((Tcl_Interp * interp, Tk_Window tkwin, Tk_Uid str)); /* 91 */ - Tk_Cursor (*tk_GetCursorFromData) _ANSI_ARGS_((Tcl_Interp * interp, Tk_Window tkwin, CONST char * source, CONST char * mask, int width, int height, int xHot, int yHot, Tk_Uid fg, Tk_Uid bg)); /* 92 */ - Tk_Font (*tk_GetFont) _ANSI_ARGS_((Tcl_Interp * interp, Tk_Window tkwin, CONST char * str)); /* 93 */ - Tk_Font (*tk_GetFontFromObj) _ANSI_ARGS_((Tk_Window tkwin, Tcl_Obj * objPtr)); /* 94 */ - void (*tk_GetFontMetrics) _ANSI_ARGS_((Tk_Font font, Tk_FontMetrics * fmPtr)); /* 95 */ - GC (*tk_GetGC) _ANSI_ARGS_((Tk_Window tkwin, unsigned long valueMask, XGCValues * valuePtr)); /* 96 */ - Tk_Image (*tk_GetImage) _ANSI_ARGS_((Tcl_Interp * interp, Tk_Window tkwin, CONST char * name, Tk_ImageChangedProc * changeProc, ClientData clientData)); /* 97 */ - ClientData (*tk_GetImageMasterData) _ANSI_ARGS_((Tcl_Interp * interp, CONST char * name, Tk_ImageType ** typePtrPtr)); /* 98 */ + CONST84_RETURN char * (*tk_GetBinding) _ANSI_ARGS_((Tcl_Interp *interp, Tk_BindingTable bindingTable, ClientData object, CONST char *eventStr)); /* 84 */ + Pixmap (*tk_GetBitmap) _ANSI_ARGS_((Tcl_Interp *interp, Tk_Window tkwin, CONST char *str)); /* 85 */ + Pixmap (*tk_GetBitmapFromData) _ANSI_ARGS_((Tcl_Interp *interp, Tk_Window tkwin, CONST char *source, int width, int height)); /* 86 */ + int (*tk_GetCapStyle) _ANSI_ARGS_((Tcl_Interp *interp, CONST char *str, int *capPtr)); /* 87 */ + XColor * (*tk_GetColor) _ANSI_ARGS_((Tcl_Interp *interp, Tk_Window tkwin, Tk_Uid name)); /* 88 */ + XColor * (*tk_GetColorByValue) _ANSI_ARGS_((Tk_Window tkwin, XColor *colorPtr)); /* 89 */ + Colormap (*tk_GetColormap) _ANSI_ARGS_((Tcl_Interp *interp, Tk_Window tkwin, CONST char *str)); /* 90 */ + Tk_Cursor (*tk_GetCursor) _ANSI_ARGS_((Tcl_Interp *interp, Tk_Window tkwin, Tk_Uid str)); /* 91 */ + Tk_Cursor (*tk_GetCursorFromData) _ANSI_ARGS_((Tcl_Interp *interp, Tk_Window tkwin, CONST char *source, CONST char *mask, int width, int height, int xHot, int yHot, Tk_Uid fg, Tk_Uid bg)); /* 92 */ + Tk_Font (*tk_GetFont) _ANSI_ARGS_((Tcl_Interp *interp, Tk_Window tkwin, CONST char *str)); /* 93 */ + Tk_Font (*tk_GetFontFromObj) _ANSI_ARGS_((Tk_Window tkwin, Tcl_Obj *objPtr)); /* 94 */ + void (*tk_GetFontMetrics) _ANSI_ARGS_((Tk_Font font, Tk_FontMetrics *fmPtr)); /* 95 */ + GC (*tk_GetGC) _ANSI_ARGS_((Tk_Window tkwin, unsigned long valueMask, XGCValues *valuePtr)); /* 96 */ + Tk_Image (*tk_GetImage) _ANSI_ARGS_((Tcl_Interp *interp, Tk_Window tkwin, CONST char *name, Tk_ImageChangedProc *changeProc, ClientData clientData)); /* 97 */ + ClientData (*tk_GetImageMasterData) _ANSI_ARGS_((Tcl_Interp *interp, CONST char *name, Tk_ImageType **typePtrPtr)); /* 98 */ Tk_ItemType * (*tk_GetItemTypes) _ANSI_ARGS_((void)); /* 99 */ - int (*tk_GetJoinStyle) _ANSI_ARGS_((Tcl_Interp * interp, CONST char * str, int * joinPtr)); /* 100 */ - int (*tk_GetJustify) _ANSI_ARGS_((Tcl_Interp * interp, CONST char * str, Tk_Justify * justifyPtr)); /* 101 */ + int (*tk_GetJoinStyle) _ANSI_ARGS_((Tcl_Interp *interp, CONST char *str, int *joinPtr)); /* 100 */ + int (*tk_GetJustify) _ANSI_ARGS_((Tcl_Interp *interp, CONST char *str, Tk_Justify *justifyPtr)); /* 101 */ int (*tk_GetNumMainWindows) _ANSI_ARGS_((void)); /* 102 */ - Tk_Uid (*tk_GetOption) _ANSI_ARGS_((Tk_Window tkwin, CONST char * name, CONST char * className)); /* 103 */ - int (*tk_GetPixels) _ANSI_ARGS_((Tcl_Interp * interp, Tk_Window tkwin, CONST char * str, int * intPtr)); /* 104 */ - Pixmap (*tk_GetPixmap) _ANSI_ARGS_((Display * display, Drawable d, int width, int height, int depth)); /* 105 */ - int (*tk_GetRelief) _ANSI_ARGS_((Tcl_Interp * interp, CONST char * name, int * reliefPtr)); /* 106 */ - void (*tk_GetRootCoords) _ANSI_ARGS_((Tk_Window tkwin, int * xPtr, int * yPtr)); /* 107 */ - int (*tk_GetScrollInfo) _ANSI_ARGS_((Tcl_Interp * interp, int argc, CONST84 char ** argv, double * dblPtr, int * intPtr)); /* 108 */ - int (*tk_GetScreenMM) _ANSI_ARGS_((Tcl_Interp * interp, Tk_Window tkwin, CONST char * str, double * doublePtr)); /* 109 */ - int (*tk_GetSelection) _ANSI_ARGS_((Tcl_Interp * interp, Tk_Window tkwin, Atom selection, Atom target, Tk_GetSelProc * proc, ClientData clientData)); /* 110 */ - Tk_Uid (*tk_GetUid) _ANSI_ARGS_((CONST char * str)); /* 111 */ - Visual * (*tk_GetVisual) _ANSI_ARGS_((Tcl_Interp * interp, Tk_Window tkwin, CONST char * str, int * depthPtr, Colormap * colormapPtr)); /* 112 */ - void (*tk_GetVRootGeometry) _ANSI_ARGS_((Tk_Window tkwin, int * xPtr, int * yPtr, int * widthPtr, int * heightPtr)); /* 113 */ - int (*tk_Grab) _ANSI_ARGS_((Tcl_Interp * interp, Tk_Window tkwin, int grabGlobal)); /* 114 */ - void (*tk_HandleEvent) _ANSI_ARGS_((XEvent * eventPtr)); /* 115 */ - Tk_Window (*tk_IdToWindow) _ANSI_ARGS_((Display * display, Window window)); /* 116 */ + Tk_Uid (*tk_GetOption) _ANSI_ARGS_((Tk_Window tkwin, CONST char *name, CONST char *className)); /* 103 */ + int (*tk_GetPixels) _ANSI_ARGS_((Tcl_Interp *interp, Tk_Window tkwin, CONST char *str, int *intPtr)); /* 104 */ + Pixmap (*tk_GetPixmap) _ANSI_ARGS_((Display *display, Drawable d, int width, int height, int depth)); /* 105 */ + int (*tk_GetRelief) _ANSI_ARGS_((Tcl_Interp *interp, CONST char *name, int *reliefPtr)); /* 106 */ + void (*tk_GetRootCoords) _ANSI_ARGS_((Tk_Window tkwin, int *xPtr, int *yPtr)); /* 107 */ + int (*tk_GetScrollInfo) _ANSI_ARGS_((Tcl_Interp *interp, int argc, CONST84 char **argv, double *dblPtr, int *intPtr)); /* 108 */ + int (*tk_GetScreenMM) _ANSI_ARGS_((Tcl_Interp *interp, Tk_Window tkwin, CONST char *str, double *doublePtr)); /* 109 */ + int (*tk_GetSelection) _ANSI_ARGS_((Tcl_Interp *interp, Tk_Window tkwin, Atom selection, Atom target, Tk_GetSelProc *proc, ClientData clientData)); /* 110 */ + Tk_Uid (*tk_GetUid) _ANSI_ARGS_((CONST char *str)); /* 111 */ + Visual * (*tk_GetVisual) _ANSI_ARGS_((Tcl_Interp *interp, Tk_Window tkwin, CONST char *str, int *depthPtr, Colormap *colormapPtr)); /* 112 */ + void (*tk_GetVRootGeometry) _ANSI_ARGS_((Tk_Window tkwin, int *xPtr, int *yPtr, int *widthPtr, int *heightPtr)); /* 113 */ + int (*tk_Grab) _ANSI_ARGS_((Tcl_Interp *interp, Tk_Window tkwin, int grabGlobal)); /* 114 */ + void (*tk_HandleEvent) _ANSI_ARGS_((XEvent *eventPtr)); /* 115 */ + Tk_Window (*tk_IdToWindow) _ANSI_ARGS_((Display *display, Window window)); /* 116 */ void (*tk_ImageChanged) _ANSI_ARGS_((Tk_ImageMaster master, int x, int y, int width, int height, int imageWidth, int imageHeight)); /* 117 */ - int (*tk_Init) _ANSI_ARGS_((Tcl_Interp * interp)); /* 118 */ - Atom (*tk_InternAtom) _ANSI_ARGS_((Tk_Window tkwin, CONST char * name)); /* 119 */ + int (*tk_Init) _ANSI_ARGS_((Tcl_Interp *interp)); /* 118 */ + Atom (*tk_InternAtom) _ANSI_ARGS_((Tk_Window tkwin, CONST char *name)); /* 119 */ int (*tk_IntersectTextLayout) _ANSI_ARGS_((Tk_TextLayout layout, int x, int y, int width, int height)); /* 120 */ void (*tk_MaintainGeometry) _ANSI_ARGS_((Tk_Window slave, Tk_Window master, int x, int y, int width, int height)); /* 121 */ - Tk_Window (*tk_MainWindow) _ANSI_ARGS_((Tcl_Interp * interp)); /* 122 */ + Tk_Window (*tk_MainWindow) _ANSI_ARGS_((Tcl_Interp *interp)); /* 122 */ void (*tk_MakeWindowExist) _ANSI_ARGS_((Tk_Window tkwin)); /* 123 */ - void (*tk_ManageGeometry) _ANSI_ARGS_((Tk_Window tkwin, Tk_GeomMgr * mgrPtr, ClientData clientData)); /* 124 */ + void (*tk_ManageGeometry) _ANSI_ARGS_((Tk_Window tkwin, Tk_GeomMgr *mgrPtr, ClientData clientData)); /* 124 */ void (*tk_MapWindow) _ANSI_ARGS_((Tk_Window tkwin)); /* 125 */ - int (*tk_MeasureChars) _ANSI_ARGS_((Tk_Font tkfont, CONST char * source, int numBytes, int maxPixels, int flags, int * lengthPtr)); /* 126 */ + int (*tk_MeasureChars) _ANSI_ARGS_((Tk_Font tkfont, CONST char *source, int numBytes, int maxPixels, int flags, int *lengthPtr)); /* 126 */ void (*tk_MoveResizeWindow) _ANSI_ARGS_((Tk_Window tkwin, int x, int y, int width, int height)); /* 127 */ void (*tk_MoveWindow) _ANSI_ARGS_((Tk_Window tkwin, int x, int y)); /* 128 */ void (*tk_MoveToplevelWindow) _ANSI_ARGS_((Tk_Window tkwin, int x, int y)); /* 129 */ CONST84_RETURN char * (*tk_NameOf3DBorder) _ANSI_ARGS_((Tk_3DBorder border)); /* 130 */ CONST84_RETURN char * (*tk_NameOfAnchor) _ANSI_ARGS_((Tk_Anchor anchor)); /* 131 */ - CONST84_RETURN char * (*tk_NameOfBitmap) _ANSI_ARGS_((Display * display, Pixmap bitmap)); /* 132 */ + CONST84_RETURN char * (*tk_NameOfBitmap) _ANSI_ARGS_((Display *display, Pixmap bitmap)); /* 132 */ CONST84_RETURN char * (*tk_NameOfCapStyle) _ANSI_ARGS_((int cap)); /* 133 */ - CONST84_RETURN char * (*tk_NameOfColor) _ANSI_ARGS_((XColor * colorPtr)); /* 134 */ - CONST84_RETURN char * (*tk_NameOfCursor) _ANSI_ARGS_((Display * display, Tk_Cursor cursor)); /* 135 */ + CONST84_RETURN char * (*tk_NameOfColor) _ANSI_ARGS_((XColor *colorPtr)); /* 134 */ + CONST84_RETURN char * (*tk_NameOfCursor) _ANSI_ARGS_((Display *display, Tk_Cursor cursor)); /* 135 */ CONST84_RETURN char * (*tk_NameOfFont) _ANSI_ARGS_((Tk_Font font)); /* 136 */ CONST84_RETURN char * (*tk_NameOfImage) _ANSI_ARGS_((Tk_ImageMaster imageMaster)); /* 137 */ CONST84_RETURN char * (*tk_NameOfJoinStyle) _ANSI_ARGS_((int join)); /* 138 */ CONST84_RETURN char * (*tk_NameOfJustify) _ANSI_ARGS_((Tk_Justify justify)); /* 139 */ CONST84_RETURN char * (*tk_NameOfRelief) _ANSI_ARGS_((int relief)); /* 140 */ - Tk_Window (*tk_NameToWindow) _ANSI_ARGS_((Tcl_Interp * interp, CONST char * pathName, Tk_Window tkwin)); /* 141 */ - void (*tk_OwnSelection) _ANSI_ARGS_((Tk_Window tkwin, Atom selection, Tk_LostSelProc * proc, ClientData clientData)); /* 142 */ - int (*tk_ParseArgv) _ANSI_ARGS_((Tcl_Interp * interp, Tk_Window tkwin, int * argcPtr, CONST84 char ** argv, Tk_ArgvInfo * argTable, int flags)); /* 143 */ - void (*tk_PhotoPutBlock_NoComposite) _ANSI_ARGS_((Tk_PhotoHandle handle, Tk_PhotoImageBlock * blockPtr, int x, int y, int width, int height)); /* 144 */ - void (*tk_PhotoPutZoomedBlock_NoComposite) _ANSI_ARGS_((Tk_PhotoHandle handle, Tk_PhotoImageBlock * blockPtr, int x, int y, int width, int height, int zoomX, int zoomY, int subsampleX, int subsampleY)); /* 145 */ - int (*tk_PhotoGetImage) _ANSI_ARGS_((Tk_PhotoHandle handle, Tk_PhotoImageBlock * blockPtr)); /* 146 */ + Tk_Window (*tk_NameToWindow) _ANSI_ARGS_((Tcl_Interp *interp, CONST char *pathName, Tk_Window tkwin)); /* 141 */ + void (*tk_OwnSelection) _ANSI_ARGS_((Tk_Window tkwin, Atom selection, Tk_LostSelProc *proc, ClientData clientData)); /* 142 */ + int (*tk_ParseArgv) _ANSI_ARGS_((Tcl_Interp *interp, Tk_Window tkwin, int *argcPtr, CONST84 char **argv, Tk_ArgvInfo *argTable, int flags)); /* 143 */ + void (*tk_PhotoPutBlock_NoComposite) _ANSI_ARGS_((Tk_PhotoHandle handle, Tk_PhotoImageBlock *blockPtr, int x, int y, int width, int height)); /* 144 */ + void (*tk_PhotoPutZoomedBlock_NoComposite) _ANSI_ARGS_((Tk_PhotoHandle handle, Tk_PhotoImageBlock *blockPtr, int x, int y, int width, int height, int zoomX, int zoomY, int subsampleX, int subsampleY)); /* 145 */ + int (*tk_PhotoGetImage) _ANSI_ARGS_((Tk_PhotoHandle handle, Tk_PhotoImageBlock *blockPtr)); /* 146 */ void (*tk_PhotoBlank) _ANSI_ARGS_((Tk_PhotoHandle handle)); /* 147 */ void (*tk_PhotoExpand) _ANSI_ARGS_((Tk_PhotoHandle handle, int width, int height)); /* 148 */ - void (*tk_PhotoGetSize) _ANSI_ARGS_((Tk_PhotoHandle handle, int * widthPtr, int * heightPtr)); /* 149 */ + void (*tk_PhotoGetSize) _ANSI_ARGS_((Tk_PhotoHandle handle, int *widthPtr, int *heightPtr)); /* 149 */ void (*tk_PhotoSetSize) _ANSI_ARGS_((Tk_PhotoHandle handle, int width, int height)); /* 150 */ int (*tk_PointToChar) _ANSI_ARGS_((Tk_TextLayout layout, int x, int y)); /* 151 */ - int (*tk_PostscriptFontName) _ANSI_ARGS_((Tk_Font tkfont, Tcl_DString * dsPtr)); /* 152 */ - void (*tk_PreserveColormap) _ANSI_ARGS_((Display * display, Colormap colormap)); /* 153 */ - void (*tk_QueueWindowEvent) _ANSI_ARGS_((XEvent * eventPtr, Tcl_QueuePosition position)); /* 154 */ + int (*tk_PostscriptFontName) _ANSI_ARGS_((Tk_Font tkfont, Tcl_DString *dsPtr)); /* 152 */ + void (*tk_PreserveColormap) _ANSI_ARGS_((Display *display, Colormap colormap)); /* 153 */ + void (*tk_QueueWindowEvent) _ANSI_ARGS_((XEvent *eventPtr, Tcl_QueuePosition position)); /* 154 */ void (*tk_RedrawImage) _ANSI_ARGS_((Tk_Image image, int imageX, int imageY, int width, int height, Drawable drawable, int drawableX, int drawableY)); /* 155 */ void (*tk_ResizeWindow) _ANSI_ARGS_((Tk_Window tkwin, int width, int height)); /* 156 */ int (*tk_RestackWindow) _ANSI_ARGS_((Tk_Window tkwin, int aboveBelow, Tk_Window other)); /* 157 */ - Tk_RestrictProc * (*tk_RestrictEvents) _ANSI_ARGS_((Tk_RestrictProc * proc, ClientData arg, ClientData * prevArgPtr)); /* 158 */ - int (*tk_SafeInit) _ANSI_ARGS_((Tcl_Interp * interp)); /* 159 */ - CONST char * (*tk_SetAppName) _ANSI_ARGS_((Tk_Window tkwin, CONST char * name)); /* 160 */ + Tk_RestrictProc * (*tk_RestrictEvents) _ANSI_ARGS_((Tk_RestrictProc *proc, ClientData arg, ClientData *prevArgPtr)); /* 158 */ + int (*tk_SafeInit) _ANSI_ARGS_((Tcl_Interp *interp)); /* 159 */ + CONST char * (*tk_SetAppName) _ANSI_ARGS_((Tk_Window tkwin, CONST char *name)); /* 160 */ void (*tk_SetBackgroundFromBorder) _ANSI_ARGS_((Tk_Window tkwin, Tk_3DBorder border)); /* 161 */ - void (*tk_SetClass) _ANSI_ARGS_((Tk_Window tkwin, CONST char * className)); /* 162 */ + void (*tk_SetClass) _ANSI_ARGS_((Tk_Window tkwin, CONST char *className)); /* 162 */ void (*tk_SetGrid) _ANSI_ARGS_((Tk_Window tkwin, int reqWidth, int reqHeight, int gridWidth, int gridHeight)); /* 163 */ void (*tk_SetInternalBorder) _ANSI_ARGS_((Tk_Window tkwin, int width)); /* 164 */ void (*tk_SetWindowBackground) _ANSI_ARGS_((Tk_Window tkwin, unsigned long pixel)); /* 165 */ @@ -1099,106 +1100,117 @@ void (*tk_SetWindowBorderWidth) _ANSI_ARGS_((Tk_Window tkwin, int width)); /* 168 */ void (*tk_SetWindowBorderPixmap) _ANSI_ARGS_((Tk_Window tkwin, Pixmap pixmap)); /* 169 */ void (*tk_SetWindowColormap) _ANSI_ARGS_((Tk_Window tkwin, Colormap colormap)); /* 170 */ - int (*tk_SetWindowVisual) _ANSI_ARGS_((Tk_Window tkwin, Visual * visual, int depth, Colormap colormap)); /* 171 */ - void (*tk_SizeOfBitmap) _ANSI_ARGS_((Display * display, Pixmap bitmap, int * widthPtr, int * heightPtr)); /* 172 */ - void (*tk_SizeOfImage) _ANSI_ARGS_((Tk_Image image, int * widthPtr, int * heightPtr)); /* 173 */ + int (*tk_SetWindowVisual) _ANSI_ARGS_((Tk_Window tkwin, Visual *visual, int depth, Colormap colormap)); /* 171 */ + void (*tk_SizeOfBitmap) _ANSI_ARGS_((Display *display, Pixmap bitmap, int *widthPtr, int *heightPtr)); /* 172 */ + void (*tk_SizeOfImage) _ANSI_ARGS_((Tk_Image image, int *widthPtr, int *heightPtr)); /* 173 */ int (*tk_StrictMotif) _ANSI_ARGS_((Tk_Window tkwin)); /* 174 */ - void (*tk_TextLayoutToPostscript) _ANSI_ARGS_((Tcl_Interp * interp, Tk_TextLayout layout)); /* 175 */ - int (*tk_TextWidth) _ANSI_ARGS_((Tk_Font font, CONST char * str, int numBytes)); /* 176 */ + void (*tk_TextLayoutToPostscript) _ANSI_ARGS_((Tcl_Interp *interp, Tk_TextLayout layout)); /* 175 */ + int (*tk_TextWidth) _ANSI_ARGS_((Tk_Font font, CONST char *str, int numBytes)); /* 176 */ void (*tk_UndefineCursor) _ANSI_ARGS_((Tk_Window window)); /* 177 */ - void (*tk_UnderlineChars) _ANSI_ARGS_((Display * display, Drawable drawable, GC gc, Tk_Font tkfont, CONST char * source, int x, int y, int firstByte, int lastByte)); /* 178 */ - void (*tk_UnderlineTextLayout) _ANSI_ARGS_((Display * display, Drawable drawable, GC gc, Tk_TextLayout layout, int x, int y, int underline)); /* 179 */ + void (*tk_UnderlineChars) _ANSI_ARGS_((Display *display, Drawable drawable, GC gc, Tk_Font tkfont, CONST char *source, int x, int y, int firstByte, int lastByte)); /* 178 */ + void (*tk_UnderlineTextLayout) _ANSI_ARGS_((Display *display, Drawable drawable, GC gc, Tk_TextLayout layout, int x, int y, int underline)); /* 179 */ void (*tk_Ungrab) _ANSI_ARGS_((Tk_Window tkwin)); /* 180 */ void (*tk_UnmaintainGeometry) _ANSI_ARGS_((Tk_Window slave, Tk_Window master)); /* 181 */ void (*tk_UnmapWindow) _ANSI_ARGS_((Tk_Window tkwin)); /* 182 */ void (*tk_UnsetGrid) _ANSI_ARGS_((Tk_Window tkwin)); /* 183 */ void (*tk_UpdatePointer) _ANSI_ARGS_((Tk_Window tkwin, int x, int y, int state)); /* 184 */ - Pixmap (*tk_AllocBitmapFromObj) _ANSI_ARGS_((Tcl_Interp * interp, Tk_Window tkwin, Tcl_Obj * objPtr)); /* 185 */ - Tk_3DBorder (*tk_Alloc3DBorderFromObj) _ANSI_ARGS_((Tcl_Interp * interp, Tk_Window tkwin, Tcl_Obj * objPtr)); /* 186 */ - XColor * (*tk_AllocColorFromObj) _ANSI_ARGS_((Tcl_Interp * interp, Tk_Window tkwin, Tcl_Obj * objPtr)); /* 187 */ - Tk_Cursor (*tk_AllocCursorFromObj) _ANSI_ARGS_((Tcl_Interp * interp, Tk_Window tkwin, Tcl_Obj * objPtr)); /* 188 */ - Tk_Font (*tk_AllocFontFromObj) _ANSI_ARGS_((Tcl_Interp * interp, Tk_Window tkwin, Tcl_Obj * objPtr)); /* 189 */ - Tk_OptionTable (*tk_CreateOptionTable) _ANSI_ARGS_((Tcl_Interp * interp, CONST Tk_OptionSpec * templatePtr)); /* 190 */ + Pixmap (*tk_AllocBitmapFromObj) _ANSI_ARGS_((Tcl_Interp *interp, Tk_Window tkwin, Tcl_Obj *objPtr)); /* 185 */ + Tk_3DBorder (*tk_Alloc3DBorderFromObj) _ANSI_ARGS_((Tcl_Interp *interp, Tk_Window tkwin, Tcl_Obj *objPtr)); /* 186 */ + XColor * (*tk_AllocColorFromObj) _ANSI_ARGS_((Tcl_Interp *interp, Tk_Window tkwin, Tcl_Obj *objPtr)); /* 187 */ + Tk_Cursor (*tk_AllocCursorFromObj) _ANSI_ARGS_((Tcl_Interp *interp, Tk_Window tkwin, Tcl_Obj *objPtr)); /* 188 */ + Tk_Font (*tk_AllocFontFromObj) _ANSI_ARGS_((Tcl_Interp *interp, Tk_Window tkwin, Tcl_Obj *objPtr)); /* 189 */ + Tk_OptionTable (*tk_CreateOptionTable) _ANSI_ARGS_((Tcl_Interp *interp, CONST Tk_OptionSpec *templatePtr)); /* 190 */ void (*tk_DeleteOptionTable) _ANSI_ARGS_((Tk_OptionTable optionTable)); /* 191 */ - void (*tk_Free3DBorderFromObj) _ANSI_ARGS_((Tk_Window tkwin, Tcl_Obj * objPtr)); /* 192 */ - void (*tk_FreeBitmapFromObj) _ANSI_ARGS_((Tk_Window tkwin, Tcl_Obj * objPtr)); /* 193 */ - void (*tk_FreeColorFromObj) _ANSI_ARGS_((Tk_Window tkwin, Tcl_Obj * objPtr)); /* 194 */ - void (*tk_FreeConfigOptions) _ANSI_ARGS_((char * recordPtr, Tk_OptionTable optionToken, Tk_Window tkwin)); /* 195 */ - void (*tk_FreeSavedOptions) _ANSI_ARGS_((Tk_SavedOptions * savePtr)); /* 196 */ - void (*tk_FreeCursorFromObj) _ANSI_ARGS_((Tk_Window tkwin, Tcl_Obj * objPtr)); /* 197 */ - void (*tk_FreeFontFromObj) _ANSI_ARGS_((Tk_Window tkwin, Tcl_Obj * objPtr)); /* 198 */ - Tk_3DBorder (*tk_Get3DBorderFromObj) _ANSI_ARGS_((Tk_Window tkwin, Tcl_Obj * objPtr)); /* 199 */ - int (*tk_GetAnchorFromObj) _ANSI_ARGS_((Tcl_Interp * interp, Tcl_Obj * objPtr, Tk_Anchor * anchorPtr)); /* 200 */ - Pixmap (*tk_GetBitmapFromObj) _ANSI_ARGS_((Tk_Window tkwin, Tcl_Obj * objPtr)); /* 201 */ - XColor * (*tk_GetColorFromObj) _ANSI_ARGS_((Tk_Window tkwin, Tcl_Obj * objPtr)); /* 202 */ - Tk_Cursor (*tk_GetCursorFromObj) _ANSI_ARGS_((Tk_Window tkwin, Tcl_Obj * objPtr)); /* 203 */ - Tcl_Obj * (*tk_GetOptionInfo) _ANSI_ARGS_((Tcl_Interp * interp, char * recordPtr, Tk_OptionTable optionTable, Tcl_Obj * namePtr, Tk_Window tkwin)); /* 204 */ - Tcl_Obj * (*tk_GetOptionValue) _ANSI_ARGS_((Tcl_Interp * interp, char * recordPtr, Tk_OptionTable optionTable, Tcl_Obj * namePtr, Tk_Window tkwin)); /* 205 */ - int (*tk_GetJustifyFromObj) _ANSI_ARGS_((Tcl_Interp * interp, Tcl_Obj * objPtr, Tk_Justify * justifyPtr)); /* 206 */ - int (*tk_GetMMFromObj) _ANSI_ARGS_((Tcl_Interp * interp, Tk_Window tkwin, Tcl_Obj * objPtr, double * doublePtr)); /* 207 */ - int (*tk_GetPixelsFromObj) _ANSI_ARGS_((Tcl_Interp * interp, Tk_Window tkwin, Tcl_Obj * objPtr, int * intPtr)); /* 208 */ - int (*tk_GetReliefFromObj) _ANSI_ARGS_((Tcl_Interp * interp, Tcl_Obj * objPtr, int * resultPtr)); /* 209 */ - int (*tk_GetScrollInfoObj) _ANSI_ARGS_((Tcl_Interp * interp, int objc, Tcl_Obj *CONST objv[], double * dblPtr, int * intPtr)); /* 210 */ - int (*tk_InitOptions) _ANSI_ARGS_((Tcl_Interp * interp, char * recordPtr, Tk_OptionTable optionToken, Tk_Window tkwin)); /* 211 */ - void (*tk_MainEx) _ANSI_ARGS_((int argc, char ** argv, Tcl_AppInitProc * appInitProc, Tcl_Interp * interp)); /* 212 */ - void (*tk_RestoreSavedOptions) _ANSI_ARGS_((Tk_SavedOptions * savePtr)); /* 213 */ - int (*tk_SetOptions) _ANSI_ARGS_((Tcl_Interp * interp, char * recordPtr, Tk_OptionTable optionTable, int objc, Tcl_Obj *CONST objv[], Tk_Window tkwin, Tk_SavedOptions * savePtr, int * maskPtr)); /* 214 */ - void (*tk_InitConsoleChannels) _ANSI_ARGS_((Tcl_Interp * interp)); /* 215 */ - int (*tk_CreateConsoleWindow) _ANSI_ARGS_((Tcl_Interp * interp)); /* 216 */ - void (*tk_CreateSmoothMethod) _ANSI_ARGS_((Tcl_Interp * interp, Tk_SmoothMethod * method)); /* 217 */ - void *reserved218; - void *reserved219; - int (*tk_GetDash) _ANSI_ARGS_((Tcl_Interp * interp, CONST char * value, Tk_Dash * dash)); /* 220 */ - void (*tk_CreateOutline) _ANSI_ARGS_((Tk_Outline * outline)); /* 221 */ - void (*tk_DeleteOutline) _ANSI_ARGS_((Display * display, Tk_Outline * outline)); /* 222 */ - int (*tk_ConfigOutlineGC) _ANSI_ARGS_((XGCValues * gcValues, Tk_Canvas canvas, Tk_Item * item, Tk_Outline * outline)); /* 223 */ - int (*tk_ChangeOutlineGC) _ANSI_ARGS_((Tk_Canvas canvas, Tk_Item * item, Tk_Outline * outline)); /* 224 */ - int (*tk_ResetOutlineGC) _ANSI_ARGS_((Tk_Canvas canvas, Tk_Item * item, Tk_Outline * outline)); /* 225 */ - int (*tk_CanvasPsOutline) _ANSI_ARGS_((Tk_Canvas canvas, Tk_Item * item, Tk_Outline * outline)); /* 226 */ + void (*tk_Free3DBorderFromObj) _ANSI_ARGS_((Tk_Window tkwin, Tcl_Obj *objPtr)); /* 192 */ + void (*tk_FreeBitmapFromObj) _ANSI_ARGS_((Tk_Window tkwin, Tcl_Obj *objPtr)); /* 193 */ + void (*tk_FreeColorFromObj) _ANSI_ARGS_((Tk_Window tkwin, Tcl_Obj *objPtr)); /* 194 */ + void (*tk_FreeConfigOptions) _ANSI_ARGS_((char *recordPtr, Tk_OptionTable optionToken, Tk_Window tkwin)); /* 195 */ + void (*tk_FreeSavedOptions) _ANSI_ARGS_((Tk_SavedOptions *savePtr)); /* 196 */ + void (*tk_FreeCursorFromObj) _ANSI_ARGS_((Tk_Window tkwin, Tcl_Obj *objPtr)); /* 197 */ + void (*tk_FreeFontFromObj) _ANSI_ARGS_((Tk_Window tkwin, Tcl_Obj *objPtr)); /* 198 */ + Tk_3DBorder (*tk_Get3DBorderFromObj) _ANSI_ARGS_((Tk_Window tkwin, Tcl_Obj *objPtr)); /* 199 */ + int (*tk_GetAnchorFromObj) _ANSI_ARGS_((Tcl_Interp *interp, Tcl_Obj *objPtr, Tk_Anchor *anchorPtr)); /* 200 */ + Pixmap (*tk_GetBitmapFromObj) _ANSI_ARGS_((Tk_Window tkwin, Tcl_Obj *objPtr)); /* 201 */ + XColor * (*tk_GetColorFromObj) _ANSI_ARGS_((Tk_Window tkwin, Tcl_Obj *objPtr)); /* 202 */ + Tk_Cursor (*tk_GetCursorFromObj) _ANSI_ARGS_((Tk_Window tkwin, Tcl_Obj *objPtr)); /* 203 */ + Tcl_Obj * (*tk_GetOptionInfo) _ANSI_ARGS_((Tcl_Interp *interp, char *recordPtr, Tk_OptionTable optionTable, Tcl_Obj *namePtr, Tk_Window tkwin)); /* 204 */ + Tcl_Obj * (*tk_GetOptionValue) _ANSI_ARGS_((Tcl_Interp *interp, char *recordPtr, Tk_OptionTable optionTable, Tcl_Obj *namePtr, Tk_Window tkwin)); /* 205 */ + int (*tk_GetJustifyFromObj) _ANSI_ARGS_((Tcl_Interp *interp, Tcl_Obj *objPtr, Tk_Justify *justifyPtr)); /* 206 */ + int (*tk_GetMMFromObj) _ANSI_ARGS_((Tcl_Interp *interp, Tk_Window tkwin, Tcl_Obj *objPtr, double *doublePtr)); /* 207 */ + int (*tk_GetPixelsFromObj) _ANSI_ARGS_((Tcl_Interp *interp, Tk_Window tkwin, Tcl_Obj *objPtr, int *intPtr)); /* 208 */ + int (*tk_GetReliefFromObj) _ANSI_ARGS_((Tcl_Interp *interp, Tcl_Obj *objPtr, int *resultPtr)); /* 209 */ + int (*tk_GetScrollInfoObj) _ANSI_ARGS_((Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[], double *dblPtr, int *intPtr)); /* 210 */ + int (*tk_InitOptions) _ANSI_ARGS_((Tcl_Interp *interp, char *recordPtr, Tk_OptionTable optionToken, Tk_Window tkwin)); /* 211 */ + void (*tk_MainEx) _ANSI_ARGS_((int argc, char **argv, Tcl_AppInitProc *appInitProc, Tcl_Interp *interp)); /* 212 */ + void (*tk_RestoreSavedOptions) _ANSI_ARGS_((Tk_SavedOptions *savePtr)); /* 213 */ + int (*tk_SetOptions) _ANSI_ARGS_((Tcl_Interp *interp, char *recordPtr, Tk_OptionTable optionTable, int objc, Tcl_Obj *CONST objv[], Tk_Window tkwin, Tk_SavedOptions *savePtr, int *maskPtr)); /* 214 */ + void (*tk_InitConsoleChannels) _ANSI_ARGS_((Tcl_Interp *interp)); /* 215 */ + int (*tk_CreateConsoleWindow) _ANSI_ARGS_((Tcl_Interp *interp)); /* 216 */ + void (*tk_CreateSmoothMethod) _ANSI_ARGS_((Tcl_Interp *interp, Tk_SmoothMethod *method)); /* 217 */ + VOID *reserved218; + VOID *reserved219; + int (*tk_GetDash) _ANSI_ARGS_((Tcl_Interp *interp, CONST char *value, Tk_Dash *dash)); /* 220 */ + void (*tk_CreateOutline) _ANSI_ARGS_((Tk_Outline *outline)); /* 221 */ + void (*tk_DeleteOutline) _ANSI_ARGS_((Display *display, Tk_Outline *outline)); /* 222 */ + int (*tk_ConfigOutlineGC) _ANSI_ARGS_((XGCValues *gcValues, Tk_Canvas canvas, Tk_Item *item, Tk_Outline *outline)); /* 223 */ + int (*tk_ChangeOutlineGC) _ANSI_ARGS_((Tk_Canvas canvas, Tk_Item *item, Tk_Outline *outline)); /* 224 */ + int (*tk_ResetOutlineGC) _ANSI_ARGS_((Tk_Canvas canvas, Tk_Item *item, Tk_Outline *outline)); /* 225 */ + int (*tk_CanvasPsOutline) _ANSI_ARGS_((Tk_Canvas canvas, Tk_Item *item, Tk_Outline *outline)); /* 226 */ void (*tk_SetTSOrigin) _ANSI_ARGS_((Tk_Window tkwin, GC gc, int x, int y)); /* 227 */ - int (*tk_CanvasGetCoordFromObj) _ANSI_ARGS_((Tcl_Interp * interp, Tk_Canvas canvas, Tcl_Obj * obj, double * doublePtr)); /* 228 */ - void (*tk_CanvasSetOffset) _ANSI_ARGS_((Tk_Canvas canvas, GC gc, Tk_TSOffset * offset)); /* 229 */ + int (*tk_CanvasGetCoordFromObj) _ANSI_ARGS_((Tcl_Interp *interp, Tk_Canvas canvas, Tcl_Obj *obj, double *doublePtr)); /* 228 */ + void (*tk_CanvasSetOffset) _ANSI_ARGS_((Tk_Canvas canvas, GC gc, Tk_TSOffset *offset)); /* 229 */ void (*tk_DitherPhoto) _ANSI_ARGS_((Tk_PhotoHandle handle, int x, int y, int width, int height)); /* 230 */ - int (*tk_PostscriptBitmap) _ANSI_ARGS_((Tcl_Interp * interp, Tk_Window tkwin, Tk_PostscriptInfo psInfo, Pixmap bitmap, int startX, int startY, int width, int height)); /* 231 */ - int (*tk_PostscriptColor) _ANSI_ARGS_((Tcl_Interp * interp, Tk_PostscriptInfo psInfo, XColor * colorPtr)); /* 232 */ - int (*tk_PostscriptFont) _ANSI_ARGS_((Tcl_Interp * interp, Tk_PostscriptInfo psInfo, Tk_Font font)); /* 233 */ - int (*tk_PostscriptImage) _ANSI_ARGS_((Tk_Image image, Tcl_Interp * interp, Tk_Window tkwin, Tk_PostscriptInfo psinfo, int x, int y, int width, int height, int prepass)); /* 234 */ - void (*tk_PostscriptPath) _ANSI_ARGS_((Tcl_Interp * interp, Tk_PostscriptInfo psInfo, double * coordPtr, int numPoints)); /* 235 */ - int (*tk_PostscriptStipple) _ANSI_ARGS_((Tcl_Interp * interp, Tk_Window tkwin, Tk_PostscriptInfo psInfo, Pixmap bitmap)); /* 236 */ + int (*tk_PostscriptBitmap) _ANSI_ARGS_((Tcl_Interp *interp, Tk_Window tkwin, Tk_PostscriptInfo psInfo, Pixmap bitmap, int startX, int startY, int width, int height)); /* 231 */ + int (*tk_PostscriptColor) _ANSI_ARGS_((Tcl_Interp *interp, Tk_PostscriptInfo psInfo, XColor *colorPtr)); /* 232 */ + int (*tk_PostscriptFont) _ANSI_ARGS_((Tcl_Interp *interp, Tk_PostscriptInfo psInfo, Tk_Font font)); /* 233 */ + int (*tk_PostscriptImage) _ANSI_ARGS_((Tk_Image image, Tcl_Interp *interp, Tk_Window tkwin, Tk_PostscriptInfo psinfo, int x, int y, int width, int height, int prepass)); /* 234 */ + void (*tk_PostscriptPath) _ANSI_ARGS_((Tcl_Interp *interp, Tk_PostscriptInfo psInfo, double *coordPtr, int numPoints)); /* 235 */ + int (*tk_PostscriptStipple) _ANSI_ARGS_((Tcl_Interp *interp, Tk_Window tkwin, Tk_PostscriptInfo psInfo, Pixmap bitmap)); /* 236 */ double (*tk_PostscriptY) _ANSI_ARGS_((double y, Tk_PostscriptInfo psInfo)); /* 237 */ - int (*tk_PostscriptPhoto) _ANSI_ARGS_((Tcl_Interp * interp, Tk_PhotoImageBlock * blockPtr, Tk_PostscriptInfo psInfo, int width, int height)); /* 238 */ - void (*tk_CreateClientMessageHandler) _ANSI_ARGS_((Tk_ClientMessageProc * proc)); /* 239 */ - void (*tk_DeleteClientMessageHandler) _ANSI_ARGS_((Tk_ClientMessageProc * proc)); /* 240 */ - Tk_Window (*tk_CreateAnonymousWindow) _ANSI_ARGS_((Tcl_Interp * interp, Tk_Window parent, CONST char * screenName)); /* 241 */ - void (*tk_SetClassProcs) _ANSI_ARGS_((Tk_Window tkwin, Tk_ClassProcs * procs, ClientData instanceData)); /* 242 */ + int (*tk_PostscriptPhoto) _ANSI_ARGS_((Tcl_Interp *interp, Tk_PhotoImageBlock *blockPtr, Tk_PostscriptInfo psInfo, int width, int height)); /* 238 */ + void (*tk_CreateClientMessageHandler) _ANSI_ARGS_((Tk_ClientMessageProc *proc)); /* 239 */ + void (*tk_DeleteClientMessageHandler) _ANSI_ARGS_((Tk_ClientMessageProc *proc)); /* 240 */ + Tk_Window (*tk_CreateAnonymousWindow) _ANSI_ARGS_((Tcl_Interp *interp, Tk_Window parent, CONST char *screenName)); /* 241 */ + void (*tk_SetClassProcs) _ANSI_ARGS_((Tk_Window tkwin, Tk_ClassProcs *procs, ClientData instanceData)); /* 242 */ void (*tk_SetInternalBorderEx) _ANSI_ARGS_((Tk_Window tkwin, int left, int right, int top, int bottom)); /* 243 */ void (*tk_SetMinimumRequestSize) _ANSI_ARGS_((Tk_Window tkwin, int minWidth, int minHeight)); /* 244 */ void (*tk_SetCaretPos) _ANSI_ARGS_((Tk_Window tkwin, int x, int y, int height)); /* 245 */ - void (*tk_PhotoPutBlock) _ANSI_ARGS_((Tk_PhotoHandle handle, Tk_PhotoImageBlock * blockPtr, int x, int y, int width, int height, int compRule)); /* 246 */ - void (*tk_PhotoPutZoomedBlock) _ANSI_ARGS_((Tk_PhotoHandle handle, Tk_PhotoImageBlock * blockPtr, int x, int y, int width, int height, int zoomX, int zoomY, int subsampleX, int subsampleY, int compRule)); /* 247 */ - int (*tk_CollapseMotionEvents) _ANSI_ARGS_((Display * display, int collapse)); /* 248 */ - Tk_StyleEngine (*tk_RegisterStyleEngine) _ANSI_ARGS_((CONST char * name, Tk_StyleEngine parent)); /* 249 */ - Tk_StyleEngine (*tk_GetStyleEngine) _ANSI_ARGS_((CONST char * name)); /* 250 */ - int (*tk_RegisterStyledElement) _ANSI_ARGS_((Tk_StyleEngine engine, Tk_ElementSpec * templatePtr)); /* 251 */ - int (*tk_GetElementId) _ANSI_ARGS_((CONST char * name)); /* 252 */ - Tk_Style (*tk_CreateStyle) _ANSI_ARGS_((CONST char * name, Tk_StyleEngine engine, ClientData clientData)); /* 253 */ - Tk_Style (*tk_GetStyle) _ANSI_ARGS_((Tcl_Interp * interp, CONST char * name)); /* 254 */ + void (*tk_PhotoPutBlock) _ANSI_ARGS_((Tk_PhotoHandle handle, Tk_PhotoImageBlock *blockPtr, int x, int y, int width, int height, int compRule)); /* 246 */ + void (*tk_PhotoPutZoomedBlock) _ANSI_ARGS_((Tk_PhotoHandle handle, Tk_PhotoImageBlock *blockPtr, int x, int y, int width, int height, int zoomX, int zoomY, int subsampleX, int subsampleY, int compRule)); /* 247 */ + int (*tk_CollapseMotionEvents) _ANSI_ARGS_((Display *display, int collapse)); /* 248 */ + Tk_StyleEngine (*tk_RegisterStyleEngine) _ANSI_ARGS_((CONST char *name, Tk_StyleEngine parent)); /* 249 */ + Tk_StyleEngine (*tk_GetStyleEngine) _ANSI_ARGS_((CONST char *name)); /* 250 */ + int (*tk_RegisterStyledElement) _ANSI_ARGS_((Tk_StyleEngine engine, Tk_ElementSpec *templatePtr)); /* 251 */ + int (*tk_GetElementId) _ANSI_ARGS_((CONST char *name)); /* 252 */ + Tk_Style (*tk_CreateStyle) _ANSI_ARGS_((CONST char *name, Tk_StyleEngine engine, ClientData clientData)); /* 253 */ + Tk_Style (*tk_GetStyle) _ANSI_ARGS_((Tcl_Interp *interp, CONST char *name)); /* 254 */ void (*tk_FreeStyle) _ANSI_ARGS_((Tk_Style style)); /* 255 */ CONST char * (*tk_NameOfStyle) _ANSI_ARGS_((Tk_Style style)); /* 256 */ - Tk_Style (*tk_AllocStyleFromObj) _ANSI_ARGS_((Tcl_Interp * interp, Tcl_Obj * objPtr)); /* 257 */ - Tk_Style (*tk_GetStyleFromObj) _ANSI_ARGS_((Tcl_Obj * objPtr)); /* 258 */ - void (*tk_FreeStyleFromObj) _ANSI_ARGS_((Tcl_Obj * objPtr)); /* 259 */ + Tk_Style (*tk_AllocStyleFromObj) _ANSI_ARGS_((Tcl_Interp *interp, Tcl_Obj *objPtr)); /* 257 */ + Tk_Style (*tk_GetStyleFromObj) _ANSI_ARGS_((Tcl_Obj *objPtr)); /* 258 */ + void (*tk_FreeStyleFromObj) _ANSI_ARGS_((Tcl_Obj *objPtr)); /* 259 */ Tk_StyledElement (*tk_GetStyledElement) _ANSI_ARGS_((Tk_Style style, int elementId, Tk_OptionTable optionTable)); /* 260 */ - void (*tk_GetElementSize) _ANSI_ARGS_((Tk_Style style, Tk_StyledElement element, char * recordPtr, Tk_Window tkwin, int width, int height, int inner, int * widthPtr, int * heightPtr)); /* 261 */ - void (*tk_GetElementBox) _ANSI_ARGS_((Tk_Style style, Tk_StyledElement element, char * recordPtr, Tk_Window tkwin, int x, int y, int width, int height, int inner, int * xPtr, int * yPtr, int * widthPtr, int * heightPtr)); /* 262 */ - int (*tk_GetElementBorderWidth) _ANSI_ARGS_((Tk_Style style, Tk_StyledElement element, char * recordPtr, Tk_Window tkwin)); /* 263 */ - void (*tk_DrawElement) _ANSI_ARGS_((Tk_Style style, Tk_StyledElement element, char * recordPtr, Tk_Window tkwin, Drawable d, int x, int y, int width, int height, int state)); /* 264 */ + void (*tk_GetElementSize) _ANSI_ARGS_((Tk_Style style, Tk_StyledElement element, char *recordPtr, Tk_Window tkwin, int width, int height, int inner, int *widthPtr, int *heightPtr)); /* 261 */ + void (*tk_GetElementBox) _ANSI_ARGS_((Tk_Style style, Tk_StyledElement element, char *recordPtr, Tk_Window tkwin, int x, int y, int width, int height, int inner, int *xPtr, int *yPtr, int *widthPtr, int *heightPtr)); /* 262 */ + int (*tk_GetElementBorderWidth) _ANSI_ARGS_((Tk_Style style, Tk_StyledElement element, char *recordPtr, Tk_Window tkwin)); /* 263 */ + void (*tk_DrawElement) _ANSI_ARGS_((Tk_Style style, Tk_StyledElement element, char *recordPtr, Tk_Window tkwin, Drawable d, int x, int y, int width, int height, int state)); /* 264 */ + VOID *reserved265; + VOID *reserved266; + VOID *reserved267; + VOID *reserved268; + VOID *reserved269; + VOID *reserved270; + VOID *reserved271; + VOID *reserved272; + VOID *reserved273; + VOID *reserved274; + void (*tkUnusedStubEntry) _ANSI_ARGS_((void)); /* 275 */ } TkStubs; #ifdef __cplusplus extern "C" { #endif -extern const TkStubs *tkStubsPtr; +extern TkStubs *tkStubsPtr; #ifdef __cplusplus } #endif @@ -2263,6 +2275,20 @@ #define Tk_DrawElement \ (tkStubsPtr->tk_DrawElement) /* 264 */ #endif +/* Slot 265 is reserved */ +/* Slot 266 is reserved */ +/* Slot 267 is reserved */ +/* Slot 268 is reserved */ +/* Slot 269 is reserved */ +/* Slot 270 is reserved */ +/* Slot 271 is reserved */ +/* Slot 272 is reserved */ +/* Slot 273 is reserved */ +/* Slot 274 is reserved */ +#ifndef TkUnusedStubEntry +#define TkUnusedStubEntry \ + (tkStubsPtr->tkUnusedStubEntry) /* 275 */ +#endif #endif /* defined(USE_TK_STUBS) && !defined(USE_TK_STUB_PROCS) */ @@ -2271,5 +2297,7 @@ #undef TCL_STORAGE_CLASS #define TCL_STORAGE_CLASS DLLIMPORT +#undef TkUnusedStubEntry + #endif /* _TKDECLS */ diff -Nru critcl-3.1.9/lib/critcl/critcl_c/tcl8.4/tk.h critcl-3.1.17+dfsg/lib/critcl/critcl_c/tcl8.4/tk.h --- critcl-3.1.9/lib/critcl/critcl_c/tcl8.4/tk.h 2013-05-10 05:57:04.000000000 +0000 +++ critcl-3.1.17+dfsg/lib/critcl/critcl_c/tcl8.4/tk.h 2017-10-14 02:48:11.000000000 +0000 @@ -11,8 +11,6 @@ * * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tk.h,v 1.74.2.24 2009/04/09 15:57:52 dgp Exp $ */ #ifndef _TK @@ -55,16 +53,15 @@ #define TK_MAJOR_VERSION 8 #define TK_MINOR_VERSION 4 #define TK_RELEASE_LEVEL TCL_FINAL_RELEASE -#define TK_RELEASE_SERIAL 19 +#define TK_RELEASE_SERIAL 20 #define TK_VERSION "8.4" -#define TK_PATCH_LEVEL "8.4.19" +#define TK_PATCH_LEVEL "8.4.20" /* * A special definition used to allow this header file to be included - * from windows or mac resource files so that they can obtain version - * information. RC_INVOKED is defined by default by the windows RC tool - * and manually set for macintosh. + * from windows resource files so that they can obtain version + * information. RC_INVOKED is defined by default by the windows RC tool. * * Resource compilers don't like all the C stuff, like typedefs and * procedure declarations, that occur below, so block them out. @@ -73,10 +70,7 @@ #ifndef RC_INVOKED #ifndef _XLIB_H -# if defined (MAC_TCL) -# include -# include -# elif defined(MAC_OSX_TK) +# if defined(MAC_OSX_TK) # include # include # else @@ -655,6 +649,10 @@ * the most information to the user. The only difference is the changing * of the detail field for a virtual event so that it holds the name of the * virtual event being triggered. + * + * When using this structure, if you want your code to work correctly + * in Tk 8.5 as well, you should ensure that you zero out all the + * fields first using memset() or bzero(). */ typedef struct { @@ -671,6 +669,7 @@ unsigned int state; /* key or button mask */ Tk_Uid name; /* Name of virtual event. */ Bool same_screen; /* same screen flag */ + Tcl_Obj *user_data; /* not used in Tk 8.4 */ } XVirtualEvent; typedef struct { diff -Nru critcl-3.1.9/lib/critcl/critcl_c/tcl8.4/tkPlatDecls.h critcl-3.1.17+dfsg/lib/critcl/critcl_c/tcl8.4/tkPlatDecls.h --- critcl-3.1.9/lib/critcl/critcl_c/tcl8.4/tkPlatDecls.h 2013-05-10 05:57:04.000000000 +0000 +++ critcl-3.1.17+dfsg/lib/critcl/critcl_c/tcl8.4/tkPlatDecls.h 2017-10-14 02:48:11.000000000 +0000 @@ -7,8 +7,6 @@ * * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tkPlatDecls.h,v 1.7.2.1 2006/02/09 19:09:43 das Exp $ */ #ifndef _TKPLATDECLS @@ -31,9 +29,9 @@ * Exported function declarations: */ -#ifdef __WIN32__ +#if defined(__WIN32__) || defined(__CYGWIN__) /* WIN */ /* 0 */ -EXTERN Window Tk_AttachHWND _ANSI_ARGS_((Tk_Window tkwin, +EXTERN Window Tk_AttachHWND _ANSI_ARGS_((Tk_Window tkwin, HWND hwnd)); /* 1 */ EXTERN HINSTANCE Tk_GetHINSTANCE _ANSI_ARGS_((void)); @@ -44,64 +42,30 @@ /* 4 */ EXTERN void Tk_PointerEvent _ANSI_ARGS_((HWND hwnd, int x, int y)); /* 5 */ -EXTERN int Tk_TranslateWinEvent _ANSI_ARGS_((HWND hwnd, - UINT message, WPARAM wParam, LPARAM lParam, - LRESULT * result)); -#endif /* __WIN32__ */ -#ifdef MAC_TCL -/* 0 */ -EXTERN void Tk_MacSetEmbedHandler _ANSI_ARGS_(( - Tk_MacEmbedRegisterWinProc * registerWinProcPtr, - Tk_MacEmbedGetGrafPortProc * getPortProcPtr, - Tk_MacEmbedMakeContainerExistProc * containerExistProcPtr, - Tk_MacEmbedGetClipProc * getClipProc, - Tk_MacEmbedGetOffsetInParentProc * getOffsetProc)); -/* 1 */ -EXTERN void Tk_MacTurnOffMenus _ANSI_ARGS_((void)); -/* 2 */ -EXTERN void Tk_MacTkOwnsCursor _ANSI_ARGS_((int tkOwnsIt)); -/* 3 */ -EXTERN void TkMacInitMenus _ANSI_ARGS_((Tcl_Interp * interp)); -/* 4 */ -EXTERN void TkMacInitAppleEvents _ANSI_ARGS_(( - Tcl_Interp * interp)); -/* 5 */ -EXTERN int TkMacConvertEvent _ANSI_ARGS_(( - EventRecord * eventPtr)); -/* 6 */ -EXTERN int TkMacConvertTkEvent _ANSI_ARGS_(( - EventRecord * eventPtr, Window window)); -/* 7 */ -EXTERN void TkGenWMConfigureEvent _ANSI_ARGS_((Tk_Window tkwin, - int x, int y, int width, int height, - int flags)); -/* 8 */ -EXTERN void TkMacInvalClipRgns _ANSI_ARGS_((TkWindow * winPtr)); -/* 9 */ -EXTERN int TkMacHaveAppearance _ANSI_ARGS_((void)); -/* 10 */ -EXTERN GWorldPtr TkMacGetDrawablePort _ANSI_ARGS_((Drawable drawable)); -#endif /* MAC_TCL */ -#ifdef MAC_OSX_TK +EXTERN int Tk_TranslateWinEvent _ANSI_ARGS_((HWND hwnd, + UINT message, WPARAM wParam, LPARAM lParam, + LRESULT *result)); +#endif /* WIN */ +#ifdef MAC_OSX_TK /* AQUA */ /* 0 */ EXTERN void Tk_MacOSXSetEmbedHandler _ANSI_ARGS_(( - Tk_MacOSXEmbedRegisterWinProc * registerWinProcPtr, - Tk_MacOSXEmbedGetGrafPortProc * getPortProcPtr, - Tk_MacOSXEmbedMakeContainerExistProc * containerExistProcPtr, - Tk_MacOSXEmbedGetClipProc * getClipProc, - Tk_MacOSXEmbedGetOffsetInParentProc * getOffsetProc)); + Tk_MacOSXEmbedRegisterWinProc *registerWinProcPtr, + Tk_MacOSXEmbedGetGrafPortProc *getPortProcPtr, + Tk_MacOSXEmbedMakeContainerExistProc *containerExistProcPtr, + Tk_MacOSXEmbedGetClipProc *getClipProc, + Tk_MacOSXEmbedGetOffsetInParentProc *getOffsetProc)); /* 1 */ EXTERN void Tk_MacOSXTurnOffMenus _ANSI_ARGS_((void)); /* 2 */ EXTERN void Tk_MacOSXTkOwnsCursor _ANSI_ARGS_((int tkOwnsIt)); /* 3 */ -EXTERN void TkMacOSXInitMenus _ANSI_ARGS_((Tcl_Interp * interp)); +EXTERN void TkMacOSXInitMenus _ANSI_ARGS_((Tcl_Interp *interp)); /* 4 */ EXTERN void TkMacOSXInitAppleEvents _ANSI_ARGS_(( - Tcl_Interp * interp)); + Tcl_Interp *interp)); /* 5 */ -EXTERN void TkGenWMConfigureEvent _ANSI_ARGS_((Tk_Window tkwin, - int x, int y, int width, int height, +EXTERN void TkGenWMConfigureEvent _ANSI_ARGS_((Tk_Window tkwin, + int x, int y, int width, int height, int flags)); /* 6 */ EXTERN void TkMacOSXInvalClipRgns _ANSI_ARGS_((Tk_Window tkwin)); @@ -115,52 +79,39 @@ EXTERN void Tk_MacOSXSetupTkNotifier _ANSI_ARGS_((void)); /* 10 */ EXTERN int Tk_MacOSXIsAppInFront _ANSI_ARGS_((void)); -#endif /* MAC_OSX_TK */ +#endif /* AQUA */ typedef struct TkPlatStubs { int magic; struct TkPlatStubHooks *hooks; -#ifdef __WIN32__ +#if defined(__WIN32__) || defined(__CYGWIN__) /* WIN */ Window (*tk_AttachHWND) _ANSI_ARGS_((Tk_Window tkwin, HWND hwnd)); /* 0 */ HINSTANCE (*tk_GetHINSTANCE) _ANSI_ARGS_((void)); /* 1 */ HWND (*tk_GetHWND) _ANSI_ARGS_((Window window)); /* 2 */ Tk_Window (*tk_HWNDToWindow) _ANSI_ARGS_((HWND hwnd)); /* 3 */ void (*tk_PointerEvent) _ANSI_ARGS_((HWND hwnd, int x, int y)); /* 4 */ - int (*tk_TranslateWinEvent) _ANSI_ARGS_((HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam, LRESULT * result)); /* 5 */ -#endif /* __WIN32__ */ -#ifdef MAC_TCL - void (*tk_MacSetEmbedHandler) _ANSI_ARGS_((Tk_MacEmbedRegisterWinProc * registerWinProcPtr, Tk_MacEmbedGetGrafPortProc * getPortProcPtr, Tk_MacEmbedMakeContainerExistProc * containerExistProcPtr, Tk_MacEmbedGetClipProc * getClipProc, Tk_MacEmbedGetOffsetInParentProc * getOffsetProc)); /* 0 */ - void (*tk_MacTurnOffMenus) _ANSI_ARGS_((void)); /* 1 */ - void (*tk_MacTkOwnsCursor) _ANSI_ARGS_((int tkOwnsIt)); /* 2 */ - void (*tkMacInitMenus) _ANSI_ARGS_((Tcl_Interp * interp)); /* 3 */ - void (*tkMacInitAppleEvents) _ANSI_ARGS_((Tcl_Interp * interp)); /* 4 */ - int (*tkMacConvertEvent) _ANSI_ARGS_((EventRecord * eventPtr)); /* 5 */ - int (*tkMacConvertTkEvent) _ANSI_ARGS_((EventRecord * eventPtr, Window window)); /* 6 */ - void (*tkGenWMConfigureEvent) _ANSI_ARGS_((Tk_Window tkwin, int x, int y, int width, int height, int flags)); /* 7 */ - void (*tkMacInvalClipRgns) _ANSI_ARGS_((TkWindow * winPtr)); /* 8 */ - int (*tkMacHaveAppearance) _ANSI_ARGS_((void)); /* 9 */ - GWorldPtr (*tkMacGetDrawablePort) _ANSI_ARGS_((Drawable drawable)); /* 10 */ -#endif /* MAC_TCL */ -#ifdef MAC_OSX_TK - void (*tk_MacOSXSetEmbedHandler) _ANSI_ARGS_((Tk_MacOSXEmbedRegisterWinProc * registerWinProcPtr, Tk_MacOSXEmbedGetGrafPortProc * getPortProcPtr, Tk_MacOSXEmbedMakeContainerExistProc * containerExistProcPtr, Tk_MacOSXEmbedGetClipProc * getClipProc, Tk_MacOSXEmbedGetOffsetInParentProc * getOffsetProc)); /* 0 */ + int (*tk_TranslateWinEvent) _ANSI_ARGS_((HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam, LRESULT *result)); /* 5 */ +#endif /* WIN */ +#ifdef MAC_OSX_TK /* AQUA */ + void (*tk_MacOSXSetEmbedHandler) _ANSI_ARGS_((Tk_MacOSXEmbedRegisterWinProc *registerWinProcPtr, Tk_MacOSXEmbedGetGrafPortProc *getPortProcPtr, Tk_MacOSXEmbedMakeContainerExistProc *containerExistProcPtr, Tk_MacOSXEmbedGetClipProc *getClipProc, Tk_MacOSXEmbedGetOffsetInParentProc *getOffsetProc)); /* 0 */ void (*tk_MacOSXTurnOffMenus) _ANSI_ARGS_((void)); /* 1 */ void (*tk_MacOSXTkOwnsCursor) _ANSI_ARGS_((int tkOwnsIt)); /* 2 */ - void (*tkMacOSXInitMenus) _ANSI_ARGS_((Tcl_Interp * interp)); /* 3 */ - void (*tkMacOSXInitAppleEvents) _ANSI_ARGS_((Tcl_Interp * interp)); /* 4 */ + void (*tkMacOSXInitMenus) _ANSI_ARGS_((Tcl_Interp *interp)); /* 3 */ + void (*tkMacOSXInitAppleEvents) _ANSI_ARGS_((Tcl_Interp *interp)); /* 4 */ void (*tkGenWMConfigureEvent) _ANSI_ARGS_((Tk_Window tkwin, int x, int y, int width, int height, int flags)); /* 5 */ void (*tkMacOSXInvalClipRgns) _ANSI_ARGS_((Tk_Window tkwin)); /* 6 */ GWorldPtr (*tkMacOSXGetDrawablePort) _ANSI_ARGS_((Drawable drawable)); /* 7 */ ControlRef (*tkMacOSXGetRootControl) _ANSI_ARGS_((Drawable drawable)); /* 8 */ void (*tk_MacOSXSetupTkNotifier) _ANSI_ARGS_((void)); /* 9 */ int (*tk_MacOSXIsAppInFront) _ANSI_ARGS_((void)); /* 10 */ -#endif /* MAC_OSX_TK */ +#endif /* AQUA */ } TkPlatStubs; #ifdef __cplusplus extern "C" { #endif -extern const TkPlatStubs *tkPlatStubsPtr; +extern TkPlatStubs *tkPlatStubsPtr; #ifdef __cplusplus } #endif @@ -171,7 +122,7 @@ * Inline function declarations: */ -#ifdef __WIN32__ +#if defined(__WIN32__) || defined(__CYGWIN__) /* WIN */ #ifndef Tk_AttachHWND #define Tk_AttachHWND \ (tkPlatStubsPtr->tk_AttachHWND) /* 0 */ @@ -196,54 +147,8 @@ #define Tk_TranslateWinEvent \ (tkPlatStubsPtr->tk_TranslateWinEvent) /* 5 */ #endif -#endif /* __WIN32__ */ -#ifdef MAC_TCL -#ifndef Tk_MacSetEmbedHandler -#define Tk_MacSetEmbedHandler \ - (tkPlatStubsPtr->tk_MacSetEmbedHandler) /* 0 */ -#endif -#ifndef Tk_MacTurnOffMenus -#define Tk_MacTurnOffMenus \ - (tkPlatStubsPtr->tk_MacTurnOffMenus) /* 1 */ -#endif -#ifndef Tk_MacTkOwnsCursor -#define Tk_MacTkOwnsCursor \ - (tkPlatStubsPtr->tk_MacTkOwnsCursor) /* 2 */ -#endif -#ifndef TkMacInitMenus -#define TkMacInitMenus \ - (tkPlatStubsPtr->tkMacInitMenus) /* 3 */ -#endif -#ifndef TkMacInitAppleEvents -#define TkMacInitAppleEvents \ - (tkPlatStubsPtr->tkMacInitAppleEvents) /* 4 */ -#endif -#ifndef TkMacConvertEvent -#define TkMacConvertEvent \ - (tkPlatStubsPtr->tkMacConvertEvent) /* 5 */ -#endif -#ifndef TkMacConvertTkEvent -#define TkMacConvertTkEvent \ - (tkPlatStubsPtr->tkMacConvertTkEvent) /* 6 */ -#endif -#ifndef TkGenWMConfigureEvent -#define TkGenWMConfigureEvent \ - (tkPlatStubsPtr->tkGenWMConfigureEvent) /* 7 */ -#endif -#ifndef TkMacInvalClipRgns -#define TkMacInvalClipRgns \ - (tkPlatStubsPtr->tkMacInvalClipRgns) /* 8 */ -#endif -#ifndef TkMacHaveAppearance -#define TkMacHaveAppearance \ - (tkPlatStubsPtr->tkMacHaveAppearance) /* 9 */ -#endif -#ifndef TkMacGetDrawablePort -#define TkMacGetDrawablePort \ - (tkPlatStubsPtr->tkMacGetDrawablePort) /* 10 */ -#endif -#endif /* MAC_TCL */ -#ifdef MAC_OSX_TK +#endif /* WIN */ +#ifdef MAC_OSX_TK /* AQUA */ #ifndef Tk_MacOSXSetEmbedHandler #define Tk_MacOSXSetEmbedHandler \ (tkPlatStubsPtr->tk_MacOSXSetEmbedHandler) /* 0 */ @@ -288,7 +193,7 @@ #define Tk_MacOSXIsAppInFront \ (tkPlatStubsPtr->tk_MacOSXIsAppInFront) /* 10 */ #endif -#endif /* MAC_OSX_TK */ +#endif /* AQUA */ #endif /* defined(USE_TK_STUBS) && !defined(USE_TK_STUB_PROCS) */ diff -Nru critcl-3.1.9/lib/critcl/critcl_c/tcl8.4/X11/keysym.h critcl-3.1.17+dfsg/lib/critcl/critcl_c/tcl8.4/X11/keysym.h --- critcl-3.1.9/lib/critcl/critcl_c/tcl8.4/X11/keysym.h 2013-05-10 05:57:04.000000000 +0000 +++ critcl-3.1.17+dfsg/lib/critcl/critcl_c/tcl8.4/X11/keysym.h 2017-10-14 02:48:11.000000000 +0000 @@ -32,8 +32,4 @@ #define XK_LATIN4 #define XK_GREEK -#ifdef MAC_TCL -#include -#else #include -#endif diff -Nru critcl-3.1.9/lib/critcl/critcl_c/tcl8.4/X11/tkIntXlibDecls.h critcl-3.1.17+dfsg/lib/critcl/critcl_c/tcl8.4/X11/tkIntXlibDecls.h --- critcl-3.1.9/lib/critcl/critcl_c/tcl8.4/X11/tkIntXlibDecls.h 2013-05-10 05:57:04.000000000 +0000 +++ critcl-3.1.17+dfsg/lib/critcl/critcl_c/tcl8.4/X11/tkIntXlibDecls.h 2017-10-14 02:48:11.000000000 +0000 @@ -8,29 +8,27 @@ * * Copyright (c) 1998-1999 by Scriptics Corporation. * All rights reserved. - * - * RCS: @(#) $Id: tkIntXlibDecls.h,v 1.16.2.1 2005/11/27 02:44:25 das Exp $ */ #ifndef _TKINTXLIBDECLS #define _TKINTXLIBDECLS -#ifdef MAC_TCL -#include "Xutil.h" -#else +/* + * WARNING: This file is automatically generated by the tools/genStubs.tcl + * script. Any modifications to the function declarations below should be made + * in the generic/tkInt.decls script. + */ + #include "X11/Xutil.h" -#endif #ifdef BUILD_tk #undef TCL_STORAGE_CLASS #define TCL_STORAGE_CLASS DLLEXPORT #endif -/* - * WARNING: This file is automatically generated by the tools/genStubs.tcl - * script. Any modifications to the function declarations below should be made - * in the generic/tkInt.decls script. - */ +typedef int (*XAfterFunction) ( /* WARNING, this type not in Xlib spec */ + Display* /* display */ +); /* !BEGIN!: Do not edit below this line. */ @@ -38,1223 +36,865 @@ * Exported function declarations: */ -#ifdef __WIN32__ +#if defined(__WIN32__) || defined(__CYGWIN__) /* WIN */ /* 0 */ -EXTERN void XSetDashes _ANSI_ARGS_((Display* display, GC gc, - int dash_offset, _Xconst char* dash_list, +EXTERN int XSetDashes _ANSI_ARGS_((Display *display, GC gc, + int dash_offset, _Xconst char *dash_list, int n)); /* 1 */ -EXTERN XModifierKeymap* XGetModifierMapping _ANSI_ARGS_((Display* d)); +EXTERN XModifierKeymap * XGetModifierMapping _ANSI_ARGS_((Display *d)); /* 2 */ -EXTERN XImage * XCreateImage _ANSI_ARGS_((Display* d, Visual* v, - unsigned int ui1, int i1, int i2, char* cp, - unsigned int ui2, unsigned int ui3, int i3, +EXTERN XImage * XCreateImage _ANSI_ARGS_((Display *d, Visual *v, + unsigned int ui1, int i1, int i2, char *cp, + unsigned int ui2, unsigned int ui3, int i3, int i4)); /* 3 */ -EXTERN XImage * XGetImage _ANSI_ARGS_((Display* d, Drawable dr, - int i1, int i2, unsigned int ui1, +EXTERN XImage * XGetImage _ANSI_ARGS_((Display *d, Drawable dr, + int i1, int i2, unsigned int ui1, unsigned int ui2, unsigned long ul, int i3)); /* 4 */ -EXTERN char * XGetAtomName _ANSI_ARGS_((Display* d, Atom a)); +EXTERN char * XGetAtomName _ANSI_ARGS_((Display *d, Atom a)); /* 5 */ EXTERN char * XKeysymToString _ANSI_ARGS_((KeySym k)); /* 6 */ -EXTERN Colormap XCreateColormap _ANSI_ARGS_((Display* d, Window w, - Visual* v, int i)); +EXTERN Colormap XCreateColormap _ANSI_ARGS_((Display *d, Window w, + Visual *v, int i)); /* 7 */ -EXTERN Cursor XCreatePixmapCursor _ANSI_ARGS_((Display* d, - Pixmap p1, Pixmap p2, XColor* x1, XColor* x2, +EXTERN Cursor XCreatePixmapCursor _ANSI_ARGS_((Display *d, + Pixmap p1, Pixmap p2, XColor *x1, XColor *x2, unsigned int ui1, unsigned int ui2)); /* 8 */ -EXTERN Cursor XCreateGlyphCursor _ANSI_ARGS_((Display* d, Font f1, - Font f2, unsigned int ui1, unsigned int ui2, - XColor* x1, XColor* x2)); +EXTERN Cursor XCreateGlyphCursor _ANSI_ARGS_((Display *d, Font f1, + Font f2, unsigned int ui1, unsigned int ui2, + XColor _Xconst *x1, XColor _Xconst *x2)); /* 9 */ EXTERN GContext XGContextFromGC _ANSI_ARGS_((GC g)); /* 10 */ -EXTERN XHostAddress * XListHosts _ANSI_ARGS_((Display* d, int* i, Bool* b)); +EXTERN XHostAddress * XListHosts _ANSI_ARGS_((Display *d, int *i, Bool *b)); /* 11 */ -EXTERN KeySym XKeycodeToKeysym _ANSI_ARGS_((Display* d, +EXTERN KeySym XKeycodeToKeysym _ANSI_ARGS_((Display *d, unsigned int k, int i)); /* 12 */ -EXTERN KeySym XStringToKeysym _ANSI_ARGS_((_Xconst char* c)); +EXTERN KeySym XStringToKeysym _ANSI_ARGS_((_Xconst char *c)); /* 13 */ -EXTERN Window XRootWindow _ANSI_ARGS_((Display* d, int i)); +EXTERN Window XRootWindow _ANSI_ARGS_((Display *d, int i)); /* 14 */ EXTERN XErrorHandler XSetErrorHandler _ANSI_ARGS_((XErrorHandler x)); /* 15 */ -EXTERN Status XIconifyWindow _ANSI_ARGS_((Display* d, Window w, +EXTERN Status XIconifyWindow _ANSI_ARGS_((Display *d, Window w, int i)); /* 16 */ -EXTERN Status XWithdrawWindow _ANSI_ARGS_((Display* d, Window w, +EXTERN Status XWithdrawWindow _ANSI_ARGS_((Display *d, Window w, int i)); /* 17 */ -EXTERN Status XGetWMColormapWindows _ANSI_ARGS_((Display* d, - Window w, Window** wpp, int* ip)); +EXTERN Status XGetWMColormapWindows _ANSI_ARGS_((Display *d, + Window w, Window **wpp, int *ip)); /* 18 */ -EXTERN Status XAllocColor _ANSI_ARGS_((Display* d, Colormap c, - XColor* xp)); +EXTERN Status XAllocColor _ANSI_ARGS_((Display *d, Colormap c, + XColor *xp)); /* 19 */ -EXTERN void XBell _ANSI_ARGS_((Display* d, int i)); +EXTERN int XBell _ANSI_ARGS_((Display *d, int i)); /* 20 */ -EXTERN void XChangeProperty _ANSI_ARGS_((Display* d, Window w, - Atom a1, Atom a2, int i1, int i2, - _Xconst unsigned char* c, int i3)); +EXTERN int XChangeProperty _ANSI_ARGS_((Display *d, Window w, + Atom a1, Atom a2, int i1, int i2, + _Xconst unsigned char *c, int i3)); /* 21 */ -EXTERN void XChangeWindowAttributes _ANSI_ARGS_((Display* d, - Window w, unsigned long ul, - XSetWindowAttributes* x)); +EXTERN int XChangeWindowAttributes _ANSI_ARGS_((Display *d, + Window w, unsigned long ul, + XSetWindowAttributes *x)); /* 22 */ -EXTERN void XClearWindow _ANSI_ARGS_((Display* d, Window w)); +EXTERN int XClearWindow _ANSI_ARGS_((Display *d, Window w)); /* 23 */ -EXTERN void XConfigureWindow _ANSI_ARGS_((Display* d, Window w, - unsigned int i, XWindowChanges* x)); +EXTERN int XConfigureWindow _ANSI_ARGS_((Display *d, Window w, + unsigned int i, XWindowChanges *x)); /* 24 */ -EXTERN void XCopyArea _ANSI_ARGS_((Display* d, Drawable dr1, - Drawable dr2, GC g, int i1, int i2, - unsigned int ui1, unsigned int ui2, int i3, +EXTERN int XCopyArea _ANSI_ARGS_((Display *d, Drawable dr1, + Drawable dr2, GC g, int i1, int i2, + unsigned int ui1, unsigned int ui2, int i3, int i4)); /* 25 */ -EXTERN void XCopyPlane _ANSI_ARGS_((Display* d, Drawable dr1, - Drawable dr2, GC g, int i1, int i2, - unsigned int ui1, unsigned int ui2, int i3, +EXTERN int XCopyPlane _ANSI_ARGS_((Display *d, Drawable dr1, + Drawable dr2, GC g, int i1, int i2, + unsigned int ui1, unsigned int ui2, int i3, int i4, unsigned long ul)); /* 26 */ -EXTERN Pixmap XCreateBitmapFromData _ANSI_ARGS_((Display* display, - Drawable d, _Xconst char* data, +EXTERN Pixmap XCreateBitmapFromData _ANSI_ARGS_((Display *display, + Drawable d, _Xconst char *data, unsigned int width, unsigned int height)); /* 27 */ -EXTERN void XDefineCursor _ANSI_ARGS_((Display* d, Window w, +EXTERN int XDefineCursor _ANSI_ARGS_((Display *d, Window w, Cursor c)); /* 28 */ -EXTERN void XDeleteProperty _ANSI_ARGS_((Display* d, Window w, +EXTERN int XDeleteProperty _ANSI_ARGS_((Display *d, Window w, Atom a)); /* 29 */ -EXTERN void XDestroyWindow _ANSI_ARGS_((Display* d, Window w)); +EXTERN int XDestroyWindow _ANSI_ARGS_((Display *d, Window w)); /* 30 */ -EXTERN void XDrawArc _ANSI_ARGS_((Display* d, Drawable dr, GC g, - int i1, int i2, unsigned int ui1, +EXTERN int XDrawArc _ANSI_ARGS_((Display *d, Drawable dr, GC g, + int i1, int i2, unsigned int ui1, unsigned int ui2, int i3, int i4)); /* 31 */ -EXTERN void XDrawLines _ANSI_ARGS_((Display* d, Drawable dr, - GC g, XPoint* x, int i1, int i2)); +EXTERN int XDrawLines _ANSI_ARGS_((Display *d, Drawable dr, + GC g, XPoint *x, int i1, int i2)); /* 32 */ -EXTERN void XDrawRectangle _ANSI_ARGS_((Display* d, Drawable dr, - GC g, int i1, int i2, unsigned int ui1, +EXTERN int XDrawRectangle _ANSI_ARGS_((Display *d, Drawable dr, + GC g, int i1, int i2, unsigned int ui1, unsigned int ui2)); /* 33 */ -EXTERN void XFillArc _ANSI_ARGS_((Display* d, Drawable dr, GC g, - int i1, int i2, unsigned int ui1, +EXTERN int XFillArc _ANSI_ARGS_((Display *d, Drawable dr, GC g, + int i1, int i2, unsigned int ui1, unsigned int ui2, int i3, int i4)); /* 34 */ -EXTERN void XFillPolygon _ANSI_ARGS_((Display* d, Drawable dr, - GC g, XPoint* x, int i1, int i2, int i3)); +EXTERN int XFillPolygon _ANSI_ARGS_((Display *d, Drawable dr, + GC g, XPoint *x, int i1, int i2, int i3)); /* 35 */ -EXTERN void XFillRectangles _ANSI_ARGS_((Display* d, Drawable dr, - GC g, XRectangle* x, int i)); +EXTERN int XFillRectangles _ANSI_ARGS_((Display *d, Drawable dr, + GC g, XRectangle *x, int i)); /* 36 */ -EXTERN void XForceScreenSaver _ANSI_ARGS_((Display* d, int i)); +EXTERN int XForceScreenSaver _ANSI_ARGS_((Display *d, int i)); /* 37 */ -EXTERN void XFreeColormap _ANSI_ARGS_((Display* d, Colormap c)); +EXTERN int XFreeColormap _ANSI_ARGS_((Display *d, Colormap c)); /* 38 */ -EXTERN void XFreeColors _ANSI_ARGS_((Display* d, Colormap c, - unsigned long* ulp, int i, unsigned long ul)); +EXTERN int XFreeColors _ANSI_ARGS_((Display *d, Colormap c, + unsigned long *ulp, int i, unsigned long ul)); /* 39 */ -EXTERN void XFreeCursor _ANSI_ARGS_((Display* d, Cursor c)); +EXTERN int XFreeCursor _ANSI_ARGS_((Display *d, Cursor c)); /* 40 */ -EXTERN void XFreeModifiermap _ANSI_ARGS_((XModifierKeymap* x)); +EXTERN int XFreeModifiermap _ANSI_ARGS_((XModifierKeymap *x)); /* 41 */ -EXTERN Status XGetGeometry _ANSI_ARGS_((Display* d, Drawable dr, - Window* w, int* i1, int* i2, - unsigned int* ui1, unsigned int* ui2, - unsigned int* ui3, unsigned int* ui4)); +EXTERN Status XGetGeometry _ANSI_ARGS_((Display *d, Drawable dr, + Window *w, int *i1, int *i2, + unsigned int *ui1, unsigned int *ui2, + unsigned int *ui3, unsigned int *ui4)); /* 42 */ -EXTERN void XGetInputFocus _ANSI_ARGS_((Display* d, Window* w, - int* i)); +EXTERN int XGetInputFocus _ANSI_ARGS_((Display *d, Window *w, + int *i)); /* 43 */ -EXTERN int XGetWindowProperty _ANSI_ARGS_((Display* d, Window w, - Atom a1, long l1, long l2, Bool b, Atom a2, - Atom* ap, int* ip, unsigned long* ulp1, - unsigned long* ulp2, unsigned char** cpp)); +EXTERN int XGetWindowProperty _ANSI_ARGS_((Display *d, Window w, + Atom a1, long l1, long l2, Bool b, Atom a2, + Atom *ap, int *ip, unsigned long *ulp1, + unsigned long *ulp2, unsigned char **cpp)); /* 44 */ -EXTERN Status XGetWindowAttributes _ANSI_ARGS_((Display* d, - Window w, XWindowAttributes* x)); +EXTERN Status XGetWindowAttributes _ANSI_ARGS_((Display *d, + Window w, XWindowAttributes *x)); /* 45 */ -EXTERN int XGrabKeyboard _ANSI_ARGS_((Display* d, Window w, +EXTERN int XGrabKeyboard _ANSI_ARGS_((Display *d, Window w, Bool b, int i1, int i2, Time t)); /* 46 */ -EXTERN int XGrabPointer _ANSI_ARGS_((Display* d, Window w1, - Bool b, unsigned int ui, int i1, int i2, +EXTERN int XGrabPointer _ANSI_ARGS_((Display *d, Window w1, + Bool b, unsigned int ui, int i1, int i2, Window w2, Cursor c, Time t)); /* 47 */ -EXTERN KeyCode XKeysymToKeycode _ANSI_ARGS_((Display* d, KeySym k)); +EXTERN KeyCode XKeysymToKeycode _ANSI_ARGS_((Display *d, KeySym k)); /* 48 */ -EXTERN Status XLookupColor _ANSI_ARGS_((Display* d, Colormap c1, - _Xconst char* c2, XColor* x1, XColor* x2)); +EXTERN Status XLookupColor _ANSI_ARGS_((Display *d, Colormap c1, + _Xconst char *c2, XColor *x1, XColor *x2)); /* 49 */ -EXTERN void XMapWindow _ANSI_ARGS_((Display* d, Window w)); +EXTERN int XMapWindow _ANSI_ARGS_((Display *d, Window w)); /* 50 */ -EXTERN void XMoveResizeWindow _ANSI_ARGS_((Display* d, Window w, - int i1, int i2, unsigned int ui1, +EXTERN int XMoveResizeWindow _ANSI_ARGS_((Display *d, Window w, + int i1, int i2, unsigned int ui1, unsigned int ui2)); /* 51 */ -EXTERN void XMoveWindow _ANSI_ARGS_((Display* d, Window w, +EXTERN int XMoveWindow _ANSI_ARGS_((Display *d, Window w, int i1, int i2)); /* 52 */ -EXTERN void XNextEvent _ANSI_ARGS_((Display* d, XEvent* x)); +EXTERN int XNextEvent _ANSI_ARGS_((Display *d, XEvent *x)); /* 53 */ -EXTERN void XPutBackEvent _ANSI_ARGS_((Display* d, XEvent* x)); +EXTERN int XPutBackEvent _ANSI_ARGS_((Display *d, XEvent *x)); /* 54 */ -EXTERN void XQueryColors _ANSI_ARGS_((Display* d, Colormap c, - XColor* x, int i)); +EXTERN int XQueryColors _ANSI_ARGS_((Display *d, Colormap c, + XColor *x, int i)); /* 55 */ -EXTERN Bool XQueryPointer _ANSI_ARGS_((Display* d, Window w1, - Window* w2, Window* w3, int* i1, int* i2, - int* i3, int* i4, unsigned int* ui)); +EXTERN Bool XQueryPointer _ANSI_ARGS_((Display *d, Window w1, + Window *w2, Window *w3, int *i1, int *i2, + int *i3, int *i4, unsigned int *ui)); /* 56 */ -EXTERN Status XQueryTree _ANSI_ARGS_((Display* d, Window w1, - Window* w2, Window* w3, Window** w4, - unsigned int* ui)); +EXTERN Status XQueryTree _ANSI_ARGS_((Display *d, Window w1, + Window *w2, Window *w3, Window **w4, + unsigned int *ui)); /* 57 */ -EXTERN void XRaiseWindow _ANSI_ARGS_((Display* d, Window w)); +EXTERN int XRaiseWindow _ANSI_ARGS_((Display *d, Window w)); /* 58 */ -EXTERN void XRefreshKeyboardMapping _ANSI_ARGS_(( - XMappingEvent* x)); +EXTERN int XRefreshKeyboardMapping _ANSI_ARGS_(( + XMappingEvent *x)); /* 59 */ -EXTERN void XResizeWindow _ANSI_ARGS_((Display* d, Window w, +EXTERN int XResizeWindow _ANSI_ARGS_((Display *d, Window w, unsigned int ui1, unsigned int ui2)); /* 60 */ -EXTERN void XSelectInput _ANSI_ARGS_((Display* d, Window w, +EXTERN int XSelectInput _ANSI_ARGS_((Display *d, Window w, long l)); /* 61 */ -EXTERN Status XSendEvent _ANSI_ARGS_((Display* d, Window w, Bool b, - long l, XEvent* x)); +EXTERN Status XSendEvent _ANSI_ARGS_((Display *d, Window w, Bool b, + long l, XEvent *x)); /* 62 */ -EXTERN void XSetCommand _ANSI_ARGS_((Display* d, Window w, - CONST char** c, int i)); +EXTERN int XSetCommand _ANSI_ARGS_((Display *d, Window w, + char **c, int i)); /* 63 */ -EXTERN void XSetIconName _ANSI_ARGS_((Display* d, Window w, - _Xconst char* c)); +EXTERN int XSetIconName _ANSI_ARGS_((Display *d, Window w, + _Xconst char *c)); /* 64 */ -EXTERN void XSetInputFocus _ANSI_ARGS_((Display* d, Window w, +EXTERN int XSetInputFocus _ANSI_ARGS_((Display *d, Window w, int i, Time t)); /* 65 */ -EXTERN void XSetSelectionOwner _ANSI_ARGS_((Display* d, Atom a, +EXTERN int XSetSelectionOwner _ANSI_ARGS_((Display *d, Atom a, Window w, Time t)); /* 66 */ -EXTERN void XSetWindowBackground _ANSI_ARGS_((Display* d, +EXTERN int XSetWindowBackground _ANSI_ARGS_((Display *d, Window w, unsigned long ul)); /* 67 */ -EXTERN void XSetWindowBackgroundPixmap _ANSI_ARGS_((Display* d, +EXTERN int XSetWindowBackgroundPixmap _ANSI_ARGS_((Display *d, Window w, Pixmap p)); /* 68 */ -EXTERN void XSetWindowBorder _ANSI_ARGS_((Display* d, Window w, +EXTERN int XSetWindowBorder _ANSI_ARGS_((Display *d, Window w, unsigned long ul)); /* 69 */ -EXTERN void XSetWindowBorderPixmap _ANSI_ARGS_((Display* d, +EXTERN int XSetWindowBorderPixmap _ANSI_ARGS_((Display *d, Window w, Pixmap p)); /* 70 */ -EXTERN void XSetWindowBorderWidth _ANSI_ARGS_((Display* d, +EXTERN int XSetWindowBorderWidth _ANSI_ARGS_((Display *d, Window w, unsigned int ui)); /* 71 */ -EXTERN void XSetWindowColormap _ANSI_ARGS_((Display* d, Window w, +EXTERN int XSetWindowColormap _ANSI_ARGS_((Display *d, Window w, Colormap c)); /* 72 */ -EXTERN Bool XTranslateCoordinates _ANSI_ARGS_((Display* d, - Window w1, Window w2, int i1, int i2, - int* i3, int* i4, Window* w3)); +EXTERN Bool XTranslateCoordinates _ANSI_ARGS_((Display *d, + Window w1, Window w2, int i1, int i2, + int *i3, int *i4, Window *w3)); /* 73 */ -EXTERN void XUngrabKeyboard _ANSI_ARGS_((Display* d, Time t)); +EXTERN int XUngrabKeyboard _ANSI_ARGS_((Display *d, Time t)); /* 74 */ -EXTERN void XUngrabPointer _ANSI_ARGS_((Display* d, Time t)); +EXTERN int XUngrabPointer _ANSI_ARGS_((Display *d, Time t)); /* 75 */ -EXTERN void XUnmapWindow _ANSI_ARGS_((Display* d, Window w)); +EXTERN int XUnmapWindow _ANSI_ARGS_((Display *d, Window w)); /* 76 */ -EXTERN void XWindowEvent _ANSI_ARGS_((Display* d, Window w, - long l, XEvent* x)); +EXTERN int XWindowEvent _ANSI_ARGS_((Display *d, Window w, + long l, XEvent *x)); /* 77 */ EXTERN void XDestroyIC _ANSI_ARGS_((XIC x)); /* 78 */ -EXTERN Bool XFilterEvent _ANSI_ARGS_((XEvent* x, Window w)); +EXTERN Bool XFilterEvent _ANSI_ARGS_((XEvent *x, Window w)); /* 79 */ -EXTERN int XmbLookupString _ANSI_ARGS_((XIC xi, - XKeyPressedEvent* xk, char* c, int i, - KeySym* k, Status* s)); +EXTERN int XmbLookupString _ANSI_ARGS_((XIC xi, + XKeyPressedEvent *xk, char *c, int i, + KeySym *k, Status *s)); /* 80 */ -EXTERN void TkPutImage _ANSI_ARGS_((unsigned long * colors, - int ncolors, Display* display, Drawable d, - GC gc, XImage* image, int src_x, int src_y, - int dest_x, int dest_y, unsigned int width, +EXTERN int TkPutImage _ANSI_ARGS_((unsigned long *colors, + int ncolors, Display *display, Drawable d, + GC gc, XImage *image, int src_x, int src_y, + int dest_x, int dest_y, unsigned int width, unsigned int height)); /* Slot 81 is reserved */ /* 82 */ -EXTERN Status XParseColor _ANSI_ARGS_((Display * display, - Colormap map, _Xconst char* spec, - XColor * colorPtr)); +EXTERN Status XParseColor _ANSI_ARGS_((Display *display, + Colormap map, _Xconst char *spec, + XColor *colorPtr)); /* 83 */ -EXTERN GC XCreateGC _ANSI_ARGS_((Display* display, Drawable d, - unsigned long valuemask, XGCValues* values)); +EXTERN GC XCreateGC _ANSI_ARGS_((Display *display, Drawable d, + unsigned long valuemask, XGCValues *values)); /* 84 */ -EXTERN void XFreeGC _ANSI_ARGS_((Display* display, GC gc)); +EXTERN int XFreeGC _ANSI_ARGS_((Display *display, GC gc)); /* 85 */ -EXTERN Atom XInternAtom _ANSI_ARGS_((Display* display, - _Xconst char* atom_name, Bool only_if_exists)); +EXTERN Atom XInternAtom _ANSI_ARGS_((Display *display, + _Xconst char *atom_name, Bool only_if_exists)); /* 86 */ -EXTERN void XSetBackground _ANSI_ARGS_((Display* display, GC gc, +EXTERN int XSetBackground _ANSI_ARGS_((Display *display, GC gc, unsigned long foreground)); /* 87 */ -EXTERN void XSetForeground _ANSI_ARGS_((Display* display, GC gc, +EXTERN int XSetForeground _ANSI_ARGS_((Display *display, GC gc, unsigned long foreground)); /* 88 */ -EXTERN void XSetClipMask _ANSI_ARGS_((Display* display, GC gc, +EXTERN int XSetClipMask _ANSI_ARGS_((Display *display, GC gc, Pixmap pixmap)); /* 89 */ -EXTERN void XSetClipOrigin _ANSI_ARGS_((Display* display, GC gc, +EXTERN int XSetClipOrigin _ANSI_ARGS_((Display *display, GC gc, int clip_x_origin, int clip_y_origin)); /* 90 */ -EXTERN void XSetTSOrigin _ANSI_ARGS_((Display* display, GC gc, +EXTERN int XSetTSOrigin _ANSI_ARGS_((Display *display, GC gc, int ts_x_origin, int ts_y_origin)); /* 91 */ -EXTERN void XChangeGC _ANSI_ARGS_((Display * d, GC gc, - unsigned long mask, XGCValues * values)); +EXTERN int XChangeGC _ANSI_ARGS_((Display *d, GC gc, + unsigned long mask, XGCValues *values)); /* 92 */ -EXTERN void XSetFont _ANSI_ARGS_((Display * display, GC gc, +EXTERN int XSetFont _ANSI_ARGS_((Display *display, GC gc, Font font)); /* 93 */ -EXTERN void XSetArcMode _ANSI_ARGS_((Display * display, GC gc, +EXTERN int XSetArcMode _ANSI_ARGS_((Display *display, GC gc, int arc_mode)); /* 94 */ -EXTERN void XSetStipple _ANSI_ARGS_((Display * display, GC gc, +EXTERN int XSetStipple _ANSI_ARGS_((Display *display, GC gc, Pixmap stipple)); /* 95 */ -EXTERN void XSetFillRule _ANSI_ARGS_((Display * display, GC gc, +EXTERN int XSetFillRule _ANSI_ARGS_((Display *display, GC gc, int fill_rule)); /* 96 */ -EXTERN void XSetFillStyle _ANSI_ARGS_((Display * display, GC gc, +EXTERN int XSetFillStyle _ANSI_ARGS_((Display *display, GC gc, int fill_style)); /* 97 */ -EXTERN void XSetFunction _ANSI_ARGS_((Display * display, GC gc, +EXTERN int XSetFunction _ANSI_ARGS_((Display *display, GC gc, int function)); /* 98 */ -EXTERN void XSetLineAttributes _ANSI_ARGS_((Display * display, - GC gc, unsigned int line_width, - int line_style, int cap_style, +EXTERN int XSetLineAttributes _ANSI_ARGS_((Display *display, + GC gc, unsigned int line_width, + int line_style, int cap_style, int join_style)); /* 99 */ -EXTERN int _XInitImageFuncPtrs _ANSI_ARGS_((XImage * image)); +EXTERN int _XInitImageFuncPtrs _ANSI_ARGS_((XImage *image)); /* 100 */ -EXTERN XIC XCreateIC _ANSI_ARGS_((void)); +EXTERN XIC XCreateIC _ANSI_ARGS_(TCL_VARARGS(XIM,xim)); /* 101 */ -EXTERN XVisualInfo * XGetVisualInfo _ANSI_ARGS_((Display* display, - long vinfo_mask, XVisualInfo* vinfo_template, - int* nitems_return)); +EXTERN XVisualInfo * XGetVisualInfo _ANSI_ARGS_((Display *display, + long vinfo_mask, XVisualInfo *vinfo_template, + int *nitems_return)); /* 102 */ -EXTERN void XSetWMClientMachine _ANSI_ARGS_((Display* display, - Window w, XTextProperty* text_prop)); +EXTERN void XSetWMClientMachine _ANSI_ARGS_((Display *display, + Window w, XTextProperty *text_prop)); /* 103 */ -EXTERN Status XStringListToTextProperty _ANSI_ARGS_((char** list, - int count, XTextProperty* text_prop_return)); +EXTERN Status XStringListToTextProperty _ANSI_ARGS_((char **list, + int count, XTextProperty *text_prop_return)); /* 104 */ -EXTERN void XDrawLine _ANSI_ARGS_((Display* d, Drawable dr, GC g, +EXTERN int XDrawLine _ANSI_ARGS_((Display *d, Drawable dr, GC g, int x1, int y1, int x2, int y2)); /* 105 */ -EXTERN void XWarpPointer _ANSI_ARGS_((Display* d, Window s, - Window dw, int sx, int sy, unsigned int sw, +EXTERN int XWarpPointer _ANSI_ARGS_((Display *d, Window s, + Window dw, int sx, int sy, unsigned int sw, unsigned int sh, int dx, int dy)); /* 106 */ -EXTERN void XFillRectangle _ANSI_ARGS_((Display* display, - Drawable d, GC gc, int x, int y, - unsigned int width, unsigned int height)); -#endif /* __WIN32__ */ -#ifdef MAC_TCL -/* 0 */ -EXTERN void XSetDashes _ANSI_ARGS_((Display* display, GC gc, - int dash_offset, _Xconst char* dash_list, - int n)); -/* 1 */ -EXTERN XModifierKeymap* XGetModifierMapping _ANSI_ARGS_((Display* d)); -/* 2 */ -EXTERN XImage * XCreateImage _ANSI_ARGS_((Display* d, Visual* v, - unsigned int ui1, int i1, int i2, char* cp, - unsigned int ui2, unsigned int ui3, int i3, - int i4)); -/* 3 */ -EXTERN XImage * XGetImage _ANSI_ARGS_((Display* d, Drawable dr, - int i1, int i2, unsigned int ui1, - unsigned int ui2, unsigned long ul, int i3)); -/* 4 */ -EXTERN char * XGetAtomName _ANSI_ARGS_((Display* d, Atom a)); -/* 5 */ -EXTERN char * XKeysymToString _ANSI_ARGS_((KeySym k)); -/* 6 */ -EXTERN Colormap XCreateColormap _ANSI_ARGS_((Display* d, Window w, - Visual* v, int i)); -/* 7 */ -EXTERN GContext XGContextFromGC _ANSI_ARGS_((GC g)); -/* 8 */ -EXTERN KeySym XKeycodeToKeysym _ANSI_ARGS_((Display* d, KeyCode k, - int i)); -/* 9 */ -EXTERN KeySym XStringToKeysym _ANSI_ARGS_((_Xconst char* c)); -/* 10 */ -EXTERN Window XRootWindow _ANSI_ARGS_((Display* d, int i)); -/* 11 */ -EXTERN XErrorHandler XSetErrorHandler _ANSI_ARGS_((XErrorHandler x)); -/* 12 */ -EXTERN Status XAllocColor _ANSI_ARGS_((Display* d, Colormap c, - XColor* xp)); -/* 13 */ -EXTERN void XBell _ANSI_ARGS_((Display* d, int i)); -/* 14 */ -EXTERN void XChangeProperty _ANSI_ARGS_((Display* d, Window w, - Atom a1, Atom a2, int i1, int i2, - _Xconst unsigned char* c, int i3)); -/* 15 */ -EXTERN void XChangeWindowAttributes _ANSI_ARGS_((Display* d, - Window w, unsigned long ul, - XSetWindowAttributes* x)); -/* 16 */ -EXTERN void XConfigureWindow _ANSI_ARGS_((Display* d, Window w, - unsigned int i, XWindowChanges* x)); -/* 17 */ -EXTERN void XCopyArea _ANSI_ARGS_((Display* d, Drawable dr1, - Drawable dr2, GC g, int i1, int i2, - unsigned int ui1, unsigned int ui2, int i3, - int i4)); -/* 18 */ -EXTERN void XCopyPlane _ANSI_ARGS_((Display* d, Drawable dr1, - Drawable dr2, GC g, int i1, int i2, - unsigned int ui1, unsigned int ui2, int i3, - int i4, unsigned long ul)); -/* 19 */ -EXTERN Pixmap XCreateBitmapFromData _ANSI_ARGS_((Display* display, - Drawable d, _Xconst char* data, - unsigned int width, unsigned int height)); -/* 20 */ -EXTERN void XDefineCursor _ANSI_ARGS_((Display* d, Window w, - Cursor c)); -/* 21 */ -EXTERN void XDestroyWindow _ANSI_ARGS_((Display* d, Window w)); -/* 22 */ -EXTERN void XDrawArc _ANSI_ARGS_((Display* d, Drawable dr, GC g, - int i1, int i2, unsigned int ui1, - unsigned int ui2, int i3, int i4)); -/* 23 */ -EXTERN void XDrawLines _ANSI_ARGS_((Display* d, Drawable dr, - GC g, XPoint* x, int i1, int i2)); -/* 24 */ -EXTERN void XDrawRectangle _ANSI_ARGS_((Display* d, Drawable dr, - GC g, int i1, int i2, unsigned int ui1, - unsigned int ui2)); -/* 25 */ -EXTERN void XFillArc _ANSI_ARGS_((Display* d, Drawable dr, GC g, - int i1, int i2, unsigned int ui1, - unsigned int ui2, int i3, int i4)); -/* 26 */ -EXTERN void XFillPolygon _ANSI_ARGS_((Display* d, Drawable dr, - GC g, XPoint* x, int i1, int i2, int i3)); -/* 27 */ -EXTERN void XFillRectangles _ANSI_ARGS_((Display* d, Drawable dr, - GC g, XRectangle* x, int i)); -/* 28 */ -EXTERN void XFreeColormap _ANSI_ARGS_((Display* d, Colormap c)); -/* 29 */ -EXTERN void XFreeColors _ANSI_ARGS_((Display* d, Colormap c, - unsigned long* ulp, int i, unsigned long ul)); -/* 30 */ -EXTERN void XFreeModifiermap _ANSI_ARGS_((XModifierKeymap* x)); -/* 31 */ -EXTERN Status XGetGeometry _ANSI_ARGS_((Display* d, Drawable dr, - Window* w, int* i1, int* i2, - unsigned int* ui1, unsigned int* ui2, - unsigned int* ui3, unsigned int* ui4)); -/* 32 */ -EXTERN int XGetWindowProperty _ANSI_ARGS_((Display* d, Window w, - Atom a1, long l1, long l2, Bool b, Atom a2, - Atom* ap, int* ip, unsigned long* ulp1, - unsigned long* ulp2, unsigned char** cpp)); -/* 33 */ -EXTERN int XGrabKeyboard _ANSI_ARGS_((Display* d, Window w, - Bool b, int i1, int i2, Time t)); -/* 34 */ -EXTERN int XGrabPointer _ANSI_ARGS_((Display* d, Window w1, - Bool b, unsigned int ui, int i1, int i2, - Window w2, Cursor c, Time t)); -/* 35 */ -EXTERN KeyCode XKeysymToKeycode _ANSI_ARGS_((Display* d, KeySym k)); -/* 36 */ -EXTERN void XMapWindow _ANSI_ARGS_((Display* d, Window w)); -/* 37 */ -EXTERN void XMoveResizeWindow _ANSI_ARGS_((Display* d, Window w, - int i1, int i2, unsigned int ui1, - unsigned int ui2)); -/* 38 */ -EXTERN void XMoveWindow _ANSI_ARGS_((Display* d, Window w, - int i1, int i2)); -/* 39 */ -EXTERN Bool XQueryPointer _ANSI_ARGS_((Display* d, Window w1, - Window* w2, Window* w3, int* i1, int* i2, - int* i3, int* i4, unsigned int* ui)); -/* 40 */ -EXTERN void XRaiseWindow _ANSI_ARGS_((Display* d, Window w)); -/* 41 */ -EXTERN void XRefreshKeyboardMapping _ANSI_ARGS_(( - XMappingEvent* x)); -/* 42 */ -EXTERN void XResizeWindow _ANSI_ARGS_((Display* d, Window w, - unsigned int ui1, unsigned int ui2)); -/* 43 */ -EXTERN void XSelectInput _ANSI_ARGS_((Display* d, Window w, - long l)); -/* 44 */ -EXTERN Status XSendEvent _ANSI_ARGS_((Display* d, Window w, Bool b, - long l, XEvent* x)); -/* 45 */ -EXTERN void XSetIconName _ANSI_ARGS_((Display* d, Window w, - _Xconst char* c)); -/* 46 */ -EXTERN void XSetInputFocus _ANSI_ARGS_((Display* d, Window w, - int i, Time t)); -/* 47 */ -EXTERN void XSetSelectionOwner _ANSI_ARGS_((Display* d, Atom a, - Window w, Time t)); -/* 48 */ -EXTERN void XSetWindowBackground _ANSI_ARGS_((Display* d, - Window w, unsigned long ul)); -/* 49 */ -EXTERN void XSetWindowBackgroundPixmap _ANSI_ARGS_((Display* d, - Window w, Pixmap p)); -/* 50 */ -EXTERN void XSetWindowBorder _ANSI_ARGS_((Display* d, Window w, - unsigned long ul)); -/* 51 */ -EXTERN void XSetWindowBorderPixmap _ANSI_ARGS_((Display* d, - Window w, Pixmap p)); -/* 52 */ -EXTERN void XSetWindowBorderWidth _ANSI_ARGS_((Display* d, - Window w, unsigned int ui)); -/* 53 */ -EXTERN void XSetWindowColormap _ANSI_ARGS_((Display* d, Window w, - Colormap c)); -/* 54 */ -EXTERN void XUngrabKeyboard _ANSI_ARGS_((Display* d, Time t)); -/* 55 */ -EXTERN void XUngrabPointer _ANSI_ARGS_((Display* d, Time t)); -/* 56 */ -EXTERN void XUnmapWindow _ANSI_ARGS_((Display* d, Window w)); -/* 57 */ -EXTERN void TkPutImage _ANSI_ARGS_((unsigned long * colors, - int ncolors, Display* display, Drawable d, - GC gc, XImage* image, int src_x, int src_y, - int dest_x, int dest_y, unsigned int width, - unsigned int height)); -/* 58 */ -EXTERN Status XParseColor _ANSI_ARGS_((Display * display, - Colormap map, _Xconst char* spec, - XColor * colorPtr)); -/* 59 */ -EXTERN GC XCreateGC _ANSI_ARGS_((Display* display, Drawable d, - unsigned long valuemask, XGCValues* values)); -/* 60 */ -EXTERN void XFreeGC _ANSI_ARGS_((Display* display, GC gc)); -/* 61 */ -EXTERN Atom XInternAtom _ANSI_ARGS_((Display* display, - _Xconst char* atom_name, Bool only_if_exists)); -/* 62 */ -EXTERN void XSetBackground _ANSI_ARGS_((Display* display, GC gc, - unsigned long foreground)); -/* 63 */ -EXTERN void XSetForeground _ANSI_ARGS_((Display* display, GC gc, - unsigned long foreground)); -/* 64 */ -EXTERN void XSetClipMask _ANSI_ARGS_((Display* display, GC gc, - Pixmap pixmap)); -/* 65 */ -EXTERN void XSetClipOrigin _ANSI_ARGS_((Display* display, GC gc, - int clip_x_origin, int clip_y_origin)); -/* 66 */ -EXTERN void XSetTSOrigin _ANSI_ARGS_((Display* display, GC gc, - int ts_x_origin, int ts_y_origin)); -/* 67 */ -EXTERN void XChangeGC _ANSI_ARGS_((Display * d, GC gc, - unsigned long mask, XGCValues * values)); -/* 68 */ -EXTERN void XSetFont _ANSI_ARGS_((Display * display, GC gc, - Font font)); -/* 69 */ -EXTERN void XSetArcMode _ANSI_ARGS_((Display * display, GC gc, - int arc_mode)); -/* 70 */ -EXTERN void XSetStipple _ANSI_ARGS_((Display * display, GC gc, - Pixmap stipple)); -/* 71 */ -EXTERN void XSetFillRule _ANSI_ARGS_((Display * display, GC gc, - int fill_rule)); -/* 72 */ -EXTERN void XSetFillStyle _ANSI_ARGS_((Display * display, GC gc, - int fill_style)); -/* 73 */ -EXTERN void XSetFunction _ANSI_ARGS_((Display * display, GC gc, - int function)); -/* 74 */ -EXTERN void XSetLineAttributes _ANSI_ARGS_((Display * display, - GC gc, unsigned int line_width, - int line_style, int cap_style, - int join_style)); -/* 75 */ -EXTERN int _XInitImageFuncPtrs _ANSI_ARGS_((XImage * image)); -/* 76 */ -EXTERN XIC XCreateIC _ANSI_ARGS_((void)); -/* 77 */ -EXTERN XVisualInfo * XGetVisualInfo _ANSI_ARGS_((Display* display, - long vinfo_mask, XVisualInfo* vinfo_template, - int* nitems_return)); -/* 78 */ -EXTERN void XSetWMClientMachine _ANSI_ARGS_((Display* display, - Window w, XTextProperty* text_prop)); -/* 79 */ -EXTERN Status XStringListToTextProperty _ANSI_ARGS_((char** list, - int count, XTextProperty* text_prop_return)); -/* 80 */ -EXTERN void XDrawSegments _ANSI_ARGS_((Display * display, - Drawable d, GC gc, XSegment * segments, - int nsegments)); -/* 81 */ -EXTERN void XForceScreenSaver _ANSI_ARGS_((Display* display, - int mode)); -/* 82 */ -EXTERN void XDrawLine _ANSI_ARGS_((Display* d, Drawable dr, GC g, - int x1, int y1, int x2, int y2)); -/* 83 */ -EXTERN void XFillRectangle _ANSI_ARGS_((Display* display, - Drawable d, GC gc, int x, int y, +EXTERN int XFillRectangle _ANSI_ARGS_((Display *display, + Drawable d, GC gc, int x, int y, unsigned int width, unsigned int height)); -/* 84 */ -EXTERN void XClearWindow _ANSI_ARGS_((Display* d, Window w)); -/* 85 */ -EXTERN void XDrawPoint _ANSI_ARGS_((Display* display, Drawable d, - GC gc, int x, int y)); -/* 86 */ -EXTERN void XDrawPoints _ANSI_ARGS_((Display* display, - Drawable d, GC gc, XPoint * points, - int npoints, int mode)); -/* 87 */ -EXTERN void XWarpPointer _ANSI_ARGS_((Display* display, - Window src_w, Window dest_w, int src_x, - int src_y, unsigned int src_width, - unsigned int src_height, int dest_x, - int dest_y)); -/* 88 */ -EXTERN void XQueryColor _ANSI_ARGS_((Display * display, - Colormap colormap, XColor * def_in_out)); -/* 89 */ -EXTERN void XQueryColors _ANSI_ARGS_((Display * display, - Colormap colormap, XColor * defs_in_out, - int ncolors)); -/* 90 */ -EXTERN Status XQueryTree _ANSI_ARGS_((Display* d, Window w1, - Window* w2, Window* w3, Window** w4, - unsigned int* ui)); -#endif /* MAC_TCL */ -#ifdef MAC_OSX_TK +/* 107 */ +EXTERN int XFlush _ANSI_ARGS_((Display *display)); +/* 108 */ +EXTERN int XGrabServer _ANSI_ARGS_((Display *display)); +/* 109 */ +EXTERN int XUngrabServer _ANSI_ARGS_((Display *display)); +/* 110 */ +EXTERN int XFree _ANSI_ARGS_((VOID *data)); +/* 111 */ +EXTERN int XNoOp _ANSI_ARGS_((Display *display)); +/* 112 */ +EXTERN XAfterFunction XSynchronize _ANSI_ARGS_((Display *display, + Bool onoff)); +/* 113 */ +EXTERN int XSync _ANSI_ARGS_((Display *display, Bool discard)); +/* 114 */ +EXTERN VisualID XVisualIDFromVisual _ANSI_ARGS_((Visual *visual)); +#endif /* WIN */ +#ifdef MAC_OSX_TK /* AQUA */ /* 0 */ -EXTERN void XSetDashes _ANSI_ARGS_((Display* display, GC gc, - int dash_offset, _Xconst char* dash_list, +EXTERN int XSetDashes _ANSI_ARGS_((Display *display, GC gc, + int dash_offset, _Xconst char *dash_list, int n)); /* 1 */ -EXTERN XModifierKeymap* XGetModifierMapping _ANSI_ARGS_((Display* d)); +EXTERN XModifierKeymap * XGetModifierMapping _ANSI_ARGS_((Display *d)); /* 2 */ -EXTERN XImage * XCreateImage _ANSI_ARGS_((Display* d, Visual* v, - unsigned int ui1, int i1, int i2, char* cp, - unsigned int ui2, unsigned int ui3, int i3, +EXTERN XImage * XCreateImage _ANSI_ARGS_((Display *d, Visual *v, + unsigned int ui1, int i1, int i2, char *cp, + unsigned int ui2, unsigned int ui3, int i3, int i4)); /* 3 */ -EXTERN XImage * XGetImage _ANSI_ARGS_((Display* d, Drawable dr, - int i1, int i2, unsigned int ui1, +EXTERN XImage * XGetImage _ANSI_ARGS_((Display *d, Drawable dr, + int i1, int i2, unsigned int ui1, unsigned int ui2, unsigned long ul, int i3)); /* 4 */ -EXTERN char * XGetAtomName _ANSI_ARGS_((Display* d, Atom a)); +EXTERN char * XGetAtomName _ANSI_ARGS_((Display *d, Atom a)); /* 5 */ EXTERN char * XKeysymToString _ANSI_ARGS_((KeySym k)); /* 6 */ -EXTERN Colormap XCreateColormap _ANSI_ARGS_((Display* d, Window w, - Visual* v, int i)); +EXTERN Colormap XCreateColormap _ANSI_ARGS_((Display *d, Window w, + Visual *v, int i)); /* 7 */ EXTERN GContext XGContextFromGC _ANSI_ARGS_((GC g)); /* 8 */ -EXTERN KeySym XKeycodeToKeysym _ANSI_ARGS_((Display* d, KeyCode k, +EXTERN KeySym XKeycodeToKeysym _ANSI_ARGS_((Display *d, KeyCode k, int i)); /* 9 */ -EXTERN KeySym XStringToKeysym _ANSI_ARGS_((_Xconst char* c)); +EXTERN KeySym XStringToKeysym _ANSI_ARGS_((_Xconst char *c)); /* 10 */ -EXTERN Window XRootWindow _ANSI_ARGS_((Display* d, int i)); +EXTERN Window XRootWindow _ANSI_ARGS_((Display *d, int i)); /* 11 */ EXTERN XErrorHandler XSetErrorHandler _ANSI_ARGS_((XErrorHandler x)); /* 12 */ -EXTERN Status XAllocColor _ANSI_ARGS_((Display* d, Colormap c, - XColor* xp)); +EXTERN Status XAllocColor _ANSI_ARGS_((Display *d, Colormap c, + XColor *xp)); /* 13 */ -EXTERN void XBell _ANSI_ARGS_((Display* d, int i)); +EXTERN int XBell _ANSI_ARGS_((Display *d, int i)); /* 14 */ -EXTERN void XChangeProperty _ANSI_ARGS_((Display* d, Window w, - Atom a1, Atom a2, int i1, int i2, - _Xconst unsigned char* c, int i3)); +EXTERN void XChangeProperty _ANSI_ARGS_((Display *d, Window w, + Atom a1, Atom a2, int i1, int i2, + _Xconst unsigned char *c, int i3)); /* 15 */ -EXTERN void XChangeWindowAttributes _ANSI_ARGS_((Display* d, - Window w, unsigned long ul, - XSetWindowAttributes* x)); +EXTERN void XChangeWindowAttributes _ANSI_ARGS_((Display *d, + Window w, unsigned long ul, + XSetWindowAttributes *x)); /* 16 */ -EXTERN void XConfigureWindow _ANSI_ARGS_((Display* d, Window w, - unsigned int i, XWindowChanges* x)); +EXTERN void XConfigureWindow _ANSI_ARGS_((Display *d, Window w, + unsigned int i, XWindowChanges *x)); /* 17 */ -EXTERN void XCopyArea _ANSI_ARGS_((Display* d, Drawable dr1, - Drawable dr2, GC g, int i1, int i2, - unsigned int ui1, unsigned int ui2, int i3, +EXTERN void XCopyArea _ANSI_ARGS_((Display *d, Drawable dr1, + Drawable dr2, GC g, int i1, int i2, + unsigned int ui1, unsigned int ui2, int i3, int i4)); /* 18 */ -EXTERN void XCopyPlane _ANSI_ARGS_((Display* d, Drawable dr1, - Drawable dr2, GC g, int i1, int i2, - unsigned int ui1, unsigned int ui2, int i3, +EXTERN void XCopyPlane _ANSI_ARGS_((Display *d, Drawable dr1, + Drawable dr2, GC g, int i1, int i2, + unsigned int ui1, unsigned int ui2, int i3, int i4, unsigned long ul)); /* 19 */ -EXTERN Pixmap XCreateBitmapFromData _ANSI_ARGS_((Display* display, - Drawable d, _Xconst char* data, +EXTERN Pixmap XCreateBitmapFromData _ANSI_ARGS_((Display *display, + Drawable d, _Xconst char *data, unsigned int width, unsigned int height)); /* 20 */ -EXTERN void XDefineCursor _ANSI_ARGS_((Display* d, Window w, +EXTERN int XDefineCursor _ANSI_ARGS_((Display *d, Window w, Cursor c)); /* 21 */ -EXTERN void XDestroyWindow _ANSI_ARGS_((Display* d, Window w)); +EXTERN void XDestroyWindow _ANSI_ARGS_((Display *d, Window w)); /* 22 */ -EXTERN void XDrawArc _ANSI_ARGS_((Display* d, Drawable dr, GC g, - int i1, int i2, unsigned int ui1, +EXTERN void XDrawArc _ANSI_ARGS_((Display *d, Drawable dr, GC g, + int i1, int i2, unsigned int ui1, unsigned int ui2, int i3, int i4)); /* 23 */ -EXTERN void XDrawLines _ANSI_ARGS_((Display* d, Drawable dr, - GC g, XPoint* x, int i1, int i2)); +EXTERN int XDrawLines _ANSI_ARGS_((Display *d, Drawable dr, + GC g, XPoint *x, int i1, int i2)); /* 24 */ -EXTERN void XDrawRectangle _ANSI_ARGS_((Display* d, Drawable dr, - GC g, int i1, int i2, unsigned int ui1, +EXTERN void XDrawRectangle _ANSI_ARGS_((Display *d, Drawable dr, + GC g, int i1, int i2, unsigned int ui1, unsigned int ui2)); /* 25 */ -EXTERN void XFillArc _ANSI_ARGS_((Display* d, Drawable dr, GC g, - int i1, int i2, unsigned int ui1, +EXTERN void XFillArc _ANSI_ARGS_((Display *d, Drawable dr, GC g, + int i1, int i2, unsigned int ui1, unsigned int ui2, int i3, int i4)); /* 26 */ -EXTERN void XFillPolygon _ANSI_ARGS_((Display* d, Drawable dr, - GC g, XPoint* x, int i1, int i2, int i3)); +EXTERN void XFillPolygon _ANSI_ARGS_((Display *d, Drawable dr, + GC g, XPoint *x, int i1, int i2, int i3)); /* 27 */ -EXTERN void XFillRectangles _ANSI_ARGS_((Display* d, Drawable dr, - GC g, XRectangle* x, int i)); +EXTERN int XFillRectangles _ANSI_ARGS_((Display *d, Drawable dr, + GC g, XRectangle *x, int i)); /* 28 */ -EXTERN void XFreeColormap _ANSI_ARGS_((Display* d, Colormap c)); +EXTERN int XFreeColormap _ANSI_ARGS_((Display *d, Colormap c)); /* 29 */ -EXTERN void XFreeColors _ANSI_ARGS_((Display* d, Colormap c, - unsigned long* ulp, int i, unsigned long ul)); +EXTERN int XFreeColors _ANSI_ARGS_((Display *d, Colormap c, + unsigned long *ulp, int i, unsigned long ul)); /* 30 */ -EXTERN void XFreeModifiermap _ANSI_ARGS_((XModifierKeymap* x)); +EXTERN int XFreeModifiermap _ANSI_ARGS_((XModifierKeymap *x)); /* 31 */ -EXTERN Status XGetGeometry _ANSI_ARGS_((Display* d, Drawable dr, - Window* w, int* i1, int* i2, - unsigned int* ui1, unsigned int* ui2, - unsigned int* ui3, unsigned int* ui4)); +EXTERN Status XGetGeometry _ANSI_ARGS_((Display *d, Drawable dr, + Window *w, int *i1, int *i2, + unsigned int *ui1, unsigned int *ui2, + unsigned int *ui3, unsigned int *ui4)); /* 32 */ -EXTERN int XGetWindowProperty _ANSI_ARGS_((Display* d, Window w, - Atom a1, long l1, long l2, Bool b, Atom a2, - Atom* ap, int* ip, unsigned long* ulp1, - unsigned long* ulp2, unsigned char** cpp)); +EXTERN int XGetWindowProperty _ANSI_ARGS_((Display *d, Window w, + Atom a1, long l1, long l2, Bool b, Atom a2, + Atom *ap, int *ip, unsigned long *ulp1, + unsigned long *ulp2, unsigned char **cpp)); /* 33 */ -EXTERN int XGrabKeyboard _ANSI_ARGS_((Display* d, Window w, +EXTERN int XGrabKeyboard _ANSI_ARGS_((Display *d, Window w, Bool b, int i1, int i2, Time t)); /* 34 */ -EXTERN int XGrabPointer _ANSI_ARGS_((Display* d, Window w1, - Bool b, unsigned int ui, int i1, int i2, +EXTERN int XGrabPointer _ANSI_ARGS_((Display *d, Window w1, + Bool b, unsigned int ui, int i1, int i2, Window w2, Cursor c, Time t)); /* 35 */ -EXTERN KeyCode XKeysymToKeycode _ANSI_ARGS_((Display* d, KeySym k)); +EXTERN KeyCode XKeysymToKeycode _ANSI_ARGS_((Display *d, KeySym k)); /* 36 */ -EXTERN void XMapWindow _ANSI_ARGS_((Display* d, Window w)); +EXTERN void XMapWindow _ANSI_ARGS_((Display *d, Window w)); /* 37 */ -EXTERN void XMoveResizeWindow _ANSI_ARGS_((Display* d, Window w, - int i1, int i2, unsigned int ui1, +EXTERN void XMoveResizeWindow _ANSI_ARGS_((Display *d, Window w, + int i1, int i2, unsigned int ui1, unsigned int ui2)); /* 38 */ -EXTERN void XMoveWindow _ANSI_ARGS_((Display* d, Window w, +EXTERN void XMoveWindow _ANSI_ARGS_((Display *d, Window w, int i1, int i2)); /* 39 */ -EXTERN Bool XQueryPointer _ANSI_ARGS_((Display* d, Window w1, - Window* w2, Window* w3, int* i1, int* i2, - int* i3, int* i4, unsigned int* ui)); +EXTERN Bool XQueryPointer _ANSI_ARGS_((Display *d, Window w1, + Window *w2, Window *w3, int *i1, int *i2, + int *i3, int *i4, unsigned int *ui)); /* 40 */ -EXTERN void XRaiseWindow _ANSI_ARGS_((Display* d, Window w)); +EXTERN void XRaiseWindow _ANSI_ARGS_((Display *d, Window w)); /* 41 */ EXTERN void XRefreshKeyboardMapping _ANSI_ARGS_(( - XMappingEvent* x)); + XMappingEvent *x)); /* 42 */ -EXTERN void XResizeWindow _ANSI_ARGS_((Display* d, Window w, +EXTERN void XResizeWindow _ANSI_ARGS_((Display *d, Window w, unsigned int ui1, unsigned int ui2)); /* 43 */ -EXTERN void XSelectInput _ANSI_ARGS_((Display* d, Window w, +EXTERN void XSelectInput _ANSI_ARGS_((Display *d, Window w, long l)); /* 44 */ -EXTERN Status XSendEvent _ANSI_ARGS_((Display* d, Window w, Bool b, - long l, XEvent* x)); +EXTERN Status XSendEvent _ANSI_ARGS_((Display *d, Window w, Bool b, + long l, XEvent *x)); /* 45 */ -EXTERN void XSetIconName _ANSI_ARGS_((Display* d, Window w, - _Xconst char* c)); +EXTERN void XSetIconName _ANSI_ARGS_((Display *d, Window w, + _Xconst char *c)); /* 46 */ -EXTERN void XSetInputFocus _ANSI_ARGS_((Display* d, Window w, +EXTERN void XSetInputFocus _ANSI_ARGS_((Display *d, Window w, int i, Time t)); /* 47 */ -EXTERN void XSetSelectionOwner _ANSI_ARGS_((Display* d, Atom a, +EXTERN int XSetSelectionOwner _ANSI_ARGS_((Display *d, Atom a, Window w, Time t)); /* 48 */ -EXTERN void XSetWindowBackground _ANSI_ARGS_((Display* d, +EXTERN void XSetWindowBackground _ANSI_ARGS_((Display *d, Window w, unsigned long ul)); /* 49 */ -EXTERN void XSetWindowBackgroundPixmap _ANSI_ARGS_((Display* d, +EXTERN void XSetWindowBackgroundPixmap _ANSI_ARGS_((Display *d, Window w, Pixmap p)); /* 50 */ -EXTERN void XSetWindowBorder _ANSI_ARGS_((Display* d, Window w, +EXTERN void XSetWindowBorder _ANSI_ARGS_((Display *d, Window w, unsigned long ul)); /* 51 */ -EXTERN void XSetWindowBorderPixmap _ANSI_ARGS_((Display* d, +EXTERN void XSetWindowBorderPixmap _ANSI_ARGS_((Display *d, Window w, Pixmap p)); /* 52 */ -EXTERN void XSetWindowBorderWidth _ANSI_ARGS_((Display* d, +EXTERN void XSetWindowBorderWidth _ANSI_ARGS_((Display *d, Window w, unsigned int ui)); /* 53 */ -EXTERN void XSetWindowColormap _ANSI_ARGS_((Display* d, Window w, +EXTERN void XSetWindowColormap _ANSI_ARGS_((Display *d, Window w, Colormap c)); /* 54 */ -EXTERN void XUngrabKeyboard _ANSI_ARGS_((Display* d, Time t)); +EXTERN void XUngrabKeyboard _ANSI_ARGS_((Display *d, Time t)); /* 55 */ -EXTERN void XUngrabPointer _ANSI_ARGS_((Display* d, Time t)); +EXTERN int XUngrabPointer _ANSI_ARGS_((Display *d, Time t)); /* 56 */ -EXTERN void XUnmapWindow _ANSI_ARGS_((Display* d, Window w)); +EXTERN void XUnmapWindow _ANSI_ARGS_((Display *d, Window w)); /* 57 */ -EXTERN void TkPutImage _ANSI_ARGS_((unsigned long * colors, - int ncolors, Display* display, Drawable d, - GC gc, XImage* image, int src_x, int src_y, - int dest_x, int dest_y, unsigned int width, +EXTERN int TkPutImage _ANSI_ARGS_((unsigned long *colors, + int ncolors, Display *display, Drawable d, + GC gc, XImage *image, int src_x, int src_y, + int dest_x, int dest_y, unsigned int width, unsigned int height)); /* 58 */ -EXTERN Status XParseColor _ANSI_ARGS_((Display * display, - Colormap map, _Xconst char* spec, - XColor * colorPtr)); +EXTERN Status XParseColor _ANSI_ARGS_((Display *display, + Colormap map, _Xconst char *spec, + XColor *colorPtr)); /* 59 */ -EXTERN GC XCreateGC _ANSI_ARGS_((Display* display, Drawable d, - unsigned long valuemask, XGCValues* values)); +EXTERN GC XCreateGC _ANSI_ARGS_((Display *display, Drawable d, + unsigned long valuemask, XGCValues *values)); /* 60 */ -EXTERN void XFreeGC _ANSI_ARGS_((Display* display, GC gc)); +EXTERN int XFreeGC _ANSI_ARGS_((Display *display, GC gc)); /* 61 */ -EXTERN Atom XInternAtom _ANSI_ARGS_((Display* display, - _Xconst char* atom_name, Bool only_if_exists)); +EXTERN Atom XInternAtom _ANSI_ARGS_((Display *display, + _Xconst char *atom_name, Bool only_if_exists)); /* 62 */ -EXTERN void XSetBackground _ANSI_ARGS_((Display* display, GC gc, +EXTERN int XSetBackground _ANSI_ARGS_((Display *display, GC gc, unsigned long foreground)); /* 63 */ -EXTERN void XSetForeground _ANSI_ARGS_((Display* display, GC gc, +EXTERN int XSetForeground _ANSI_ARGS_((Display *display, GC gc, unsigned long foreground)); /* 64 */ -EXTERN void XSetClipMask _ANSI_ARGS_((Display* display, GC gc, +EXTERN int XSetClipMask _ANSI_ARGS_((Display *display, GC gc, Pixmap pixmap)); /* 65 */ -EXTERN void XSetClipOrigin _ANSI_ARGS_((Display* display, GC gc, +EXTERN int XSetClipOrigin _ANSI_ARGS_((Display *display, GC gc, int clip_x_origin, int clip_y_origin)); /* 66 */ -EXTERN void XSetTSOrigin _ANSI_ARGS_((Display* display, GC gc, +EXTERN int XSetTSOrigin _ANSI_ARGS_((Display *display, GC gc, int ts_x_origin, int ts_y_origin)); /* 67 */ -EXTERN void XChangeGC _ANSI_ARGS_((Display * d, GC gc, - unsigned long mask, XGCValues * values)); +EXTERN int XChangeGC _ANSI_ARGS_((Display *d, GC gc, + unsigned long mask, XGCValues *values)); /* 68 */ -EXTERN void XSetFont _ANSI_ARGS_((Display * display, GC gc, +EXTERN int XSetFont _ANSI_ARGS_((Display *display, GC gc, Font font)); /* 69 */ -EXTERN void XSetArcMode _ANSI_ARGS_((Display * display, GC gc, +EXTERN int XSetArcMode _ANSI_ARGS_((Display *display, GC gc, int arc_mode)); /* 70 */ -EXTERN void XSetStipple _ANSI_ARGS_((Display * display, GC gc, +EXTERN int XSetStipple _ANSI_ARGS_((Display *display, GC gc, Pixmap stipple)); /* 71 */ -EXTERN void XSetFillRule _ANSI_ARGS_((Display * display, GC gc, +EXTERN int XSetFillRule _ANSI_ARGS_((Display *display, GC gc, int fill_rule)); /* 72 */ -EXTERN void XSetFillStyle _ANSI_ARGS_((Display * display, GC gc, +EXTERN int XSetFillStyle _ANSI_ARGS_((Display *display, GC gc, int fill_style)); /* 73 */ -EXTERN void XSetFunction _ANSI_ARGS_((Display * display, GC gc, +EXTERN int XSetFunction _ANSI_ARGS_((Display *display, GC gc, int function)); /* 74 */ -EXTERN void XSetLineAttributes _ANSI_ARGS_((Display * display, - GC gc, unsigned int line_width, - int line_style, int cap_style, +EXTERN int XSetLineAttributes _ANSI_ARGS_((Display *display, + GC gc, unsigned int line_width, + int line_style, int cap_style, int join_style)); /* 75 */ -EXTERN int _XInitImageFuncPtrs _ANSI_ARGS_((XImage * image)); +EXTERN int _XInitImageFuncPtrs _ANSI_ARGS_((XImage *image)); /* 76 */ EXTERN XIC XCreateIC _ANSI_ARGS_((void)); /* 77 */ -EXTERN XVisualInfo * XGetVisualInfo _ANSI_ARGS_((Display* display, - long vinfo_mask, XVisualInfo* vinfo_template, - int* nitems_return)); +EXTERN XVisualInfo * XGetVisualInfo _ANSI_ARGS_((Display *display, + long vinfo_mask, XVisualInfo *vinfo_template, + int *nitems_return)); /* 78 */ -EXTERN void XSetWMClientMachine _ANSI_ARGS_((Display* display, - Window w, XTextProperty* text_prop)); +EXTERN void XSetWMClientMachine _ANSI_ARGS_((Display *display, + Window w, XTextProperty *text_prop)); /* 79 */ -EXTERN Status XStringListToTextProperty _ANSI_ARGS_((char** list, - int count, XTextProperty* text_prop_return)); +EXTERN Status XStringListToTextProperty _ANSI_ARGS_((char **list, + int count, XTextProperty *text_prop_return)); /* 80 */ -EXTERN void XDrawSegments _ANSI_ARGS_((Display * display, - Drawable d, GC gc, XSegment * segments, +EXTERN void XDrawSegments _ANSI_ARGS_((Display *display, + Drawable d, GC gc, XSegment *segments, int nsegments)); /* 81 */ -EXTERN void XForceScreenSaver _ANSI_ARGS_((Display* display, +EXTERN void XForceScreenSaver _ANSI_ARGS_((Display *display, int mode)); /* 82 */ -EXTERN void XDrawLine _ANSI_ARGS_((Display* d, Drawable dr, GC g, +EXTERN int XDrawLine _ANSI_ARGS_((Display *d, Drawable dr, GC g, int x1, int y1, int x2, int y2)); /* 83 */ -EXTERN void XFillRectangle _ANSI_ARGS_((Display* display, - Drawable d, GC gc, int x, int y, +EXTERN int XFillRectangle _ANSI_ARGS_((Display *display, + Drawable d, GC gc, int x, int y, unsigned int width, unsigned int height)); /* 84 */ -EXTERN void XClearWindow _ANSI_ARGS_((Display* d, Window w)); +EXTERN void XClearWindow _ANSI_ARGS_((Display *d, Window w)); /* 85 */ -EXTERN void XDrawPoint _ANSI_ARGS_((Display* display, Drawable d, +EXTERN void XDrawPoint _ANSI_ARGS_((Display *display, Drawable d, GC gc, int x, int y)); /* 86 */ -EXTERN void XDrawPoints _ANSI_ARGS_((Display* display, - Drawable d, GC gc, XPoint * points, +EXTERN void XDrawPoints _ANSI_ARGS_((Display *display, + Drawable d, GC gc, XPoint *points, int npoints, int mode)); /* 87 */ -EXTERN void XWarpPointer _ANSI_ARGS_((Display* display, - Window src_w, Window dest_w, int src_x, - int src_y, unsigned int src_width, - unsigned int src_height, int dest_x, +EXTERN int XWarpPointer _ANSI_ARGS_((Display *display, + Window src_w, Window dest_w, int src_x, + int src_y, unsigned int src_width, + unsigned int src_height, int dest_x, int dest_y)); /* 88 */ -EXTERN void XQueryColor _ANSI_ARGS_((Display * display, - Colormap colormap, XColor * def_in_out)); +EXTERN void XQueryColor _ANSI_ARGS_((Display *display, + Colormap colormap, XColor *def_in_out)); /* 89 */ -EXTERN void XQueryColors _ANSI_ARGS_((Display * display, - Colormap colormap, XColor * defs_in_out, +EXTERN void XQueryColors _ANSI_ARGS_((Display *display, + Colormap colormap, XColor *defs_in_out, int ncolors)); /* 90 */ -EXTERN Status XQueryTree _ANSI_ARGS_((Display* d, Window w1, - Window* w2, Window* w3, Window** w4, - unsigned int* ui)); +EXTERN Status XQueryTree _ANSI_ARGS_((Display *d, Window w1, + Window *w2, Window *w3, Window **w4, + unsigned int *ui)); /* 91 */ -EXTERN int XSync _ANSI_ARGS_((Display * display, Bool flag)); -#endif /* MAC_OSX_TK */ +EXTERN int XSync _ANSI_ARGS_((Display *display, Bool flag)); +#endif /* AQUA */ typedef struct TkIntXlibStubs { int magic; struct TkIntXlibStubHooks *hooks; -#ifdef __WIN32__ - void (*xSetDashes) _ANSI_ARGS_((Display* display, GC gc, int dash_offset, _Xconst char* dash_list, int n)); /* 0 */ - XModifierKeymap* (*xGetModifierMapping) _ANSI_ARGS_((Display* d)); /* 1 */ - XImage * (*xCreateImage) _ANSI_ARGS_((Display* d, Visual* v, unsigned int ui1, int i1, int i2, char* cp, unsigned int ui2, unsigned int ui3, int i3, int i4)); /* 2 */ - XImage * (*xGetImage) _ANSI_ARGS_((Display* d, Drawable dr, int i1, int i2, unsigned int ui1, unsigned int ui2, unsigned long ul, int i3)); /* 3 */ - char * (*xGetAtomName) _ANSI_ARGS_((Display* d, Atom a)); /* 4 */ +#if defined(__WIN32__) || defined(__CYGWIN__) /* WIN */ + int (*xSetDashes) _ANSI_ARGS_((Display *display, GC gc, int dash_offset, _Xconst char *dash_list, int n)); /* 0 */ + XModifierKeymap * (*xGetModifierMapping) _ANSI_ARGS_((Display *d)); /* 1 */ + XImage * (*xCreateImage) _ANSI_ARGS_((Display *d, Visual *v, unsigned int ui1, int i1, int i2, char *cp, unsigned int ui2, unsigned int ui3, int i3, int i4)); /* 2 */ + XImage * (*xGetImage) _ANSI_ARGS_((Display *d, Drawable dr, int i1, int i2, unsigned int ui1, unsigned int ui2, unsigned long ul, int i3)); /* 3 */ + char * (*xGetAtomName) _ANSI_ARGS_((Display *d, Atom a)); /* 4 */ char * (*xKeysymToString) _ANSI_ARGS_((KeySym k)); /* 5 */ - Colormap (*xCreateColormap) _ANSI_ARGS_((Display* d, Window w, Visual* v, int i)); /* 6 */ - Cursor (*xCreatePixmapCursor) _ANSI_ARGS_((Display* d, Pixmap p1, Pixmap p2, XColor* x1, XColor* x2, unsigned int ui1, unsigned int ui2)); /* 7 */ - Cursor (*xCreateGlyphCursor) _ANSI_ARGS_((Display* d, Font f1, Font f2, unsigned int ui1, unsigned int ui2, XColor* x1, XColor* x2)); /* 8 */ + Colormap (*xCreateColormap) _ANSI_ARGS_((Display *d, Window w, Visual *v, int i)); /* 6 */ + Cursor (*xCreatePixmapCursor) _ANSI_ARGS_((Display *d, Pixmap p1, Pixmap p2, XColor *x1, XColor *x2, unsigned int ui1, unsigned int ui2)); /* 7 */ + Cursor (*xCreateGlyphCursor) _ANSI_ARGS_((Display *d, Font f1, Font f2, unsigned int ui1, unsigned int ui2, XColor _Xconst *x1, XColor _Xconst *x2)); /* 8 */ GContext (*xGContextFromGC) _ANSI_ARGS_((GC g)); /* 9 */ - XHostAddress * (*xListHosts) _ANSI_ARGS_((Display* d, int* i, Bool* b)); /* 10 */ - KeySym (*xKeycodeToKeysym) _ANSI_ARGS_((Display* d, unsigned int k, int i)); /* 11 */ - KeySym (*xStringToKeysym) _ANSI_ARGS_((_Xconst char* c)); /* 12 */ - Window (*xRootWindow) _ANSI_ARGS_((Display* d, int i)); /* 13 */ + XHostAddress * (*xListHosts) _ANSI_ARGS_((Display *d, int *i, Bool *b)); /* 10 */ + KeySym (*xKeycodeToKeysym) _ANSI_ARGS_((Display *d, unsigned int k, int i)); /* 11 */ + KeySym (*xStringToKeysym) _ANSI_ARGS_((_Xconst char *c)); /* 12 */ + Window (*xRootWindow) _ANSI_ARGS_((Display *d, int i)); /* 13 */ XErrorHandler (*xSetErrorHandler) _ANSI_ARGS_((XErrorHandler x)); /* 14 */ - Status (*xIconifyWindow) _ANSI_ARGS_((Display* d, Window w, int i)); /* 15 */ - Status (*xWithdrawWindow) _ANSI_ARGS_((Display* d, Window w, int i)); /* 16 */ - Status (*xGetWMColormapWindows) _ANSI_ARGS_((Display* d, Window w, Window** wpp, int* ip)); /* 17 */ - Status (*xAllocColor) _ANSI_ARGS_((Display* d, Colormap c, XColor* xp)); /* 18 */ - void (*xBell) _ANSI_ARGS_((Display* d, int i)); /* 19 */ - void (*xChangeProperty) _ANSI_ARGS_((Display* d, Window w, Atom a1, Atom a2, int i1, int i2, _Xconst unsigned char* c, int i3)); /* 20 */ - void (*xChangeWindowAttributes) _ANSI_ARGS_((Display* d, Window w, unsigned long ul, XSetWindowAttributes* x)); /* 21 */ - void (*xClearWindow) _ANSI_ARGS_((Display* d, Window w)); /* 22 */ - void (*xConfigureWindow) _ANSI_ARGS_((Display* d, Window w, unsigned int i, XWindowChanges* x)); /* 23 */ - void (*xCopyArea) _ANSI_ARGS_((Display* d, Drawable dr1, Drawable dr2, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2, int i3, int i4)); /* 24 */ - void (*xCopyPlane) _ANSI_ARGS_((Display* d, Drawable dr1, Drawable dr2, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2, int i3, int i4, unsigned long ul)); /* 25 */ - Pixmap (*xCreateBitmapFromData) _ANSI_ARGS_((Display* display, Drawable d, _Xconst char* data, unsigned int width, unsigned int height)); /* 26 */ - void (*xDefineCursor) _ANSI_ARGS_((Display* d, Window w, Cursor c)); /* 27 */ - void (*xDeleteProperty) _ANSI_ARGS_((Display* d, Window w, Atom a)); /* 28 */ - void (*xDestroyWindow) _ANSI_ARGS_((Display* d, Window w)); /* 29 */ - void (*xDrawArc) _ANSI_ARGS_((Display* d, Drawable dr, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2, int i3, int i4)); /* 30 */ - void (*xDrawLines) _ANSI_ARGS_((Display* d, Drawable dr, GC g, XPoint* x, int i1, int i2)); /* 31 */ - void (*xDrawRectangle) _ANSI_ARGS_((Display* d, Drawable dr, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2)); /* 32 */ - void (*xFillArc) _ANSI_ARGS_((Display* d, Drawable dr, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2, int i3, int i4)); /* 33 */ - void (*xFillPolygon) _ANSI_ARGS_((Display* d, Drawable dr, GC g, XPoint* x, int i1, int i2, int i3)); /* 34 */ - void (*xFillRectangles) _ANSI_ARGS_((Display* d, Drawable dr, GC g, XRectangle* x, int i)); /* 35 */ - void (*xForceScreenSaver) _ANSI_ARGS_((Display* d, int i)); /* 36 */ - void (*xFreeColormap) _ANSI_ARGS_((Display* d, Colormap c)); /* 37 */ - void (*xFreeColors) _ANSI_ARGS_((Display* d, Colormap c, unsigned long* ulp, int i, unsigned long ul)); /* 38 */ - void (*xFreeCursor) _ANSI_ARGS_((Display* d, Cursor c)); /* 39 */ - void (*xFreeModifiermap) _ANSI_ARGS_((XModifierKeymap* x)); /* 40 */ - Status (*xGetGeometry) _ANSI_ARGS_((Display* d, Drawable dr, Window* w, int* i1, int* i2, unsigned int* ui1, unsigned int* ui2, unsigned int* ui3, unsigned int* ui4)); /* 41 */ - void (*xGetInputFocus) _ANSI_ARGS_((Display* d, Window* w, int* i)); /* 42 */ - int (*xGetWindowProperty) _ANSI_ARGS_((Display* d, Window w, Atom a1, long l1, long l2, Bool b, Atom a2, Atom* ap, int* ip, unsigned long* ulp1, unsigned long* ulp2, unsigned char** cpp)); /* 43 */ - Status (*xGetWindowAttributes) _ANSI_ARGS_((Display* d, Window w, XWindowAttributes* x)); /* 44 */ - int (*xGrabKeyboard) _ANSI_ARGS_((Display* d, Window w, Bool b, int i1, int i2, Time t)); /* 45 */ - int (*xGrabPointer) _ANSI_ARGS_((Display* d, Window w1, Bool b, unsigned int ui, int i1, int i2, Window w2, Cursor c, Time t)); /* 46 */ - KeyCode (*xKeysymToKeycode) _ANSI_ARGS_((Display* d, KeySym k)); /* 47 */ - Status (*xLookupColor) _ANSI_ARGS_((Display* d, Colormap c1, _Xconst char* c2, XColor* x1, XColor* x2)); /* 48 */ - void (*xMapWindow) _ANSI_ARGS_((Display* d, Window w)); /* 49 */ - void (*xMoveResizeWindow) _ANSI_ARGS_((Display* d, Window w, int i1, int i2, unsigned int ui1, unsigned int ui2)); /* 50 */ - void (*xMoveWindow) _ANSI_ARGS_((Display* d, Window w, int i1, int i2)); /* 51 */ - void (*xNextEvent) _ANSI_ARGS_((Display* d, XEvent* x)); /* 52 */ - void (*xPutBackEvent) _ANSI_ARGS_((Display* d, XEvent* x)); /* 53 */ - void (*xQueryColors) _ANSI_ARGS_((Display* d, Colormap c, XColor* x, int i)); /* 54 */ - Bool (*xQueryPointer) _ANSI_ARGS_((Display* d, Window w1, Window* w2, Window* w3, int* i1, int* i2, int* i3, int* i4, unsigned int* ui)); /* 55 */ - Status (*xQueryTree) _ANSI_ARGS_((Display* d, Window w1, Window* w2, Window* w3, Window** w4, unsigned int* ui)); /* 56 */ - void (*xRaiseWindow) _ANSI_ARGS_((Display* d, Window w)); /* 57 */ - void (*xRefreshKeyboardMapping) _ANSI_ARGS_((XMappingEvent* x)); /* 58 */ - void (*xResizeWindow) _ANSI_ARGS_((Display* d, Window w, unsigned int ui1, unsigned int ui2)); /* 59 */ - void (*xSelectInput) _ANSI_ARGS_((Display* d, Window w, long l)); /* 60 */ - Status (*xSendEvent) _ANSI_ARGS_((Display* d, Window w, Bool b, long l, XEvent* x)); /* 61 */ - void (*xSetCommand) _ANSI_ARGS_((Display* d, Window w, CONST char** c, int i)); /* 62 */ - void (*xSetIconName) _ANSI_ARGS_((Display* d, Window w, _Xconst char* c)); /* 63 */ - void (*xSetInputFocus) _ANSI_ARGS_((Display* d, Window w, int i, Time t)); /* 64 */ - void (*xSetSelectionOwner) _ANSI_ARGS_((Display* d, Atom a, Window w, Time t)); /* 65 */ - void (*xSetWindowBackground) _ANSI_ARGS_((Display* d, Window w, unsigned long ul)); /* 66 */ - void (*xSetWindowBackgroundPixmap) _ANSI_ARGS_((Display* d, Window w, Pixmap p)); /* 67 */ - void (*xSetWindowBorder) _ANSI_ARGS_((Display* d, Window w, unsigned long ul)); /* 68 */ - void (*xSetWindowBorderPixmap) _ANSI_ARGS_((Display* d, Window w, Pixmap p)); /* 69 */ - void (*xSetWindowBorderWidth) _ANSI_ARGS_((Display* d, Window w, unsigned int ui)); /* 70 */ - void (*xSetWindowColormap) _ANSI_ARGS_((Display* d, Window w, Colormap c)); /* 71 */ - Bool (*xTranslateCoordinates) _ANSI_ARGS_((Display* d, Window w1, Window w2, int i1, int i2, int* i3, int* i4, Window* w3)); /* 72 */ - void (*xUngrabKeyboard) _ANSI_ARGS_((Display* d, Time t)); /* 73 */ - void (*xUngrabPointer) _ANSI_ARGS_((Display* d, Time t)); /* 74 */ - void (*xUnmapWindow) _ANSI_ARGS_((Display* d, Window w)); /* 75 */ - void (*xWindowEvent) _ANSI_ARGS_((Display* d, Window w, long l, XEvent* x)); /* 76 */ + Status (*xIconifyWindow) _ANSI_ARGS_((Display *d, Window w, int i)); /* 15 */ + Status (*xWithdrawWindow) _ANSI_ARGS_((Display *d, Window w, int i)); /* 16 */ + Status (*xGetWMColormapWindows) _ANSI_ARGS_((Display *d, Window w, Window **wpp, int *ip)); /* 17 */ + Status (*xAllocColor) _ANSI_ARGS_((Display *d, Colormap c, XColor *xp)); /* 18 */ + int (*xBell) _ANSI_ARGS_((Display *d, int i)); /* 19 */ + int (*xChangeProperty) _ANSI_ARGS_((Display *d, Window w, Atom a1, Atom a2, int i1, int i2, _Xconst unsigned char *c, int i3)); /* 20 */ + int (*xChangeWindowAttributes) _ANSI_ARGS_((Display *d, Window w, unsigned long ul, XSetWindowAttributes *x)); /* 21 */ + int (*xClearWindow) _ANSI_ARGS_((Display *d, Window w)); /* 22 */ + int (*xConfigureWindow) _ANSI_ARGS_((Display *d, Window w, unsigned int i, XWindowChanges *x)); /* 23 */ + int (*xCopyArea) _ANSI_ARGS_((Display *d, Drawable dr1, Drawable dr2, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2, int i3, int i4)); /* 24 */ + int (*xCopyPlane) _ANSI_ARGS_((Display *d, Drawable dr1, Drawable dr2, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2, int i3, int i4, unsigned long ul)); /* 25 */ + Pixmap (*xCreateBitmapFromData) _ANSI_ARGS_((Display *display, Drawable d, _Xconst char *data, unsigned int width, unsigned int height)); /* 26 */ + int (*xDefineCursor) _ANSI_ARGS_((Display *d, Window w, Cursor c)); /* 27 */ + int (*xDeleteProperty) _ANSI_ARGS_((Display *d, Window w, Atom a)); /* 28 */ + int (*xDestroyWindow) _ANSI_ARGS_((Display *d, Window w)); /* 29 */ + int (*xDrawArc) _ANSI_ARGS_((Display *d, Drawable dr, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2, int i3, int i4)); /* 30 */ + int (*xDrawLines) _ANSI_ARGS_((Display *d, Drawable dr, GC g, XPoint *x, int i1, int i2)); /* 31 */ + int (*xDrawRectangle) _ANSI_ARGS_((Display *d, Drawable dr, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2)); /* 32 */ + int (*xFillArc) _ANSI_ARGS_((Display *d, Drawable dr, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2, int i3, int i4)); /* 33 */ + int (*xFillPolygon) _ANSI_ARGS_((Display *d, Drawable dr, GC g, XPoint *x, int i1, int i2, int i3)); /* 34 */ + int (*xFillRectangles) _ANSI_ARGS_((Display *d, Drawable dr, GC g, XRectangle *x, int i)); /* 35 */ + int (*xForceScreenSaver) _ANSI_ARGS_((Display *d, int i)); /* 36 */ + int (*xFreeColormap) _ANSI_ARGS_((Display *d, Colormap c)); /* 37 */ + int (*xFreeColors) _ANSI_ARGS_((Display *d, Colormap c, unsigned long *ulp, int i, unsigned long ul)); /* 38 */ + int (*xFreeCursor) _ANSI_ARGS_((Display *d, Cursor c)); /* 39 */ + int (*xFreeModifiermap) _ANSI_ARGS_((XModifierKeymap *x)); /* 40 */ + Status (*xGetGeometry) _ANSI_ARGS_((Display *d, Drawable dr, Window *w, int *i1, int *i2, unsigned int *ui1, unsigned int *ui2, unsigned int *ui3, unsigned int *ui4)); /* 41 */ + int (*xGetInputFocus) _ANSI_ARGS_((Display *d, Window *w, int *i)); /* 42 */ + int (*xGetWindowProperty) _ANSI_ARGS_((Display *d, Window w, Atom a1, long l1, long l2, Bool b, Atom a2, Atom *ap, int *ip, unsigned long *ulp1, unsigned long *ulp2, unsigned char **cpp)); /* 43 */ + Status (*xGetWindowAttributes) _ANSI_ARGS_((Display *d, Window w, XWindowAttributes *x)); /* 44 */ + int (*xGrabKeyboard) _ANSI_ARGS_((Display *d, Window w, Bool b, int i1, int i2, Time t)); /* 45 */ + int (*xGrabPointer) _ANSI_ARGS_((Display *d, Window w1, Bool b, unsigned int ui, int i1, int i2, Window w2, Cursor c, Time t)); /* 46 */ + KeyCode (*xKeysymToKeycode) _ANSI_ARGS_((Display *d, KeySym k)); /* 47 */ + Status (*xLookupColor) _ANSI_ARGS_((Display *d, Colormap c1, _Xconst char *c2, XColor *x1, XColor *x2)); /* 48 */ + int (*xMapWindow) _ANSI_ARGS_((Display *d, Window w)); /* 49 */ + int (*xMoveResizeWindow) _ANSI_ARGS_((Display *d, Window w, int i1, int i2, unsigned int ui1, unsigned int ui2)); /* 50 */ + int (*xMoveWindow) _ANSI_ARGS_((Display *d, Window w, int i1, int i2)); /* 51 */ + int (*xNextEvent) _ANSI_ARGS_((Display *d, XEvent *x)); /* 52 */ + int (*xPutBackEvent) _ANSI_ARGS_((Display *d, XEvent *x)); /* 53 */ + int (*xQueryColors) _ANSI_ARGS_((Display *d, Colormap c, XColor *x, int i)); /* 54 */ + Bool (*xQueryPointer) _ANSI_ARGS_((Display *d, Window w1, Window *w2, Window *w3, int *i1, int *i2, int *i3, int *i4, unsigned int *ui)); /* 55 */ + Status (*xQueryTree) _ANSI_ARGS_((Display *d, Window w1, Window *w2, Window *w3, Window **w4, unsigned int *ui)); /* 56 */ + int (*xRaiseWindow) _ANSI_ARGS_((Display *d, Window w)); /* 57 */ + int (*xRefreshKeyboardMapping) _ANSI_ARGS_((XMappingEvent *x)); /* 58 */ + int (*xResizeWindow) _ANSI_ARGS_((Display *d, Window w, unsigned int ui1, unsigned int ui2)); /* 59 */ + int (*xSelectInput) _ANSI_ARGS_((Display *d, Window w, long l)); /* 60 */ + Status (*xSendEvent) _ANSI_ARGS_((Display *d, Window w, Bool b, long l, XEvent *x)); /* 61 */ + int (*xSetCommand) _ANSI_ARGS_((Display *d, Window w, char **c, int i)); /* 62 */ + int (*xSetIconName) _ANSI_ARGS_((Display *d, Window w, _Xconst char *c)); /* 63 */ + int (*xSetInputFocus) _ANSI_ARGS_((Display *d, Window w, int i, Time t)); /* 64 */ + int (*xSetSelectionOwner) _ANSI_ARGS_((Display *d, Atom a, Window w, Time t)); /* 65 */ + int (*xSetWindowBackground) _ANSI_ARGS_((Display *d, Window w, unsigned long ul)); /* 66 */ + int (*xSetWindowBackgroundPixmap) _ANSI_ARGS_((Display *d, Window w, Pixmap p)); /* 67 */ + int (*xSetWindowBorder) _ANSI_ARGS_((Display *d, Window w, unsigned long ul)); /* 68 */ + int (*xSetWindowBorderPixmap) _ANSI_ARGS_((Display *d, Window w, Pixmap p)); /* 69 */ + int (*xSetWindowBorderWidth) _ANSI_ARGS_((Display *d, Window w, unsigned int ui)); /* 70 */ + int (*xSetWindowColormap) _ANSI_ARGS_((Display *d, Window w, Colormap c)); /* 71 */ + Bool (*xTranslateCoordinates) _ANSI_ARGS_((Display *d, Window w1, Window w2, int i1, int i2, int *i3, int *i4, Window *w3)); /* 72 */ + int (*xUngrabKeyboard) _ANSI_ARGS_((Display *d, Time t)); /* 73 */ + int (*xUngrabPointer) _ANSI_ARGS_((Display *d, Time t)); /* 74 */ + int (*xUnmapWindow) _ANSI_ARGS_((Display *d, Window w)); /* 75 */ + int (*xWindowEvent) _ANSI_ARGS_((Display *d, Window w, long l, XEvent *x)); /* 76 */ void (*xDestroyIC) _ANSI_ARGS_((XIC x)); /* 77 */ - Bool (*xFilterEvent) _ANSI_ARGS_((XEvent* x, Window w)); /* 78 */ - int (*xmbLookupString) _ANSI_ARGS_((XIC xi, XKeyPressedEvent* xk, char* c, int i, KeySym* k, Status* s)); /* 79 */ - void (*tkPutImage) _ANSI_ARGS_((unsigned long * colors, int ncolors, Display* display, Drawable d, GC gc, XImage* image, int src_x, int src_y, int dest_x, int dest_y, unsigned int width, unsigned int height)); /* 80 */ - void *reserved81; - Status (*xParseColor) _ANSI_ARGS_((Display * display, Colormap map, _Xconst char* spec, XColor * colorPtr)); /* 82 */ - GC (*xCreateGC) _ANSI_ARGS_((Display* display, Drawable d, unsigned long valuemask, XGCValues* values)); /* 83 */ - void (*xFreeGC) _ANSI_ARGS_((Display* display, GC gc)); /* 84 */ - Atom (*xInternAtom) _ANSI_ARGS_((Display* display, _Xconst char* atom_name, Bool only_if_exists)); /* 85 */ - void (*xSetBackground) _ANSI_ARGS_((Display* display, GC gc, unsigned long foreground)); /* 86 */ - void (*xSetForeground) _ANSI_ARGS_((Display* display, GC gc, unsigned long foreground)); /* 87 */ - void (*xSetClipMask) _ANSI_ARGS_((Display* display, GC gc, Pixmap pixmap)); /* 88 */ - void (*xSetClipOrigin) _ANSI_ARGS_((Display* display, GC gc, int clip_x_origin, int clip_y_origin)); /* 89 */ - void (*xSetTSOrigin) _ANSI_ARGS_((Display* display, GC gc, int ts_x_origin, int ts_y_origin)); /* 90 */ - void (*xChangeGC) _ANSI_ARGS_((Display * d, GC gc, unsigned long mask, XGCValues * values)); /* 91 */ - void (*xSetFont) _ANSI_ARGS_((Display * display, GC gc, Font font)); /* 92 */ - void (*xSetArcMode) _ANSI_ARGS_((Display * display, GC gc, int arc_mode)); /* 93 */ - void (*xSetStipple) _ANSI_ARGS_((Display * display, GC gc, Pixmap stipple)); /* 94 */ - void (*xSetFillRule) _ANSI_ARGS_((Display * display, GC gc, int fill_rule)); /* 95 */ - void (*xSetFillStyle) _ANSI_ARGS_((Display * display, GC gc, int fill_style)); /* 96 */ - void (*xSetFunction) _ANSI_ARGS_((Display * display, GC gc, int function)); /* 97 */ - void (*xSetLineAttributes) _ANSI_ARGS_((Display * display, GC gc, unsigned int line_width, int line_style, int cap_style, int join_style)); /* 98 */ - int (*_XInitImageFuncPtrs) _ANSI_ARGS_((XImage * image)); /* 99 */ - XIC (*xCreateIC) _ANSI_ARGS_((void)); /* 100 */ - XVisualInfo * (*xGetVisualInfo) _ANSI_ARGS_((Display* display, long vinfo_mask, XVisualInfo* vinfo_template, int* nitems_return)); /* 101 */ - void (*xSetWMClientMachine) _ANSI_ARGS_((Display* display, Window w, XTextProperty* text_prop)); /* 102 */ - Status (*xStringListToTextProperty) _ANSI_ARGS_((char** list, int count, XTextProperty* text_prop_return)); /* 103 */ - void (*xDrawLine) _ANSI_ARGS_((Display* d, Drawable dr, GC g, int x1, int y1, int x2, int y2)); /* 104 */ - void (*xWarpPointer) _ANSI_ARGS_((Display* d, Window s, Window dw, int sx, int sy, unsigned int sw, unsigned int sh, int dx, int dy)); /* 105 */ - void (*xFillRectangle) _ANSI_ARGS_((Display* display, Drawable d, GC gc, int x, int y, unsigned int width, unsigned int height)); /* 106 */ -#endif /* __WIN32__ */ -#ifdef MAC_TCL - void (*xSetDashes) _ANSI_ARGS_((Display* display, GC gc, int dash_offset, _Xconst char* dash_list, int n)); /* 0 */ - XModifierKeymap* (*xGetModifierMapping) _ANSI_ARGS_((Display* d)); /* 1 */ - XImage * (*xCreateImage) _ANSI_ARGS_((Display* d, Visual* v, unsigned int ui1, int i1, int i2, char* cp, unsigned int ui2, unsigned int ui3, int i3, int i4)); /* 2 */ - XImage * (*xGetImage) _ANSI_ARGS_((Display* d, Drawable dr, int i1, int i2, unsigned int ui1, unsigned int ui2, unsigned long ul, int i3)); /* 3 */ - char * (*xGetAtomName) _ANSI_ARGS_((Display* d, Atom a)); /* 4 */ - char * (*xKeysymToString) _ANSI_ARGS_((KeySym k)); /* 5 */ - Colormap (*xCreateColormap) _ANSI_ARGS_((Display* d, Window w, Visual* v, int i)); /* 6 */ - GContext (*xGContextFromGC) _ANSI_ARGS_((GC g)); /* 7 */ - KeySym (*xKeycodeToKeysym) _ANSI_ARGS_((Display* d, KeyCode k, int i)); /* 8 */ - KeySym (*xStringToKeysym) _ANSI_ARGS_((_Xconst char* c)); /* 9 */ - Window (*xRootWindow) _ANSI_ARGS_((Display* d, int i)); /* 10 */ - XErrorHandler (*xSetErrorHandler) _ANSI_ARGS_((XErrorHandler x)); /* 11 */ - Status (*xAllocColor) _ANSI_ARGS_((Display* d, Colormap c, XColor* xp)); /* 12 */ - void (*xBell) _ANSI_ARGS_((Display* d, int i)); /* 13 */ - void (*xChangeProperty) _ANSI_ARGS_((Display* d, Window w, Atom a1, Atom a2, int i1, int i2, _Xconst unsigned char* c, int i3)); /* 14 */ - void (*xChangeWindowAttributes) _ANSI_ARGS_((Display* d, Window w, unsigned long ul, XSetWindowAttributes* x)); /* 15 */ - void (*xConfigureWindow) _ANSI_ARGS_((Display* d, Window w, unsigned int i, XWindowChanges* x)); /* 16 */ - void (*xCopyArea) _ANSI_ARGS_((Display* d, Drawable dr1, Drawable dr2, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2, int i3, int i4)); /* 17 */ - void (*xCopyPlane) _ANSI_ARGS_((Display* d, Drawable dr1, Drawable dr2, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2, int i3, int i4, unsigned long ul)); /* 18 */ - Pixmap (*xCreateBitmapFromData) _ANSI_ARGS_((Display* display, Drawable d, _Xconst char* data, unsigned int width, unsigned int height)); /* 19 */ - void (*xDefineCursor) _ANSI_ARGS_((Display* d, Window w, Cursor c)); /* 20 */ - void (*xDestroyWindow) _ANSI_ARGS_((Display* d, Window w)); /* 21 */ - void (*xDrawArc) _ANSI_ARGS_((Display* d, Drawable dr, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2, int i3, int i4)); /* 22 */ - void (*xDrawLines) _ANSI_ARGS_((Display* d, Drawable dr, GC g, XPoint* x, int i1, int i2)); /* 23 */ - void (*xDrawRectangle) _ANSI_ARGS_((Display* d, Drawable dr, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2)); /* 24 */ - void (*xFillArc) _ANSI_ARGS_((Display* d, Drawable dr, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2, int i3, int i4)); /* 25 */ - void (*xFillPolygon) _ANSI_ARGS_((Display* d, Drawable dr, GC g, XPoint* x, int i1, int i2, int i3)); /* 26 */ - void (*xFillRectangles) _ANSI_ARGS_((Display* d, Drawable dr, GC g, XRectangle* x, int i)); /* 27 */ - void (*xFreeColormap) _ANSI_ARGS_((Display* d, Colormap c)); /* 28 */ - void (*xFreeColors) _ANSI_ARGS_((Display* d, Colormap c, unsigned long* ulp, int i, unsigned long ul)); /* 29 */ - void (*xFreeModifiermap) _ANSI_ARGS_((XModifierKeymap* x)); /* 30 */ - Status (*xGetGeometry) _ANSI_ARGS_((Display* d, Drawable dr, Window* w, int* i1, int* i2, unsigned int* ui1, unsigned int* ui2, unsigned int* ui3, unsigned int* ui4)); /* 31 */ - int (*xGetWindowProperty) _ANSI_ARGS_((Display* d, Window w, Atom a1, long l1, long l2, Bool b, Atom a2, Atom* ap, int* ip, unsigned long* ulp1, unsigned long* ulp2, unsigned char** cpp)); /* 32 */ - int (*xGrabKeyboard) _ANSI_ARGS_((Display* d, Window w, Bool b, int i1, int i2, Time t)); /* 33 */ - int (*xGrabPointer) _ANSI_ARGS_((Display* d, Window w1, Bool b, unsigned int ui, int i1, int i2, Window w2, Cursor c, Time t)); /* 34 */ - KeyCode (*xKeysymToKeycode) _ANSI_ARGS_((Display* d, KeySym k)); /* 35 */ - void (*xMapWindow) _ANSI_ARGS_((Display* d, Window w)); /* 36 */ - void (*xMoveResizeWindow) _ANSI_ARGS_((Display* d, Window w, int i1, int i2, unsigned int ui1, unsigned int ui2)); /* 37 */ - void (*xMoveWindow) _ANSI_ARGS_((Display* d, Window w, int i1, int i2)); /* 38 */ - Bool (*xQueryPointer) _ANSI_ARGS_((Display* d, Window w1, Window* w2, Window* w3, int* i1, int* i2, int* i3, int* i4, unsigned int* ui)); /* 39 */ - void (*xRaiseWindow) _ANSI_ARGS_((Display* d, Window w)); /* 40 */ - void (*xRefreshKeyboardMapping) _ANSI_ARGS_((XMappingEvent* x)); /* 41 */ - void (*xResizeWindow) _ANSI_ARGS_((Display* d, Window w, unsigned int ui1, unsigned int ui2)); /* 42 */ - void (*xSelectInput) _ANSI_ARGS_((Display* d, Window w, long l)); /* 43 */ - Status (*xSendEvent) _ANSI_ARGS_((Display* d, Window w, Bool b, long l, XEvent* x)); /* 44 */ - void (*xSetIconName) _ANSI_ARGS_((Display* d, Window w, _Xconst char* c)); /* 45 */ - void (*xSetInputFocus) _ANSI_ARGS_((Display* d, Window w, int i, Time t)); /* 46 */ - void (*xSetSelectionOwner) _ANSI_ARGS_((Display* d, Atom a, Window w, Time t)); /* 47 */ - void (*xSetWindowBackground) _ANSI_ARGS_((Display* d, Window w, unsigned long ul)); /* 48 */ - void (*xSetWindowBackgroundPixmap) _ANSI_ARGS_((Display* d, Window w, Pixmap p)); /* 49 */ - void (*xSetWindowBorder) _ANSI_ARGS_((Display* d, Window w, unsigned long ul)); /* 50 */ - void (*xSetWindowBorderPixmap) _ANSI_ARGS_((Display* d, Window w, Pixmap p)); /* 51 */ - void (*xSetWindowBorderWidth) _ANSI_ARGS_((Display* d, Window w, unsigned int ui)); /* 52 */ - void (*xSetWindowColormap) _ANSI_ARGS_((Display* d, Window w, Colormap c)); /* 53 */ - void (*xUngrabKeyboard) _ANSI_ARGS_((Display* d, Time t)); /* 54 */ - void (*xUngrabPointer) _ANSI_ARGS_((Display* d, Time t)); /* 55 */ - void (*xUnmapWindow) _ANSI_ARGS_((Display* d, Window w)); /* 56 */ - void (*tkPutImage) _ANSI_ARGS_((unsigned long * colors, int ncolors, Display* display, Drawable d, GC gc, XImage* image, int src_x, int src_y, int dest_x, int dest_y, unsigned int width, unsigned int height)); /* 57 */ - Status (*xParseColor) _ANSI_ARGS_((Display * display, Colormap map, _Xconst char* spec, XColor * colorPtr)); /* 58 */ - GC (*xCreateGC) _ANSI_ARGS_((Display* display, Drawable d, unsigned long valuemask, XGCValues* values)); /* 59 */ - void (*xFreeGC) _ANSI_ARGS_((Display* display, GC gc)); /* 60 */ - Atom (*xInternAtom) _ANSI_ARGS_((Display* display, _Xconst char* atom_name, Bool only_if_exists)); /* 61 */ - void (*xSetBackground) _ANSI_ARGS_((Display* display, GC gc, unsigned long foreground)); /* 62 */ - void (*xSetForeground) _ANSI_ARGS_((Display* display, GC gc, unsigned long foreground)); /* 63 */ - void (*xSetClipMask) _ANSI_ARGS_((Display* display, GC gc, Pixmap pixmap)); /* 64 */ - void (*xSetClipOrigin) _ANSI_ARGS_((Display* display, GC gc, int clip_x_origin, int clip_y_origin)); /* 65 */ - void (*xSetTSOrigin) _ANSI_ARGS_((Display* display, GC gc, int ts_x_origin, int ts_y_origin)); /* 66 */ - void (*xChangeGC) _ANSI_ARGS_((Display * d, GC gc, unsigned long mask, XGCValues * values)); /* 67 */ - void (*xSetFont) _ANSI_ARGS_((Display * display, GC gc, Font font)); /* 68 */ - void (*xSetArcMode) _ANSI_ARGS_((Display * display, GC gc, int arc_mode)); /* 69 */ - void (*xSetStipple) _ANSI_ARGS_((Display * display, GC gc, Pixmap stipple)); /* 70 */ - void (*xSetFillRule) _ANSI_ARGS_((Display * display, GC gc, int fill_rule)); /* 71 */ - void (*xSetFillStyle) _ANSI_ARGS_((Display * display, GC gc, int fill_style)); /* 72 */ - void (*xSetFunction) _ANSI_ARGS_((Display * display, GC gc, int function)); /* 73 */ - void (*xSetLineAttributes) _ANSI_ARGS_((Display * display, GC gc, unsigned int line_width, int line_style, int cap_style, int join_style)); /* 74 */ - int (*_XInitImageFuncPtrs) _ANSI_ARGS_((XImage * image)); /* 75 */ - XIC (*xCreateIC) _ANSI_ARGS_((void)); /* 76 */ - XVisualInfo * (*xGetVisualInfo) _ANSI_ARGS_((Display* display, long vinfo_mask, XVisualInfo* vinfo_template, int* nitems_return)); /* 77 */ - void (*xSetWMClientMachine) _ANSI_ARGS_((Display* display, Window w, XTextProperty* text_prop)); /* 78 */ - Status (*xStringListToTextProperty) _ANSI_ARGS_((char** list, int count, XTextProperty* text_prop_return)); /* 79 */ - void (*xDrawSegments) _ANSI_ARGS_((Display * display, Drawable d, GC gc, XSegment * segments, int nsegments)); /* 80 */ - void (*xForceScreenSaver) _ANSI_ARGS_((Display* display, int mode)); /* 81 */ - void (*xDrawLine) _ANSI_ARGS_((Display* d, Drawable dr, GC g, int x1, int y1, int x2, int y2)); /* 82 */ - void (*xFillRectangle) _ANSI_ARGS_((Display* display, Drawable d, GC gc, int x, int y, unsigned int width, unsigned int height)); /* 83 */ - void (*xClearWindow) _ANSI_ARGS_((Display* d, Window w)); /* 84 */ - void (*xDrawPoint) _ANSI_ARGS_((Display* display, Drawable d, GC gc, int x, int y)); /* 85 */ - void (*xDrawPoints) _ANSI_ARGS_((Display* display, Drawable d, GC gc, XPoint * points, int npoints, int mode)); /* 86 */ - void (*xWarpPointer) _ANSI_ARGS_((Display* display, Window src_w, Window dest_w, int src_x, int src_y, unsigned int src_width, unsigned int src_height, int dest_x, int dest_y)); /* 87 */ - void (*xQueryColor) _ANSI_ARGS_((Display * display, Colormap colormap, XColor * def_in_out)); /* 88 */ - void (*xQueryColors) _ANSI_ARGS_((Display * display, Colormap colormap, XColor * defs_in_out, int ncolors)); /* 89 */ - Status (*xQueryTree) _ANSI_ARGS_((Display* d, Window w1, Window* w2, Window* w3, Window** w4, unsigned int* ui)); /* 90 */ -#endif /* MAC_TCL */ -#ifdef MAC_OSX_TK - void (*xSetDashes) _ANSI_ARGS_((Display* display, GC gc, int dash_offset, _Xconst char* dash_list, int n)); /* 0 */ - XModifierKeymap* (*xGetModifierMapping) _ANSI_ARGS_((Display* d)); /* 1 */ - XImage * (*xCreateImage) _ANSI_ARGS_((Display* d, Visual* v, unsigned int ui1, int i1, int i2, char* cp, unsigned int ui2, unsigned int ui3, int i3, int i4)); /* 2 */ - XImage * (*xGetImage) _ANSI_ARGS_((Display* d, Drawable dr, int i1, int i2, unsigned int ui1, unsigned int ui2, unsigned long ul, int i3)); /* 3 */ - char * (*xGetAtomName) _ANSI_ARGS_((Display* d, Atom a)); /* 4 */ + Bool (*xFilterEvent) _ANSI_ARGS_((XEvent *x, Window w)); /* 78 */ + int (*xmbLookupString) _ANSI_ARGS_((XIC xi, XKeyPressedEvent *xk, char *c, int i, KeySym *k, Status *s)); /* 79 */ + int (*tkPutImage) _ANSI_ARGS_((unsigned long *colors, int ncolors, Display *display, Drawable d, GC gc, XImage *image, int src_x, int src_y, int dest_x, int dest_y, unsigned int width, unsigned int height)); /* 80 */ + VOID *reserved81; + Status (*xParseColor) _ANSI_ARGS_((Display *display, Colormap map, _Xconst char *spec, XColor *colorPtr)); /* 82 */ + GC (*xCreateGC) _ANSI_ARGS_((Display *display, Drawable d, unsigned long valuemask, XGCValues *values)); /* 83 */ + int (*xFreeGC) _ANSI_ARGS_((Display *display, GC gc)); /* 84 */ + Atom (*xInternAtom) _ANSI_ARGS_((Display *display, _Xconst char *atom_name, Bool only_if_exists)); /* 85 */ + int (*xSetBackground) _ANSI_ARGS_((Display *display, GC gc, unsigned long foreground)); /* 86 */ + int (*xSetForeground) _ANSI_ARGS_((Display *display, GC gc, unsigned long foreground)); /* 87 */ + int (*xSetClipMask) _ANSI_ARGS_((Display *display, GC gc, Pixmap pixmap)); /* 88 */ + int (*xSetClipOrigin) _ANSI_ARGS_((Display *display, GC gc, int clip_x_origin, int clip_y_origin)); /* 89 */ + int (*xSetTSOrigin) _ANSI_ARGS_((Display *display, GC gc, int ts_x_origin, int ts_y_origin)); /* 90 */ + int (*xChangeGC) _ANSI_ARGS_((Display *d, GC gc, unsigned long mask, XGCValues *values)); /* 91 */ + int (*xSetFont) _ANSI_ARGS_((Display *display, GC gc, Font font)); /* 92 */ + int (*xSetArcMode) _ANSI_ARGS_((Display *display, GC gc, int arc_mode)); /* 93 */ + int (*xSetStipple) _ANSI_ARGS_((Display *display, GC gc, Pixmap stipple)); /* 94 */ + int (*xSetFillRule) _ANSI_ARGS_((Display *display, GC gc, int fill_rule)); /* 95 */ + int (*xSetFillStyle) _ANSI_ARGS_((Display *display, GC gc, int fill_style)); /* 96 */ + int (*xSetFunction) _ANSI_ARGS_((Display *display, GC gc, int function)); /* 97 */ + int (*xSetLineAttributes) _ANSI_ARGS_((Display *display, GC gc, unsigned int line_width, int line_style, int cap_style, int join_style)); /* 98 */ + int (*_XInitImageFuncPtrs) _ANSI_ARGS_((XImage *image)); /* 99 */ + XIC (*xCreateIC) _ANSI_ARGS_((XIM xim, ...)); /* 100 */ + XVisualInfo * (*xGetVisualInfo) _ANSI_ARGS_((Display *display, long vinfo_mask, XVisualInfo *vinfo_template, int *nitems_return)); /* 101 */ + void (*xSetWMClientMachine) _ANSI_ARGS_((Display *display, Window w, XTextProperty *text_prop)); /* 102 */ + Status (*xStringListToTextProperty) _ANSI_ARGS_((char **list, int count, XTextProperty *text_prop_return)); /* 103 */ + int (*xDrawLine) _ANSI_ARGS_((Display *d, Drawable dr, GC g, int x1, int y1, int x2, int y2)); /* 104 */ + int (*xWarpPointer) _ANSI_ARGS_((Display *d, Window s, Window dw, int sx, int sy, unsigned int sw, unsigned int sh, int dx, int dy)); /* 105 */ + int (*xFillRectangle) _ANSI_ARGS_((Display *display, Drawable d, GC gc, int x, int y, unsigned int width, unsigned int height)); /* 106 */ + int (*xFlush) _ANSI_ARGS_((Display *display)); /* 107 */ + int (*xGrabServer) _ANSI_ARGS_((Display *display)); /* 108 */ + int (*xUngrabServer) _ANSI_ARGS_((Display *display)); /* 109 */ + int (*xFree) _ANSI_ARGS_((VOID *data)); /* 110 */ + int (*xNoOp) _ANSI_ARGS_((Display *display)); /* 111 */ + XAfterFunction (*xSynchronize) _ANSI_ARGS_((Display *display, Bool onoff)); /* 112 */ + int (*xSync) _ANSI_ARGS_((Display *display, Bool discard)); /* 113 */ + VisualID (*xVisualIDFromVisual) _ANSI_ARGS_((Visual *visual)); /* 114 */ +#endif /* WIN */ +#ifdef MAC_OSX_TK /* AQUA */ + int (*xSetDashes) _ANSI_ARGS_((Display *display, GC gc, int dash_offset, _Xconst char *dash_list, int n)); /* 0 */ + XModifierKeymap * (*xGetModifierMapping) _ANSI_ARGS_((Display *d)); /* 1 */ + XImage * (*xCreateImage) _ANSI_ARGS_((Display *d, Visual *v, unsigned int ui1, int i1, int i2, char *cp, unsigned int ui2, unsigned int ui3, int i3, int i4)); /* 2 */ + XImage * (*xGetImage) _ANSI_ARGS_((Display *d, Drawable dr, int i1, int i2, unsigned int ui1, unsigned int ui2, unsigned long ul, int i3)); /* 3 */ + char * (*xGetAtomName) _ANSI_ARGS_((Display *d, Atom a)); /* 4 */ char * (*xKeysymToString) _ANSI_ARGS_((KeySym k)); /* 5 */ - Colormap (*xCreateColormap) _ANSI_ARGS_((Display* d, Window w, Visual* v, int i)); /* 6 */ + Colormap (*xCreateColormap) _ANSI_ARGS_((Display *d, Window w, Visual *v, int i)); /* 6 */ GContext (*xGContextFromGC) _ANSI_ARGS_((GC g)); /* 7 */ - KeySym (*xKeycodeToKeysym) _ANSI_ARGS_((Display* d, KeyCode k, int i)); /* 8 */ - KeySym (*xStringToKeysym) _ANSI_ARGS_((_Xconst char* c)); /* 9 */ - Window (*xRootWindow) _ANSI_ARGS_((Display* d, int i)); /* 10 */ + KeySym (*xKeycodeToKeysym) _ANSI_ARGS_((Display *d, KeyCode k, int i)); /* 8 */ + KeySym (*xStringToKeysym) _ANSI_ARGS_((_Xconst char *c)); /* 9 */ + Window (*xRootWindow) _ANSI_ARGS_((Display *d, int i)); /* 10 */ XErrorHandler (*xSetErrorHandler) _ANSI_ARGS_((XErrorHandler x)); /* 11 */ - Status (*xAllocColor) _ANSI_ARGS_((Display* d, Colormap c, XColor* xp)); /* 12 */ - void (*xBell) _ANSI_ARGS_((Display* d, int i)); /* 13 */ - void (*xChangeProperty) _ANSI_ARGS_((Display* d, Window w, Atom a1, Atom a2, int i1, int i2, _Xconst unsigned char* c, int i3)); /* 14 */ - void (*xChangeWindowAttributes) _ANSI_ARGS_((Display* d, Window w, unsigned long ul, XSetWindowAttributes* x)); /* 15 */ - void (*xConfigureWindow) _ANSI_ARGS_((Display* d, Window w, unsigned int i, XWindowChanges* x)); /* 16 */ - void (*xCopyArea) _ANSI_ARGS_((Display* d, Drawable dr1, Drawable dr2, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2, int i3, int i4)); /* 17 */ - void (*xCopyPlane) _ANSI_ARGS_((Display* d, Drawable dr1, Drawable dr2, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2, int i3, int i4, unsigned long ul)); /* 18 */ - Pixmap (*xCreateBitmapFromData) _ANSI_ARGS_((Display* display, Drawable d, _Xconst char* data, unsigned int width, unsigned int height)); /* 19 */ - void (*xDefineCursor) _ANSI_ARGS_((Display* d, Window w, Cursor c)); /* 20 */ - void (*xDestroyWindow) _ANSI_ARGS_((Display* d, Window w)); /* 21 */ - void (*xDrawArc) _ANSI_ARGS_((Display* d, Drawable dr, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2, int i3, int i4)); /* 22 */ - void (*xDrawLines) _ANSI_ARGS_((Display* d, Drawable dr, GC g, XPoint* x, int i1, int i2)); /* 23 */ - void (*xDrawRectangle) _ANSI_ARGS_((Display* d, Drawable dr, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2)); /* 24 */ - void (*xFillArc) _ANSI_ARGS_((Display* d, Drawable dr, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2, int i3, int i4)); /* 25 */ - void (*xFillPolygon) _ANSI_ARGS_((Display* d, Drawable dr, GC g, XPoint* x, int i1, int i2, int i3)); /* 26 */ - void (*xFillRectangles) _ANSI_ARGS_((Display* d, Drawable dr, GC g, XRectangle* x, int i)); /* 27 */ - void (*xFreeColormap) _ANSI_ARGS_((Display* d, Colormap c)); /* 28 */ - void (*xFreeColors) _ANSI_ARGS_((Display* d, Colormap c, unsigned long* ulp, int i, unsigned long ul)); /* 29 */ - void (*xFreeModifiermap) _ANSI_ARGS_((XModifierKeymap* x)); /* 30 */ - Status (*xGetGeometry) _ANSI_ARGS_((Display* d, Drawable dr, Window* w, int* i1, int* i2, unsigned int* ui1, unsigned int* ui2, unsigned int* ui3, unsigned int* ui4)); /* 31 */ - int (*xGetWindowProperty) _ANSI_ARGS_((Display* d, Window w, Atom a1, long l1, long l2, Bool b, Atom a2, Atom* ap, int* ip, unsigned long* ulp1, unsigned long* ulp2, unsigned char** cpp)); /* 32 */ - int (*xGrabKeyboard) _ANSI_ARGS_((Display* d, Window w, Bool b, int i1, int i2, Time t)); /* 33 */ - int (*xGrabPointer) _ANSI_ARGS_((Display* d, Window w1, Bool b, unsigned int ui, int i1, int i2, Window w2, Cursor c, Time t)); /* 34 */ - KeyCode (*xKeysymToKeycode) _ANSI_ARGS_((Display* d, KeySym k)); /* 35 */ - void (*xMapWindow) _ANSI_ARGS_((Display* d, Window w)); /* 36 */ - void (*xMoveResizeWindow) _ANSI_ARGS_((Display* d, Window w, int i1, int i2, unsigned int ui1, unsigned int ui2)); /* 37 */ - void (*xMoveWindow) _ANSI_ARGS_((Display* d, Window w, int i1, int i2)); /* 38 */ - Bool (*xQueryPointer) _ANSI_ARGS_((Display* d, Window w1, Window* w2, Window* w3, int* i1, int* i2, int* i3, int* i4, unsigned int* ui)); /* 39 */ - void (*xRaiseWindow) _ANSI_ARGS_((Display* d, Window w)); /* 40 */ - void (*xRefreshKeyboardMapping) _ANSI_ARGS_((XMappingEvent* x)); /* 41 */ - void (*xResizeWindow) _ANSI_ARGS_((Display* d, Window w, unsigned int ui1, unsigned int ui2)); /* 42 */ - void (*xSelectInput) _ANSI_ARGS_((Display* d, Window w, long l)); /* 43 */ - Status (*xSendEvent) _ANSI_ARGS_((Display* d, Window w, Bool b, long l, XEvent* x)); /* 44 */ - void (*xSetIconName) _ANSI_ARGS_((Display* d, Window w, _Xconst char* c)); /* 45 */ - void (*xSetInputFocus) _ANSI_ARGS_((Display* d, Window w, int i, Time t)); /* 46 */ - void (*xSetSelectionOwner) _ANSI_ARGS_((Display* d, Atom a, Window w, Time t)); /* 47 */ - void (*xSetWindowBackground) _ANSI_ARGS_((Display* d, Window w, unsigned long ul)); /* 48 */ - void (*xSetWindowBackgroundPixmap) _ANSI_ARGS_((Display* d, Window w, Pixmap p)); /* 49 */ - void (*xSetWindowBorder) _ANSI_ARGS_((Display* d, Window w, unsigned long ul)); /* 50 */ - void (*xSetWindowBorderPixmap) _ANSI_ARGS_((Display* d, Window w, Pixmap p)); /* 51 */ - void (*xSetWindowBorderWidth) _ANSI_ARGS_((Display* d, Window w, unsigned int ui)); /* 52 */ - void (*xSetWindowColormap) _ANSI_ARGS_((Display* d, Window w, Colormap c)); /* 53 */ - void (*xUngrabKeyboard) _ANSI_ARGS_((Display* d, Time t)); /* 54 */ - void (*xUngrabPointer) _ANSI_ARGS_((Display* d, Time t)); /* 55 */ - void (*xUnmapWindow) _ANSI_ARGS_((Display* d, Window w)); /* 56 */ - void (*tkPutImage) _ANSI_ARGS_((unsigned long * colors, int ncolors, Display* display, Drawable d, GC gc, XImage* image, int src_x, int src_y, int dest_x, int dest_y, unsigned int width, unsigned int height)); /* 57 */ - Status (*xParseColor) _ANSI_ARGS_((Display * display, Colormap map, _Xconst char* spec, XColor * colorPtr)); /* 58 */ - GC (*xCreateGC) _ANSI_ARGS_((Display* display, Drawable d, unsigned long valuemask, XGCValues* values)); /* 59 */ - void (*xFreeGC) _ANSI_ARGS_((Display* display, GC gc)); /* 60 */ - Atom (*xInternAtom) _ANSI_ARGS_((Display* display, _Xconst char* atom_name, Bool only_if_exists)); /* 61 */ - void (*xSetBackground) _ANSI_ARGS_((Display* display, GC gc, unsigned long foreground)); /* 62 */ - void (*xSetForeground) _ANSI_ARGS_((Display* display, GC gc, unsigned long foreground)); /* 63 */ - void (*xSetClipMask) _ANSI_ARGS_((Display* display, GC gc, Pixmap pixmap)); /* 64 */ - void (*xSetClipOrigin) _ANSI_ARGS_((Display* display, GC gc, int clip_x_origin, int clip_y_origin)); /* 65 */ - void (*xSetTSOrigin) _ANSI_ARGS_((Display* display, GC gc, int ts_x_origin, int ts_y_origin)); /* 66 */ - void (*xChangeGC) _ANSI_ARGS_((Display * d, GC gc, unsigned long mask, XGCValues * values)); /* 67 */ - void (*xSetFont) _ANSI_ARGS_((Display * display, GC gc, Font font)); /* 68 */ - void (*xSetArcMode) _ANSI_ARGS_((Display * display, GC gc, int arc_mode)); /* 69 */ - void (*xSetStipple) _ANSI_ARGS_((Display * display, GC gc, Pixmap stipple)); /* 70 */ - void (*xSetFillRule) _ANSI_ARGS_((Display * display, GC gc, int fill_rule)); /* 71 */ - void (*xSetFillStyle) _ANSI_ARGS_((Display * display, GC gc, int fill_style)); /* 72 */ - void (*xSetFunction) _ANSI_ARGS_((Display * display, GC gc, int function)); /* 73 */ - void (*xSetLineAttributes) _ANSI_ARGS_((Display * display, GC gc, unsigned int line_width, int line_style, int cap_style, int join_style)); /* 74 */ - int (*_XInitImageFuncPtrs) _ANSI_ARGS_((XImage * image)); /* 75 */ + Status (*xAllocColor) _ANSI_ARGS_((Display *d, Colormap c, XColor *xp)); /* 12 */ + int (*xBell) _ANSI_ARGS_((Display *d, int i)); /* 13 */ + void (*xChangeProperty) _ANSI_ARGS_((Display *d, Window w, Atom a1, Atom a2, int i1, int i2, _Xconst unsigned char *c, int i3)); /* 14 */ + void (*xChangeWindowAttributes) _ANSI_ARGS_((Display *d, Window w, unsigned long ul, XSetWindowAttributes *x)); /* 15 */ + void (*xConfigureWindow) _ANSI_ARGS_((Display *d, Window w, unsigned int i, XWindowChanges *x)); /* 16 */ + void (*xCopyArea) _ANSI_ARGS_((Display *d, Drawable dr1, Drawable dr2, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2, int i3, int i4)); /* 17 */ + void (*xCopyPlane) _ANSI_ARGS_((Display *d, Drawable dr1, Drawable dr2, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2, int i3, int i4, unsigned long ul)); /* 18 */ + Pixmap (*xCreateBitmapFromData) _ANSI_ARGS_((Display *display, Drawable d, _Xconst char *data, unsigned int width, unsigned int height)); /* 19 */ + int (*xDefineCursor) _ANSI_ARGS_((Display *d, Window w, Cursor c)); /* 20 */ + void (*xDestroyWindow) _ANSI_ARGS_((Display *d, Window w)); /* 21 */ + void (*xDrawArc) _ANSI_ARGS_((Display *d, Drawable dr, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2, int i3, int i4)); /* 22 */ + int (*xDrawLines) _ANSI_ARGS_((Display *d, Drawable dr, GC g, XPoint *x, int i1, int i2)); /* 23 */ + void (*xDrawRectangle) _ANSI_ARGS_((Display *d, Drawable dr, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2)); /* 24 */ + void (*xFillArc) _ANSI_ARGS_((Display *d, Drawable dr, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2, int i3, int i4)); /* 25 */ + void (*xFillPolygon) _ANSI_ARGS_((Display *d, Drawable dr, GC g, XPoint *x, int i1, int i2, int i3)); /* 26 */ + int (*xFillRectangles) _ANSI_ARGS_((Display *d, Drawable dr, GC g, XRectangle *x, int i)); /* 27 */ + int (*xFreeColormap) _ANSI_ARGS_((Display *d, Colormap c)); /* 28 */ + int (*xFreeColors) _ANSI_ARGS_((Display *d, Colormap c, unsigned long *ulp, int i, unsigned long ul)); /* 29 */ + int (*xFreeModifiermap) _ANSI_ARGS_((XModifierKeymap *x)); /* 30 */ + Status (*xGetGeometry) _ANSI_ARGS_((Display *d, Drawable dr, Window *w, int *i1, int *i2, unsigned int *ui1, unsigned int *ui2, unsigned int *ui3, unsigned int *ui4)); /* 31 */ + int (*xGetWindowProperty) _ANSI_ARGS_((Display *d, Window w, Atom a1, long l1, long l2, Bool b, Atom a2, Atom *ap, int *ip, unsigned long *ulp1, unsigned long *ulp2, unsigned char **cpp)); /* 32 */ + int (*xGrabKeyboard) _ANSI_ARGS_((Display *d, Window w, Bool b, int i1, int i2, Time t)); /* 33 */ + int (*xGrabPointer) _ANSI_ARGS_((Display *d, Window w1, Bool b, unsigned int ui, int i1, int i2, Window w2, Cursor c, Time t)); /* 34 */ + KeyCode (*xKeysymToKeycode) _ANSI_ARGS_((Display *d, KeySym k)); /* 35 */ + void (*xMapWindow) _ANSI_ARGS_((Display *d, Window w)); /* 36 */ + void (*xMoveResizeWindow) _ANSI_ARGS_((Display *d, Window w, int i1, int i2, unsigned int ui1, unsigned int ui2)); /* 37 */ + void (*xMoveWindow) _ANSI_ARGS_((Display *d, Window w, int i1, int i2)); /* 38 */ + Bool (*xQueryPointer) _ANSI_ARGS_((Display *d, Window w1, Window *w2, Window *w3, int *i1, int *i2, int *i3, int *i4, unsigned int *ui)); /* 39 */ + void (*xRaiseWindow) _ANSI_ARGS_((Display *d, Window w)); /* 40 */ + void (*xRefreshKeyboardMapping) _ANSI_ARGS_((XMappingEvent *x)); /* 41 */ + void (*xResizeWindow) _ANSI_ARGS_((Display *d, Window w, unsigned int ui1, unsigned int ui2)); /* 42 */ + void (*xSelectInput) _ANSI_ARGS_((Display *d, Window w, long l)); /* 43 */ + Status (*xSendEvent) _ANSI_ARGS_((Display *d, Window w, Bool b, long l, XEvent *x)); /* 44 */ + void (*xSetIconName) _ANSI_ARGS_((Display *d, Window w, _Xconst char *c)); /* 45 */ + void (*xSetInputFocus) _ANSI_ARGS_((Display *d, Window w, int i, Time t)); /* 46 */ + int (*xSetSelectionOwner) _ANSI_ARGS_((Display *d, Atom a, Window w, Time t)); /* 47 */ + void (*xSetWindowBackground) _ANSI_ARGS_((Display *d, Window w, unsigned long ul)); /* 48 */ + void (*xSetWindowBackgroundPixmap) _ANSI_ARGS_((Display *d, Window w, Pixmap p)); /* 49 */ + void (*xSetWindowBorder) _ANSI_ARGS_((Display *d, Window w, unsigned long ul)); /* 50 */ + void (*xSetWindowBorderPixmap) _ANSI_ARGS_((Display *d, Window w, Pixmap p)); /* 51 */ + void (*xSetWindowBorderWidth) _ANSI_ARGS_((Display *d, Window w, unsigned int ui)); /* 52 */ + void (*xSetWindowColormap) _ANSI_ARGS_((Display *d, Window w, Colormap c)); /* 53 */ + void (*xUngrabKeyboard) _ANSI_ARGS_((Display *d, Time t)); /* 54 */ + int (*xUngrabPointer) _ANSI_ARGS_((Display *d, Time t)); /* 55 */ + void (*xUnmapWindow) _ANSI_ARGS_((Display *d, Window w)); /* 56 */ + int (*tkPutImage) _ANSI_ARGS_((unsigned long *colors, int ncolors, Display *display, Drawable d, GC gc, XImage *image, int src_x, int src_y, int dest_x, int dest_y, unsigned int width, unsigned int height)); /* 57 */ + Status (*xParseColor) _ANSI_ARGS_((Display *display, Colormap map, _Xconst char *spec, XColor *colorPtr)); /* 58 */ + GC (*xCreateGC) _ANSI_ARGS_((Display *display, Drawable d, unsigned long valuemask, XGCValues *values)); /* 59 */ + int (*xFreeGC) _ANSI_ARGS_((Display *display, GC gc)); /* 60 */ + Atom (*xInternAtom) _ANSI_ARGS_((Display *display, _Xconst char *atom_name, Bool only_if_exists)); /* 61 */ + int (*xSetBackground) _ANSI_ARGS_((Display *display, GC gc, unsigned long foreground)); /* 62 */ + int (*xSetForeground) _ANSI_ARGS_((Display *display, GC gc, unsigned long foreground)); /* 63 */ + int (*xSetClipMask) _ANSI_ARGS_((Display *display, GC gc, Pixmap pixmap)); /* 64 */ + int (*xSetClipOrigin) _ANSI_ARGS_((Display *display, GC gc, int clip_x_origin, int clip_y_origin)); /* 65 */ + int (*xSetTSOrigin) _ANSI_ARGS_((Display *display, GC gc, int ts_x_origin, int ts_y_origin)); /* 66 */ + int (*xChangeGC) _ANSI_ARGS_((Display *d, GC gc, unsigned long mask, XGCValues *values)); /* 67 */ + int (*xSetFont) _ANSI_ARGS_((Display *display, GC gc, Font font)); /* 68 */ + int (*xSetArcMode) _ANSI_ARGS_((Display *display, GC gc, int arc_mode)); /* 69 */ + int (*xSetStipple) _ANSI_ARGS_((Display *display, GC gc, Pixmap stipple)); /* 70 */ + int (*xSetFillRule) _ANSI_ARGS_((Display *display, GC gc, int fill_rule)); /* 71 */ + int (*xSetFillStyle) _ANSI_ARGS_((Display *display, GC gc, int fill_style)); /* 72 */ + int (*xSetFunction) _ANSI_ARGS_((Display *display, GC gc, int function)); /* 73 */ + int (*xSetLineAttributes) _ANSI_ARGS_((Display *display, GC gc, unsigned int line_width, int line_style, int cap_style, int join_style)); /* 74 */ + int (*_XInitImageFuncPtrs) _ANSI_ARGS_((XImage *image)); /* 75 */ XIC (*xCreateIC) _ANSI_ARGS_((void)); /* 76 */ - XVisualInfo * (*xGetVisualInfo) _ANSI_ARGS_((Display* display, long vinfo_mask, XVisualInfo* vinfo_template, int* nitems_return)); /* 77 */ - void (*xSetWMClientMachine) _ANSI_ARGS_((Display* display, Window w, XTextProperty* text_prop)); /* 78 */ - Status (*xStringListToTextProperty) _ANSI_ARGS_((char** list, int count, XTextProperty* text_prop_return)); /* 79 */ - void (*xDrawSegments) _ANSI_ARGS_((Display * display, Drawable d, GC gc, XSegment * segments, int nsegments)); /* 80 */ - void (*xForceScreenSaver) _ANSI_ARGS_((Display* display, int mode)); /* 81 */ - void (*xDrawLine) _ANSI_ARGS_((Display* d, Drawable dr, GC g, int x1, int y1, int x2, int y2)); /* 82 */ - void (*xFillRectangle) _ANSI_ARGS_((Display* display, Drawable d, GC gc, int x, int y, unsigned int width, unsigned int height)); /* 83 */ - void (*xClearWindow) _ANSI_ARGS_((Display* d, Window w)); /* 84 */ - void (*xDrawPoint) _ANSI_ARGS_((Display* display, Drawable d, GC gc, int x, int y)); /* 85 */ - void (*xDrawPoints) _ANSI_ARGS_((Display* display, Drawable d, GC gc, XPoint * points, int npoints, int mode)); /* 86 */ - void (*xWarpPointer) _ANSI_ARGS_((Display* display, Window src_w, Window dest_w, int src_x, int src_y, unsigned int src_width, unsigned int src_height, int dest_x, int dest_y)); /* 87 */ - void (*xQueryColor) _ANSI_ARGS_((Display * display, Colormap colormap, XColor * def_in_out)); /* 88 */ - void (*xQueryColors) _ANSI_ARGS_((Display * display, Colormap colormap, XColor * defs_in_out, int ncolors)); /* 89 */ - Status (*xQueryTree) _ANSI_ARGS_((Display* d, Window w1, Window* w2, Window* w3, Window** w4, unsigned int* ui)); /* 90 */ - int (*xSync) _ANSI_ARGS_((Display * display, Bool flag)); /* 91 */ -#endif /* MAC_OSX_TK */ + XVisualInfo * (*xGetVisualInfo) _ANSI_ARGS_((Display *display, long vinfo_mask, XVisualInfo *vinfo_template, int *nitems_return)); /* 77 */ + void (*xSetWMClientMachine) _ANSI_ARGS_((Display *display, Window w, XTextProperty *text_prop)); /* 78 */ + Status (*xStringListToTextProperty) _ANSI_ARGS_((char **list, int count, XTextProperty *text_prop_return)); /* 79 */ + void (*xDrawSegments) _ANSI_ARGS_((Display *display, Drawable d, GC gc, XSegment *segments, int nsegments)); /* 80 */ + void (*xForceScreenSaver) _ANSI_ARGS_((Display *display, int mode)); /* 81 */ + int (*xDrawLine) _ANSI_ARGS_((Display *d, Drawable dr, GC g, int x1, int y1, int x2, int y2)); /* 82 */ + int (*xFillRectangle) _ANSI_ARGS_((Display *display, Drawable d, GC gc, int x, int y, unsigned int width, unsigned int height)); /* 83 */ + void (*xClearWindow) _ANSI_ARGS_((Display *d, Window w)); /* 84 */ + void (*xDrawPoint) _ANSI_ARGS_((Display *display, Drawable d, GC gc, int x, int y)); /* 85 */ + void (*xDrawPoints) _ANSI_ARGS_((Display *display, Drawable d, GC gc, XPoint *points, int npoints, int mode)); /* 86 */ + int (*xWarpPointer) _ANSI_ARGS_((Display *display, Window src_w, Window dest_w, int src_x, int src_y, unsigned int src_width, unsigned int src_height, int dest_x, int dest_y)); /* 87 */ + void (*xQueryColor) _ANSI_ARGS_((Display *display, Colormap colormap, XColor *def_in_out)); /* 88 */ + void (*xQueryColors) _ANSI_ARGS_((Display *display, Colormap colormap, XColor *defs_in_out, int ncolors)); /* 89 */ + Status (*xQueryTree) _ANSI_ARGS_((Display *d, Window w1, Window *w2, Window *w3, Window **w4, unsigned int *ui)); /* 90 */ + int (*xSync) _ANSI_ARGS_((Display *display, Bool flag)); /* 91 */ +#endif /* AQUA */ } TkIntXlibStubs; #ifdef __cplusplus extern "C" { #endif -extern const TkIntXlibStubs *tkIntXlibStubsPtr; +extern TkIntXlibStubs *tkIntXlibStubsPtr; #ifdef __cplusplus } #endif @@ -1265,7 +905,7 @@ * Inline function declarations: */ -#ifdef __WIN32__ +#if defined(__WIN32__) || defined(__CYGWIN__) /* WIN */ #ifndef XSetDashes #define XSetDashes \ (tkIntXlibStubsPtr->xSetDashes) /* 0 */ @@ -1691,8 +1331,40 @@ #define XFillRectangle \ (tkIntXlibStubsPtr->xFillRectangle) /* 106 */ #endif -#endif /* __WIN32__ */ -#ifdef MAC_TCL +#ifndef XFlush +#define XFlush \ + (tkIntXlibStubsPtr->xFlush) /* 107 */ +#endif +#ifndef XGrabServer +#define XGrabServer \ + (tkIntXlibStubsPtr->xGrabServer) /* 108 */ +#endif +#ifndef XUngrabServer +#define XUngrabServer \ + (tkIntXlibStubsPtr->xUngrabServer) /* 109 */ +#endif +#ifndef XFree +#define XFree \ + (tkIntXlibStubsPtr->xFree) /* 110 */ +#endif +#ifndef XNoOp +#define XNoOp \ + (tkIntXlibStubsPtr->xNoOp) /* 111 */ +#endif +#ifndef XSynchronize +#define XSynchronize \ + (tkIntXlibStubsPtr->xSynchronize) /* 112 */ +#endif +#ifndef XSync +#define XSync \ + (tkIntXlibStubsPtr->xSync) /* 113 */ +#endif +#ifndef XVisualIDFromVisual +#define XVisualIDFromVisual \ + (tkIntXlibStubsPtr->xVisualIDFromVisual) /* 114 */ +#endif +#endif /* WIN */ +#ifdef MAC_OSX_TK /* AQUA */ #ifndef XSetDashes #define XSetDashes \ (tkIntXlibStubsPtr->xSetDashes) /* 0 */ @@ -2057,377 +1729,11 @@ #define XQueryTree \ (tkIntXlibStubsPtr->xQueryTree) /* 90 */ #endif -#endif /* MAC_TCL */ -#ifdef MAC_OSX_TK -#ifndef XSetDashes -#define XSetDashes \ - (tkIntXlibStubsPtr->xSetDashes) /* 0 */ -#endif -#ifndef XGetModifierMapping -#define XGetModifierMapping \ - (tkIntXlibStubsPtr->xGetModifierMapping) /* 1 */ -#endif -#ifndef XCreateImage -#define XCreateImage \ - (tkIntXlibStubsPtr->xCreateImage) /* 2 */ -#endif -#ifndef XGetImage -#define XGetImage \ - (tkIntXlibStubsPtr->xGetImage) /* 3 */ -#endif -#ifndef XGetAtomName -#define XGetAtomName \ - (tkIntXlibStubsPtr->xGetAtomName) /* 4 */ -#endif -#ifndef XKeysymToString -#define XKeysymToString \ - (tkIntXlibStubsPtr->xKeysymToString) /* 5 */ -#endif -#ifndef XCreateColormap -#define XCreateColormap \ - (tkIntXlibStubsPtr->xCreateColormap) /* 6 */ -#endif -#ifndef XGContextFromGC -#define XGContextFromGC \ - (tkIntXlibStubsPtr->xGContextFromGC) /* 7 */ -#endif -#ifndef XKeycodeToKeysym -#define XKeycodeToKeysym \ - (tkIntXlibStubsPtr->xKeycodeToKeysym) /* 8 */ -#endif -#ifndef XStringToKeysym -#define XStringToKeysym \ - (tkIntXlibStubsPtr->xStringToKeysym) /* 9 */ -#endif -#ifndef XRootWindow -#define XRootWindow \ - (tkIntXlibStubsPtr->xRootWindow) /* 10 */ -#endif -#ifndef XSetErrorHandler -#define XSetErrorHandler \ - (tkIntXlibStubsPtr->xSetErrorHandler) /* 11 */ -#endif -#ifndef XAllocColor -#define XAllocColor \ - (tkIntXlibStubsPtr->xAllocColor) /* 12 */ -#endif -#ifndef XBell -#define XBell \ - (tkIntXlibStubsPtr->xBell) /* 13 */ -#endif -#ifndef XChangeProperty -#define XChangeProperty \ - (tkIntXlibStubsPtr->xChangeProperty) /* 14 */ -#endif -#ifndef XChangeWindowAttributes -#define XChangeWindowAttributes \ - (tkIntXlibStubsPtr->xChangeWindowAttributes) /* 15 */ -#endif -#ifndef XConfigureWindow -#define XConfigureWindow \ - (tkIntXlibStubsPtr->xConfigureWindow) /* 16 */ -#endif -#ifndef XCopyArea -#define XCopyArea \ - (tkIntXlibStubsPtr->xCopyArea) /* 17 */ -#endif -#ifndef XCopyPlane -#define XCopyPlane \ - (tkIntXlibStubsPtr->xCopyPlane) /* 18 */ -#endif -#ifndef XCreateBitmapFromData -#define XCreateBitmapFromData \ - (tkIntXlibStubsPtr->xCreateBitmapFromData) /* 19 */ -#endif -#ifndef XDefineCursor -#define XDefineCursor \ - (tkIntXlibStubsPtr->xDefineCursor) /* 20 */ +#ifndef XSync +#define XSync \ + (tkIntXlibStubsPtr->xSync) /* 91 */ #endif -#ifndef XDestroyWindow -#define XDestroyWindow \ - (tkIntXlibStubsPtr->xDestroyWindow) /* 21 */ -#endif -#ifndef XDrawArc -#define XDrawArc \ - (tkIntXlibStubsPtr->xDrawArc) /* 22 */ -#endif -#ifndef XDrawLines -#define XDrawLines \ - (tkIntXlibStubsPtr->xDrawLines) /* 23 */ -#endif -#ifndef XDrawRectangle -#define XDrawRectangle \ - (tkIntXlibStubsPtr->xDrawRectangle) /* 24 */ -#endif -#ifndef XFillArc -#define XFillArc \ - (tkIntXlibStubsPtr->xFillArc) /* 25 */ -#endif -#ifndef XFillPolygon -#define XFillPolygon \ - (tkIntXlibStubsPtr->xFillPolygon) /* 26 */ -#endif -#ifndef XFillRectangles -#define XFillRectangles \ - (tkIntXlibStubsPtr->xFillRectangles) /* 27 */ -#endif -#ifndef XFreeColormap -#define XFreeColormap \ - (tkIntXlibStubsPtr->xFreeColormap) /* 28 */ -#endif -#ifndef XFreeColors -#define XFreeColors \ - (tkIntXlibStubsPtr->xFreeColors) /* 29 */ -#endif -#ifndef XFreeModifiermap -#define XFreeModifiermap \ - (tkIntXlibStubsPtr->xFreeModifiermap) /* 30 */ -#endif -#ifndef XGetGeometry -#define XGetGeometry \ - (tkIntXlibStubsPtr->xGetGeometry) /* 31 */ -#endif -#ifndef XGetWindowProperty -#define XGetWindowProperty \ - (tkIntXlibStubsPtr->xGetWindowProperty) /* 32 */ -#endif -#ifndef XGrabKeyboard -#define XGrabKeyboard \ - (tkIntXlibStubsPtr->xGrabKeyboard) /* 33 */ -#endif -#ifndef XGrabPointer -#define XGrabPointer \ - (tkIntXlibStubsPtr->xGrabPointer) /* 34 */ -#endif -#ifndef XKeysymToKeycode -#define XKeysymToKeycode \ - (tkIntXlibStubsPtr->xKeysymToKeycode) /* 35 */ -#endif -#ifndef XMapWindow -#define XMapWindow \ - (tkIntXlibStubsPtr->xMapWindow) /* 36 */ -#endif -#ifndef XMoveResizeWindow -#define XMoveResizeWindow \ - (tkIntXlibStubsPtr->xMoveResizeWindow) /* 37 */ -#endif -#ifndef XMoveWindow -#define XMoveWindow \ - (tkIntXlibStubsPtr->xMoveWindow) /* 38 */ -#endif -#ifndef XQueryPointer -#define XQueryPointer \ - (tkIntXlibStubsPtr->xQueryPointer) /* 39 */ -#endif -#ifndef XRaiseWindow -#define XRaiseWindow \ - (tkIntXlibStubsPtr->xRaiseWindow) /* 40 */ -#endif -#ifndef XRefreshKeyboardMapping -#define XRefreshKeyboardMapping \ - (tkIntXlibStubsPtr->xRefreshKeyboardMapping) /* 41 */ -#endif -#ifndef XResizeWindow -#define XResizeWindow \ - (tkIntXlibStubsPtr->xResizeWindow) /* 42 */ -#endif -#ifndef XSelectInput -#define XSelectInput \ - (tkIntXlibStubsPtr->xSelectInput) /* 43 */ -#endif -#ifndef XSendEvent -#define XSendEvent \ - (tkIntXlibStubsPtr->xSendEvent) /* 44 */ -#endif -#ifndef XSetIconName -#define XSetIconName \ - (tkIntXlibStubsPtr->xSetIconName) /* 45 */ -#endif -#ifndef XSetInputFocus -#define XSetInputFocus \ - (tkIntXlibStubsPtr->xSetInputFocus) /* 46 */ -#endif -#ifndef XSetSelectionOwner -#define XSetSelectionOwner \ - (tkIntXlibStubsPtr->xSetSelectionOwner) /* 47 */ -#endif -#ifndef XSetWindowBackground -#define XSetWindowBackground \ - (tkIntXlibStubsPtr->xSetWindowBackground) /* 48 */ -#endif -#ifndef XSetWindowBackgroundPixmap -#define XSetWindowBackgroundPixmap \ - (tkIntXlibStubsPtr->xSetWindowBackgroundPixmap) /* 49 */ -#endif -#ifndef XSetWindowBorder -#define XSetWindowBorder \ - (tkIntXlibStubsPtr->xSetWindowBorder) /* 50 */ -#endif -#ifndef XSetWindowBorderPixmap -#define XSetWindowBorderPixmap \ - (tkIntXlibStubsPtr->xSetWindowBorderPixmap) /* 51 */ -#endif -#ifndef XSetWindowBorderWidth -#define XSetWindowBorderWidth \ - (tkIntXlibStubsPtr->xSetWindowBorderWidth) /* 52 */ -#endif -#ifndef XSetWindowColormap -#define XSetWindowColormap \ - (tkIntXlibStubsPtr->xSetWindowColormap) /* 53 */ -#endif -#ifndef XUngrabKeyboard -#define XUngrabKeyboard \ - (tkIntXlibStubsPtr->xUngrabKeyboard) /* 54 */ -#endif -#ifndef XUngrabPointer -#define XUngrabPointer \ - (tkIntXlibStubsPtr->xUngrabPointer) /* 55 */ -#endif -#ifndef XUnmapWindow -#define XUnmapWindow \ - (tkIntXlibStubsPtr->xUnmapWindow) /* 56 */ -#endif -#ifndef TkPutImage -#define TkPutImage \ - (tkIntXlibStubsPtr->tkPutImage) /* 57 */ -#endif -#ifndef XParseColor -#define XParseColor \ - (tkIntXlibStubsPtr->xParseColor) /* 58 */ -#endif -#ifndef XCreateGC -#define XCreateGC \ - (tkIntXlibStubsPtr->xCreateGC) /* 59 */ -#endif -#ifndef XFreeGC -#define XFreeGC \ - (tkIntXlibStubsPtr->xFreeGC) /* 60 */ -#endif -#ifndef XInternAtom -#define XInternAtom \ - (tkIntXlibStubsPtr->xInternAtom) /* 61 */ -#endif -#ifndef XSetBackground -#define XSetBackground \ - (tkIntXlibStubsPtr->xSetBackground) /* 62 */ -#endif -#ifndef XSetForeground -#define XSetForeground \ - (tkIntXlibStubsPtr->xSetForeground) /* 63 */ -#endif -#ifndef XSetClipMask -#define XSetClipMask \ - (tkIntXlibStubsPtr->xSetClipMask) /* 64 */ -#endif -#ifndef XSetClipOrigin -#define XSetClipOrigin \ - (tkIntXlibStubsPtr->xSetClipOrigin) /* 65 */ -#endif -#ifndef XSetTSOrigin -#define XSetTSOrigin \ - (tkIntXlibStubsPtr->xSetTSOrigin) /* 66 */ -#endif -#ifndef XChangeGC -#define XChangeGC \ - (tkIntXlibStubsPtr->xChangeGC) /* 67 */ -#endif -#ifndef XSetFont -#define XSetFont \ - (tkIntXlibStubsPtr->xSetFont) /* 68 */ -#endif -#ifndef XSetArcMode -#define XSetArcMode \ - (tkIntXlibStubsPtr->xSetArcMode) /* 69 */ -#endif -#ifndef XSetStipple -#define XSetStipple \ - (tkIntXlibStubsPtr->xSetStipple) /* 70 */ -#endif -#ifndef XSetFillRule -#define XSetFillRule \ - (tkIntXlibStubsPtr->xSetFillRule) /* 71 */ -#endif -#ifndef XSetFillStyle -#define XSetFillStyle \ - (tkIntXlibStubsPtr->xSetFillStyle) /* 72 */ -#endif -#ifndef XSetFunction -#define XSetFunction \ - (tkIntXlibStubsPtr->xSetFunction) /* 73 */ -#endif -#ifndef XSetLineAttributes -#define XSetLineAttributes \ - (tkIntXlibStubsPtr->xSetLineAttributes) /* 74 */ -#endif -#ifndef _XInitImageFuncPtrs -#define _XInitImageFuncPtrs \ - (tkIntXlibStubsPtr->_XInitImageFuncPtrs) /* 75 */ -#endif -#ifndef XCreateIC -#define XCreateIC \ - (tkIntXlibStubsPtr->xCreateIC) /* 76 */ -#endif -#ifndef XGetVisualInfo -#define XGetVisualInfo \ - (tkIntXlibStubsPtr->xGetVisualInfo) /* 77 */ -#endif -#ifndef XSetWMClientMachine -#define XSetWMClientMachine \ - (tkIntXlibStubsPtr->xSetWMClientMachine) /* 78 */ -#endif -#ifndef XStringListToTextProperty -#define XStringListToTextProperty \ - (tkIntXlibStubsPtr->xStringListToTextProperty) /* 79 */ -#endif -#ifndef XDrawSegments -#define XDrawSegments \ - (tkIntXlibStubsPtr->xDrawSegments) /* 80 */ -#endif -#ifndef XForceScreenSaver -#define XForceScreenSaver \ - (tkIntXlibStubsPtr->xForceScreenSaver) /* 81 */ -#endif -#ifndef XDrawLine -#define XDrawLine \ - (tkIntXlibStubsPtr->xDrawLine) /* 82 */ -#endif -#ifndef XFillRectangle -#define XFillRectangle \ - (tkIntXlibStubsPtr->xFillRectangle) /* 83 */ -#endif -#ifndef XClearWindow -#define XClearWindow \ - (tkIntXlibStubsPtr->xClearWindow) /* 84 */ -#endif -#ifndef XDrawPoint -#define XDrawPoint \ - (tkIntXlibStubsPtr->xDrawPoint) /* 85 */ -#endif -#ifndef XDrawPoints -#define XDrawPoints \ - (tkIntXlibStubsPtr->xDrawPoints) /* 86 */ -#endif -#ifndef XWarpPointer -#define XWarpPointer \ - (tkIntXlibStubsPtr->xWarpPointer) /* 87 */ -#endif -#ifndef XQueryColor -#define XQueryColor \ - (tkIntXlibStubsPtr->xQueryColor) /* 88 */ -#endif -#ifndef XQueryColors -#define XQueryColors \ - (tkIntXlibStubsPtr->xQueryColors) /* 89 */ -#endif -#ifndef XQueryTree -#define XQueryTree \ - (tkIntXlibStubsPtr->xQueryTree) /* 90 */ -#endif -#ifndef XSync -#define XSync \ - (tkIntXlibStubsPtr->xSync) /* 91 */ -#endif -#endif /* MAC_OSX_TK */ +#endif /* AQUA */ #endif /* defined(USE_TK_STUBS) && !defined(USE_TK_STUB_PROCS) */ @@ -2436,4 +1742,65 @@ #undef TCL_STORAGE_CLASS #define TCL_STORAGE_CLASS DLLIMPORT +#if defined(__WIN32__) + +#undef XFlush +#undef XGrabServer +#undef XUngrabServer +#undef XFree +#undef XNoOp +#undef XSynchronize +#undef XSync +#undef XVisualIDFromVisual + +#if defined(USE_TK_STUBS) && !defined(USE_TK_STUB_PROCS) +/* + * The following stubs implement various calls that don't do anything + * under Windows. In win32 tclsh 8.4 and 8.5 holds: + * tkIntStubsPtr->tkBindDeadWindow != NULL + * Then the following macros don't do anything. But when running Tcl win32 + * version 8.6 or Cygwin (8.4, 8.5 or 8.6) then the functions are available in + * the stub table. The real function from the stub table will be called, + * even though it might be doing nothing. + */ + +#define XFlush(display) (tkIntStubsPtr->tkBindDeadWindow? 0: tkIntXlibStubsPtr->xFlush(display)) +#define XGrabServer(display) (tkIntStubsPtr->tkBindDeadWindow? 0: tkIntXlibStubsPtr->xGrabServer(display)) +#define XUngrabServer(display) (tkIntStubsPtr->tkBindDeadWindow? 0: tkIntXlibStubsPtr->xUngrabServer(display)) + +/* + * The following functions are implemented as macros under Windows. + */ + + +#define XFree(data) (tkIntStubsPtr->tkBindDeadWindow? ((data)? (ckfree((char *) (data)), 0): 0): tkIntXlibStubsPtr->xFree(data)) +#define XNoOp(display) (tkIntStubsPtr->tkBindDeadWindow? 0: tkIntXlibStubsPtr->xNoOp(display)) +#define XSynchronize(display, bool) (tkIntStubsPtr->tkBindDeadWindow? 0: tkIntXlibStubsPtr->xSynchronize(display, bool)) +#define XSync(display, bool) (tkIntStubsPtr->tkBindDeadWindow? 0: tkIntXlibStubsPtr->xSync(display, bool)) +#define XVisualIDFromVisual(visual) (tkIntStubsPtr->tkBindDeadWindow? ((visual)->visualid): tkIntXlibStubsPtr->xVisualIDFromVisual(visual)) + +#else /* !USE_TK_STUBS */ +/* + * The following stubs implement various calls that don't do anything + * under Windows. + */ + +#define XFlush(display) +#define XGrabServer(display) +#define XUngrabServer(display) + +/* + * The following functions are implemented as macros under Windows. + */ + +#define XFree(data) {if ((data) != NULL) ckfree((char *) (data));} +#define XNoOp(display) {display->request++;} +#define XSynchronize(display, bool) {display->request++;} +#define XSync(display, bool) {display->request++;} +#define XVisualIDFromVisual(visual) (visual->visualid) + +#endif /* !USE_TK_STUBS */ + +#endif /* __WIN32__ */ + #endif /* _TKINTXLIBDECLS */ diff -Nru critcl-3.1.9/lib/critcl/critcl_c/tcl8.4/X11/X.h critcl-3.1.17+dfsg/lib/critcl/critcl_c/tcl8.4/X11/X.h --- critcl-3.1.9/lib/critcl/critcl_c/tcl8.4/X11/X.h 2013-05-10 05:57:04.000000000 +0000 +++ critcl-3.1.17+dfsg/lib/critcl/critcl_c/tcl8.4/X11/X.h 2017-10-14 02:48:11.000000000 +0000 @@ -33,7 +33,7 @@ #define X_PROTOCOL 11 /* current protocol version */ #define X_PROTOCOL_REVISION 0 /* current minor version */ -#if defined(MAC_TCL) || defined(MAC_OSX_TK) +#if defined(MAC_OSX_TK) # define Cursor XCursor # define Region XRegion #endif @@ -669,7 +669,7 @@ #define LSBFirst 0 #define MSBFirst 1 -#if defined(MAC_TCL) || defined(MAC_OSX_TK) +#if defined(MAC_OSX_TK) # undef Cursor # undef Region #endif diff -Nru critcl-3.1.9/lib/critcl/critcl_c/tcl8.4/X11/Xlib.h critcl-3.1.17+dfsg/lib/critcl/critcl_c/tcl8.4/X11/Xlib.h --- critcl-3.1.9/lib/critcl/critcl_c/tcl8.4/X11/Xlib.h 2013-05-10 05:57:04.000000000 +0000 +++ critcl-3.1.17+dfsg/lib/critcl/critcl_c/tcl8.4/X11/Xlib.h 2017-10-14 02:48:11.000000000 +0000 @@ -27,14 +27,9 @@ #define XlibSpecificationRelease 5 -#if !defined(MAC_TCL) && !defined(MAC_OSX_TK) +#if !defined(MAC_OSX_TK) # include #endif -#ifdef MAC_TCL -# include -# define Cursor XCursor -# define Region XRegion -#endif #ifdef MAC_OSX_TK # include # define Cursor XCursor @@ -42,11 +37,7 @@ #endif /* applications should not depend on these two headers being included! */ -#ifdef MAC_TCL -#include -#else #include -#endif #ifndef X_WCHAR #ifdef X_NOT_STDC_ENV @@ -64,7 +55,7 @@ typedef char *XPointer; #define Bool int -#if defined(MAC_TCL) || defined(MAC_OSX_TK) +#if defined(MAC_OSX_TK) /* Use define rather than typedef, since may need to undefine this later */ #define Status int #else @@ -1206,7 +1197,7 @@ _XFUNCPROTOEND -#if defined(MAC_TCL) || defined(MAC_OSX_TK) +#if defined(MAC_OSX_TK) # undef Cursor # undef Region #endif diff -Nru critcl-3.1.9/lib/critcl/critcl_c/tcl8.4/X11/Xutil.h critcl-3.1.17+dfsg/lib/critcl/critcl_c/tcl8.4/X11/Xutil.h --- critcl-3.1.9/lib/critcl/critcl_c/tcl8.4/X11/Xutil.h 2013-05-10 05:57:04.000000000 +0000 +++ critcl-3.1.17+dfsg/lib/critcl/critcl_c/tcl8.4/X11/Xutil.h 2017-10-14 02:48:11.000000000 +0000 @@ -29,7 +29,7 @@ /* You must include before including this file */ -#if defined(MAC_TCL) || defined(MAC_OSX_TK) +#if defined(MAC_OSX_TK) # define Region XRegion #endif @@ -364,13 +364,13 @@ #endif ); -extern void XEmptyRegion( +extern Bool XEmptyRegion( #if NeedFunctionPrototypes Region /* r */ #endif ); -extern void XEqualRegion( +extern Bool XEqualRegion( #if NeedFunctionPrototypes Region /* r1 */, Region /* r2 */ @@ -848,7 +848,7 @@ _XFUNCPROTOEND -#if defined(MAC_TCL) || defined(MAC_OSX_TK) +#if defined(MAC_OSX_TK) # undef Region #endif diff -Nru critcl-3.1.9/lib/critcl/critcl_c/tcl8.5/tclDecls.h critcl-3.1.17+dfsg/lib/critcl/critcl_c/tcl8.5/tclDecls.h --- critcl-3.1.9/lib/critcl/critcl_c/tcl8.5/tclDecls.h 2013-05-10 05:57:04.000000000 +0000 +++ critcl-3.1.17+dfsg/lib/critcl/critcl_c/tcl8.5/tclDecls.h 2017-10-14 02:48:11.000000000 +0000 @@ -7,8 +7,6 @@ * * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tclDecls.h,v 1.130.2.2 2010/02/07 22:16:54 nijtmans Exp $ */ #ifndef _TCLDECLS @@ -80,7 +78,7 @@ #ifndef Tcl_DbCkfree_TCL_DECLARED #define Tcl_DbCkfree_TCL_DECLARED /* 7 */ -EXTERN int Tcl_DbCkfree(char *ptr, CONST char *file, int line); +EXTERN void Tcl_DbCkfree(char *ptr, CONST char *file, int line); #endif #ifndef Tcl_DbCkrealloc_TCL_DECLARED #define Tcl_DbCkrealloc_TCL_DECLARED @@ -1314,12 +1312,12 @@ #ifndef Tcl_ScanElement_TCL_DECLARED #define Tcl_ScanElement_TCL_DECLARED /* 218 */ -EXTERN int Tcl_ScanElement(CONST char *str, int *flagPtr); +EXTERN int Tcl_ScanElement(CONST char *src, int *flagPtr); #endif #ifndef Tcl_ScanCountedElement_TCL_DECLARED #define Tcl_ScanCountedElement_TCL_DECLARED /* 219 */ -EXTERN int Tcl_ScanCountedElement(CONST char *str, int length, +EXTERN int Tcl_ScanCountedElement(CONST char *src, int length, int *flagPtr); #endif #ifndef Tcl_SeekOld_TCL_DECLARED @@ -3410,6 +3408,61 @@ EXTERN void Tcl_AppendPrintfToObj(Tcl_Obj *objPtr, CONST char *format, ...); #endif +/* Slot 580 is reserved */ +/* Slot 581 is reserved */ +/* Slot 582 is reserved */ +/* Slot 583 is reserved */ +/* Slot 584 is reserved */ +/* Slot 585 is reserved */ +/* Slot 586 is reserved */ +/* Slot 587 is reserved */ +/* Slot 588 is reserved */ +/* Slot 589 is reserved */ +/* Slot 590 is reserved */ +/* Slot 591 is reserved */ +/* Slot 592 is reserved */ +/* Slot 593 is reserved */ +/* Slot 594 is reserved */ +/* Slot 595 is reserved */ +/* Slot 596 is reserved */ +/* Slot 597 is reserved */ +/* Slot 598 is reserved */ +/* Slot 599 is reserved */ +/* Slot 600 is reserved */ +/* Slot 601 is reserved */ +/* Slot 602 is reserved */ +/* Slot 603 is reserved */ +/* Slot 604 is reserved */ +/* Slot 605 is reserved */ +/* Slot 606 is reserved */ +/* Slot 607 is reserved */ +/* Slot 608 is reserved */ +/* Slot 609 is reserved */ +/* Slot 610 is reserved */ +/* Slot 611 is reserved */ +/* Slot 612 is reserved */ +/* Slot 613 is reserved */ +/* Slot 614 is reserved */ +/* Slot 615 is reserved */ +/* Slot 616 is reserved */ +/* Slot 617 is reserved */ +/* Slot 618 is reserved */ +/* Slot 619 is reserved */ +/* Slot 620 is reserved */ +/* Slot 621 is reserved */ +/* Slot 622 is reserved */ +/* Slot 623 is reserved */ +/* Slot 624 is reserved */ +/* Slot 625 is reserved */ +/* Slot 626 is reserved */ +/* Slot 627 is reserved */ +/* Slot 628 is reserved */ +/* Slot 629 is reserved */ +#ifndef TclUnusedStubEntry_TCL_DECLARED +#define TclUnusedStubEntry_TCL_DECLARED +/* 630 */ +EXTERN void TclUnusedStubEntry(void); +#endif typedef struct TclStubHooks { struct TclPlatStubs *tclPlatStubs; @@ -3428,13 +3481,13 @@ void (*tcl_Free) (char *ptr); /* 4 */ char * (*tcl_Realloc) (char *ptr, unsigned int size); /* 5 */ char * (*tcl_DbCkalloc) (unsigned int size, CONST char *file, int line); /* 6 */ - int (*tcl_DbCkfree) (char *ptr, CONST char *file, int line); /* 7 */ + void (*tcl_DbCkfree) (char *ptr, CONST char *file, int line); /* 7 */ char * (*tcl_DbCkrealloc) (char *ptr, unsigned int size, CONST char *file, int line); /* 8 */ #if !defined(__WIN32__) && !defined(MAC_OSX_TCL) /* UNIX */ void (*tcl_CreateFileHandler) (int fd, int mask, Tcl_FileProc *proc, ClientData clientData); /* 9 */ #endif /* UNIX */ -#ifdef __WIN32__ /* WIN */ - void *reserved9; +#if defined(__WIN32__) /* WIN */ + VOID *reserved9; #endif /* WIN */ #ifdef MAC_OSX_TCL /* MACOSX */ void (*tcl_CreateFileHandler) (int fd, int mask, Tcl_FileProc *proc, ClientData clientData); /* 9 */ @@ -3442,8 +3495,8 @@ #if !defined(__WIN32__) && !defined(MAC_OSX_TCL) /* UNIX */ void (*tcl_DeleteFileHandler) (int fd); /* 10 */ #endif /* UNIX */ -#ifdef __WIN32__ /* WIN */ - void *reserved10; +#if defined(__WIN32__) /* WIN */ + VOID *reserved10; #endif /* WIN */ #ifdef MAC_OSX_TCL /* MACOSX */ void (*tcl_DeleteFileHandler) (int fd); /* 10 */ @@ -3607,8 +3660,8 @@ #if !defined(__WIN32__) && !defined(MAC_OSX_TCL) /* UNIX */ int (*tcl_GetOpenFile) (Tcl_Interp *interp, CONST char *chanID, int forWriting, int checkUsage, ClientData *filePtr); /* 167 */ #endif /* UNIX */ -#ifdef __WIN32__ /* WIN */ - void *reserved167; +#if defined(__WIN32__) /* WIN */ + VOID *reserved167; #endif /* WIN */ #ifdef MAC_OSX_TCL /* MACOSX */ int (*tcl_GetOpenFile) (Tcl_Interp *interp, CONST char *chanID, int forWriting, int checkUsage, ClientData *filePtr); /* 167 */ @@ -3633,7 +3686,7 @@ int (*tcl_IsSafe) (Tcl_Interp *interp); /* 185 */ char * (*tcl_JoinPath) (int argc, CONST84 char *CONST *argv, Tcl_DString *resultPtr); /* 186 */ int (*tcl_LinkVar) (Tcl_Interp *interp, CONST char *varName, char *addr, int type); /* 187 */ - void *reserved188; + VOID *reserved188; Tcl_Channel (*tcl_MakeFileChannel) (ClientData handle, int mode); /* 189 */ int (*tcl_MakeSafe) (Tcl_Interp *interp); /* 190 */ Tcl_Channel (*tcl_MakeTcpClientChannel) (ClientData tcpSocket); /* 191 */ @@ -3663,8 +3716,8 @@ void (*tcl_RegExpRange) (Tcl_RegExp regexp, int index, CONST84 char **startPtr, CONST84 char **endPtr); /* 215 */ void (*tcl_Release) (ClientData clientData); /* 216 */ void (*tcl_ResetResult) (Tcl_Interp *interp); /* 217 */ - int (*tcl_ScanElement) (CONST char *str, int *flagPtr); /* 218 */ - int (*tcl_ScanCountedElement) (CONST char *str, int length, int *flagPtr); /* 219 */ + int (*tcl_ScanElement) (CONST char *src, int *flagPtr); /* 218 */ + int (*tcl_ScanCountedElement) (CONST char *src, int length, int *flagPtr); /* 219 */ int (*tcl_SeekOld) (Tcl_Channel chan, int offset, int mode); /* 220 */ int (*tcl_ServiceAll) (void); /* 221 */ int (*tcl_ServiceEvent) (int flags); /* 222 */ @@ -3730,7 +3783,7 @@ int (*tcl_UnstackChannel) (Tcl_Interp *interp, Tcl_Channel chan); /* 282 */ Tcl_Channel (*tcl_GetStackedChannel) (Tcl_Channel chan); /* 283 */ void (*tcl_SetMainLoop) (Tcl_MainLoopProc *proc); /* 284 */ - void *reserved285; + VOID *reserved285; void (*tcl_AppendObjToObj) (Tcl_Obj *objPtr, Tcl_Obj *appendObjPtr); /* 286 */ Tcl_Encoding (*tcl_CreateEncoding) (CONST Tcl_EncodingType *typePtr); /* 287 */ void (*tcl_CreateThreadExitHandler) (Tcl_ExitProc *proc, ClientData clientData); /* 288 */ @@ -4025,12 +4078,63 @@ int (*tcl_AppendFormatToObj) (Tcl_Interp *interp, Tcl_Obj *objPtr, CONST char *format, int objc, Tcl_Obj *CONST objv[]); /* 577 */ Tcl_Obj * (*tcl_ObjPrintf) (CONST char *format, ...); /* 578 */ void (*tcl_AppendPrintfToObj) (Tcl_Obj *objPtr, CONST char *format, ...); /* 579 */ + VOID *reserved580; + VOID *reserved581; + VOID *reserved582; + VOID *reserved583; + VOID *reserved584; + VOID *reserved585; + VOID *reserved586; + VOID *reserved587; + VOID *reserved588; + VOID *reserved589; + VOID *reserved590; + VOID *reserved591; + VOID *reserved592; + VOID *reserved593; + VOID *reserved594; + VOID *reserved595; + VOID *reserved596; + VOID *reserved597; + VOID *reserved598; + VOID *reserved599; + VOID *reserved600; + VOID *reserved601; + VOID *reserved602; + VOID *reserved603; + VOID *reserved604; + VOID *reserved605; + VOID *reserved606; + VOID *reserved607; + VOID *reserved608; + VOID *reserved609; + VOID *reserved610; + VOID *reserved611; + VOID *reserved612; + VOID *reserved613; + VOID *reserved614; + VOID *reserved615; + VOID *reserved616; + VOID *reserved617; + VOID *reserved618; + VOID *reserved619; + VOID *reserved620; + VOID *reserved621; + VOID *reserved622; + VOID *reserved623; + VOID *reserved624; + VOID *reserved625; + VOID *reserved626; + VOID *reserved627; + VOID *reserved628; + VOID *reserved629; + void (*tclUnusedStubEntry) (void); /* 630 */ } TclStubs; #ifdef __cplusplus extern "C" { #endif -extern const TclStubs *tclStubsPtr; +extern TclStubs *tclStubsPtr; #ifdef __cplusplus } #endif @@ -6379,13 +6483,81 @@ #define Tcl_AppendPrintfToObj \ (tclStubsPtr->tcl_AppendPrintfToObj) /* 579 */ #endif +/* Slot 580 is reserved */ +/* Slot 581 is reserved */ +/* Slot 582 is reserved */ +/* Slot 583 is reserved */ +/* Slot 584 is reserved */ +/* Slot 585 is reserved */ +/* Slot 586 is reserved */ +/* Slot 587 is reserved */ +/* Slot 588 is reserved */ +/* Slot 589 is reserved */ +/* Slot 590 is reserved */ +/* Slot 591 is reserved */ +/* Slot 592 is reserved */ +/* Slot 593 is reserved */ +/* Slot 594 is reserved */ +/* Slot 595 is reserved */ +/* Slot 596 is reserved */ +/* Slot 597 is reserved */ +/* Slot 598 is reserved */ +/* Slot 599 is reserved */ +/* Slot 600 is reserved */ +/* Slot 601 is reserved */ +/* Slot 602 is reserved */ +/* Slot 603 is reserved */ +/* Slot 604 is reserved */ +/* Slot 605 is reserved */ +/* Slot 606 is reserved */ +/* Slot 607 is reserved */ +/* Slot 608 is reserved */ +/* Slot 609 is reserved */ +/* Slot 610 is reserved */ +/* Slot 611 is reserved */ +/* Slot 612 is reserved */ +/* Slot 613 is reserved */ +/* Slot 614 is reserved */ +/* Slot 615 is reserved */ +/* Slot 616 is reserved */ +/* Slot 617 is reserved */ +/* Slot 618 is reserved */ +/* Slot 619 is reserved */ +/* Slot 620 is reserved */ +/* Slot 621 is reserved */ +/* Slot 622 is reserved */ +/* Slot 623 is reserved */ +/* Slot 624 is reserved */ +/* Slot 625 is reserved */ +/* Slot 626 is reserved */ +/* Slot 627 is reserved */ +/* Slot 628 is reserved */ +/* Slot 629 is reserved */ +#ifndef TclUnusedStubEntry +#define TclUnusedStubEntry \ + (tclStubsPtr->tclUnusedStubEntry) /* 630 */ +#endif #endif /* defined(USE_TCL_STUBS) && !defined(USE_TCL_STUB_PROCS) */ /* !END!: Do not edit above this line. */ +#undef TclUnusedStubEntry + #undef TCL_STORAGE_CLASS #define TCL_STORAGE_CLASS DLLIMPORT +/* + * Deprecated Tcl procedures: + */ +#if defined(USE_TCL_STUBS) && !defined(USE_TCL_STUB_PROCS) +# undef Tcl_EvalObj +# define Tcl_EvalObj(interp,objPtr) \ + Tcl_EvalObjEx((interp),(objPtr),0) +# undef Tcl_GlobalEvalObj +# define Tcl_GlobalEvalObj(interp,objPtr) \ + Tcl_EvalObjEx((interp),(objPtr),TCL_EVAL_GLOBAL) +#endif + #endif /* _TCLDECLS */ diff -Nru critcl-3.1.9/lib/critcl/critcl_c/tcl8.5/tcl.h critcl-3.1.17+dfsg/lib/critcl/critcl_c/tcl8.5/tcl.h --- critcl-3.1.9/lib/critcl/critcl_c/tcl8.5/tcl.h 2013-05-10 05:57:04.000000000 +0000 +++ critcl-3.1.17+dfsg/lib/critcl/critcl_c/tcl8.5/tcl.h 2017-10-14 02:48:11.000000000 +0000 @@ -12,8 +12,6 @@ * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tcl.h,v 1.254.2.16 2010/08/04 17:02:39 dgp Exp $ */ #ifndef _TCL @@ -60,10 +58,10 @@ #define TCL_MAJOR_VERSION 8 #define TCL_MINOR_VERSION 5 #define TCL_RELEASE_LEVEL TCL_FINAL_RELEASE -#define TCL_RELEASE_SERIAL 9 +#define TCL_RELEASE_SERIAL 13 #define TCL_VERSION "8.5" -#define TCL_PATCH_LEVEL "8.5.9" +#define TCL_PATCH_LEVEL "8.5.13" /* * The following definitions set up the proper options for Windows compilers. @@ -156,11 +154,6 @@ # define TCL_VARARGS_DEF(type, name) (type name, ...) # define TCL_VARARGS_START(type, name, list) (va_start(list, name), name) #endif -#if defined(__GNUC__) && (__GNUC__ > 2) -# define TCL_FORMAT_PRINTF(a,b) __attribute__ ((__format__ (__printf__, a, b))) -#else -# define TCL_FORMAT_PRINTF(a,b) -#endif /* * Macros used to declare a function to be exported by a DLL. Used by Windows, @@ -359,28 +352,17 @@ */ #if !defined(TCL_WIDE_INT_TYPE)&&!defined(TCL_WIDE_INT_IS_LONG) -# if defined(__GNUC__) -# define TCL_WIDE_INT_TYPE long long -# if defined(__WIN32__) && !defined(__CYGWIN__) -# define TCL_LL_MODIFIER "I64" -# else -# define TCL_LL_MODIFIER "ll" -# endif -typedef struct stat Tcl_StatBuf; -# elif defined(__WIN32__) +# if defined(__WIN32__) # define TCL_WIDE_INT_TYPE __int64 # ifdef __BORLANDC__ -typedef struct stati64 Tcl_StatBuf; # define TCL_LL_MODIFIER "L" # else /* __BORLANDC__ */ -# if _MSC_VER < 1400 || !defined(_M_IX86) -typedef struct _stati64 Tcl_StatBuf; -# else -typedef struct _stat64 Tcl_StatBuf; -# endif /* _MSC_VER < 1400 */ # define TCL_LL_MODIFIER "I64" # endif /* __BORLANDC__ */ -# else /* __WIN32__ */ +# elif defined(__GNUC__) +# define TCL_WIDE_INT_TYPE long long +# define TCL_LL_MODIFIER "ll" +# else /* ! __WIN32__ && ! __GNUC__ */ /* * Don't know what platform it is and configure hasn't discovered what is * going on for us. Try to guess... @@ -406,7 +388,6 @@ typedef unsigned TCL_WIDE_INT_TYPE Tcl_WideUInt; #ifdef TCL_WIDE_INT_IS_LONG -typedef struct stat Tcl_StatBuf; # define Tcl_WideAsLong(val) ((long)(val)) # define Tcl_LongAsWide(val) ((long)(val)) # define Tcl_WideAsDouble(val) ((double)((long)(val))) @@ -420,11 +401,6 @@ * or some other strange platform. */ # ifndef TCL_LL_MODIFIER -# ifdef HAVE_STRUCT_STAT64 -typedef struct stat64 Tcl_StatBuf; -# else -typedef struct stat Tcl_StatBuf; -# endif /* HAVE_STRUCT_STAT64 */ # define TCL_LL_MODIFIER "ll" # endif /* !TCL_LL_MODIFIER */ # define Tcl_WideAsLong(val) ((long)((Tcl_WideInt)(val))) @@ -433,6 +409,39 @@ # define Tcl_DoubleAsWide(val) ((Tcl_WideInt)((double)(val))) #endif /* TCL_WIDE_INT_IS_LONG */ +#if defined(__WIN32__) +# ifdef __BORLANDC__ + typedef struct stati64 Tcl_StatBuf; +# elif defined(_WIN64) + typedef struct __stat64 Tcl_StatBuf; +# elif (defined(_MSC_VER) && (_MSC_VER < 1400)) || defined(_USE_32BIT_TIME_T) + typedef struct _stati64 Tcl_StatBuf; +# else + typedef struct _stat32i64 Tcl_StatBuf; +# endif /* _MSC_VER < 1400 */ +#elif defined(__CYGWIN__) + typedef struct _stat32i64 { + dev_t st_dev; + unsigned short st_ino; + unsigned short st_mode; + short st_nlink; + short st_uid; + short st_gid; + /* Here is a 2-byte gap */ + dev_t st_rdev; + /* Here is a 4-byte gap */ + long long st_size; + struct {long tv_sec;} st_atim; + struct {long tv_sec;} st_mtim; + struct {long tv_sec;} st_ctim; + /* Here is a 4-byte gap */ + } Tcl_StatBuf; +#elif defined(HAVE_STRUCT_STAT64) && !defined(__APPLE__) + typedef struct stat64 Tcl_StatBuf; +#else + typedef struct stat Tcl_StatBuf; +#endif + /* * Data structures defined opaquely in this module. The definitions below just * provide dummy types. A few fields are made visible in Tcl_Interp @@ -789,10 +798,7 @@ * whether an object is shared (i.e. has reference count > 1). Note: clients * should use Tcl_DecrRefCount() when they are finished using an object, and * should never call TclFreeObj() directly. TclFreeObj() is only defined and - * made public in tcl.h to support Tcl_DecrRefCount's macro definition. Note - * also that Tcl_DecrRefCount() refers to the parameter "obj" twice. This - * means that you should avoid calling it with an expression that is expensive - * to compute or has side effects. + * made public in tcl.h to support Tcl_DecrRefCount's macro definition. */ void Tcl_IncrRefCount _ANSI_ARGS_((Tcl_Obj *objPtr)); @@ -961,8 +967,6 @@ * is safe to leave the hash unquoted when the element is not the first * element of a list, and this flag can be used by the caller to indicate * that condition. - * (Careful! If you change these flag values be sure to change the definitions - * at the front of tclUtil.c). */ #define TCL_DONT_USE_BRACES 1 @@ -2142,7 +2146,7 @@ * reflected in regcustom.h. */ -#if TCL_UTF_MAX > 3 +#if TCL_UTF_MAX > 4 /* * unsigned int isn't 100% accurate as it should be a strict 4-byte value * (perhaps wchar_t). 64-bit systems may have troubles. The size of this @@ -2308,7 +2312,12 @@ * http://c2.com/cgi/wiki?TrivialDoWhileLoop */ # define Tcl_DecrRefCount(objPtr) \ - do { if (--(objPtr)->refCount <= 0) TclFreeObj(objPtr); } while(0) + do { \ + Tcl_Obj *_objPtr = (objPtr); \ + if (--(_objPtr)->refCount <= 0) { \ + TclFreeObj(_objPtr); \ + } \ + } while(0) # define Tcl_IsShared(objPtr) \ ((objPtr)->refCount > 1) #endif @@ -2398,17 +2407,6 @@ #ifndef TCL_NO_DEPRECATED /* - * Deprecated Tcl functions: - */ - -# undef Tcl_EvalObj -# define Tcl_EvalObj(interp,objPtr) \ - Tcl_EvalObjEx((interp),(objPtr),0) -# undef Tcl_GlobalEvalObj -# define Tcl_GlobalEvalObj(interp,objPtr) \ - Tcl_EvalObjEx((interp),(objPtr),TCL_EVAL_GLOBAL) - - /* * These function have been renamed. The old names are deprecated, but we * define these macros for backwards compatibilty. */ diff -Nru critcl-3.1.9/lib/critcl/critcl_c/tcl8.5/tclPlatDecls.h critcl-3.1.17+dfsg/lib/critcl/critcl_c/tcl8.5/tclPlatDecls.h --- critcl-3.1.9/lib/critcl/critcl_c/tcl8.5/tclPlatDecls.h 2013-05-10 05:57:04.000000000 +0000 +++ critcl-3.1.17+dfsg/lib/critcl/critcl_c/tcl8.5/tclPlatDecls.h 2017-10-14 02:48:11.000000000 +0000 @@ -5,8 +5,6 @@ * * Copyright (c) 1998-1999 by Scriptics Corporation. * All rights reserved. - * - * RCS: @(#) $Id: tclPlatDecls.h,v 1.27.2.3 2010/11/16 14:57:46 nijtmans Exp $ */ #ifndef _TCLPLATDECLS @@ -24,19 +22,16 @@ #endif /* - * Pull in the typedef of TCHAR for windows. + * TCHAR is needed here for win32, so if it is not defined yet do it here. + * This way, we don't need to include just for one define. */ -#if defined(__WIN32__) && !defined(_TCHAR_DEFINED) -# include -# ifndef _TCHAR_DEFINED - /* Borland seems to forget to set this. */ - typedef _TCHAR TCHAR; -# define _TCHAR_DEFINED -# endif -# if defined(_MSC_VER) && defined(__STDC__) - /* VS2005 SP1 misses this. See [Bug #3110161] */ - typedef _TCHAR TCHAR; +#if (defined(_WIN32) || defined(__CYGWIN__)) && !defined(_TCHAR_DEFINED) +# if defined(_UNICODE) + typedef wchar_t TCHAR; +# else + typedef char TCHAR; # endif +# define _TCHAR_DEFINED #endif /* !BEGIN!: Do not edit below this line. */ @@ -45,7 +40,7 @@ * Exported function declarations: */ -#ifdef __WIN32__ /* WIN */ +#if defined(__WIN32__) || defined(__CYGWIN__) /* WIN */ #ifndef Tcl_WinUtfToTChar_TCL_DECLARED #define Tcl_WinUtfToTChar_TCL_DECLARED /* 0 */ @@ -82,7 +77,7 @@ int magic; struct TclPlatStubHooks *hooks; -#ifdef __WIN32__ /* WIN */ +#if defined(__WIN32__) || defined(__CYGWIN__) /* WIN */ TCHAR * (*tcl_WinUtfToTChar) (CONST char *str, int len, Tcl_DString *dsPtr); /* 0 */ char * (*tcl_WinTCharToUtf) (CONST TCHAR *str, int len, Tcl_DString *dsPtr); /* 1 */ #endif /* WIN */ @@ -95,7 +90,7 @@ #ifdef __cplusplus extern "C" { #endif -extern const TclPlatStubs *tclPlatStubsPtr; +extern TclPlatStubs *tclPlatStubsPtr; #ifdef __cplusplus } #endif @@ -106,7 +101,7 @@ * Inline function declarations: */ -#ifdef __WIN32__ /* WIN */ +#if defined(__WIN32__) || defined(__CYGWIN__) /* WIN */ #ifndef Tcl_WinUtfToTChar #define Tcl_WinUtfToTChar \ (tclPlatStubsPtr->tcl_WinUtfToTChar) /* 0 */ diff -Nru critcl-3.1.9/lib/critcl/critcl_c/tcl8.5/tkDecls.h critcl-3.1.17+dfsg/lib/critcl/critcl_c/tcl8.5/tkDecls.h --- critcl-3.1.9/lib/critcl/critcl_c/tcl8.5/tkDecls.h 2013-05-10 05:57:04.000000000 +0000 +++ critcl-3.1.17+dfsg/lib/critcl/critcl_c/tcl8.5/tkDecls.h 2017-10-14 02:48:11.000000000 +0000 @@ -7,8 +7,6 @@ * * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tkDecls.h,v 1.30.4.1 2010/02/07 23:24:13 nijtmans Exp $ */ #ifndef _TKDECLS @@ -27,6 +25,10 @@ /* !BEGIN!: Do not edit below this line. */ +#ifdef __cplusplus +extern "C" { +#endif + /* * Exported function declarations: */ @@ -1676,6 +1678,12 @@ EXTERN void Tk_CreateOldPhotoImageFormat( Tk_PhotoImageFormat *formatPtr); #endif +/* Slot 274 is reserved */ +#ifndef TkUnusedStubEntry_TCL_DECLARED +#define TkUnusedStubEntry_TCL_DECLARED +/* 275 */ +EXTERN void TkUnusedStubEntry(void); +#endif typedef struct TkStubHooks { struct TkPlatStubs *tkPlatStubs; @@ -1906,8 +1914,8 @@ void (*tk_InitConsoleChannels) (Tcl_Interp *interp); /* 215 */ int (*tk_CreateConsoleWindow) (Tcl_Interp *interp); /* 216 */ void (*tk_CreateSmoothMethod) (Tcl_Interp *interp, Tk_SmoothMethod *method); /* 217 */ - void *reserved218; - void *reserved219; + VOID *reserved218; + VOID *reserved219; int (*tk_GetDash) (Tcl_Interp *interp, CONST char *value, Tk_Dash *dash); /* 220 */ void (*tk_CreateOutline) (Tk_Outline *outline); /* 221 */ void (*tk_DeleteOutline) (Display *display, Tk_Outline *outline); /* 222 */ @@ -1962,12 +1970,12 @@ Tcl_Interp * (*tk_Interp) (Tk_Window tkwin); /* 271 */ void (*tk_CreateOldImageType) (Tk_ImageType *typePtr); /* 272 */ void (*tk_CreateOldPhotoImageFormat) (Tk_PhotoImageFormat *formatPtr); /* 273 */ + VOID *reserved274; + void (*tkUnusedStubEntry) (void); /* 275 */ } TkStubs; -#ifdef __cplusplus -extern "C" { -#endif -extern const TkStubs *tkStubsPtr; +extern TkStubs *tkStubsPtr; + #ifdef __cplusplus } #endif @@ -3068,6 +3076,11 @@ #define Tk_CreateOldPhotoImageFormat \ (tkStubsPtr->tk_CreateOldPhotoImageFormat) /* 273 */ #endif +/* Slot 274 is reserved */ +#ifndef TkUnusedStubEntry +#define TkUnusedStubEntry \ + (tkStubsPtr->tkUnusedStubEntry) /* 275 */ +#endif #endif /* defined(USE_TK_STUBS) && !defined(USE_TK_STUB_PROCS) */ @@ -3076,5 +3089,7 @@ #undef TCL_STORAGE_CLASS #define TCL_STORAGE_CLASS DLLIMPORT +#undef TkUnusedStubEntry + #endif /* _TKDECLS */ diff -Nru critcl-3.1.9/lib/critcl/critcl_c/tcl8.5/tk.h critcl-3.1.17+dfsg/lib/critcl/critcl_c/tcl8.5/tk.h --- critcl-3.1.9/lib/critcl/critcl_c/tcl8.5/tk.h 2013-05-10 05:57:04.000000000 +0000 +++ critcl-3.1.17+dfsg/lib/critcl/critcl_c/tcl8.5/tk.h 2017-10-14 02:48:11.000000000 +0000 @@ -11,18 +11,24 @@ * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tk.h,v 1.109.2.13 2010/08/04 17:06:52 dgp Exp $ */ #ifndef _TK #define _TK #include -#if (TCL_MAJOR_VERSION != 8) || (TCL_MINOR_VERSION != 5) -# error Tk 8.5 must be compiled with tcl.h from Tcl 8.5 +#if (TCL_MAJOR_VERSION != 8) || (TCL_MINOR_VERSION < 5) +# error Tk 8.5 must be compiled with tcl.h from Tcl 8.5 or better #endif +#ifndef _ANSI_ARGS_ +# ifndef NO_PROTOTYPES +# define _ANSI_ARGS_(x) x +# else +# define _ANSI_ARGS_(x) () +# endif +#endif + /* * For C++ compilers, use extern "C" */ @@ -35,7 +41,7 @@ * When version numbers change here, you must also go into the following files * and update the version numbers: * - * library/tk.tcl (2 LOC patch) + * library/tk.tcl (1 LOC patch) * unix/configure.in (2 LOC Major, 2 LOC minor, 1 LOC patch) * win/configure.in (as above) * README (sections 0 and 1) @@ -53,10 +59,10 @@ #define TK_MAJOR_VERSION 8 #define TK_MINOR_VERSION 5 #define TK_RELEASE_LEVEL TCL_FINAL_RELEASE -#define TK_RELEASE_SERIAL 9 +#define TK_RELEASE_SERIAL 18 #define TK_VERSION "8.5" -#define TK_PATCH_LEVEL "8.5.9" +#define TK_PATCH_LEVEL "8.5.18" /* * A special definition used to allow this header file to be included from @@ -71,11 +77,9 @@ #ifndef RC_INVOKED #ifndef _XLIB_H -# if defined(MAC_OSX_TK) -# include +# include +# ifdef MAC_OSX_TK # include -# else -# include # endif #endif #ifdef __STDC__ @@ -83,18 +87,20 @@ #endif #ifdef BUILD_tk -# undef TCL_STORAGE_CLASS -# define TCL_STORAGE_CLASS DLLEXPORT +#undef TCL_STORAGE_CLASS +#define TCL_STORAGE_CLASS DLLEXPORT #endif - + /* + *---------------------------------------------------------------------- + * * Decide whether or not to use input methods. */ #ifdef XNQueryInputStyle #define TK_USE_INPUT_METHODS #endif - + /* * Dummy types that are used by clients: */ @@ -120,8 +126,10 @@ */ typedef const char *Tk_Uid; - + /* + *---------------------------------------------------------------------- + * * The enum below defines the valid types for Tk configuration options as * implemented by Tk_InitOptions, Tk_SetOptions, etc. */ @@ -219,7 +227,7 @@ Tk_Window tkwin, char *internalPtr)); typedef struct Tk_ObjCustomOption { - const char *name; /* Name of the custom option. */ + const char *name; /* Name of the custom option. */ Tk_CustomOptionSetProc *setProc; /* Function to use to set a record's option * value from a Tcl_Obj */ @@ -295,7 +303,7 @@ * old values in a single structure. NULL * means no more structures. */ } Tk_SavedOptions; - + /* * Structure used to describe application-specific configuration options: * indicates procedures to call to parse an option and to return a text string @@ -394,7 +402,7 @@ #define TK_CONFIG_OPTION_SPECIFIED (1 << 4) #define TK_CONFIG_USER_BIT 0x100 #endif /* __NO_OLD_CONFIG */ - + /* * Structure used to specify how to handle argv options. */ @@ -438,7 +446,7 @@ #define TK_ARGV_NO_LEFTOVERS 0x2 #define TK_ARGV_NO_ABBREV 0x4 #define TK_ARGV_DONT_SKIP_FIRST_ARG 0x8 - + /* * Enumerated type for describing actions to be taken in response to a * restrictProc established by Tk_RestrictEvents. @@ -496,7 +504,7 @@ TK_ANCHOR_S, TK_ANCHOR_SW, TK_ANCHOR_W, TK_ANCHOR_NW, TK_ANCHOR_CENTER } Tk_Anchor; - + /* * Enumerated type for describing a style of justification: */ @@ -540,7 +548,7 @@ #define TK_IGNORE_TABS 8 #define TK_IGNORE_NEWLINES 16 - + /* * Widget class procedures used to implement platform specific widget * behavior. @@ -584,7 +592,7 @@ #define Tk_GetClassProc(procs, which) \ (((procs) == NULL) ? NULL : \ (((procs)->size <= Tk_Offset(Tk_ClassProcs, which)) ? NULL:(procs)->which)) - + /* * Each geometry manager (the packer, the placer, etc.) is represented by a * structure of the following form, which indicates procedures to invoke in @@ -618,13 +626,13 @@ #define TK_SCROLL_PAGES 2 #define TK_SCROLL_UNITS 3 #define TK_SCROLL_ERROR 4 - + /* - *--------------------------------------------------------------------------- + *---------------------------------------------------------------------- * * Extensions to the X event set * - *--------------------------------------------------------------------------- + *---------------------------------------------------------------------- */ #define VirtualEvent (MappingNotify + 1) @@ -683,12 +691,12 @@ typedef XActivateDeactivateEvent XDeactivateEvent; /* - *-------------------------------------------------------------- + *---------------------------------------------------------------------- * * Macros for querying Tk_Window structures. See the manual entries for * documentation. * - *-------------------------------------------------------------- + *---------------------------------------------------------------------- */ #define Tk_Display(tkwin) (((Tk_FakeWin *) (tkwin))->display) @@ -885,11 +893,11 @@ #define TK_WM_MANAGEABLE 0x80000 /* - *-------------------------------------------------------------- + *---------------------------------------------------------------------- * * Procedure prototypes and structures used for defining new canvas items: * - *-------------------------------------------------------------- + *---------------------------------------------------------------------- */ typedef enum { @@ -1126,7 +1134,7 @@ * should be displayed in focusItemPtr. * Read-only to items.*/ } Tk_CanvasTextInfo; - + /* * Structures used for Dashing and Outline. */ @@ -1182,11 +1190,11 @@ } Tk_Outline; /* - *-------------------------------------------------------------- + *---------------------------------------------------------------------- * * Procedure prototypes and structures used for managing images: * - *-------------------------------------------------------------- + *---------------------------------------------------------------------- */ typedef struct Tk_ImageType Tk_ImageType; @@ -1249,13 +1257,13 @@ * manager. */ char *reserved; /* reserved for future expansion */ }; - + /* - *-------------------------------------------------------------- + *---------------------------------------------------------------------- * * Additional definitions used to manage images of type "photo". * - *-------------------------------------------------------------- + *---------------------------------------------------------------------- */ /* @@ -1365,18 +1373,13 @@ * currently known. Filled in by Tk, not by * image format handler. */ }; - -#ifdef USE_OLD_IMAGE -#define Tk_CreateImageType Tk_CreateOldImageType -#define Tk_CreatePhotoImageFormat Tk_CreateOldPhotoImageFormat -#endif /* - *-------------------------------------------------------------- + *---------------------------------------------------------------------- * * Procedure prototypes and structures used for managing styles: * - *-------------------------------------------------------------- + *---------------------------------------------------------------------- */ /* @@ -1440,13 +1443,13 @@ #define TK_ELEMENT_STATE_PRESSED 1<<3 /* - *-------------------------------------------------------------- + *---------------------------------------------------------------------- * * The definitions below provide backward compatibility for functions and * types related to event handling that used to be in Tk but have moved to * Tcl. * - *-------------------------------------------------------------- + *---------------------------------------------------------------------- */ #define TK_READABLE TCL_READABLE @@ -1493,21 +1496,18 @@ const char *version, int exact)); #ifndef USE_TK_STUBS - #define Tk_InitStubs(interp, version, exact) \ Tk_PkgInitStubsCheck(interp, version, exact) - -#endif +#endif /* USE_TK_STUBS */ #define Tk_InitImageArgs(interp, argc, argv) /**/ - /* - *-------------------------------------------------------------- + *---------------------------------------------------------------------- * * Additional procedure types defined by Tk. * - *-------------------------------------------------------------- + *---------------------------------------------------------------------- */ typedef int (Tk_ErrorProc) _ANSI_ARGS_((ClientData clientData, @@ -1525,18 +1525,27 @@ ClientData clientData, XEvent *eventPtr)); typedef int (Tk_SelectionProc) _ANSI_ARGS_((ClientData clientData, int offset, char *buffer, int maxBytes)); - + /* - *-------------------------------------------------------------- + *---------------------------------------------------------------------- * - * Platform independant exported procedures and variables. + * Platform independent exported procedures and variables. * - *-------------------------------------------------------------- + *---------------------------------------------------------------------- */ #include "tkDecls.h" + +#ifdef USE_OLD_IMAGE +#undef Tk_CreateImageType +#define Tk_CreateImageType Tk_CreateOldImageType +#undef Tk_CreatePhotoImageFormat +#define Tk_CreatePhotoImageFormat Tk_CreateOldPhotoImageFormat +#endif /* USE_OLD_IMAGE */ /* + *---------------------------------------------------------------------- + * * Allow users to say that they don't want to alter their source to add extra * arguments to Tk_PhotoPutBlock() et al; DO NOT DEFINE THIS WHEN BUILDING TK. * @@ -1576,11 +1585,7 @@ # endif # define Tk_PhotoSetSize Tk_PhotoSetSize_Panic #endif /* USE_PANIC_ON_PHOTO_ALLOC_FAILURE */ - -/* - * Tcl commands exported by Tk: - */ - + #undef TCL_STORAGE_CLASS #define TCL_STORAGE_CLASS DLLIMPORT diff -Nru critcl-3.1.9/lib/critcl/critcl_c/tcl8.5/tkPlatDecls.h critcl-3.1.17+dfsg/lib/critcl/critcl_c/tcl8.5/tkPlatDecls.h --- critcl-3.1.9/lib/critcl/critcl_c/tcl8.5/tkPlatDecls.h 2013-05-10 05:57:04.000000000 +0000 +++ critcl-3.1.17+dfsg/lib/critcl/critcl_c/tcl8.5/tkPlatDecls.h 2017-10-14 02:48:11.000000000 +0000 @@ -7,8 +7,6 @@ * * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tkPlatDecls.h,v 1.15.2.1 2010/02/07 23:24:13 nijtmans Exp $ */ #ifndef _TKPLATDECLS @@ -27,11 +25,15 @@ /* !BEGIN!: Do not edit below this line. */ +#ifdef __cplusplus +extern "C" { +#endif + /* * Exported function declarations: */ -#ifdef __WIN32__ /* WIN */ +#if defined(__WIN32__) || defined(__CYGWIN__) /* WIN */ #ifndef Tk_AttachHWND_TCL_DECLARED #define Tk_AttachHWND_TCL_DECLARED /* 0 */ @@ -110,12 +112,12 @@ #ifndef TkMacOSXGetDrawablePort_TCL_DECLARED #define TkMacOSXGetDrawablePort_TCL_DECLARED /* 7 */ -EXTERN GWorldPtr TkMacOSXGetDrawablePort(Drawable drawable); +EXTERN VOID * TkMacOSXGetDrawablePort(Drawable drawable); #endif #ifndef TkMacOSXGetRootControl_TCL_DECLARED #define TkMacOSXGetRootControl_TCL_DECLARED /* 8 */ -EXTERN ControlRef TkMacOSXGetRootControl(Drawable drawable); +EXTERN VOID * TkMacOSXGetRootControl(Drawable drawable); #endif #ifndef Tk_MacOSXSetupTkNotifier_TCL_DECLARED #define Tk_MacOSXSetupTkNotifier_TCL_DECLARED @@ -133,7 +135,7 @@ int magic; struct TkPlatStubHooks *hooks; -#ifdef __WIN32__ /* WIN */ +#if defined(__WIN32__) || defined(__CYGWIN__) /* WIN */ Window (*tk_AttachHWND) (Tk_Window tkwin, HWND hwnd); /* 0 */ HINSTANCE (*tk_GetHINSTANCE) (void); /* 1 */ HWND (*tk_GetHWND) (Window window); /* 2 */ @@ -149,17 +151,15 @@ void (*tkMacOSXInitAppleEvents) (Tcl_Interp *interp); /* 4 */ void (*tkGenWMConfigureEvent) (Tk_Window tkwin, int x, int y, int width, int height, int flags); /* 5 */ void (*tkMacOSXInvalClipRgns) (Tk_Window tkwin); /* 6 */ - GWorldPtr (*tkMacOSXGetDrawablePort) (Drawable drawable); /* 7 */ - ControlRef (*tkMacOSXGetRootControl) (Drawable drawable); /* 8 */ + VOID * (*tkMacOSXGetDrawablePort) (Drawable drawable); /* 7 */ + VOID * (*tkMacOSXGetRootControl) (Drawable drawable); /* 8 */ void (*tk_MacOSXSetupTkNotifier) (void); /* 9 */ int (*tk_MacOSXIsAppInFront) (void); /* 10 */ #endif /* AQUA */ } TkPlatStubs; -#ifdef __cplusplus -extern "C" { -#endif -extern const TkPlatStubs *tkPlatStubsPtr; +extern TkPlatStubs *tkPlatStubsPtr; + #ifdef __cplusplus } #endif @@ -170,7 +170,7 @@ * Inline function declarations: */ -#ifdef __WIN32__ /* WIN */ +#if defined(__WIN32__) || defined(__CYGWIN__) /* WIN */ #ifndef Tk_AttachHWND #define Tk_AttachHWND \ (tkPlatStubsPtr->tk_AttachHWND) /* 0 */ diff -Nru critcl-3.1.9/lib/critcl/critcl_c/tcl8.5/X11/keysym.h critcl-3.1.17+dfsg/lib/critcl/critcl_c/tcl8.5/X11/keysym.h --- critcl-3.1.9/lib/critcl/critcl_c/tcl8.5/X11/keysym.h 2013-05-10 05:57:04.000000000 +0000 +++ critcl-3.1.17+dfsg/lib/critcl/critcl_c/tcl8.5/X11/keysym.h 2017-10-14 02:48:11.000000000 +0000 @@ -6,13 +6,13 @@ All Rights Reserved -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in +both that copyright notice and this permission notice appear in supporting documentation, and that the names of Digital or MIT not be used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. +software without specific, written prior permission. DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL diff -Nru critcl-3.1.9/lib/critcl/critcl_c/tcl8.5/X11/tk.h critcl-3.1.17+dfsg/lib/critcl/critcl_c/tcl8.5/X11/tk.h --- critcl-3.1.9/lib/critcl/critcl_c/tcl8.5/X11/tk.h 2013-05-10 05:57:04.000000000 +0000 +++ critcl-3.1.17+dfsg/lib/critcl/critcl_c/tcl8.5/X11/tk.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,1605 +0,0 @@ -/* - * tk.h -- - * - * Declarations for Tk-related things that are visible outside of the Tk - * module itself. - * - * Copyright (c) 1989-1994 The Regents of the University of California. - * Copyright (c) 1994 The Australian National University. - * Copyright (c) 1994-1998 Sun Microsystems, Inc. - * Copyright (c) 1998-2000 Ajuba Solutions. - * - * See the file "license.terms" for information on usage and redistribution of - * this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tk.h,v 1.109.2.13 2010/08/04 17:06:52 dgp Exp $ - */ - -#ifndef _TK -#define _TK - -#include -#if (TCL_MAJOR_VERSION != 8) || (TCL_MINOR_VERSION != 5) -# error Tk 8.5 must be compiled with tcl.h from Tcl 8.5 -#endif - -/* - * For C++ compilers, use extern "C" - */ - -#ifdef __cplusplus -extern "C" { -#endif - -/* - * When version numbers change here, you must also go into the following files - * and update the version numbers: - * - * library/tk.tcl (2 LOC patch) - * unix/configure.in (2 LOC Major, 2 LOC minor, 1 LOC patch) - * win/configure.in (as above) - * README (sections 0 and 1) - * macosx/Wish.xcode/project.pbxproj (not patchlevel) 1 LOC - * macosx/Wish-Common.xcconfig (not patchlevel) 1 LOC - * win/README (not patchlevel) - * unix/README (not patchlevel) - * unix/tk.spec (1 LOC patch) - * win/tcl.m4 (not patchlevel) - * - * You may also need to update some of these files when the numbers change for - * the version of Tcl that this release of Tk is compiled against. - */ - -#define TK_MAJOR_VERSION 8 -#define TK_MINOR_VERSION 5 -#define TK_RELEASE_LEVEL TCL_FINAL_RELEASE -#define TK_RELEASE_SERIAL 9 - -#define TK_VERSION "8.5" -#define TK_PATCH_LEVEL "8.5.9" - -/* - * A special definition used to allow this header file to be included from - * windows or mac resource files so that they can obtain version information. - * RC_INVOKED is defined by default by the windows RC tool and manually set - * for macintosh. - * - * Resource compilers don't like all the C stuff, like typedefs and procedure - * declarations, that occur below, so block them out. - */ - -#ifndef RC_INVOKED - -#ifndef _XLIB_H -# if defined(MAC_OSX_TK) -# include -# include -# else -# include -# endif -#endif -#ifdef __STDC__ -# include -#endif - -#ifdef BUILD_tk -# undef TCL_STORAGE_CLASS -# define TCL_STORAGE_CLASS DLLEXPORT -#endif - -/* - * Decide whether or not to use input methods. - */ - -#ifdef XNQueryInputStyle -#define TK_USE_INPUT_METHODS -#endif - -/* - * Dummy types that are used by clients: - */ - -typedef struct Tk_BindingTable_ *Tk_BindingTable; -typedef struct Tk_Canvas_ *Tk_Canvas; -typedef struct Tk_Cursor_ *Tk_Cursor; -typedef struct Tk_ErrorHandler_ *Tk_ErrorHandler; -typedef struct Tk_Font_ *Tk_Font; -typedef struct Tk_Image__ *Tk_Image; -typedef struct Tk_ImageMaster_ *Tk_ImageMaster; -typedef struct Tk_OptionTable_ *Tk_OptionTable; -typedef struct Tk_PostscriptInfo_ *Tk_PostscriptInfo; -typedef struct Tk_TextLayout_ *Tk_TextLayout; -typedef struct Tk_Window_ *Tk_Window; -typedef struct Tk_3DBorder_ *Tk_3DBorder; -typedef struct Tk_Style_ *Tk_Style; -typedef struct Tk_StyleEngine_ *Tk_StyleEngine; -typedef struct Tk_StyledElement_ *Tk_StyledElement; - -/* - * Additional types exported to clients. - */ - -typedef const char *Tk_Uid; - -/* - * The enum below defines the valid types for Tk configuration options as - * implemented by Tk_InitOptions, Tk_SetOptions, etc. - */ - -typedef enum { - TK_OPTION_BOOLEAN, - TK_OPTION_INT, - TK_OPTION_DOUBLE, - TK_OPTION_STRING, - TK_OPTION_STRING_TABLE, - TK_OPTION_COLOR, - TK_OPTION_FONT, - TK_OPTION_BITMAP, - TK_OPTION_BORDER, - TK_OPTION_RELIEF, - TK_OPTION_CURSOR, - TK_OPTION_JUSTIFY, - TK_OPTION_ANCHOR, - TK_OPTION_SYNONYM, - TK_OPTION_PIXELS, - TK_OPTION_WINDOW, - TK_OPTION_END, - TK_OPTION_CUSTOM, - TK_OPTION_STYLE -} Tk_OptionType; - -/* - * Structures of the following type are used by widgets to specify their - * configuration options. Typically each widget has a static array of these - * structures, where each element of the array describes a single - * configuration option. The array is passed to Tk_CreateOptionTable. - */ - -typedef struct Tk_OptionSpec { - Tk_OptionType type; /* Type of option, such as TK_OPTION_COLOR; - * see definitions above. Last option in table - * must have type TK_OPTION_END. */ - const char *optionName; /* Name used to specify option in Tcl - * commands. */ - const char *dbName; /* Name for option in option database. */ - const char *dbClass; /* Class for option in database. */ - const char *defValue; /* Default value for option if not specified - * in command line, the option database, or - * the system. */ - int objOffset; /* Where in record to store a Tcl_Obj * that - * holds the value of this option, specified - * as an offset in bytes from the start of the - * record. Use the Tk_Offset macro to generate - * values for this. -1 means don't store the - * Tcl_Obj in the record. */ - int internalOffset; /* Where in record to store the internal - * representation of the value of this option, - * such as an int or XColor *. This field is - * specified as an offset in bytes from the - * start of the record. Use the Tk_Offset - * macro to generate values for it. -1 means - * don't store the internal representation in - * the record. */ - int flags; /* Any combination of the values defined - * below. */ - ClientData clientData; /* An alternate place to put option-specific - * data. Used for the monochrome default value - * for colors, etc. */ - int typeMask; /* An arbitrary bit mask defined by the class - * manager; typically bits correspond to - * certain kinds of options such as all those - * that require a redisplay when they change. - * Tk_SetOptions returns the bit-wise OR of - * the typeMasks of all options that were - * changed. */ -} Tk_OptionSpec; - -/* - * Flag values for Tk_OptionSpec structures. These flags are shared by - * Tk_ConfigSpec structures, so be sure to coordinate any changes carefully. - */ - -#define TK_OPTION_NULL_OK (1 << 0) -#define TK_OPTION_DONT_SET_DEFAULT (1 << 3) - -/* - * The following structure and function types are used by TK_OPTION_CUSTOM - * options; the structure holds pointers to the functions needed by the Tk - * option config code to handle a custom option. - */ - -typedef int (Tk_CustomOptionSetProc) _ANSI_ARGS_((ClientData clientData, - Tcl_Interp *interp, Tk_Window tkwin, Tcl_Obj **value, char *widgRec, - int offset, char *saveInternalPtr, int flags)); -typedef Tcl_Obj *(Tk_CustomOptionGetProc) _ANSI_ARGS_((ClientData clientData, - Tk_Window tkwin, char *widgRec, int offset)); -typedef void (Tk_CustomOptionRestoreProc) _ANSI_ARGS_((ClientData clientData, - Tk_Window tkwin, char *internalPtr, char *saveInternalPtr)); -typedef void (Tk_CustomOptionFreeProc) _ANSI_ARGS_((ClientData clientData, - Tk_Window tkwin, char *internalPtr)); - -typedef struct Tk_ObjCustomOption { - const char *name; /* Name of the custom option. */ - Tk_CustomOptionSetProc *setProc; - /* Function to use to set a record's option - * value from a Tcl_Obj */ - Tk_CustomOptionGetProc *getProc; - /* Function to use to get a Tcl_Obj - * representation from an internal - * representation of an option. */ - Tk_CustomOptionRestoreProc *restoreProc; - /* Function to use to restore a saved value - * for the internal representation. */ - Tk_CustomOptionFreeProc *freeProc; - /* Function to use to free the internal - * representation of an option. */ - ClientData clientData; /* Arbitrary one-word value passed to the - * handling procs. */ -} Tk_ObjCustomOption; - -/* - * Macro to use to fill in "offset" fields of the Tk_OptionSpec structure. - * Computes number of bytes from beginning of structure to a given field. - */ - -#ifdef offsetof -#define Tk_Offset(type, field) ((int) offsetof(type, field)) -#else -#define Tk_Offset(type, field) ((int) ((char *) &((type *) 0)->field)) -#endif - -/* - * The following two structures are used for error handling. When config - * options are being modified, the old values are saved in a Tk_SavedOptions - * structure. If an error occurs, then the contents of the structure can be - * used to restore all of the old values. The contents of this structure are - * for the private use Tk. No-one outside Tk should ever read or write any of - * the fields of these structures. - */ - -typedef struct Tk_SavedOption { - struct TkOption *optionPtr; /* Points to information that describes the - * option. */ - Tcl_Obj *valuePtr; /* The old value of the option, in the form of - * a Tcl object; may be NULL if the value was - * not saved as an object. */ - double internalForm; /* The old value of the option, in some - * internal representation such as an int or - * (XColor *). Valid only if the field - * optionPtr->specPtr->objOffset is < 0. The - * space must be large enough to accommodate a - * double, a long, or a pointer; right now it - * looks like a double (i.e., 8 bytes) is big - * enough. Also, using a double guarantees - * that the field is properly aligned for - * storing large values. */ -} Tk_SavedOption; - -#ifdef TCL_MEM_DEBUG -# define TK_NUM_SAVED_OPTIONS 2 -#else -# define TK_NUM_SAVED_OPTIONS 20 -#endif - -typedef struct Tk_SavedOptions { - char *recordPtr; /* The data structure in which to restore - * configuration options. */ - Tk_Window tkwin; /* Window associated with recordPtr; needed to - * restore certain options. */ - int numItems; /* The number of valid items in items field. */ - Tk_SavedOption items[TK_NUM_SAVED_OPTIONS]; - /* Items used to hold old values. */ - struct Tk_SavedOptions *nextPtr; - /* Points to next structure in list; needed if - * too many options changed to hold all the - * old values in a single structure. NULL - * means no more structures. */ -} Tk_SavedOptions; - -/* - * Structure used to describe application-specific configuration options: - * indicates procedures to call to parse an option and to return a text string - * describing an option. THESE ARE DEPRECATED; PLEASE USE THE NEW STRUCTURES - * LISTED ABOVE. - */ - -/* - * This is a temporary flag used while tkObjConfig and new widgets are in - * development. - */ - -#ifndef __NO_OLD_CONFIG - -typedef int (Tk_OptionParseProc) _ANSI_ARGS_((ClientData clientData, - Tcl_Interp *interp, Tk_Window tkwin, CONST84 char *value, char *widgRec, - int offset)); -typedef char *(Tk_OptionPrintProc) _ANSI_ARGS_((ClientData clientData, - Tk_Window tkwin, char *widgRec, int offset, - Tcl_FreeProc **freeProcPtr)); - -typedef struct Tk_CustomOption { - Tk_OptionParseProc *parseProc; - /* Procedure to call to parse an option and - * store it in converted form. */ - Tk_OptionPrintProc *printProc; - /* Procedure to return a printable string - * describing an existing option. */ - ClientData clientData; /* Arbitrary one-word value used by option - * parser: passed to parseProc and - * printProc. */ -} Tk_CustomOption; - -/* - * Structure used to specify information for Tk_ConfigureWidget. Each - * structure gives complete information for one option, including how the - * option is specified on the command line, where it appears in the option - * database, etc. - */ - -typedef struct Tk_ConfigSpec { - int type; /* Type of option, such as TK_CONFIG_COLOR; - * see definitions below. Last option in table - * must have type TK_CONFIG_END. */ - char *argvName; /* Switch used to specify option in argv. NULL - * means this spec is part of a group. */ - Tk_Uid dbName; /* Name for option in option database. */ - Tk_Uid dbClass; /* Class for option in database. */ - Tk_Uid defValue; /* Default value for option if not specified - * in command line or database. */ - int offset; /* Where in widget record to store value; use - * Tk_Offset macro to generate values for - * this. */ - int specFlags; /* Any combination of the values defined - * below; other bits are used internally by - * tkConfig.c. */ - Tk_CustomOption *customPtr; /* If type is TK_CONFIG_CUSTOM then this is a - * pointer to info about how to parse and - * print the option. Otherwise it is - * irrelevant. */ -} Tk_ConfigSpec; - -/* - * Type values for Tk_ConfigSpec structures. See the user documentation for - * details. - */ - -typedef enum { - TK_CONFIG_BOOLEAN, TK_CONFIG_INT, TK_CONFIG_DOUBLE, TK_CONFIG_STRING, - TK_CONFIG_UID, TK_CONFIG_COLOR, TK_CONFIG_FONT, TK_CONFIG_BITMAP, - TK_CONFIG_BORDER, TK_CONFIG_RELIEF, TK_CONFIG_CURSOR, - TK_CONFIG_ACTIVE_CURSOR, TK_CONFIG_JUSTIFY, TK_CONFIG_ANCHOR, - TK_CONFIG_SYNONYM, TK_CONFIG_CAP_STYLE, TK_CONFIG_JOIN_STYLE, - TK_CONFIG_PIXELS, TK_CONFIG_MM, TK_CONFIG_WINDOW, TK_CONFIG_CUSTOM, - TK_CONFIG_END -} Tk_ConfigTypes; - -/* - * Possible values for flags argument to Tk_ConfigureWidget: - */ - -#define TK_CONFIG_ARGV_ONLY 1 -#define TK_CONFIG_OBJS 0x80 - -/* - * Possible flag values for Tk_ConfigSpec structures. Any bits at or above - * TK_CONFIG_USER_BIT may be used by clients for selecting certain entries. - * Before changing any values here, coordinate with tkOldConfig.c - * (internal-use-only flags are defined there). - */ - -#define TK_CONFIG_NULL_OK (1 << 0) -#define TK_CONFIG_COLOR_ONLY (1 << 1) -#define TK_CONFIG_MONO_ONLY (1 << 2) -#define TK_CONFIG_DONT_SET_DEFAULT (1 << 3) -#define TK_CONFIG_OPTION_SPECIFIED (1 << 4) -#define TK_CONFIG_USER_BIT 0x100 -#endif /* __NO_OLD_CONFIG */ - -/* - * Structure used to specify how to handle argv options. - */ - -typedef struct { - char *key; /* The key string that flags the option in the - * argv array. */ - int type; /* Indicates option type; see below. */ - char *src; /* Value to be used in setting dst; usage - * depends on type. */ - char *dst; /* Address of value to be modified; usage - * depends on type. */ - char *help; /* Documentation message describing this - * option. */ -} Tk_ArgvInfo; - -/* - * Legal values for the type field of a Tk_ArgvInfo: see the user - * documentation for details. - */ - -#define TK_ARGV_CONSTANT 15 -#define TK_ARGV_INT 16 -#define TK_ARGV_STRING 17 -#define TK_ARGV_UID 18 -#define TK_ARGV_REST 19 -#define TK_ARGV_FLOAT 20 -#define TK_ARGV_FUNC 21 -#define TK_ARGV_GENFUNC 22 -#define TK_ARGV_HELP 23 -#define TK_ARGV_CONST_OPTION 24 -#define TK_ARGV_OPTION_VALUE 25 -#define TK_ARGV_OPTION_NAME_VALUE 26 -#define TK_ARGV_END 27 - -/* - * Flag bits for passing to Tk_ParseArgv: - */ - -#define TK_ARGV_NO_DEFAULTS 0x1 -#define TK_ARGV_NO_LEFTOVERS 0x2 -#define TK_ARGV_NO_ABBREV 0x4 -#define TK_ARGV_DONT_SKIP_FIRST_ARG 0x8 - -/* - * Enumerated type for describing actions to be taken in response to a - * restrictProc established by Tk_RestrictEvents. - */ - -typedef enum { - TK_DEFER_EVENT, TK_PROCESS_EVENT, TK_DISCARD_EVENT -} Tk_RestrictAction; - -/* - * Priority levels to pass to Tk_AddOption: - */ - -#define TK_WIDGET_DEFAULT_PRIO 20 -#define TK_STARTUP_FILE_PRIO 40 -#define TK_USER_DEFAULT_PRIO 60 -#define TK_INTERACTIVE_PRIO 80 -#define TK_MAX_PRIO 100 - -/* - * Relief values returned by Tk_GetRelief: - */ - -#define TK_RELIEF_NULL -1 -#define TK_RELIEF_FLAT 0 -#define TK_RELIEF_GROOVE 1 -#define TK_RELIEF_RAISED 2 -#define TK_RELIEF_RIDGE 3 -#define TK_RELIEF_SOLID 4 -#define TK_RELIEF_SUNKEN 5 - -/* - * "Which" argument values for Tk_3DBorderGC: - */ - -#define TK_3D_FLAT_GC 1 -#define TK_3D_LIGHT_GC 2 -#define TK_3D_DARK_GC 3 - -/* - * Special EnterNotify/LeaveNotify "mode" for use in events generated by - * tkShare.c. Pick a high enough value that it's unlikely to conflict with - * existing values (like NotifyNormal) or any new values defined in the - * future. - */ - -#define TK_NOTIFY_SHARE 20 - -/* - * Enumerated type for describing a point by which to anchor something: - */ - -typedef enum { - TK_ANCHOR_N, TK_ANCHOR_NE, TK_ANCHOR_E, TK_ANCHOR_SE, - TK_ANCHOR_S, TK_ANCHOR_SW, TK_ANCHOR_W, TK_ANCHOR_NW, - TK_ANCHOR_CENTER -} Tk_Anchor; - -/* - * Enumerated type for describing a style of justification: - */ - -typedef enum { - TK_JUSTIFY_LEFT, TK_JUSTIFY_RIGHT, TK_JUSTIFY_CENTER -} Tk_Justify; - -/* - * The following structure is used by Tk_GetFontMetrics() to return - * information about the properties of a Tk_Font. - */ - -typedef struct Tk_FontMetrics { - int ascent; /* The amount in pixels that the tallest - * letter sticks up above the baseline, plus - * any extra blank space added by the designer - * of the font. */ - int descent; /* The largest amount in pixels that any - * letter sticks below the baseline, plus any - * extra blank space added by the designer of - * the font. */ - int linespace; /* The sum of the ascent and descent. How far - * apart two lines of text in the same font - * should be placed so that none of the - * characters in one line overlap any of the - * characters in the other line. */ -} Tk_FontMetrics; - -/* - * Flags passed to Tk_MeasureChars: - */ - -#define TK_WHOLE_WORDS 1 -#define TK_AT_LEAST_ONE 2 -#define TK_PARTIAL_OK 4 - -/* - * Flags passed to Tk_ComputeTextLayout: - */ - -#define TK_IGNORE_TABS 8 -#define TK_IGNORE_NEWLINES 16 - -/* - * Widget class procedures used to implement platform specific widget - * behavior. - */ - -typedef Window (Tk_ClassCreateProc) _ANSI_ARGS_((Tk_Window tkwin, - Window parent, ClientData instanceData)); -typedef void (Tk_ClassWorldChangedProc) _ANSI_ARGS_((ClientData instanceData)); -typedef void (Tk_ClassModalProc) _ANSI_ARGS_((Tk_Window tkwin, - XEvent *eventPtr)); - -typedef struct Tk_ClassProcs { - unsigned int size; - Tk_ClassWorldChangedProc *worldChangedProc; - /* Procedure to invoke when the widget needs - * to respond in some way to a change in the - * world (font changes, etc.) */ - Tk_ClassCreateProc *createProc; - /* Procedure to invoke when the platform- - * dependent window needs to be created. */ - Tk_ClassModalProc *modalProc; - /* Procedure to invoke after all bindings on a - * widget have been triggered in order to - * handle a modal loop. */ -} Tk_ClassProcs; - -/* - * Simple accessor for Tk_ClassProcs structure. Checks that the structure is - * not NULL, then checks the size field and returns either the requested - * field, if present, or NULL if the structure is too small to have the field - * (or NULL if the structure is NULL). - * - * A more general version of this function may be useful if other - * size-versioned structure pop up in the future: - * - * #define Tk_GetField(name, who, which) \ - * (((who) == NULL) ? NULL : - * (((who)->size <= Tk_Offset(name, which)) ? NULL :(name)->which)) - */ - -#define Tk_GetClassProc(procs, which) \ - (((procs) == NULL) ? NULL : \ - (((procs)->size <= Tk_Offset(Tk_ClassProcs, which)) ? NULL:(procs)->which)) - -/* - * Each geometry manager (the packer, the placer, etc.) is represented by a - * structure of the following form, which indicates procedures to invoke in - * the geometry manager to carry out certain functions. - */ - -typedef void (Tk_GeomRequestProc) _ANSI_ARGS_((ClientData clientData, - Tk_Window tkwin)); -typedef void (Tk_GeomLostSlaveProc) _ANSI_ARGS_((ClientData clientData, - Tk_Window tkwin)); - -typedef struct Tk_GeomMgr { - const char *name; /* Name of the geometry manager (command used - * to invoke it, or name of widget class that - * allows embedded widgets). */ - Tk_GeomRequestProc *requestProc; - /* Procedure to invoke when a slave's - * requested geometry changes. */ - Tk_GeomLostSlaveProc *lostSlaveProc; - /* Procedure to invoke when a slave is taken - * away from one geometry manager by another. - * NULL means geometry manager doesn't care - * when slaves are lost. */ -} Tk_GeomMgr; - -/* - * Result values returned by Tk_GetScrollInfo: - */ - -#define TK_SCROLL_MOVETO 1 -#define TK_SCROLL_PAGES 2 -#define TK_SCROLL_UNITS 3 -#define TK_SCROLL_ERROR 4 - -/* - *--------------------------------------------------------------------------- - * - * Extensions to the X event set - * - *--------------------------------------------------------------------------- - */ - -#define VirtualEvent (MappingNotify + 1) -#define ActivateNotify (MappingNotify + 2) -#define DeactivateNotify (MappingNotify + 3) -#define MouseWheelEvent (MappingNotify + 4) -#define TK_LASTEVENT (MappingNotify + 5) - -#define MouseWheelMask (1L << 28) -#define ActivateMask (1L << 29) -#define VirtualEventMask (1L << 30) - -/* - * A virtual event shares most of its fields with the XKeyEvent and - * XButtonEvent structures. 99% of the time a virtual event will be an - * abstraction of a key or button event, so this structure provides the most - * information to the user. The only difference is the changing of the detail - * field for a virtual event so that it holds the name of the virtual event - * being triggered. - * - * When using this structure, you should ensure that you zero out all the - * fields first using memset() or bzero(). - */ - -typedef struct { - int type; - unsigned long serial; /* # of last request processed by server. */ - Bool send_event; /* True if this came from a SendEvent - * request. */ - Display *display; /* Display the event was read from. */ - Window event; /* Window on which event was requested. */ - Window root; /* Root window that the event occured on. */ - Window subwindow; /* Child window. */ - Time time; /* Milliseconds. */ - int x, y; /* Pointer x, y coordinates in event - * window. */ - int x_root, y_root; /* Coordinates relative to root. */ - unsigned int state; /* Key or button mask */ - Tk_Uid name; /* Name of virtual event. */ - Bool same_screen; /* Same screen flag. */ - Tcl_Obj *user_data; /* Application-specific data reference; Tk - * will decrement the reference count *once* - * when it has finished processing the - * event. */ -} XVirtualEvent; - -typedef struct { - int type; - unsigned long serial; /* # of last request processed by server. */ - Bool send_event; /* True if this came from a SendEvent - * request. */ - Display *display; /* Display the event was read from. */ - Window window; /* Window in which event occurred. */ -} XActivateDeactivateEvent; -typedef XActivateDeactivateEvent XActivateEvent; -typedef XActivateDeactivateEvent XDeactivateEvent; - -/* - *-------------------------------------------------------------- - * - * Macros for querying Tk_Window structures. See the manual entries for - * documentation. - * - *-------------------------------------------------------------- - */ - -#define Tk_Display(tkwin) (((Tk_FakeWin *) (tkwin))->display) -#define Tk_ScreenNumber(tkwin) (((Tk_FakeWin *) (tkwin))->screenNum) -#define Tk_Screen(tkwin) \ - (ScreenOfDisplay(Tk_Display(tkwin), Tk_ScreenNumber(tkwin))) -#define Tk_Depth(tkwin) (((Tk_FakeWin *) (tkwin))->depth) -#define Tk_Visual(tkwin) (((Tk_FakeWin *) (tkwin))->visual) -#define Tk_WindowId(tkwin) (((Tk_FakeWin *) (tkwin))->window) -#define Tk_PathName(tkwin) (((Tk_FakeWin *) (tkwin))->pathName) -#define Tk_Name(tkwin) (((Tk_FakeWin *) (tkwin))->nameUid) -#define Tk_Class(tkwin) (((Tk_FakeWin *) (tkwin))->classUid) -#define Tk_X(tkwin) (((Tk_FakeWin *) (tkwin))->changes.x) -#define Tk_Y(tkwin) (((Tk_FakeWin *) (tkwin))->changes.y) -#define Tk_Width(tkwin) (((Tk_FakeWin *) (tkwin))->changes.width) -#define Tk_Height(tkwin) \ - (((Tk_FakeWin *) (tkwin))->changes.height) -#define Tk_Changes(tkwin) (&((Tk_FakeWin *) (tkwin))->changes) -#define Tk_Attributes(tkwin) (&((Tk_FakeWin *) (tkwin))->atts) -#define Tk_IsEmbedded(tkwin) \ - (((Tk_FakeWin *) (tkwin))->flags & TK_EMBEDDED) -#define Tk_IsContainer(tkwin) \ - (((Tk_FakeWin *) (tkwin))->flags & TK_CONTAINER) -#define Tk_IsMapped(tkwin) \ - (((Tk_FakeWin *) (tkwin))->flags & TK_MAPPED) -#define Tk_IsTopLevel(tkwin) \ - (((Tk_FakeWin *) (tkwin))->flags & TK_TOP_LEVEL) -#define Tk_HasWrapper(tkwin) \ - (((Tk_FakeWin *) (tkwin))->flags & TK_HAS_WRAPPER) -#define Tk_WinManaged(tkwin) \ - (((Tk_FakeWin *) (tkwin))->flags & TK_WIN_MANAGED) -#define Tk_TopWinHierarchy(tkwin) \ - (((Tk_FakeWin *) (tkwin))->flags & TK_TOP_HIERARCHY) -#define Tk_IsManageable(tkwin) \ - (((Tk_FakeWin *) (tkwin))->flags & TK_WM_MANAGEABLE) -#define Tk_ReqWidth(tkwin) (((Tk_FakeWin *) (tkwin))->reqWidth) -#define Tk_ReqHeight(tkwin) (((Tk_FakeWin *) (tkwin))->reqHeight) -/* Tk_InternalBorderWidth is deprecated */ -#define Tk_InternalBorderWidth(tkwin) \ - (((Tk_FakeWin *) (tkwin))->internalBorderLeft) -#define Tk_InternalBorderLeft(tkwin) \ - (((Tk_FakeWin *) (tkwin))->internalBorderLeft) -#define Tk_InternalBorderRight(tkwin) \ - (((Tk_FakeWin *) (tkwin))->internalBorderRight) -#define Tk_InternalBorderTop(tkwin) \ - (((Tk_FakeWin *) (tkwin))->internalBorderTop) -#define Tk_InternalBorderBottom(tkwin) \ - (((Tk_FakeWin *) (tkwin))->internalBorderBottom) -#define Tk_MinReqWidth(tkwin) (((Tk_FakeWin *) (tkwin))->minReqWidth) -#define Tk_MinReqHeight(tkwin) (((Tk_FakeWin *) (tkwin))->minReqHeight) -#define Tk_Parent(tkwin) (((Tk_FakeWin *) (tkwin))->parentPtr) -#define Tk_Colormap(tkwin) (((Tk_FakeWin *) (tkwin))->atts.colormap) - -/* - * The structure below is needed by the macros above so that they can access - * the fields of a Tk_Window. The fields not needed by the macros are declared - * as "dummyX". The structure has its own type in order to prevent apps from - * accessing Tk_Window fields except using official macros. WARNING!! The - * structure definition must be kept consistent with the TkWindow structure in - * tkInt.h. If you change one, then change the other. See the declaration in - * tkInt.h for documentation on what the fields are used for internally. - */ - -typedef struct Tk_FakeWin { - Display *display; - char *dummy1; /* dispPtr */ - int screenNum; - Visual *visual; - int depth; - Window window; - char *dummy2; /* childList */ - char *dummy3; /* lastChildPtr */ - Tk_Window parentPtr; /* parentPtr */ - char *dummy4; /* nextPtr */ - char *dummy5; /* mainPtr */ - char *pathName; - Tk_Uid nameUid; - Tk_Uid classUid; - XWindowChanges changes; - unsigned int dummy6; /* dirtyChanges */ - XSetWindowAttributes atts; - unsigned long dummy7; /* dirtyAtts */ - unsigned int flags; - char *dummy8; /* handlerList */ -#ifdef TK_USE_INPUT_METHODS - XIC dummy9; /* inputContext */ -#endif /* TK_USE_INPUT_METHODS */ - ClientData *dummy10; /* tagPtr */ - int dummy11; /* numTags */ - int dummy12; /* optionLevel */ - char *dummy13; /* selHandlerList */ - char *dummy14; /* geomMgrPtr */ - ClientData dummy15; /* geomData */ - int reqWidth, reqHeight; - int internalBorderLeft; - char *dummy16; /* wmInfoPtr */ - char *dummy17; /* classProcPtr */ - ClientData dummy18; /* instanceData */ - char *dummy19; /* privatePtr */ - int internalBorderRight; - int internalBorderTop; - int internalBorderBottom; - int minReqWidth; - int minReqHeight; -} Tk_FakeWin; - -/* - * Flag values for TkWindow (and Tk_FakeWin) structures are: - * - * TK_MAPPED: 1 means window is currently mapped, - * 0 means unmapped. - * TK_TOP_LEVEL: 1 means this is a top-level widget. - * TK_ALREADY_DEAD: 1 means the window is in the process of - * being destroyed already. - * TK_NEED_CONFIG_NOTIFY: 1 means that the window has been reconfigured - * before it was made to exist. At the time of - * making it exist a ConfigureNotify event needs - * to be generated. - * TK_GRAB_FLAG: Used to manage grabs. See tkGrab.c for details - * TK_CHECKED_IC: 1 means we've already tried to get an input - * context for this window; if the ic field is - * NULL it means that there isn't a context for - * the field. - * TK_DONT_DESTROY_WINDOW: 1 means that Tk_DestroyWindow should not - * invoke XDestroyWindow to destroy this widget's - * X window. The flag is set when the window has - * already been destroyed elsewhere (e.g. by - * another application) or when it will be - * destroyed later (e.g. by destroying its parent) - * TK_WM_COLORMAP_WINDOW: 1 means that this window has at some time - * appeared in the WM_COLORMAP_WINDOWS property - * for its toplevel, so we have to remove it from - * that property if the window is deleted and the - * toplevel isn't. - * TK_EMBEDDED: 1 means that this window (which must be a - * toplevel) is not a free-standing window but - * rather is embedded in some other application. - * TK_CONTAINER: 1 means that this window is a container, and - * that some other application (either in this - * process or elsewhere) may be embedding itself - * inside the window. - * TK_BOTH_HALVES: 1 means that this window is used for - * application embedding (either as container or - * embedded application), and both the containing - * and embedded halves are associated with - * windows in this particular process. - * TK_DEFER_MODAL: 1 means that this window has deferred a modal - * loop until all of the bindings for the current - * event have been invoked. - * TK_WRAPPER: 1 means that this window is the extra wrapper - * window created around a toplevel to hold the - * menubar under Unix. See tkUnixWm.c for more - * information. - * TK_REPARENTED: 1 means that this window has been reparented - * so that as far as the window system is - * concerned it isn't a child of its Tk parent. - * Initially this is used only for special Unix - * menubar windows. - * TK_ANONYMOUS_WINDOW: 1 means that this window has no name, and is - * thus not accessible from Tk. - * TK_HAS_WRAPPER 1 means that this window has a wrapper window - * TK_WIN_MANAGED 1 means that this window is a child of the root - * window, and is managed by the window manager. - * TK_TOP_HIERARCHY 1 means this window is at the top of a physical - * window hierarchy within this process, i.e. the - * window's parent either doesn't exist or is not - * owned by this Tk application. - * TK_PROP_PROPCHANGE 1 means that PropertyNotify events in the - * window's children should propagate up to this - * window. - * TK_WM_MANAGEABLE 1 marks a window as capable of being converted - * into a toplevel using [wm manage]. - */ - -#define TK_MAPPED 1 -#define TK_TOP_LEVEL 2 -#define TK_ALREADY_DEAD 4 -#define TK_NEED_CONFIG_NOTIFY 8 -#define TK_GRAB_FLAG 0x10 -#define TK_CHECKED_IC 0x20 -#define TK_DONT_DESTROY_WINDOW 0x40 -#define TK_WM_COLORMAP_WINDOW 0x80 -#define TK_EMBEDDED 0x100 -#define TK_CONTAINER 0x200 -#define TK_BOTH_HALVES 0x400 -#define TK_DEFER_MODAL 0x800 -#define TK_WRAPPER 0x1000 -#define TK_REPARENTED 0x2000 -#define TK_ANONYMOUS_WINDOW 0x4000 -#define TK_HAS_WRAPPER 0x8000 -#define TK_WIN_MANAGED 0x10000 -#define TK_TOP_HIERARCHY 0x20000 -#define TK_PROP_PROPCHANGE 0x40000 -#define TK_WM_MANAGEABLE 0x80000 - -/* - *-------------------------------------------------------------- - * - * Procedure prototypes and structures used for defining new canvas items: - * - *-------------------------------------------------------------- - */ - -typedef enum { - TK_STATE_NULL = -1, TK_STATE_ACTIVE, TK_STATE_DISABLED, - TK_STATE_NORMAL, TK_STATE_HIDDEN -} Tk_State; - -typedef struct Tk_SmoothMethod { - char *name; - int (*coordProc) _ANSI_ARGS_((Tk_Canvas canvas, - double *pointPtr, int numPoints, int numSteps, - XPoint xPoints[], double dblPoints[])); - void (*postscriptProc) _ANSI_ARGS_((Tcl_Interp *interp, - Tk_Canvas canvas, double *coordPtr, - int numPoints, int numSteps)); -} Tk_SmoothMethod; - -/* - * For each item in a canvas widget there exists one record with the following - * structure. Each actual item is represented by a record with the following - * stuff at its beginning, plus additional type-specific stuff after that. - */ - -#define TK_TAG_SPACE 3 - -typedef struct Tk_Item { - int id; /* Unique identifier for this item (also - * serves as first tag for item). */ - struct Tk_Item *nextPtr; /* Next in display list of all items in this - * canvas. Later items in list are drawn on - * top of earlier ones. */ - Tk_Uid staticTagSpace[TK_TAG_SPACE]; - /* Built-in space for limited # of tags. */ - Tk_Uid *tagPtr; /* Pointer to array of tags. Usually points to - * staticTagSpace, but may point to malloc-ed - * space if there are lots of tags. */ - int tagSpace; /* Total amount of tag space available at - * tagPtr. */ - int numTags; /* Number of tag slots actually used at - * *tagPtr. */ - struct Tk_ItemType *typePtr;/* Table of procedures that implement this - * type of item. */ - int x1, y1, x2, y2; /* Bounding box for item, in integer canvas - * units. Set by item-specific code and - * guaranteed to contain every pixel drawn in - * item. Item area includes x1 and y1 but not - * x2 and y2. */ - struct Tk_Item *prevPtr; /* Previous in display list of all items in - * this canvas. Later items in list are drawn - * just below earlier ones. */ - Tk_State state; /* State of item. */ - char *reserved1; /* reserved for future use */ - int redraw_flags; /* Some flags used in the canvas */ - - /* - *------------------------------------------------------------------ - * Starting here is additional type-specific stuff; see the declarations - * for individual types to see what is part of each type. The actual space - * below is determined by the "itemInfoSize" of the type's Tk_ItemType - * record. - *------------------------------------------------------------------ - */ -} Tk_Item; - -/* - * Flag bits for canvases (redraw_flags): - * - * TK_ITEM_STATE_DEPENDANT - 1 means that object needs to be redrawn if the - * canvas state changes. - * TK_ITEM_DONT_REDRAW - 1 means that the object redraw is already been - * prepared, so the general canvas code doesn't - * need to do that any more. - */ - -#define TK_ITEM_STATE_DEPENDANT 1 -#define TK_ITEM_DONT_REDRAW 2 - -/* - * Records of the following type are used to describe a type of item (e.g. - * lines, circles, etc.) that can form part of a canvas widget. - */ - -#ifdef USE_OLD_CANVAS -typedef int Tk_ItemCreateProc _ANSI_ARGS_((Tcl_Interp *interp, - Tk_Canvas canvas, Tk_Item *itemPtr, int argc, - char **argv)); -typedef int Tk_ItemConfigureProc _ANSI_ARGS_((Tcl_Interp *interp, - Tk_Canvas canvas, Tk_Item *itemPtr, int argc, - char **argv, int flags)); -typedef int Tk_ItemCoordProc _ANSI_ARGS_((Tcl_Interp *interp, - Tk_Canvas canvas, Tk_Item *itemPtr, int argc, - char **argv)); -#else -typedef int Tk_ItemCreateProc _ANSI_ARGS_((Tcl_Interp *interp, - Tk_Canvas canvas, Tk_Item *itemPtr, int argc, - Tcl_Obj *const objv[])); -typedef int Tk_ItemConfigureProc _ANSI_ARGS_((Tcl_Interp *interp, - Tk_Canvas canvas, Tk_Item *itemPtr, int argc, - Tcl_Obj *const objv[], int flags)); -typedef int Tk_ItemCoordProc _ANSI_ARGS_((Tcl_Interp *interp, - Tk_Canvas canvas, Tk_Item *itemPtr, int argc, - Tcl_Obj *const argv[])); -#endif -typedef void Tk_ItemDeleteProc _ANSI_ARGS_((Tk_Canvas canvas, - Tk_Item *itemPtr, Display *display)); -typedef void Tk_ItemDisplayProc _ANSI_ARGS_((Tk_Canvas canvas, - Tk_Item *itemPtr, Display *display, Drawable dst, - int x, int y, int width, int height)); -typedef double Tk_ItemPointProc _ANSI_ARGS_((Tk_Canvas canvas, - Tk_Item *itemPtr, double *pointPtr)); -typedef int Tk_ItemAreaProc _ANSI_ARGS_((Tk_Canvas canvas, - Tk_Item *itemPtr, double *rectPtr)); -typedef int Tk_ItemPostscriptProc _ANSI_ARGS_((Tcl_Interp *interp, - Tk_Canvas canvas, Tk_Item *itemPtr, int prepass)); -typedef void Tk_ItemScaleProc _ANSI_ARGS_((Tk_Canvas canvas, - Tk_Item *itemPtr, double originX, double originY, - double scaleX, double scaleY)); -typedef void Tk_ItemTranslateProc _ANSI_ARGS_((Tk_Canvas canvas, - Tk_Item *itemPtr, double deltaX, double deltaY)); -typedef int Tk_ItemIndexProc _ANSI_ARGS_((Tcl_Interp *interp, - Tk_Canvas canvas, Tk_Item *itemPtr, char *indexString, - int *indexPtr)); -typedef void Tk_ItemCursorProc _ANSI_ARGS_((Tk_Canvas canvas, - Tk_Item *itemPtr, int index)); -typedef int Tk_ItemSelectionProc _ANSI_ARGS_((Tk_Canvas canvas, - Tk_Item *itemPtr, int offset, char *buffer, - int maxBytes)); -typedef void Tk_ItemInsertProc _ANSI_ARGS_((Tk_Canvas canvas, - Tk_Item *itemPtr, int beforeThis, char *string)); -typedef void Tk_ItemDCharsProc _ANSI_ARGS_((Tk_Canvas canvas, - Tk_Item *itemPtr, int first, int last)); - -#ifndef __NO_OLD_CONFIG - -typedef struct Tk_ItemType { - char *name; /* The name of this type of item, such as - * "line". */ - int itemSize; /* Total amount of space needed for item's - * record. */ - Tk_ItemCreateProc *createProc; - /* Procedure to create a new item of this - * type. */ - Tk_ConfigSpec *configSpecs; /* Pointer to array of configuration specs for - * this type. Used for returning configuration - * info. */ - Tk_ItemConfigureProc *configProc; - /* Procedure to call to change configuration - * options. */ - Tk_ItemCoordProc *coordProc;/* Procedure to call to get and set the item's - * coordinates. */ - Tk_ItemDeleteProc *deleteProc; - /* Procedure to delete existing item of this - * type. */ - Tk_ItemDisplayProc *displayProc; - /* Procedure to display items of this type. */ - int alwaysRedraw; /* Non-zero means displayProc should be called - * even when the item has been moved - * off-screen. */ - Tk_ItemPointProc *pointProc;/* Computes distance from item to a given - * point. */ - Tk_ItemAreaProc *areaProc; /* Computes whether item is inside, outside, - * or overlapping an area. */ - Tk_ItemPostscriptProc *postscriptProc; - /* Procedure to write a Postscript description - * for items of this type. */ - Tk_ItemScaleProc *scaleProc;/* Procedure to rescale items of this type. */ - Tk_ItemTranslateProc *translateProc; - /* Procedure to translate items of this - * type. */ - Tk_ItemIndexProc *indexProc;/* Procedure to determine index of indicated - * character. NULL if item doesn't support - * indexing. */ - Tk_ItemCursorProc *icursorProc; - /* Procedure to set insert cursor posn to just - * before a given position. */ - Tk_ItemSelectionProc *selectionProc; - /* Procedure to return selection (in STRING - * format) when it is in this item. */ - Tk_ItemInsertProc *insertProc; - /* Procedure to insert something into an - * item. */ - Tk_ItemDCharsProc *dCharsProc; - /* Procedure to delete characters from an - * item. */ - struct Tk_ItemType *nextPtr;/* Used to link types together into a list. */ - char *reserved1; /* Reserved for future extension. */ - int reserved2; /* Carefully compatible with */ - char *reserved3; /* Jan Nijtmans dash patch */ - char *reserved4; -} Tk_ItemType; - -#endif - -/* - * The following structure provides information about the selection and the - * insertion cursor. It is needed by only a few items, such as those that - * display text. It is shared by the generic canvas code and the item-specific - * code, but most of the fields should be written only by the canvas generic - * code. - */ - -typedef struct Tk_CanvasTextInfo { - Tk_3DBorder selBorder; /* Border and background for selected - * characters. Read-only to items.*/ - int selBorderWidth; /* Width of border around selection. Read-only - * to items. */ - XColor *selFgColorPtr; /* Foreground color for selected text. - * Read-only to items. */ - Tk_Item *selItemPtr; /* Pointer to selected item. NULL means - * selection isn't in this canvas. Writable by - * items. */ - int selectFirst; /* Character index of first selected - * character. Writable by items. */ - int selectLast; /* Character index of last selected character. - * Writable by items. */ - Tk_Item *anchorItemPtr; /* Item corresponding to "selectAnchor": not - * necessarily selItemPtr. Read-only to - * items. */ - int selectAnchor; /* Character index of fixed end of selection - * (i.e. "select to" operation will use this - * as one end of the selection). Writable by - * items. */ - Tk_3DBorder insertBorder; /* Used to draw vertical bar for insertion - * cursor. Read-only to items. */ - int insertWidth; /* Total width of insertion cursor. Read-only - * to items. */ - int insertBorderWidth; /* Width of 3-D border around insert cursor. - * Read-only to items. */ - Tk_Item *focusItemPtr; /* Item that currently has the input focus, or - * NULL if no such item. Read-only to items. */ - int gotFocus; /* Non-zero means that the canvas widget has - * the input focus. Read-only to items.*/ - int cursorOn; /* Non-zero means that an insertion cursor - * should be displayed in focusItemPtr. - * Read-only to items.*/ -} Tk_CanvasTextInfo; - -/* - * Structures used for Dashing and Outline. - */ - -typedef struct Tk_Dash { - int number; - union { - char *pt; - char array[sizeof(char *)]; - } pattern; -} Tk_Dash; - -typedef struct Tk_TSOffset { - int flags; /* Flags; see below for possible values */ - int xoffset; /* x offset */ - int yoffset; /* y offset */ -} Tk_TSOffset; - -/* - * Bit fields in Tk_Offset->flags: - */ - -#define TK_OFFSET_INDEX 1 -#define TK_OFFSET_RELATIVE 2 -#define TK_OFFSET_LEFT 4 -#define TK_OFFSET_CENTER 8 -#define TK_OFFSET_RIGHT 16 -#define TK_OFFSET_TOP 32 -#define TK_OFFSET_MIDDLE 64 -#define TK_OFFSET_BOTTOM 128 - -typedef struct Tk_Outline { - GC gc; /* Graphics context. */ - double width; /* Width of outline. */ - double activeWidth; /* Width of outline. */ - double disabledWidth; /* Width of outline. */ - int offset; /* Dash offset. */ - Tk_Dash dash; /* Dash pattern. */ - Tk_Dash activeDash; /* Dash pattern if state is active. */ - Tk_Dash disabledDash; /* Dash pattern if state is disabled. */ - VOID *reserved1; /* Reserved for future expansion. */ - VOID *reserved2; - VOID *reserved3; - Tk_TSOffset tsoffset; /* Stipple offset for outline. */ - XColor *color; /* Outline color. */ - XColor *activeColor; /* Outline color if state is active. */ - XColor *disabledColor; /* Outline color if state is disabled. */ - Pixmap stipple; /* Outline Stipple pattern. */ - Pixmap activeStipple; /* Outline Stipple pattern if state is - * active. */ - Pixmap disabledStipple; /* Outline Stipple pattern if state is - * disabled. */ -} Tk_Outline; - -/* - *-------------------------------------------------------------- - * - * Procedure prototypes and structures used for managing images: - * - *-------------------------------------------------------------- - */ - -typedef struct Tk_ImageType Tk_ImageType; -#ifdef USE_OLD_IMAGE -typedef int (Tk_ImageCreateProc) _ANSI_ARGS_((Tcl_Interp *interp, - char *name, int argc, char **argv, Tk_ImageType *typePtr, - Tk_ImageMaster master, ClientData *masterDataPtr)); -#else -typedef int (Tk_ImageCreateProc) _ANSI_ARGS_((Tcl_Interp *interp, - char *name, int objc, Tcl_Obj *const objv[], Tk_ImageType *typePtr, - Tk_ImageMaster master, ClientData *masterDataPtr)); -#endif -typedef ClientData (Tk_ImageGetProc) _ANSI_ARGS_((Tk_Window tkwin, - ClientData masterData)); -typedef void (Tk_ImageDisplayProc) _ANSI_ARGS_((ClientData instanceData, - Display *display, Drawable drawable, int imageX, int imageY, - int width, int height, int drawableX, int drawableY)); -typedef void (Tk_ImageFreeProc) _ANSI_ARGS_((ClientData instanceData, - Display *display)); -typedef void (Tk_ImageDeleteProc) _ANSI_ARGS_((ClientData masterData)); -typedef void (Tk_ImageChangedProc) _ANSI_ARGS_((ClientData clientData, - int x, int y, int width, int height, int imageWidth, - int imageHeight)); -typedef int (Tk_ImagePostscriptProc) _ANSI_ARGS_((ClientData clientData, - Tcl_Interp *interp, Tk_Window tkwin, Tk_PostscriptInfo psinfo, - int x, int y, int width, int height, int prepass)); - -/* - * The following structure represents a particular type of image (bitmap, xpm - * image, etc.). It provides information common to all images of that type, - * such as the type name and a collection of procedures in the image manager - * that respond to various events. Each image manager is represented by one of - * these structures. - */ - -struct Tk_ImageType { - char *name; /* Name of image type. */ - Tk_ImageCreateProc *createProc; - /* Procedure to call to create a new image of - * this type. */ - Tk_ImageGetProc *getProc; /* Procedure to call the first time - * Tk_GetImage is called in a new way (new - * visual or screen). */ - Tk_ImageDisplayProc *displayProc; - /* Call to draw image, in response to - * Tk_RedrawImage calls. */ - Tk_ImageFreeProc *freeProc; /* Procedure to call whenever Tk_FreeImage is - * called to release an instance of an - * image. */ - Tk_ImageDeleteProc *deleteProc; - /* Procedure to call to delete image. It will - * not be called until after freeProc has been - * called for each instance of the image. */ - Tk_ImagePostscriptProc *postscriptProc; - /* Procedure to call to produce postscript - * output for the image. */ - struct Tk_ImageType *nextPtr; - /* Next in list of all image types currently - * known. Filled in by Tk, not by image - * manager. */ - char *reserved; /* reserved for future expansion */ -}; - -/* - *-------------------------------------------------------------- - * - * Additional definitions used to manage images of type "photo". - * - *-------------------------------------------------------------- - */ - -/* - * The following type is used to identify a particular photo image to be - * manipulated: - */ - -typedef void *Tk_PhotoHandle; - -/* - * The following structure describes a block of pixels in memory: - */ - -typedef struct Tk_PhotoImageBlock { - unsigned char *pixelPtr; /* Pointer to the first pixel. */ - int width; /* Width of block, in pixels. */ - int height; /* Height of block, in pixels. */ - int pitch; /* Address difference between corresponding - * pixels in successive lines. */ - int pixelSize; /* Address difference between successive - * pixels in the same line. */ - int offset[4]; /* Address differences between the red, green, - * blue and alpha components of the pixel and - * the pixel as a whole. */ -} Tk_PhotoImageBlock; - -/* - * The following values control how blocks are combined into photo images when - * the alpha component of a pixel is not 255, a.k.a. the compositing rule. - */ - -#define TK_PHOTO_COMPOSITE_OVERLAY 0 -#define TK_PHOTO_COMPOSITE_SET 1 - -/* - * Procedure prototypes and structures used in reading and writing photo - * images: - */ - -typedef struct Tk_PhotoImageFormat Tk_PhotoImageFormat; -#ifdef USE_OLD_IMAGE -typedef int (Tk_ImageFileMatchProc) _ANSI_ARGS_((Tcl_Channel chan, - char *fileName, char *formatString, int *widthPtr, int *heightPtr)); -typedef int (Tk_ImageStringMatchProc) _ANSI_ARGS_((char *string, - char *formatString, int *widthPtr, int *heightPtr)); -typedef int (Tk_ImageFileReadProc) _ANSI_ARGS_((Tcl_Interp *interp, - Tcl_Channel chan, char *fileName, char *formatString, - Tk_PhotoHandle imageHandle, int destX, int destY, - int width, int height, int srcX, int srcY)); -typedef int (Tk_ImageStringReadProc) _ANSI_ARGS_((Tcl_Interp *interp, - char *string, char *formatString, Tk_PhotoHandle imageHandle, - int destX, int destY, int width, int height, int srcX, int srcY)); -typedef int (Tk_ImageFileWriteProc) _ANSI_ARGS_((Tcl_Interp *interp, - char *fileName, char *formatString, Tk_PhotoImageBlock *blockPtr)); -typedef int (Tk_ImageStringWriteProc) _ANSI_ARGS_((Tcl_Interp *interp, - Tcl_DString *dataPtr, char *formatString, - Tk_PhotoImageBlock *blockPtr)); -#else -typedef int (Tk_ImageFileMatchProc) _ANSI_ARGS_((Tcl_Channel chan, - const char *fileName, Tcl_Obj *format, int *widthPtr, - int *heightPtr, Tcl_Interp *interp)); -typedef int (Tk_ImageStringMatchProc) _ANSI_ARGS_((Tcl_Obj *dataObj, - Tcl_Obj *format, int *widthPtr, int *heightPtr, - Tcl_Interp *interp)); -typedef int (Tk_ImageFileReadProc) _ANSI_ARGS_((Tcl_Interp *interp, - Tcl_Channel chan, const char *fileName, Tcl_Obj *format, - Tk_PhotoHandle imageHandle, int destX, int destY, - int width, int height, int srcX, int srcY)); -typedef int (Tk_ImageStringReadProc) _ANSI_ARGS_((Tcl_Interp *interp, - Tcl_Obj *dataObj, Tcl_Obj *format, Tk_PhotoHandle imageHandle, - int destX, int destY, int width, int height, int srcX, int srcY)); -typedef int (Tk_ImageFileWriteProc) _ANSI_ARGS_((Tcl_Interp *interp, - const char *fileName, Tcl_Obj *format, Tk_PhotoImageBlock *blockPtr)); -typedef int (Tk_ImageStringWriteProc) _ANSI_ARGS_((Tcl_Interp *interp, - Tcl_Obj *format, Tk_PhotoImageBlock *blockPtr)); -#endif - -/* - * The following structure represents a particular file format for storing - * images (e.g., PPM, GIF, JPEG, etc.). It provides information to allow image - * files of that format to be recognized and read into a photo image. - */ - -struct Tk_PhotoImageFormat { - char *name; /* Name of image file format */ - Tk_ImageFileMatchProc *fileMatchProc; - /* Procedure to call to determine whether an - * image file matches this format. */ - Tk_ImageStringMatchProc *stringMatchProc; - /* Procedure to call to determine whether the - * data in a string matches this format. */ - Tk_ImageFileReadProc *fileReadProc; - /* Procedure to call to read data from an - * image file into a photo image. */ - Tk_ImageStringReadProc *stringReadProc; - /* Procedure to call to read data from a - * string into a photo image. */ - Tk_ImageFileWriteProc *fileWriteProc; - /* Procedure to call to write data from a - * photo image to a file. */ - Tk_ImageStringWriteProc *stringWriteProc; - /* Procedure to call to obtain a string - * representation of the data in a photo - * image.*/ - struct Tk_PhotoImageFormat *nextPtr; - /* Next in list of all photo image formats - * currently known. Filled in by Tk, not by - * image format handler. */ -}; - -#ifdef USE_OLD_IMAGE -#define Tk_CreateImageType Tk_CreateOldImageType -#define Tk_CreatePhotoImageFormat Tk_CreateOldPhotoImageFormat -#endif - -/* - *-------------------------------------------------------------- - * - * Procedure prototypes and structures used for managing styles: - * - *-------------------------------------------------------------- - */ - -/* - * Style support version tag. - */ - -#define TK_STYLE_VERSION_1 0x1 -#define TK_STYLE_VERSION TK_STYLE_VERSION_1 - -/* - * The following structures and prototypes are used as static templates to - * declare widget elements. - */ - -typedef void (Tk_GetElementSizeProc) _ANSI_ARGS_((ClientData clientData, - char *recordPtr, const Tk_OptionSpec **optionsPtr, Tk_Window tkwin, - int width, int height, int inner, int *widthPtr, int *heightPtr)); -typedef void (Tk_GetElementBoxProc) _ANSI_ARGS_((ClientData clientData, - char *recordPtr, const Tk_OptionSpec **optionsPtr, Tk_Window tkwin, - int x, int y, int width, int height, int inner, int *xPtr, int *yPtr, - int *widthPtr, int *heightPtr)); -typedef int (Tk_GetElementBorderWidthProc) _ANSI_ARGS_((ClientData clientData, - char *recordPtr, const Tk_OptionSpec **optionsPtr, Tk_Window tkwin)); -typedef void (Tk_DrawElementProc) _ANSI_ARGS_((ClientData clientData, - char *recordPtr, const Tk_OptionSpec **optionsPtr, Tk_Window tkwin, - Drawable d, int x, int y, int width, int height, int state)); - -typedef struct Tk_ElementOptionSpec { - char *name; /* Name of the required option. */ - Tk_OptionType type; /* Accepted option type. TK_OPTION_END means - * any. */ -} Tk_ElementOptionSpec; - -typedef struct Tk_ElementSpec { - int version; /* Version of the style support. */ - char *name; /* Name of element. */ - Tk_ElementOptionSpec *options; - /* List of required options. Last one's name - * must be NULL. */ - Tk_GetElementSizeProc *getSize; - /* Compute the external (resp. internal) size - * of the element from its desired internal - * (resp. external) size. */ - Tk_GetElementBoxProc *getBox; - /* Compute the inscribed or bounding boxes - * within a given area. */ - Tk_GetElementBorderWidthProc *getBorderWidth; - /* Return the element's internal border width. - * Mostly useful for widgets. */ - Tk_DrawElementProc *draw; /* Draw the element in the given bounding - * box. */ -} Tk_ElementSpec; - -/* - * Element state flags. Can be OR'ed. - */ - -#define TK_ELEMENT_STATE_ACTIVE 1<<0 -#define TK_ELEMENT_STATE_DISABLED 1<<1 -#define TK_ELEMENT_STATE_FOCUS 1<<2 -#define TK_ELEMENT_STATE_PRESSED 1<<3 - -/* - *-------------------------------------------------------------- - * - * The definitions below provide backward compatibility for functions and - * types related to event handling that used to be in Tk but have moved to - * Tcl. - * - *-------------------------------------------------------------- - */ - -#define TK_READABLE TCL_READABLE -#define TK_WRITABLE TCL_WRITABLE -#define TK_EXCEPTION TCL_EXCEPTION - -#define TK_DONT_WAIT TCL_DONT_WAIT -#define TK_X_EVENTS TCL_WINDOW_EVENTS -#define TK_WINDOW_EVENTS TCL_WINDOW_EVENTS -#define TK_FILE_EVENTS TCL_FILE_EVENTS -#define TK_TIMER_EVENTS TCL_TIMER_EVENTS -#define TK_IDLE_EVENTS TCL_IDLE_EVENTS -#define TK_ALL_EVENTS TCL_ALL_EVENTS - -#define Tk_IdleProc Tcl_IdleProc -#define Tk_FileProc Tcl_FileProc -#define Tk_TimerProc Tcl_TimerProc -#define Tk_TimerToken Tcl_TimerToken - -#define Tk_BackgroundError Tcl_BackgroundError -#define Tk_CancelIdleCall Tcl_CancelIdleCall -#define Tk_CreateFileHandler Tcl_CreateFileHandler -#define Tk_CreateTimerHandler Tcl_CreateTimerHandler -#define Tk_DeleteFileHandler Tcl_DeleteFileHandler -#define Tk_DeleteTimerHandler Tcl_DeleteTimerHandler -#define Tk_DoOneEvent Tcl_DoOneEvent -#define Tk_DoWhenIdle Tcl_DoWhenIdle -#define Tk_Sleep Tcl_Sleep - -/* Additional stuff that has moved to Tcl: */ - -#define Tk_EventuallyFree Tcl_EventuallyFree -#define Tk_FreeProc Tcl_FreeProc -#define Tk_Preserve Tcl_Preserve -#define Tk_Release Tcl_Release - -/* Removed Tk_Main, use macro instead */ -#define Tk_Main(argc, argv, proc) \ - Tk_MainEx(argc, argv, proc, Tcl_CreateInterp()) - -const char * Tk_InitStubs _ANSI_ARGS_((Tcl_Interp *interp, - const char *version, int exact)); -EXTERN const char * Tk_PkgInitStubsCheck _ANSI_ARGS_((Tcl_Interp *interp, - const char *version, int exact)); - -#ifndef USE_TK_STUBS - -#define Tk_InitStubs(interp, version, exact) \ - Tk_PkgInitStubsCheck(interp, version, exact) - -#endif - -#define Tk_InitImageArgs(interp, argc, argv) /**/ - - -/* - *-------------------------------------------------------------- - * - * Additional procedure types defined by Tk. - * - *-------------------------------------------------------------- - */ - -typedef int (Tk_ErrorProc) _ANSI_ARGS_((ClientData clientData, - XErrorEvent *errEventPtr)); -typedef void (Tk_EventProc) _ANSI_ARGS_((ClientData clientData, - XEvent *eventPtr)); -typedef int (Tk_GenericProc) _ANSI_ARGS_((ClientData clientData, - XEvent *eventPtr)); -typedef int (Tk_ClientMessageProc) _ANSI_ARGS_((Tk_Window tkwin, - XEvent *eventPtr)); -typedef int (Tk_GetSelProc) _ANSI_ARGS_((ClientData clientData, - Tcl_Interp *interp, char *portion)); -typedef void (Tk_LostSelProc) _ANSI_ARGS_((ClientData clientData)); -typedef Tk_RestrictAction (Tk_RestrictProc) _ANSI_ARGS_(( - ClientData clientData, XEvent *eventPtr)); -typedef int (Tk_SelectionProc) _ANSI_ARGS_((ClientData clientData, - int offset, char *buffer, int maxBytes)); - -/* - *-------------------------------------------------------------- - * - * Platform independant exported procedures and variables. - * - *-------------------------------------------------------------- - */ - -#include "tkDecls.h" - -/* - * Allow users to say that they don't want to alter their source to add extra - * arguments to Tk_PhotoPutBlock() et al; DO NOT DEFINE THIS WHEN BUILDING TK. - * - * This goes after the inclusion of the stubbed-decls so that the declarations - * of what is actually there can be correct. - */ - -#ifdef USE_COMPOSITELESS_PHOTO_PUT_BLOCK -# ifdef Tk_PhotoPutBlock -# undef Tk_PhotoPutBlock -# endif -# define Tk_PhotoPutBlock Tk_PhotoPutBlock_NoComposite -# ifdef Tk_PhotoPutZoomedBlock -# undef Tk_PhotoPutZoomedBlock -# endif -# define Tk_PhotoPutZoomedBlock Tk_PhotoPutZoomedBlock_NoComposite -# define USE_PANIC_ON_PHOTO_ALLOC_FAILURE -#else /* !USE_COMPOSITELESS_PHOTO_PUT_BLOCK */ -# ifdef USE_PANIC_ON_PHOTO_ALLOC_FAILURE -# ifdef Tk_PhotoPutBlock -# undef Tk_PhotoPutBlock -# endif -# define Tk_PhotoPutBlock Tk_PhotoPutBlock_Panic -# ifdef Tk_PhotoPutZoomedBlock -# undef Tk_PhotoPutZoomedBlock -# endif -# define Tk_PhotoPutZoomedBlock Tk_PhotoPutZoomedBlock_Panic -# endif /* USE_PANIC_ON_PHOTO_ALLOC_FAILURE */ -#endif /* USE_COMPOSITELESS_PHOTO_PUT_BLOCK */ -#ifdef USE_PANIC_ON_PHOTO_ALLOC_FAILURE -# ifdef Tk_PhotoExpand -# undef Tk_PhotoExpand -# endif -# define Tk_PhotoExpand Tk_PhotoExpand_Panic -# ifdef Tk_PhotoSetSize -# undef Tk_PhotoSetSize -# endif -# define Tk_PhotoSetSize Tk_PhotoSetSize_Panic -#endif /* USE_PANIC_ON_PHOTO_ALLOC_FAILURE */ - -/* - * Tcl commands exported by Tk: - */ - -#undef TCL_STORAGE_CLASS -#define TCL_STORAGE_CLASS DLLIMPORT - -#endif /* RC_INVOKED */ - -/* - * end block for C++ - */ - -#ifdef __cplusplus -} -#endif - -#endif /* _TK */ - -/* - * Local Variables: - * mode: c - * c-basic-offset: 4 - * fill-column: 78 - * End: - */ diff -Nru critcl-3.1.9/lib/critcl/critcl_c/tcl8.5/X11/tkIntXlibDecls.h critcl-3.1.17+dfsg/lib/critcl/critcl_c/tcl8.5/X11/tkIntXlibDecls.h --- critcl-3.1.9/lib/critcl/critcl_c/tcl8.5/X11/tkIntXlibDecls.h 2013-05-10 05:57:04.000000000 +0000 +++ critcl-3.1.17+dfsg/lib/critcl/critcl_c/tcl8.5/X11/tkIntXlibDecls.h 2017-10-14 02:48:11.000000000 +0000 @@ -8,37 +8,47 @@ * * Copyright (c) 1998-1999 by Scriptics Corporation. * All rights reserved. - * - * RCS: @(#) $Id: tkIntXlibDecls.h,v 1.23.2.1 2010/02/07 23:24:13 nijtmans Exp $ */ #ifndef _TKINTXLIBDECLS #define _TKINTXLIBDECLS +/* + * WARNING: This file is automatically generated by the tools/genStubs.tcl + * script. Any modifications to the function declarations below should be made + * in the generic/tkInt.decls script. + */ + +#ifdef MAC_TCL +#include "Xutil.h" +#else #include "X11/Xutil.h" +#endif #ifdef BUILD_tk #undef TCL_STORAGE_CLASS #define TCL_STORAGE_CLASS DLLEXPORT #endif -/* - * WARNING: This file is automatically generated by the tools/genStubs.tcl - * script. Any modifications to the function declarations below should be made - * in the generic/tkInt.decls script. - */ +typedef int (*XAfterFunction) ( /* WARNING, this type not in Xlib spec */ + Display* /* display */ +); /* !BEGIN!: Do not edit below this line. */ +#ifdef __cplusplus +extern "C" { +#endif + /* * Exported function declarations: */ -#ifdef __WIN32__ /* WIN */ +#if defined(__WIN32__) || defined(__CYGWIN__) /* WIN */ #ifndef XSetDashes_TCL_DECLARED #define XSetDashes_TCL_DECLARED /* 0 */ -EXTERN void XSetDashes(Display *display, GC gc, int dash_offset, +EXTERN int XSetDashes(Display *display, GC gc, int dash_offset, _Xconst char *dash_list, int n); #endif #ifndef XGetModifierMapping_TCL_DECLARED @@ -88,7 +98,7 @@ /* 8 */ EXTERN Cursor XCreateGlyphCursor(Display *d, Font f1, Font f2, unsigned int ui1, unsigned int ui2, - XColor *x1, XColor *x2); + XColor _Xconst *x1, XColor _Xconst *x2); #endif #ifndef XGContextFromGC_TCL_DECLARED #define XGContextFromGC_TCL_DECLARED @@ -144,43 +154,43 @@ #ifndef XBell_TCL_DECLARED #define XBell_TCL_DECLARED /* 19 */ -EXTERN void XBell(Display *d, int i); +EXTERN int XBell(Display *d, int i); #endif #ifndef XChangeProperty_TCL_DECLARED #define XChangeProperty_TCL_DECLARED /* 20 */ -EXTERN void XChangeProperty(Display *d, Window w, Atom a1, +EXTERN int XChangeProperty(Display *d, Window w, Atom a1, Atom a2, int i1, int i2, _Xconst unsigned char *c, int i3); #endif #ifndef XChangeWindowAttributes_TCL_DECLARED #define XChangeWindowAttributes_TCL_DECLARED /* 21 */ -EXTERN void XChangeWindowAttributes(Display *d, Window w, +EXTERN int XChangeWindowAttributes(Display *d, Window w, unsigned long ul, XSetWindowAttributes *x); #endif #ifndef XClearWindow_TCL_DECLARED #define XClearWindow_TCL_DECLARED /* 22 */ -EXTERN void XClearWindow(Display *d, Window w); +EXTERN int XClearWindow(Display *d, Window w); #endif #ifndef XConfigureWindow_TCL_DECLARED #define XConfigureWindow_TCL_DECLARED /* 23 */ -EXTERN void XConfigureWindow(Display *d, Window w, +EXTERN int XConfigureWindow(Display *d, Window w, unsigned int i, XWindowChanges *x); #endif #ifndef XCopyArea_TCL_DECLARED #define XCopyArea_TCL_DECLARED /* 24 */ -EXTERN void XCopyArea(Display *d, Drawable dr1, Drawable dr2, +EXTERN int XCopyArea(Display *d, Drawable dr1, Drawable dr2, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2, int i3, int i4); #endif #ifndef XCopyPlane_TCL_DECLARED #define XCopyPlane_TCL_DECLARED /* 25 */ -EXTERN void XCopyPlane(Display *d, Drawable dr1, Drawable dr2, +EXTERN int XCopyPlane(Display *d, Drawable dr1, Drawable dr2, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2, int i3, int i4, unsigned long ul); @@ -195,81 +205,81 @@ #ifndef XDefineCursor_TCL_DECLARED #define XDefineCursor_TCL_DECLARED /* 27 */ -EXTERN void XDefineCursor(Display *d, Window w, Cursor c); +EXTERN int XDefineCursor(Display *d, Window w, Cursor c); #endif #ifndef XDeleteProperty_TCL_DECLARED #define XDeleteProperty_TCL_DECLARED /* 28 */ -EXTERN void XDeleteProperty(Display *d, Window w, Atom a); +EXTERN int XDeleteProperty(Display *d, Window w, Atom a); #endif #ifndef XDestroyWindow_TCL_DECLARED #define XDestroyWindow_TCL_DECLARED /* 29 */ -EXTERN void XDestroyWindow(Display *d, Window w); +EXTERN int XDestroyWindow(Display *d, Window w); #endif #ifndef XDrawArc_TCL_DECLARED #define XDrawArc_TCL_DECLARED /* 30 */ -EXTERN void XDrawArc(Display *d, Drawable dr, GC g, int i1, +EXTERN int XDrawArc(Display *d, Drawable dr, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2, int i3, int i4); #endif #ifndef XDrawLines_TCL_DECLARED #define XDrawLines_TCL_DECLARED /* 31 */ -EXTERN void XDrawLines(Display *d, Drawable dr, GC g, XPoint *x, +EXTERN int XDrawLines(Display *d, Drawable dr, GC g, XPoint *x, int i1, int i2); #endif #ifndef XDrawRectangle_TCL_DECLARED #define XDrawRectangle_TCL_DECLARED /* 32 */ -EXTERN void XDrawRectangle(Display *d, Drawable dr, GC g, int i1, +EXTERN int XDrawRectangle(Display *d, Drawable dr, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2); #endif #ifndef XFillArc_TCL_DECLARED #define XFillArc_TCL_DECLARED /* 33 */ -EXTERN void XFillArc(Display *d, Drawable dr, GC g, int i1, +EXTERN int XFillArc(Display *d, Drawable dr, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2, int i3, int i4); #endif #ifndef XFillPolygon_TCL_DECLARED #define XFillPolygon_TCL_DECLARED /* 34 */ -EXTERN void XFillPolygon(Display *d, Drawable dr, GC g, +EXTERN int XFillPolygon(Display *d, Drawable dr, GC g, XPoint *x, int i1, int i2, int i3); #endif #ifndef XFillRectangles_TCL_DECLARED #define XFillRectangles_TCL_DECLARED /* 35 */ -EXTERN void XFillRectangles(Display *d, Drawable dr, GC g, +EXTERN int XFillRectangles(Display *d, Drawable dr, GC g, XRectangle *x, int i); #endif #ifndef XForceScreenSaver_TCL_DECLARED #define XForceScreenSaver_TCL_DECLARED /* 36 */ -EXTERN void XForceScreenSaver(Display *d, int i); +EXTERN int XForceScreenSaver(Display *d, int i); #endif #ifndef XFreeColormap_TCL_DECLARED #define XFreeColormap_TCL_DECLARED /* 37 */ -EXTERN void XFreeColormap(Display *d, Colormap c); +EXTERN int XFreeColormap(Display *d, Colormap c); #endif #ifndef XFreeColors_TCL_DECLARED #define XFreeColors_TCL_DECLARED /* 38 */ -EXTERN void XFreeColors(Display *d, Colormap c, +EXTERN int XFreeColors(Display *d, Colormap c, unsigned long *ulp, int i, unsigned long ul); #endif #ifndef XFreeCursor_TCL_DECLARED #define XFreeCursor_TCL_DECLARED /* 39 */ -EXTERN void XFreeCursor(Display *d, Cursor c); +EXTERN int XFreeCursor(Display *d, Cursor c); #endif #ifndef XFreeModifiermap_TCL_DECLARED #define XFreeModifiermap_TCL_DECLARED /* 40 */ -EXTERN void XFreeModifiermap(XModifierKeymap *x); +EXTERN int XFreeModifiermap(XModifierKeymap *x); #endif #ifndef XGetGeometry_TCL_DECLARED #define XGetGeometry_TCL_DECLARED @@ -282,7 +292,7 @@ #ifndef XGetInputFocus_TCL_DECLARED #define XGetInputFocus_TCL_DECLARED /* 42 */ -EXTERN void XGetInputFocus(Display *d, Window *w, int *i); +EXTERN int XGetInputFocus(Display *d, Window *w, int *i); #endif #ifndef XGetWindowProperty_TCL_DECLARED #define XGetWindowProperty_TCL_DECLARED @@ -325,33 +335,33 @@ #ifndef XMapWindow_TCL_DECLARED #define XMapWindow_TCL_DECLARED /* 49 */ -EXTERN void XMapWindow(Display *d, Window w); +EXTERN int XMapWindow(Display *d, Window w); #endif #ifndef XMoveResizeWindow_TCL_DECLARED #define XMoveResizeWindow_TCL_DECLARED /* 50 */ -EXTERN void XMoveResizeWindow(Display *d, Window w, int i1, +EXTERN int XMoveResizeWindow(Display *d, Window w, int i1, int i2, unsigned int ui1, unsigned int ui2); #endif #ifndef XMoveWindow_TCL_DECLARED #define XMoveWindow_TCL_DECLARED /* 51 */ -EXTERN void XMoveWindow(Display *d, Window w, int i1, int i2); +EXTERN int XMoveWindow(Display *d, Window w, int i1, int i2); #endif #ifndef XNextEvent_TCL_DECLARED #define XNextEvent_TCL_DECLARED /* 52 */ -EXTERN void XNextEvent(Display *d, XEvent *x); +EXTERN int XNextEvent(Display *d, XEvent *x); #endif #ifndef XPutBackEvent_TCL_DECLARED #define XPutBackEvent_TCL_DECLARED /* 53 */ -EXTERN void XPutBackEvent(Display *d, XEvent *x); +EXTERN int XPutBackEvent(Display *d, XEvent *x); #endif #ifndef XQueryColors_TCL_DECLARED #define XQueryColors_TCL_DECLARED /* 54 */ -EXTERN void XQueryColors(Display *d, Colormap c, XColor *x, +EXTERN int XQueryColors(Display *d, Colormap c, XColor *x, int i); #endif #ifndef XQueryPointer_TCL_DECLARED @@ -370,23 +380,23 @@ #ifndef XRaiseWindow_TCL_DECLARED #define XRaiseWindow_TCL_DECLARED /* 57 */ -EXTERN void XRaiseWindow(Display *d, Window w); +EXTERN int XRaiseWindow(Display *d, Window w); #endif #ifndef XRefreshKeyboardMapping_TCL_DECLARED #define XRefreshKeyboardMapping_TCL_DECLARED /* 58 */ -EXTERN void XRefreshKeyboardMapping(XMappingEvent *x); +EXTERN int XRefreshKeyboardMapping(XMappingEvent *x); #endif #ifndef XResizeWindow_TCL_DECLARED #define XResizeWindow_TCL_DECLARED /* 59 */ -EXTERN void XResizeWindow(Display *d, Window w, unsigned int ui1, +EXTERN int XResizeWindow(Display *d, Window w, unsigned int ui1, unsigned int ui2); #endif #ifndef XSelectInput_TCL_DECLARED #define XSelectInput_TCL_DECLARED /* 60 */ -EXTERN void XSelectInput(Display *d, Window w, long l); +EXTERN int XSelectInput(Display *d, Window w, long l); #endif #ifndef XSendEvent_TCL_DECLARED #define XSendEvent_TCL_DECLARED @@ -397,59 +407,58 @@ #ifndef XSetCommand_TCL_DECLARED #define XSetCommand_TCL_DECLARED /* 62 */ -EXTERN void XSetCommand(Display *d, Window w, CONST char **c, - int i); +EXTERN int XSetCommand(Display *d, Window w, char **c, int i); #endif #ifndef XSetIconName_TCL_DECLARED #define XSetIconName_TCL_DECLARED /* 63 */ -EXTERN void XSetIconName(Display *d, Window w, _Xconst char *c); +EXTERN int XSetIconName(Display *d, Window w, _Xconst char *c); #endif #ifndef XSetInputFocus_TCL_DECLARED #define XSetInputFocus_TCL_DECLARED /* 64 */ -EXTERN void XSetInputFocus(Display *d, Window w, int i, Time t); +EXTERN int XSetInputFocus(Display *d, Window w, int i, Time t); #endif #ifndef XSetSelectionOwner_TCL_DECLARED #define XSetSelectionOwner_TCL_DECLARED /* 65 */ -EXTERN void XSetSelectionOwner(Display *d, Atom a, Window w, +EXTERN int XSetSelectionOwner(Display *d, Atom a, Window w, Time t); #endif #ifndef XSetWindowBackground_TCL_DECLARED #define XSetWindowBackground_TCL_DECLARED /* 66 */ -EXTERN void XSetWindowBackground(Display *d, Window w, +EXTERN int XSetWindowBackground(Display *d, Window w, unsigned long ul); #endif #ifndef XSetWindowBackgroundPixmap_TCL_DECLARED #define XSetWindowBackgroundPixmap_TCL_DECLARED /* 67 */ -EXTERN void XSetWindowBackgroundPixmap(Display *d, Window w, +EXTERN int XSetWindowBackgroundPixmap(Display *d, Window w, Pixmap p); #endif #ifndef XSetWindowBorder_TCL_DECLARED #define XSetWindowBorder_TCL_DECLARED /* 68 */ -EXTERN void XSetWindowBorder(Display *d, Window w, +EXTERN int XSetWindowBorder(Display *d, Window w, unsigned long ul); #endif #ifndef XSetWindowBorderPixmap_TCL_DECLARED #define XSetWindowBorderPixmap_TCL_DECLARED /* 69 */ -EXTERN void XSetWindowBorderPixmap(Display *d, Window w, +EXTERN int XSetWindowBorderPixmap(Display *d, Window w, Pixmap p); #endif #ifndef XSetWindowBorderWidth_TCL_DECLARED #define XSetWindowBorderWidth_TCL_DECLARED /* 70 */ -EXTERN void XSetWindowBorderWidth(Display *d, Window w, +EXTERN int XSetWindowBorderWidth(Display *d, Window w, unsigned int ui); #endif #ifndef XSetWindowColormap_TCL_DECLARED #define XSetWindowColormap_TCL_DECLARED /* 71 */ -EXTERN void XSetWindowColormap(Display *d, Window w, Colormap c); +EXTERN int XSetWindowColormap(Display *d, Window w, Colormap c); #endif #ifndef XTranslateCoordinates_TCL_DECLARED #define XTranslateCoordinates_TCL_DECLARED @@ -461,22 +470,22 @@ #ifndef XUngrabKeyboard_TCL_DECLARED #define XUngrabKeyboard_TCL_DECLARED /* 73 */ -EXTERN void XUngrabKeyboard(Display *d, Time t); +EXTERN int XUngrabKeyboard(Display *d, Time t); #endif #ifndef XUngrabPointer_TCL_DECLARED #define XUngrabPointer_TCL_DECLARED /* 74 */ -EXTERN void XUngrabPointer(Display *d, Time t); +EXTERN int XUngrabPointer(Display *d, Time t); #endif #ifndef XUnmapWindow_TCL_DECLARED #define XUnmapWindow_TCL_DECLARED /* 75 */ -EXTERN void XUnmapWindow(Display *d, Window w); +EXTERN int XUnmapWindow(Display *d, Window w); #endif #ifndef XWindowEvent_TCL_DECLARED #define XWindowEvent_TCL_DECLARED /* 76 */ -EXTERN void XWindowEvent(Display *d, Window w, long l, XEvent *x); +EXTERN int XWindowEvent(Display *d, Window w, long l, XEvent *x); #endif #ifndef XDestroyIC_TCL_DECLARED #define XDestroyIC_TCL_DECLARED @@ -497,7 +506,7 @@ #ifndef TkPutImage_TCL_DECLARED #define TkPutImage_TCL_DECLARED /* 80 */ -EXTERN void TkPutImage(unsigned long *colors, int ncolors, +EXTERN int TkPutImage(unsigned long *colors, int ncolors, Display *display, Drawable d, GC gc, XImage *image, int src_x, int src_y, int dest_x, int dest_y, unsigned int width, @@ -519,7 +528,7 @@ #ifndef XFreeGC_TCL_DECLARED #define XFreeGC_TCL_DECLARED /* 84 */ -EXTERN void XFreeGC(Display *display, GC gc); +EXTERN int XFreeGC(Display *display, GC gc); #endif #ifndef XInternAtom_TCL_DECLARED #define XInternAtom_TCL_DECLARED @@ -530,73 +539,73 @@ #ifndef XSetBackground_TCL_DECLARED #define XSetBackground_TCL_DECLARED /* 86 */ -EXTERN void XSetBackground(Display *display, GC gc, +EXTERN int XSetBackground(Display *display, GC gc, unsigned long foreground); #endif #ifndef XSetForeground_TCL_DECLARED #define XSetForeground_TCL_DECLARED /* 87 */ -EXTERN void XSetForeground(Display *display, GC gc, +EXTERN int XSetForeground(Display *display, GC gc, unsigned long foreground); #endif #ifndef XSetClipMask_TCL_DECLARED #define XSetClipMask_TCL_DECLARED /* 88 */ -EXTERN void XSetClipMask(Display *display, GC gc, Pixmap pixmap); +EXTERN int XSetClipMask(Display *display, GC gc, Pixmap pixmap); #endif #ifndef XSetClipOrigin_TCL_DECLARED #define XSetClipOrigin_TCL_DECLARED /* 89 */ -EXTERN void XSetClipOrigin(Display *display, GC gc, +EXTERN int XSetClipOrigin(Display *display, GC gc, int clip_x_origin, int clip_y_origin); #endif #ifndef XSetTSOrigin_TCL_DECLARED #define XSetTSOrigin_TCL_DECLARED /* 90 */ -EXTERN void XSetTSOrigin(Display *display, GC gc, +EXTERN int XSetTSOrigin(Display *display, GC gc, int ts_x_origin, int ts_y_origin); #endif #ifndef XChangeGC_TCL_DECLARED #define XChangeGC_TCL_DECLARED /* 91 */ -EXTERN void XChangeGC(Display *d, GC gc, unsigned long mask, +EXTERN int XChangeGC(Display *d, GC gc, unsigned long mask, XGCValues *values); #endif #ifndef XSetFont_TCL_DECLARED #define XSetFont_TCL_DECLARED /* 92 */ -EXTERN void XSetFont(Display *display, GC gc, Font font); +EXTERN int XSetFont(Display *display, GC gc, Font font); #endif #ifndef XSetArcMode_TCL_DECLARED #define XSetArcMode_TCL_DECLARED /* 93 */ -EXTERN void XSetArcMode(Display *display, GC gc, int arc_mode); +EXTERN int XSetArcMode(Display *display, GC gc, int arc_mode); #endif #ifndef XSetStipple_TCL_DECLARED #define XSetStipple_TCL_DECLARED /* 94 */ -EXTERN void XSetStipple(Display *display, GC gc, Pixmap stipple); +EXTERN int XSetStipple(Display *display, GC gc, Pixmap stipple); #endif #ifndef XSetFillRule_TCL_DECLARED #define XSetFillRule_TCL_DECLARED /* 95 */ -EXTERN void XSetFillRule(Display *display, GC gc, int fill_rule); +EXTERN int XSetFillRule(Display *display, GC gc, int fill_rule); #endif #ifndef XSetFillStyle_TCL_DECLARED #define XSetFillStyle_TCL_DECLARED /* 96 */ -EXTERN void XSetFillStyle(Display *display, GC gc, +EXTERN int XSetFillStyle(Display *display, GC gc, int fill_style); #endif #ifndef XSetFunction_TCL_DECLARED #define XSetFunction_TCL_DECLARED /* 97 */ -EXTERN void XSetFunction(Display *display, GC gc, int function); +EXTERN int XSetFunction(Display *display, GC gc, int function); #endif #ifndef XSetLineAttributes_TCL_DECLARED #define XSetLineAttributes_TCL_DECLARED /* 98 */ -EXTERN void XSetLineAttributes(Display *display, GC gc, +EXTERN int XSetLineAttributes(Display *display, GC gc, unsigned int line_width, int line_style, int cap_style, int join_style); #endif @@ -608,7 +617,7 @@ #ifndef XCreateIC_TCL_DECLARED #define XCreateIC_TCL_DECLARED /* 100 */ -EXTERN XIC XCreateIC(void); +EXTERN XIC XCreateIC(XIM xim, ...); #endif #ifndef XGetVisualInfo_TCL_DECLARED #define XGetVisualInfo_TCL_DECLARED @@ -632,29 +641,69 @@ #ifndef XDrawLine_TCL_DECLARED #define XDrawLine_TCL_DECLARED /* 104 */ -EXTERN void XDrawLine(Display *d, Drawable dr, GC g, int x1, +EXTERN int XDrawLine(Display *d, Drawable dr, GC g, int x1, int y1, int x2, int y2); #endif #ifndef XWarpPointer_TCL_DECLARED #define XWarpPointer_TCL_DECLARED /* 105 */ -EXTERN void XWarpPointer(Display *d, Window s, Window dw, int sx, +EXTERN int XWarpPointer(Display *d, Window s, Window dw, int sx, int sy, unsigned int sw, unsigned int sh, int dx, int dy); #endif #ifndef XFillRectangle_TCL_DECLARED #define XFillRectangle_TCL_DECLARED /* 106 */ -EXTERN void XFillRectangle(Display *display, Drawable d, GC gc, +EXTERN int XFillRectangle(Display *display, Drawable d, GC gc, int x, int y, unsigned int width, unsigned int height); #endif +#ifndef XFlush_TCL_DECLARED +#define XFlush_TCL_DECLARED +/* 107 */ +EXTERN int XFlush(Display *display); +#endif +#ifndef XGrabServer_TCL_DECLARED +#define XGrabServer_TCL_DECLARED +/* 108 */ +EXTERN int XGrabServer(Display *display); +#endif +#ifndef XUngrabServer_TCL_DECLARED +#define XUngrabServer_TCL_DECLARED +/* 109 */ +EXTERN int XUngrabServer(Display *display); +#endif +#ifndef XFree_TCL_DECLARED +#define XFree_TCL_DECLARED +/* 110 */ +EXTERN int XFree(VOID *data); +#endif +#ifndef XNoOp_TCL_DECLARED +#define XNoOp_TCL_DECLARED +/* 111 */ +EXTERN int XNoOp(Display *display); +#endif +#ifndef XSynchronize_TCL_DECLARED +#define XSynchronize_TCL_DECLARED +/* 112 */ +EXTERN XAfterFunction XSynchronize(Display *display, Bool onoff); +#endif +#ifndef XSync_TCL_DECLARED +#define XSync_TCL_DECLARED +/* 113 */ +EXTERN int XSync(Display *display, Bool discard); +#endif +#ifndef XVisualIDFromVisual_TCL_DECLARED +#define XVisualIDFromVisual_TCL_DECLARED +/* 114 */ +EXTERN VisualID XVisualIDFromVisual(Visual *visual); +#endif #endif /* WIN */ #ifdef MAC_OSX_TK /* AQUA */ #ifndef XSetDashes_TCL_DECLARED #define XSetDashes_TCL_DECLARED /* 0 */ -EXTERN void XSetDashes(Display *display, GC gc, int dash_offset, +EXTERN int XSetDashes(Display *display, GC gc, int dash_offset, _Xconst char *dash_list, int n); #endif #ifndef XGetModifierMapping_TCL_DECLARED @@ -725,7 +774,7 @@ #ifndef XBell_TCL_DECLARED #define XBell_TCL_DECLARED /* 13 */ -EXTERN void XBell(Display *d, int i); +EXTERN int XBell(Display *d, int i); #endif #ifndef XChangeProperty_TCL_DECLARED #define XChangeProperty_TCL_DECLARED @@ -771,7 +820,7 @@ #ifndef XDefineCursor_TCL_DECLARED #define XDefineCursor_TCL_DECLARED /* 20 */ -EXTERN void XDefineCursor(Display *d, Window w, Cursor c); +EXTERN int XDefineCursor(Display *d, Window w, Cursor c); #endif #ifndef XDestroyWindow_TCL_DECLARED #define XDestroyWindow_TCL_DECLARED @@ -788,7 +837,7 @@ #ifndef XDrawLines_TCL_DECLARED #define XDrawLines_TCL_DECLARED /* 23 */ -EXTERN void XDrawLines(Display *d, Drawable dr, GC g, XPoint *x, +EXTERN int XDrawLines(Display *d, Drawable dr, GC g, XPoint *x, int i1, int i2); #endif #ifndef XDrawRectangle_TCL_DECLARED @@ -813,24 +862,24 @@ #ifndef XFillRectangles_TCL_DECLARED #define XFillRectangles_TCL_DECLARED /* 27 */ -EXTERN void XFillRectangles(Display *d, Drawable dr, GC g, +EXTERN int XFillRectangles(Display *d, Drawable dr, GC g, XRectangle *x, int i); #endif #ifndef XFreeColormap_TCL_DECLARED #define XFreeColormap_TCL_DECLARED /* 28 */ -EXTERN void XFreeColormap(Display *d, Colormap c); +EXTERN int XFreeColormap(Display *d, Colormap c); #endif #ifndef XFreeColors_TCL_DECLARED #define XFreeColors_TCL_DECLARED /* 29 */ -EXTERN void XFreeColors(Display *d, Colormap c, +EXTERN int XFreeColors(Display *d, Colormap c, unsigned long *ulp, int i, unsigned long ul); #endif #ifndef XFreeModifiermap_TCL_DECLARED #define XFreeModifiermap_TCL_DECLARED /* 30 */ -EXTERN void XFreeModifiermap(XModifierKeymap *x); +EXTERN int XFreeModifiermap(XModifierKeymap *x); #endif #ifndef XGetGeometry_TCL_DECLARED #define XGetGeometry_TCL_DECLARED @@ -929,7 +978,7 @@ #ifndef XSetSelectionOwner_TCL_DECLARED #define XSetSelectionOwner_TCL_DECLARED /* 47 */ -EXTERN void XSetSelectionOwner(Display *d, Atom a, Window w, +EXTERN int XSetSelectionOwner(Display *d, Atom a, Window w, Time t); #endif #ifndef XSetWindowBackground_TCL_DECLARED @@ -975,7 +1024,7 @@ #ifndef XUngrabPointer_TCL_DECLARED #define XUngrabPointer_TCL_DECLARED /* 55 */ -EXTERN void XUngrabPointer(Display *d, Time t); +EXTERN int XUngrabPointer(Display *d, Time t); #endif #ifndef XUnmapWindow_TCL_DECLARED #define XUnmapWindow_TCL_DECLARED @@ -985,7 +1034,7 @@ #ifndef TkPutImage_TCL_DECLARED #define TkPutImage_TCL_DECLARED /* 57 */ -EXTERN void TkPutImage(unsigned long *colors, int ncolors, +EXTERN int TkPutImage(unsigned long *colors, int ncolors, Display *display, Drawable d, GC gc, XImage *image, int src_x, int src_y, int dest_x, int dest_y, unsigned int width, @@ -1006,7 +1055,7 @@ #ifndef XFreeGC_TCL_DECLARED #define XFreeGC_TCL_DECLARED /* 60 */ -EXTERN void XFreeGC(Display *display, GC gc); +EXTERN int XFreeGC(Display *display, GC gc); #endif #ifndef XInternAtom_TCL_DECLARED #define XInternAtom_TCL_DECLARED @@ -1017,73 +1066,73 @@ #ifndef XSetBackground_TCL_DECLARED #define XSetBackground_TCL_DECLARED /* 62 */ -EXTERN void XSetBackground(Display *display, GC gc, +EXTERN int XSetBackground(Display *display, GC gc, unsigned long foreground); #endif #ifndef XSetForeground_TCL_DECLARED #define XSetForeground_TCL_DECLARED /* 63 */ -EXTERN void XSetForeground(Display *display, GC gc, +EXTERN int XSetForeground(Display *display, GC gc, unsigned long foreground); #endif #ifndef XSetClipMask_TCL_DECLARED #define XSetClipMask_TCL_DECLARED /* 64 */ -EXTERN void XSetClipMask(Display *display, GC gc, Pixmap pixmap); +EXTERN int XSetClipMask(Display *display, GC gc, Pixmap pixmap); #endif #ifndef XSetClipOrigin_TCL_DECLARED #define XSetClipOrigin_TCL_DECLARED /* 65 */ -EXTERN void XSetClipOrigin(Display *display, GC gc, +EXTERN int XSetClipOrigin(Display *display, GC gc, int clip_x_origin, int clip_y_origin); #endif #ifndef XSetTSOrigin_TCL_DECLARED #define XSetTSOrigin_TCL_DECLARED /* 66 */ -EXTERN void XSetTSOrigin(Display *display, GC gc, +EXTERN int XSetTSOrigin(Display *display, GC gc, int ts_x_origin, int ts_y_origin); #endif #ifndef XChangeGC_TCL_DECLARED #define XChangeGC_TCL_DECLARED /* 67 */ -EXTERN void XChangeGC(Display *d, GC gc, unsigned long mask, +EXTERN int XChangeGC(Display *d, GC gc, unsigned long mask, XGCValues *values); #endif #ifndef XSetFont_TCL_DECLARED #define XSetFont_TCL_DECLARED /* 68 */ -EXTERN void XSetFont(Display *display, GC gc, Font font); +EXTERN int XSetFont(Display *display, GC gc, Font font); #endif #ifndef XSetArcMode_TCL_DECLARED #define XSetArcMode_TCL_DECLARED /* 69 */ -EXTERN void XSetArcMode(Display *display, GC gc, int arc_mode); +EXTERN int XSetArcMode(Display *display, GC gc, int arc_mode); #endif #ifndef XSetStipple_TCL_DECLARED #define XSetStipple_TCL_DECLARED /* 70 */ -EXTERN void XSetStipple(Display *display, GC gc, Pixmap stipple); +EXTERN int XSetStipple(Display *display, GC gc, Pixmap stipple); #endif #ifndef XSetFillRule_TCL_DECLARED #define XSetFillRule_TCL_DECLARED /* 71 */ -EXTERN void XSetFillRule(Display *display, GC gc, int fill_rule); +EXTERN int XSetFillRule(Display *display, GC gc, int fill_rule); #endif #ifndef XSetFillStyle_TCL_DECLARED #define XSetFillStyle_TCL_DECLARED /* 72 */ -EXTERN void XSetFillStyle(Display *display, GC gc, +EXTERN int XSetFillStyle(Display *display, GC gc, int fill_style); #endif #ifndef XSetFunction_TCL_DECLARED #define XSetFunction_TCL_DECLARED /* 73 */ -EXTERN void XSetFunction(Display *display, GC gc, int function); +EXTERN int XSetFunction(Display *display, GC gc, int function); #endif #ifndef XSetLineAttributes_TCL_DECLARED #define XSetLineAttributes_TCL_DECLARED /* 74 */ -EXTERN void XSetLineAttributes(Display *display, GC gc, +EXTERN int XSetLineAttributes(Display *display, GC gc, unsigned int line_width, int line_style, int cap_style, int join_style); #endif @@ -1130,13 +1179,13 @@ #ifndef XDrawLine_TCL_DECLARED #define XDrawLine_TCL_DECLARED /* 82 */ -EXTERN void XDrawLine(Display *d, Drawable dr, GC g, int x1, +EXTERN int XDrawLine(Display *d, Drawable dr, GC g, int x1, int y1, int x2, int y2); #endif #ifndef XFillRectangle_TCL_DECLARED #define XFillRectangle_TCL_DECLARED /* 83 */ -EXTERN void XFillRectangle(Display *display, Drawable d, GC gc, +EXTERN int XFillRectangle(Display *display, Drawable d, GC gc, int x, int y, unsigned int width, unsigned int height); #endif @@ -1160,7 +1209,7 @@ #ifndef XWarpPointer_TCL_DECLARED #define XWarpPointer_TCL_DECLARED /* 87 */ -EXTERN void XWarpPointer(Display *display, Window src_w, +EXTERN int XWarpPointer(Display *display, Window src_w, Window dest_w, int src_x, int src_y, unsigned int src_width, unsigned int src_height, int dest_x, @@ -1195,8 +1244,8 @@ int magic; struct TkIntXlibStubHooks *hooks; -#ifdef __WIN32__ /* WIN */ - void (*xSetDashes) (Display *display, GC gc, int dash_offset, _Xconst char *dash_list, int n); /* 0 */ +#if defined(__WIN32__) || defined(__CYGWIN__) /* WIN */ + int (*xSetDashes) (Display *display, GC gc, int dash_offset, _Xconst char *dash_list, int n); /* 0 */ XModifierKeymap * (*xGetModifierMapping) (Display *d); /* 1 */ XImage * (*xCreateImage) (Display *d, Visual *v, unsigned int ui1, int i1, int i2, char *cp, unsigned int ui2, unsigned int ui3, int i3, int i4); /* 2 */ XImage * (*xGetImage) (Display *d, Drawable dr, int i1, int i2, unsigned int ui1, unsigned int ui2, unsigned long ul, int i3); /* 3 */ @@ -1204,7 +1253,7 @@ char * (*xKeysymToString) (KeySym k); /* 5 */ Colormap (*xCreateColormap) (Display *d, Window w, Visual *v, int i); /* 6 */ Cursor (*xCreatePixmapCursor) (Display *d, Pixmap p1, Pixmap p2, XColor *x1, XColor *x2, unsigned int ui1, unsigned int ui2); /* 7 */ - Cursor (*xCreateGlyphCursor) (Display *d, Font f1, Font f2, unsigned int ui1, unsigned int ui2, XColor *x1, XColor *x2); /* 8 */ + Cursor (*xCreateGlyphCursor) (Display *d, Font f1, Font f2, unsigned int ui1, unsigned int ui2, XColor _Xconst *x1, XColor _Xconst *x2); /* 8 */ GContext (*xGContextFromGC) (GC g); /* 9 */ XHostAddress * (*xListHosts) (Display *d, int *i, Bool *b); /* 10 */ KeySym (*xKeycodeToKeysym) (Display *d, unsigned int k, int i); /* 11 */ @@ -1215,97 +1264,105 @@ Status (*xWithdrawWindow) (Display *d, Window w, int i); /* 16 */ Status (*xGetWMColormapWindows) (Display *d, Window w, Window **wpp, int *ip); /* 17 */ Status (*xAllocColor) (Display *d, Colormap c, XColor *xp); /* 18 */ - void (*xBell) (Display *d, int i); /* 19 */ - void (*xChangeProperty) (Display *d, Window w, Atom a1, Atom a2, int i1, int i2, _Xconst unsigned char *c, int i3); /* 20 */ - void (*xChangeWindowAttributes) (Display *d, Window w, unsigned long ul, XSetWindowAttributes *x); /* 21 */ - void (*xClearWindow) (Display *d, Window w); /* 22 */ - void (*xConfigureWindow) (Display *d, Window w, unsigned int i, XWindowChanges *x); /* 23 */ - void (*xCopyArea) (Display *d, Drawable dr1, Drawable dr2, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2, int i3, int i4); /* 24 */ - void (*xCopyPlane) (Display *d, Drawable dr1, Drawable dr2, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2, int i3, int i4, unsigned long ul); /* 25 */ + int (*xBell) (Display *d, int i); /* 19 */ + int (*xChangeProperty) (Display *d, Window w, Atom a1, Atom a2, int i1, int i2, _Xconst unsigned char *c, int i3); /* 20 */ + int (*xChangeWindowAttributes) (Display *d, Window w, unsigned long ul, XSetWindowAttributes *x); /* 21 */ + int (*xClearWindow) (Display *d, Window w); /* 22 */ + int (*xConfigureWindow) (Display *d, Window w, unsigned int i, XWindowChanges *x); /* 23 */ + int (*xCopyArea) (Display *d, Drawable dr1, Drawable dr2, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2, int i3, int i4); /* 24 */ + int (*xCopyPlane) (Display *d, Drawable dr1, Drawable dr2, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2, int i3, int i4, unsigned long ul); /* 25 */ Pixmap (*xCreateBitmapFromData) (Display *display, Drawable d, _Xconst char *data, unsigned int width, unsigned int height); /* 26 */ - void (*xDefineCursor) (Display *d, Window w, Cursor c); /* 27 */ - void (*xDeleteProperty) (Display *d, Window w, Atom a); /* 28 */ - void (*xDestroyWindow) (Display *d, Window w); /* 29 */ - void (*xDrawArc) (Display *d, Drawable dr, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2, int i3, int i4); /* 30 */ - void (*xDrawLines) (Display *d, Drawable dr, GC g, XPoint *x, int i1, int i2); /* 31 */ - void (*xDrawRectangle) (Display *d, Drawable dr, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2); /* 32 */ - void (*xFillArc) (Display *d, Drawable dr, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2, int i3, int i4); /* 33 */ - void (*xFillPolygon) (Display *d, Drawable dr, GC g, XPoint *x, int i1, int i2, int i3); /* 34 */ - void (*xFillRectangles) (Display *d, Drawable dr, GC g, XRectangle *x, int i); /* 35 */ - void (*xForceScreenSaver) (Display *d, int i); /* 36 */ - void (*xFreeColormap) (Display *d, Colormap c); /* 37 */ - void (*xFreeColors) (Display *d, Colormap c, unsigned long *ulp, int i, unsigned long ul); /* 38 */ - void (*xFreeCursor) (Display *d, Cursor c); /* 39 */ - void (*xFreeModifiermap) (XModifierKeymap *x); /* 40 */ + int (*xDefineCursor) (Display *d, Window w, Cursor c); /* 27 */ + int (*xDeleteProperty) (Display *d, Window w, Atom a); /* 28 */ + int (*xDestroyWindow) (Display *d, Window w); /* 29 */ + int (*xDrawArc) (Display *d, Drawable dr, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2, int i3, int i4); /* 30 */ + int (*xDrawLines) (Display *d, Drawable dr, GC g, XPoint *x, int i1, int i2); /* 31 */ + int (*xDrawRectangle) (Display *d, Drawable dr, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2); /* 32 */ + int (*xFillArc) (Display *d, Drawable dr, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2, int i3, int i4); /* 33 */ + int (*xFillPolygon) (Display *d, Drawable dr, GC g, XPoint *x, int i1, int i2, int i3); /* 34 */ + int (*xFillRectangles) (Display *d, Drawable dr, GC g, XRectangle *x, int i); /* 35 */ + int (*xForceScreenSaver) (Display *d, int i); /* 36 */ + int (*xFreeColormap) (Display *d, Colormap c); /* 37 */ + int (*xFreeColors) (Display *d, Colormap c, unsigned long *ulp, int i, unsigned long ul); /* 38 */ + int (*xFreeCursor) (Display *d, Cursor c); /* 39 */ + int (*xFreeModifiermap) (XModifierKeymap *x); /* 40 */ Status (*xGetGeometry) (Display *d, Drawable dr, Window *w, int *i1, int *i2, unsigned int *ui1, unsigned int *ui2, unsigned int *ui3, unsigned int *ui4); /* 41 */ - void (*xGetInputFocus) (Display *d, Window *w, int *i); /* 42 */ + int (*xGetInputFocus) (Display *d, Window *w, int *i); /* 42 */ int (*xGetWindowProperty) (Display *d, Window w, Atom a1, long l1, long l2, Bool b, Atom a2, Atom *ap, int *ip, unsigned long *ulp1, unsigned long *ulp2, unsigned char **cpp); /* 43 */ Status (*xGetWindowAttributes) (Display *d, Window w, XWindowAttributes *x); /* 44 */ int (*xGrabKeyboard) (Display *d, Window w, Bool b, int i1, int i2, Time t); /* 45 */ int (*xGrabPointer) (Display *d, Window w1, Bool b, unsigned int ui, int i1, int i2, Window w2, Cursor c, Time t); /* 46 */ KeyCode (*xKeysymToKeycode) (Display *d, KeySym k); /* 47 */ Status (*xLookupColor) (Display *d, Colormap c1, _Xconst char *c2, XColor *x1, XColor *x2); /* 48 */ - void (*xMapWindow) (Display *d, Window w); /* 49 */ - void (*xMoveResizeWindow) (Display *d, Window w, int i1, int i2, unsigned int ui1, unsigned int ui2); /* 50 */ - void (*xMoveWindow) (Display *d, Window w, int i1, int i2); /* 51 */ - void (*xNextEvent) (Display *d, XEvent *x); /* 52 */ - void (*xPutBackEvent) (Display *d, XEvent *x); /* 53 */ - void (*xQueryColors) (Display *d, Colormap c, XColor *x, int i); /* 54 */ + int (*xMapWindow) (Display *d, Window w); /* 49 */ + int (*xMoveResizeWindow) (Display *d, Window w, int i1, int i2, unsigned int ui1, unsigned int ui2); /* 50 */ + int (*xMoveWindow) (Display *d, Window w, int i1, int i2); /* 51 */ + int (*xNextEvent) (Display *d, XEvent *x); /* 52 */ + int (*xPutBackEvent) (Display *d, XEvent *x); /* 53 */ + int (*xQueryColors) (Display *d, Colormap c, XColor *x, int i); /* 54 */ Bool (*xQueryPointer) (Display *d, Window w1, Window *w2, Window *w3, int *i1, int *i2, int *i3, int *i4, unsigned int *ui); /* 55 */ Status (*xQueryTree) (Display *d, Window w1, Window *w2, Window *w3, Window **w4, unsigned int *ui); /* 56 */ - void (*xRaiseWindow) (Display *d, Window w); /* 57 */ - void (*xRefreshKeyboardMapping) (XMappingEvent *x); /* 58 */ - void (*xResizeWindow) (Display *d, Window w, unsigned int ui1, unsigned int ui2); /* 59 */ - void (*xSelectInput) (Display *d, Window w, long l); /* 60 */ + int (*xRaiseWindow) (Display *d, Window w); /* 57 */ + int (*xRefreshKeyboardMapping) (XMappingEvent *x); /* 58 */ + int (*xResizeWindow) (Display *d, Window w, unsigned int ui1, unsigned int ui2); /* 59 */ + int (*xSelectInput) (Display *d, Window w, long l); /* 60 */ Status (*xSendEvent) (Display *d, Window w, Bool b, long l, XEvent *x); /* 61 */ - void (*xSetCommand) (Display *d, Window w, CONST char **c, int i); /* 62 */ - void (*xSetIconName) (Display *d, Window w, _Xconst char *c); /* 63 */ - void (*xSetInputFocus) (Display *d, Window w, int i, Time t); /* 64 */ - void (*xSetSelectionOwner) (Display *d, Atom a, Window w, Time t); /* 65 */ - void (*xSetWindowBackground) (Display *d, Window w, unsigned long ul); /* 66 */ - void (*xSetWindowBackgroundPixmap) (Display *d, Window w, Pixmap p); /* 67 */ - void (*xSetWindowBorder) (Display *d, Window w, unsigned long ul); /* 68 */ - void (*xSetWindowBorderPixmap) (Display *d, Window w, Pixmap p); /* 69 */ - void (*xSetWindowBorderWidth) (Display *d, Window w, unsigned int ui); /* 70 */ - void (*xSetWindowColormap) (Display *d, Window w, Colormap c); /* 71 */ + int (*xSetCommand) (Display *d, Window w, char **c, int i); /* 62 */ + int (*xSetIconName) (Display *d, Window w, _Xconst char *c); /* 63 */ + int (*xSetInputFocus) (Display *d, Window w, int i, Time t); /* 64 */ + int (*xSetSelectionOwner) (Display *d, Atom a, Window w, Time t); /* 65 */ + int (*xSetWindowBackground) (Display *d, Window w, unsigned long ul); /* 66 */ + int (*xSetWindowBackgroundPixmap) (Display *d, Window w, Pixmap p); /* 67 */ + int (*xSetWindowBorder) (Display *d, Window w, unsigned long ul); /* 68 */ + int (*xSetWindowBorderPixmap) (Display *d, Window w, Pixmap p); /* 69 */ + int (*xSetWindowBorderWidth) (Display *d, Window w, unsigned int ui); /* 70 */ + int (*xSetWindowColormap) (Display *d, Window w, Colormap c); /* 71 */ Bool (*xTranslateCoordinates) (Display *d, Window w1, Window w2, int i1, int i2, int *i3, int *i4, Window *w3); /* 72 */ - void (*xUngrabKeyboard) (Display *d, Time t); /* 73 */ - void (*xUngrabPointer) (Display *d, Time t); /* 74 */ - void (*xUnmapWindow) (Display *d, Window w); /* 75 */ - void (*xWindowEvent) (Display *d, Window w, long l, XEvent *x); /* 76 */ + int (*xUngrabKeyboard) (Display *d, Time t); /* 73 */ + int (*xUngrabPointer) (Display *d, Time t); /* 74 */ + int (*xUnmapWindow) (Display *d, Window w); /* 75 */ + int (*xWindowEvent) (Display *d, Window w, long l, XEvent *x); /* 76 */ void (*xDestroyIC) (XIC x); /* 77 */ Bool (*xFilterEvent) (XEvent *x, Window w); /* 78 */ int (*xmbLookupString) (XIC xi, XKeyPressedEvent *xk, char *c, int i, KeySym *k, Status *s); /* 79 */ - void (*tkPutImage) (unsigned long *colors, int ncolors, Display *display, Drawable d, GC gc, XImage *image, int src_x, int src_y, int dest_x, int dest_y, unsigned int width, unsigned int height); /* 80 */ - void *reserved81; + int (*tkPutImage) (unsigned long *colors, int ncolors, Display *display, Drawable d, GC gc, XImage *image, int src_x, int src_y, int dest_x, int dest_y, unsigned int width, unsigned int height); /* 80 */ + VOID *reserved81; Status (*xParseColor) (Display *display, Colormap map, _Xconst char *spec, XColor *colorPtr); /* 82 */ GC (*xCreateGC) (Display *display, Drawable d, unsigned long valuemask, XGCValues *values); /* 83 */ - void (*xFreeGC) (Display *display, GC gc); /* 84 */ + int (*xFreeGC) (Display *display, GC gc); /* 84 */ Atom (*xInternAtom) (Display *display, _Xconst char *atom_name, Bool only_if_exists); /* 85 */ - void (*xSetBackground) (Display *display, GC gc, unsigned long foreground); /* 86 */ - void (*xSetForeground) (Display *display, GC gc, unsigned long foreground); /* 87 */ - void (*xSetClipMask) (Display *display, GC gc, Pixmap pixmap); /* 88 */ - void (*xSetClipOrigin) (Display *display, GC gc, int clip_x_origin, int clip_y_origin); /* 89 */ - void (*xSetTSOrigin) (Display *display, GC gc, int ts_x_origin, int ts_y_origin); /* 90 */ - void (*xChangeGC) (Display *d, GC gc, unsigned long mask, XGCValues *values); /* 91 */ - void (*xSetFont) (Display *display, GC gc, Font font); /* 92 */ - void (*xSetArcMode) (Display *display, GC gc, int arc_mode); /* 93 */ - void (*xSetStipple) (Display *display, GC gc, Pixmap stipple); /* 94 */ - void (*xSetFillRule) (Display *display, GC gc, int fill_rule); /* 95 */ - void (*xSetFillStyle) (Display *display, GC gc, int fill_style); /* 96 */ - void (*xSetFunction) (Display *display, GC gc, int function); /* 97 */ - void (*xSetLineAttributes) (Display *display, GC gc, unsigned int line_width, int line_style, int cap_style, int join_style); /* 98 */ + int (*xSetBackground) (Display *display, GC gc, unsigned long foreground); /* 86 */ + int (*xSetForeground) (Display *display, GC gc, unsigned long foreground); /* 87 */ + int (*xSetClipMask) (Display *display, GC gc, Pixmap pixmap); /* 88 */ + int (*xSetClipOrigin) (Display *display, GC gc, int clip_x_origin, int clip_y_origin); /* 89 */ + int (*xSetTSOrigin) (Display *display, GC gc, int ts_x_origin, int ts_y_origin); /* 90 */ + int (*xChangeGC) (Display *d, GC gc, unsigned long mask, XGCValues *values); /* 91 */ + int (*xSetFont) (Display *display, GC gc, Font font); /* 92 */ + int (*xSetArcMode) (Display *display, GC gc, int arc_mode); /* 93 */ + int (*xSetStipple) (Display *display, GC gc, Pixmap stipple); /* 94 */ + int (*xSetFillRule) (Display *display, GC gc, int fill_rule); /* 95 */ + int (*xSetFillStyle) (Display *display, GC gc, int fill_style); /* 96 */ + int (*xSetFunction) (Display *display, GC gc, int function); /* 97 */ + int (*xSetLineAttributes) (Display *display, GC gc, unsigned int line_width, int line_style, int cap_style, int join_style); /* 98 */ int (*_XInitImageFuncPtrs) (XImage *image); /* 99 */ - XIC (*xCreateIC) (void); /* 100 */ + XIC (*xCreateIC) (XIM xim, ...); /* 100 */ XVisualInfo * (*xGetVisualInfo) (Display *display, long vinfo_mask, XVisualInfo *vinfo_template, int *nitems_return); /* 101 */ void (*xSetWMClientMachine) (Display *display, Window w, XTextProperty *text_prop); /* 102 */ Status (*xStringListToTextProperty) (char **list, int count, XTextProperty *text_prop_return); /* 103 */ - void (*xDrawLine) (Display *d, Drawable dr, GC g, int x1, int y1, int x2, int y2); /* 104 */ - void (*xWarpPointer) (Display *d, Window s, Window dw, int sx, int sy, unsigned int sw, unsigned int sh, int dx, int dy); /* 105 */ - void (*xFillRectangle) (Display *display, Drawable d, GC gc, int x, int y, unsigned int width, unsigned int height); /* 106 */ + int (*xDrawLine) (Display *d, Drawable dr, GC g, int x1, int y1, int x2, int y2); /* 104 */ + int (*xWarpPointer) (Display *d, Window s, Window dw, int sx, int sy, unsigned int sw, unsigned int sh, int dx, int dy); /* 105 */ + int (*xFillRectangle) (Display *display, Drawable d, GC gc, int x, int y, unsigned int width, unsigned int height); /* 106 */ + int (*xFlush) (Display *display); /* 107 */ + int (*xGrabServer) (Display *display); /* 108 */ + int (*xUngrabServer) (Display *display); /* 109 */ + int (*xFree) (VOID *data); /* 110 */ + int (*xNoOp) (Display *display); /* 111 */ + XAfterFunction (*xSynchronize) (Display *display, Bool onoff); /* 112 */ + int (*xSync) (Display *display, Bool discard); /* 113 */ + VisualID (*xVisualIDFromVisual) (Visual *visual); /* 114 */ #endif /* WIN */ #ifdef MAC_OSX_TK /* AQUA */ - void (*xSetDashes) (Display *display, GC gc, int dash_offset, _Xconst char *dash_list, int n); /* 0 */ + int (*xSetDashes) (Display *display, GC gc, int dash_offset, _Xconst char *dash_list, int n); /* 0 */ XModifierKeymap * (*xGetModifierMapping) (Display *d); /* 1 */ XImage * (*xCreateImage) (Display *d, Visual *v, unsigned int ui1, int i1, int i2, char *cp, unsigned int ui2, unsigned int ui3, int i3, int i4); /* 2 */ XImage * (*xGetImage) (Display *d, Drawable dr, int i1, int i2, unsigned int ui1, unsigned int ui2, unsigned long ul, int i3); /* 3 */ @@ -1318,24 +1375,24 @@ Window (*xRootWindow) (Display *d, int i); /* 10 */ XErrorHandler (*xSetErrorHandler) (XErrorHandler x); /* 11 */ Status (*xAllocColor) (Display *d, Colormap c, XColor *xp); /* 12 */ - void (*xBell) (Display *d, int i); /* 13 */ + int (*xBell) (Display *d, int i); /* 13 */ void (*xChangeProperty) (Display *d, Window w, Atom a1, Atom a2, int i1, int i2, _Xconst unsigned char *c, int i3); /* 14 */ void (*xChangeWindowAttributes) (Display *d, Window w, unsigned long ul, XSetWindowAttributes *x); /* 15 */ void (*xConfigureWindow) (Display *d, Window w, unsigned int i, XWindowChanges *x); /* 16 */ void (*xCopyArea) (Display *d, Drawable dr1, Drawable dr2, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2, int i3, int i4); /* 17 */ void (*xCopyPlane) (Display *d, Drawable dr1, Drawable dr2, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2, int i3, int i4, unsigned long ul); /* 18 */ Pixmap (*xCreateBitmapFromData) (Display *display, Drawable d, _Xconst char *data, unsigned int width, unsigned int height); /* 19 */ - void (*xDefineCursor) (Display *d, Window w, Cursor c); /* 20 */ + int (*xDefineCursor) (Display *d, Window w, Cursor c); /* 20 */ void (*xDestroyWindow) (Display *d, Window w); /* 21 */ void (*xDrawArc) (Display *d, Drawable dr, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2, int i3, int i4); /* 22 */ - void (*xDrawLines) (Display *d, Drawable dr, GC g, XPoint *x, int i1, int i2); /* 23 */ + int (*xDrawLines) (Display *d, Drawable dr, GC g, XPoint *x, int i1, int i2); /* 23 */ void (*xDrawRectangle) (Display *d, Drawable dr, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2); /* 24 */ void (*xFillArc) (Display *d, Drawable dr, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2, int i3, int i4); /* 25 */ void (*xFillPolygon) (Display *d, Drawable dr, GC g, XPoint *x, int i1, int i2, int i3); /* 26 */ - void (*xFillRectangles) (Display *d, Drawable dr, GC g, XRectangle *x, int i); /* 27 */ - void (*xFreeColormap) (Display *d, Colormap c); /* 28 */ - void (*xFreeColors) (Display *d, Colormap c, unsigned long *ulp, int i, unsigned long ul); /* 29 */ - void (*xFreeModifiermap) (XModifierKeymap *x); /* 30 */ + int (*xFillRectangles) (Display *d, Drawable dr, GC g, XRectangle *x, int i); /* 27 */ + int (*xFreeColormap) (Display *d, Colormap c); /* 28 */ + int (*xFreeColors) (Display *d, Colormap c, unsigned long *ulp, int i, unsigned long ul); /* 29 */ + int (*xFreeModifiermap) (XModifierKeymap *x); /* 30 */ Status (*xGetGeometry) (Display *d, Drawable dr, Window *w, int *i1, int *i2, unsigned int *ui1, unsigned int *ui2, unsigned int *ui3, unsigned int *ui4); /* 31 */ int (*xGetWindowProperty) (Display *d, Window w, Atom a1, long l1, long l2, Bool b, Atom a2, Atom *ap, int *ip, unsigned long *ulp1, unsigned long *ulp2, unsigned char **cpp); /* 32 */ int (*xGrabKeyboard) (Display *d, Window w, Bool b, int i1, int i2, Time t); /* 33 */ @@ -1352,7 +1409,7 @@ Status (*xSendEvent) (Display *d, Window w, Bool b, long l, XEvent *x); /* 44 */ void (*xSetIconName) (Display *d, Window w, _Xconst char *c); /* 45 */ void (*xSetInputFocus) (Display *d, Window w, int i, Time t); /* 46 */ - void (*xSetSelectionOwner) (Display *d, Atom a, Window w, Time t); /* 47 */ + int (*xSetSelectionOwner) (Display *d, Atom a, Window w, Time t); /* 47 */ void (*xSetWindowBackground) (Display *d, Window w, unsigned long ul); /* 48 */ void (*xSetWindowBackgroundPixmap) (Display *d, Window w, Pixmap p); /* 49 */ void (*xSetWindowBorder) (Display *d, Window w, unsigned long ul); /* 50 */ @@ -1360,26 +1417,26 @@ void (*xSetWindowBorderWidth) (Display *d, Window w, unsigned int ui); /* 52 */ void (*xSetWindowColormap) (Display *d, Window w, Colormap c); /* 53 */ void (*xUngrabKeyboard) (Display *d, Time t); /* 54 */ - void (*xUngrabPointer) (Display *d, Time t); /* 55 */ + int (*xUngrabPointer) (Display *d, Time t); /* 55 */ void (*xUnmapWindow) (Display *d, Window w); /* 56 */ - void (*tkPutImage) (unsigned long *colors, int ncolors, Display *display, Drawable d, GC gc, XImage *image, int src_x, int src_y, int dest_x, int dest_y, unsigned int width, unsigned int height); /* 57 */ + int (*tkPutImage) (unsigned long *colors, int ncolors, Display *display, Drawable d, GC gc, XImage *image, int src_x, int src_y, int dest_x, int dest_y, unsigned int width, unsigned int height); /* 57 */ Status (*xParseColor) (Display *display, Colormap map, _Xconst char *spec, XColor *colorPtr); /* 58 */ GC (*xCreateGC) (Display *display, Drawable d, unsigned long valuemask, XGCValues *values); /* 59 */ - void (*xFreeGC) (Display *display, GC gc); /* 60 */ + int (*xFreeGC) (Display *display, GC gc); /* 60 */ Atom (*xInternAtom) (Display *display, _Xconst char *atom_name, Bool only_if_exists); /* 61 */ - void (*xSetBackground) (Display *display, GC gc, unsigned long foreground); /* 62 */ - void (*xSetForeground) (Display *display, GC gc, unsigned long foreground); /* 63 */ - void (*xSetClipMask) (Display *display, GC gc, Pixmap pixmap); /* 64 */ - void (*xSetClipOrigin) (Display *display, GC gc, int clip_x_origin, int clip_y_origin); /* 65 */ - void (*xSetTSOrigin) (Display *display, GC gc, int ts_x_origin, int ts_y_origin); /* 66 */ - void (*xChangeGC) (Display *d, GC gc, unsigned long mask, XGCValues *values); /* 67 */ - void (*xSetFont) (Display *display, GC gc, Font font); /* 68 */ - void (*xSetArcMode) (Display *display, GC gc, int arc_mode); /* 69 */ - void (*xSetStipple) (Display *display, GC gc, Pixmap stipple); /* 70 */ - void (*xSetFillRule) (Display *display, GC gc, int fill_rule); /* 71 */ - void (*xSetFillStyle) (Display *display, GC gc, int fill_style); /* 72 */ - void (*xSetFunction) (Display *display, GC gc, int function); /* 73 */ - void (*xSetLineAttributes) (Display *display, GC gc, unsigned int line_width, int line_style, int cap_style, int join_style); /* 74 */ + int (*xSetBackground) (Display *display, GC gc, unsigned long foreground); /* 62 */ + int (*xSetForeground) (Display *display, GC gc, unsigned long foreground); /* 63 */ + int (*xSetClipMask) (Display *display, GC gc, Pixmap pixmap); /* 64 */ + int (*xSetClipOrigin) (Display *display, GC gc, int clip_x_origin, int clip_y_origin); /* 65 */ + int (*xSetTSOrigin) (Display *display, GC gc, int ts_x_origin, int ts_y_origin); /* 66 */ + int (*xChangeGC) (Display *d, GC gc, unsigned long mask, XGCValues *values); /* 67 */ + int (*xSetFont) (Display *display, GC gc, Font font); /* 68 */ + int (*xSetArcMode) (Display *display, GC gc, int arc_mode); /* 69 */ + int (*xSetStipple) (Display *display, GC gc, Pixmap stipple); /* 70 */ + int (*xSetFillRule) (Display *display, GC gc, int fill_rule); /* 71 */ + int (*xSetFillStyle) (Display *display, GC gc, int fill_style); /* 72 */ + int (*xSetFunction) (Display *display, GC gc, int function); /* 73 */ + int (*xSetLineAttributes) (Display *display, GC gc, unsigned int line_width, int line_style, int cap_style, int join_style); /* 74 */ int (*_XInitImageFuncPtrs) (XImage *image); /* 75 */ XIC (*xCreateIC) (void); /* 76 */ XVisualInfo * (*xGetVisualInfo) (Display *display, long vinfo_mask, XVisualInfo *vinfo_template, int *nitems_return); /* 77 */ @@ -1387,12 +1444,12 @@ Status (*xStringListToTextProperty) (char **list, int count, XTextProperty *text_prop_return); /* 79 */ void (*xDrawSegments) (Display *display, Drawable d, GC gc, XSegment *segments, int nsegments); /* 80 */ void (*xForceScreenSaver) (Display *display, int mode); /* 81 */ - void (*xDrawLine) (Display *d, Drawable dr, GC g, int x1, int y1, int x2, int y2); /* 82 */ - void (*xFillRectangle) (Display *display, Drawable d, GC gc, int x, int y, unsigned int width, unsigned int height); /* 83 */ + int (*xDrawLine) (Display *d, Drawable dr, GC g, int x1, int y1, int x2, int y2); /* 82 */ + int (*xFillRectangle) (Display *display, Drawable d, GC gc, int x, int y, unsigned int width, unsigned int height); /* 83 */ void (*xClearWindow) (Display *d, Window w); /* 84 */ void (*xDrawPoint) (Display *display, Drawable d, GC gc, int x, int y); /* 85 */ void (*xDrawPoints) (Display *display, Drawable d, GC gc, XPoint *points, int npoints, int mode); /* 86 */ - void (*xWarpPointer) (Display *display, Window src_w, Window dest_w, int src_x, int src_y, unsigned int src_width, unsigned int src_height, int dest_x, int dest_y); /* 87 */ + int (*xWarpPointer) (Display *display, Window src_w, Window dest_w, int src_x, int src_y, unsigned int src_width, unsigned int src_height, int dest_x, int dest_y); /* 87 */ void (*xQueryColor) (Display *display, Colormap colormap, XColor *def_in_out); /* 88 */ void (*xQueryColors) (Display *display, Colormap colormap, XColor *defs_in_out, int ncolors); /* 89 */ Status (*xQueryTree) (Display *d, Window w1, Window *w2, Window *w3, Window **w4, unsigned int *ui); /* 90 */ @@ -1400,10 +1457,8 @@ #endif /* AQUA */ } TkIntXlibStubs; -#ifdef __cplusplus -extern "C" { -#endif -extern const TkIntXlibStubs *tkIntXlibStubsPtr; +extern TkIntXlibStubs *tkIntXlibStubsPtr; + #ifdef __cplusplus } #endif @@ -1414,7 +1469,7 @@ * Inline function declarations: */ -#ifdef __WIN32__ /* WIN */ +#if defined(__WIN32__) || defined(__CYGWIN__) /* WIN */ #ifndef XSetDashes #define XSetDashes \ (tkIntXlibStubsPtr->xSetDashes) /* 0 */ @@ -1840,6 +1895,38 @@ #define XFillRectangle \ (tkIntXlibStubsPtr->xFillRectangle) /* 106 */ #endif +#ifndef XFlush +#define XFlush \ + (tkIntXlibStubsPtr->xFlush) /* 107 */ +#endif +#ifndef XGrabServer +#define XGrabServer \ + (tkIntXlibStubsPtr->xGrabServer) /* 108 */ +#endif +#ifndef XUngrabServer +#define XUngrabServer \ + (tkIntXlibStubsPtr->xUngrabServer) /* 109 */ +#endif +#ifndef XFree +#define XFree \ + (tkIntXlibStubsPtr->xFree) /* 110 */ +#endif +#ifndef XNoOp +#define XNoOp \ + (tkIntXlibStubsPtr->xNoOp) /* 111 */ +#endif +#ifndef XSynchronize +#define XSynchronize \ + (tkIntXlibStubsPtr->xSynchronize) /* 112 */ +#endif +#ifndef XSync +#define XSync \ + (tkIntXlibStubsPtr->xSync) /* 113 */ +#endif +#ifndef XVisualIDFromVisual +#define XVisualIDFromVisual \ + (tkIntXlibStubsPtr->xVisualIDFromVisual) /* 114 */ +#endif #endif /* WIN */ #ifdef MAC_OSX_TK /* AQUA */ #ifndef XSetDashes @@ -2219,4 +2306,65 @@ #undef TCL_STORAGE_CLASS #define TCL_STORAGE_CLASS DLLIMPORT +#if defined(__WIN32__) + +#undef XFlush +#undef XGrabServer +#undef XUngrabServer +#undef XFree +#undef XNoOp +#undef XSynchronize +#undef XSync +#undef XVisualIDFromVisual + +#if defined(USE_TK_STUBS) && !defined(USE_TK_STUB_PROCS) +/* + * The following stubs implement various calls that don't do anything + * under Windows. In win32 tclsh 8.4 and 8.5 holds: + * tkIntStubsPtr->tkBindDeadWindow != NULL + * Then the following macros don't do anything. But when running Tcl win32 + * version 8.6 or Cygwin (8.4, 8.5 or 8.6) then the functions are available in + * the stub table. The real function from the stub table will be called, + * even though it might be doing nothing. + */ + +#define XFlush(display) (tkIntStubsPtr->tkBindDeadWindow? 0: tkIntXlibStubsPtr->xFlush(display)) +#define XGrabServer(display) (tkIntStubsPtr->tkBindDeadWindow? 0: tkIntXlibStubsPtr->xGrabServer(display)) +#define XUngrabServer(display) (tkIntStubsPtr->tkBindDeadWindow? 0: tkIntXlibStubsPtr->xUngrabServer(display)) + +/* + * The following functions are implemented as macros under Windows. + */ + + +#define XFree(data) (tkIntStubsPtr->tkBindDeadWindow? ((data)? (ckfree((char *) (data)), 0): 0): tkIntXlibStubsPtr->xFree(data)) +#define XNoOp(display) (tkIntStubsPtr->tkBindDeadWindow? 0: tkIntXlibStubsPtr->xNoOp(display)) +#define XSynchronize(display, bool) (tkIntStubsPtr->tkBindDeadWindow? 0: tkIntXlibStubsPtr->xSynchronize(display, bool)) +#define XSync(display, bool) (tkIntStubsPtr->tkBindDeadWindow? 0: tkIntXlibStubsPtr->xSync(display, bool)) +#define XVisualIDFromVisual(visual) (tkIntStubsPtr->tkBindDeadWindow? ((visual)->visualid): tkIntXlibStubsPtr->xVisualIDFromVisual(visual)) + +#else /* !USE_TK_STUBS */ +/* + * The following stubs implement various calls that don't do anything + * under Windows. + */ + +#define XFlush(display) +#define XGrabServer(display) +#define XUngrabServer(display) + +/* + * The following functions are implemented as macros under Windows. + */ + +#define XFree(data) {if ((data) != NULL) ckfree((char *) (data));} +#define XNoOp(display) {display->request++;} +#define XSynchronize(display, bool) {display->request++;} +#define XSync(display, bool) {display->request++;} +#define XVisualIDFromVisual(visual) (visual->visualid) + +#endif /* !USE_TK_STUBS */ + +#endif /* __WIN32__ */ + #endif /* _TKINTXLIBDECLS */ diff -Nru critcl-3.1.9/lib/critcl/critcl_c/tcl8.5/X11/Xfuncproto.h critcl-3.1.17+dfsg/lib/critcl/critcl_c/tcl8.5/X11/Xfuncproto.h --- critcl-3.1.9/lib/critcl/critcl_c/tcl8.5/X11/Xfuncproto.h 2013-05-10 05:57:04.000000000 +0000 +++ critcl-3.1.17+dfsg/lib/critcl/critcl_c/tcl8.5/X11/Xfuncproto.h 2017-10-14 02:48:11.000000000 +0000 @@ -1,14 +1,14 @@ /* $XConsortium: Xfuncproto.h,v 1.7 91/05/13 20:49:21 rws Exp $ */ -/* +/* * Copyright 1989, 1991 by the Massachusetts Institute of Technology * * Permission to use, copy, modify, and distribute this software and its - * documentation for any purpose and without fee is hereby granted, provided - * that the above copyright notice appear in all copies and that both that - * copyright notice and this permission notice appear in supporting + * documentation for any purpose and without fee is hereby granted, provided + * that the above copyright notice appear in all copies and that both that + * copyright notice and this permission notice appear in supporting * documentation, and that the name of M.I.T. not be used in advertising - * or publicity pertaining to distribution of the software without specific, - * written prior permission. M.I.T. makes no representations about the + * or publicity pertaining to distribution of the software without specific, + * written prior permission. M.I.T. makes no representations about the * suitability of this software for any purpose. It is provided "as is" * without express or implied warranty. * diff -Nru critcl-3.1.9/lib/critcl/critcl_c/tcl8.5/X11/X.h critcl-3.1.17+dfsg/lib/critcl/critcl_c/tcl8.5/X11/X.h --- critcl-3.1.9/lib/critcl/critcl_c/tcl8.5/X11/X.h 2013-05-10 05:57:04.000000000 +0000 +++ critcl-3.1.17+dfsg/lib/critcl/critcl_c/tcl8.5/X11/X.h 2017-10-14 02:48:11.000000000 +0000 @@ -13,13 +13,13 @@ All Rights Reserved -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in +both that copyright notice and this permission notice appear in supporting documentation, and that the names of Digital or MIT not be used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. +software without specific, written prior permission. DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL @@ -100,39 +100,39 @@ #define NoSymbol 0L /* special KeySym */ -/***************************************************************** - * EVENT DEFINITIONS +/***************************************************************** + * EVENT DEFINITIONS *****************************************************************/ /* Input Event Masks. Used as event-mask window attribute and as arguments to Grab requests. Not to be confused with event names. */ #define NoEventMask 0L -#define KeyPressMask (1L<<0) -#define KeyReleaseMask (1L<<1) -#define ButtonPressMask (1L<<2) -#define ButtonReleaseMask (1L<<3) -#define EnterWindowMask (1L<<4) -#define LeaveWindowMask (1L<<5) -#define PointerMotionMask (1L<<6) -#define PointerMotionHintMask (1L<<7) -#define Button1MotionMask (1L<<8) -#define Button2MotionMask (1L<<9) -#define Button3MotionMask (1L<<10) -#define Button4MotionMask (1L<<11) -#define Button5MotionMask (1L<<12) -#define ButtonMotionMask (1L<<13) +#define KeyPressMask (1L<<0) +#define KeyReleaseMask (1L<<1) +#define ButtonPressMask (1L<<2) +#define ButtonReleaseMask (1L<<3) +#define EnterWindowMask (1L<<4) +#define LeaveWindowMask (1L<<5) +#define PointerMotionMask (1L<<6) +#define PointerMotionHintMask (1L<<7) +#define Button1MotionMask (1L<<8) +#define Button2MotionMask (1L<<9) +#define Button3MotionMask (1L<<10) +#define Button4MotionMask (1L<<11) +#define Button5MotionMask (1L<<12) +#define ButtonMotionMask (1L<<13) #define KeymapStateMask (1L<<14) -#define ExposureMask (1L<<15) -#define VisibilityChangeMask (1L<<16) -#define StructureNotifyMask (1L<<17) -#define ResizeRedirectMask (1L<<18) -#define SubstructureNotifyMask (1L<<19) -#define SubstructureRedirectMask (1L<<20) -#define FocusChangeMask (1L<<21) -#define PropertyChangeMask (1L<<22) -#define ColormapChangeMask (1L<<23) -#define OwnerGrabButtonMask (1L<<24) +#define ExposureMask (1L<<15) +#define VisibilityChangeMask (1L<<16) +#define StructureNotifyMask (1L<<17) +#define ResizeRedirectMask (1L<<18) +#define SubstructureNotifyMask (1L<<19) +#define SubstructureRedirectMask (1L<<20) +#define FocusChangeMask (1L<<21) +#define PropertyChangeMask (1L<<22) +#define ColormapChangeMask (1L<<23) +#define OwnerGrabButtonMask (1L<<24) /* Event names. Used in "type" field in XEvent structures. Not to be confused with event masks above. They start from 2 because 0 and 1 @@ -229,7 +229,7 @@ #define NotifyWhileGrabbed 3 #define NotifyHint 1 /* for MotionNotify events */ - + /* Notify detail */ #define NotifyAncestor 0 @@ -299,7 +299,7 @@ #define RevertToParent 2 /***************************************************************** - * ERROR CODES + * ERROR CODES *****************************************************************/ #define Success 0 /* everything's okay */ @@ -314,9 +314,9 @@ #define BadDrawable 9 /* parameter not a Pixmap or Window */ #define BadAccess 10 /* depending on context: - key/button already grabbed - - attempt to free an illegal - cmap entry - - attempt to store into a read-only + - attempt to free an illegal + cmap entry + - attempt to store into a read-only color map entry. - attempt to modify the access control list from other than the local host. @@ -333,7 +333,7 @@ #define LastExtensionError 255 /***************************************************************** - * WINDOW DEFINITIONS + * WINDOW DEFINITIONS *****************************************************************/ /* Window classes used by CreateWindow */ @@ -525,7 +525,7 @@ #define GCCapStyle (1L<<6) #define GCJoinStyle (1L<<7) #define GCFillStyle (1L<<8) -#define GCFillRule (1L<<9) +#define GCFillRule (1L<<9) #define GCTile (1L<<10) #define GCStipple (1L<<11) #define GCTileStipXOrigin (1L<<12) @@ -542,7 +542,7 @@ #define GCLastBit 22 /***************************************************************** - * FONTS + * FONTS *****************************************************************/ /* used in QueryFont -- draw direction */ @@ -553,7 +553,7 @@ #define FontChange 255 /***************************************************************** - * IMAGING + * IMAGING *****************************************************************/ /* ImageFormat -- PutImage, GetImage */ @@ -563,7 +563,7 @@ #define ZPixmap 2 /* depth == drawable depth */ /***************************************************************** - * COLOR MAP STUFF + * COLOR MAP STUFF *****************************************************************/ /* For CreateColormap */ @@ -588,7 +588,7 @@ #define TileShape 1 /* size tiled fastest */ #define StippleShape 2 /* size stippled fastest */ -/***************************************************************** +/***************************************************************** * KEYBOARD/POINTER STUFF *****************************************************************/ @@ -619,7 +619,7 @@ #define MappingPointer 2 /***************************************************************** - * SCREEN SAVER STUFF + * SCREEN SAVER STUFF *****************************************************************/ #define DontPreferBlanking 0 @@ -649,10 +649,10 @@ /* for ChangeAccessControl */ -#define EnableAccess 1 +#define EnableAccess 1 #define DisableAccess 0 -/* Display classes used in opening the connection +/* Display classes used in opening the connection * Note that the statically allocated ones are even numbered and the * dynamically changeable ones are odd numbered */ diff -Nru critcl-3.1.9/lib/critcl/critcl_c/tcl8.5/X11/Xlib.h critcl-3.1.17+dfsg/lib/critcl/critcl_c/tcl8.5/X11/Xlib.h --- critcl-3.1.9/lib/critcl/critcl_c/tcl8.5/X11/Xlib.h 2013-05-10 05:57:04.000000000 +0000 +++ critcl-3.1.17+dfsg/lib/critcl/critcl_c/tcl8.5/X11/Xlib.h 2017-10-14 02:48:11.000000000 +0000 @@ -1,14 +1,14 @@ /* $XConsortium: Xlib.h,v 11.221 93/07/02 14:13:28 gildea Exp $ */ -/* +/* * Copyright 1985, 1986, 1987, 1991 by the Massachusetts Institute of Technology * * Permission to use, copy, modify, and distribute this software and its - * documentation for any purpose and without fee is hereby granted, provided - * that the above copyright notice appear in all copies and that both that - * copyright notice and this permission notice appear in supporting + * documentation for any purpose and without fee is hereby granted, provided + * that the above copyright notice appear in all copies and that both that + * copyright notice and this permission notice appear in supporting * documentation, and that the name of M.I.T. not be used in advertising - * or publicity pertaining to distribution of the software without specific, - * written prior permission. M.I.T. makes no representations about the + * or publicity pertaining to distribution of the software without specific, + * written prior permission. M.I.T. makes no representations about the * suitability of this software for any purpose. It is provided "as is" * without express or implied warranty. * @@ -163,10 +163,10 @@ unsigned long background;/* background pixel */ int line_width; /* line width */ int line_style; /* LineSolid, LineOnOffDash, LineDoubleDash */ - int cap_style; /* CapNotLast, CapButt, + int cap_style; /* CapNotLast, CapButt, CapRound, CapProjecting */ int join_style; /* JoinMiter, JoinRound, JoinBevel */ - int fill_style; /* FillSolid, FillTiled, + int fill_style; /* FillSolid, FillTiled, FillStippled, FillOpaeueStippled */ int fill_rule; /* EvenOddRule, WindingRule */ int arc_mode; /* ArcChord, ArcPieSlice */ @@ -209,7 +209,7 @@ /* * Depth structure; contains information for each possible depth. - */ + */ typedef struct { int depth; /* this depth (Z) of the depth */ int nvisuals; /* number of Visual types at this depth */ @@ -237,7 +237,7 @@ unsigned long black_pixel; /* White and Black pixel values */ int max_maps, min_maps; /* max and min color maps */ int backing_store; /* Never, WhenMapped, Always */ - Bool save_unders; + Bool save_unders; long root_input_mask; /* initial root input mask */ } Screen; @@ -348,7 +348,7 @@ } f; } XImage; -/* +/* * Data structure for XReconfigureWindow */ typedef struct { @@ -369,7 +369,7 @@ char pad; } XColor; -/* +/* * Data structures for graphics operations. On most machines, these are * congruent with the wire protocol structures, so reformatting the data * can be avoided on these architectures. @@ -381,12 +381,12 @@ typedef struct { short x, y; } XPoint; - + typedef struct { short x, y; unsigned short width, height; } XRectangle; - + typedef struct { short x, y; unsigned short width, height; @@ -487,7 +487,7 @@ struct _XExten *ext_procs; /* extensions initialized on this display */ /* * the following can be fixed size, as the protocol defines how - * much address space is available. + * much address space is available. * While this could be done using the extension vector, there * may be MANY events processed, so a search through the extension * list to find the right procedure for each event might be @@ -602,7 +602,7 @@ int mode; /* NotifyNormal, NotifyGrab, NotifyUngrab */ int detail; /* - * NotifyAncestor, NotifyVirtual, NotifyInferior, + * NotifyAncestor, NotifyVirtual, NotifyInferior, * NotifyNonlinear,NotifyNonlinearVirtual */ Bool same_screen; /* same screen flag */ @@ -621,9 +621,9 @@ int mode; /* NotifyNormal, NotifyGrab, NotifyUngrab */ int detail; /* - * NotifyAncestor, NotifyVirtual, NotifyInferior, + * NotifyAncestor, NotifyVirtual, NotifyInferior, * NotifyNonlinear,NotifyNonlinearVirtual, NotifyPointer, - * NotifyPointerRoot, NotifyDetailNone + * NotifyPointerRoot, NotifyDetailNone */ } XFocusChangeEvent; typedef XFocusChangeEvent XFocusInEvent; @@ -637,7 +637,7 @@ Display *display; /* Display the event was read from */ Window window; char key_vector[32]; -} XKeymapEvent; +} XKeymapEvent; typedef struct { int type; @@ -1124,7 +1124,7 @@ typedef unsigned long XIMFeedback; #define XIMReverse 1 -#define XIMUnderline (1<<1) +#define XIMUnderline (1<<1) #define XIMHighlight (1<<2) #define XIMPrimary (1<<5) #define XIMSecondary (1<<6) @@ -1133,11 +1133,11 @@ typedef struct _XIMText { unsigned short length; XIMFeedback *feedback; - Bool encoding_is_wchar; + Bool encoding_is_wchar; union { char *multi_byte; wchar_t *wide_char; - } string; + } string; } XIMText; typedef struct _XIMPreeditDrawCallbackStruct { @@ -1152,13 +1152,13 @@ XIMForwardWord, XIMBackwardWord, XIMCaretUp, XIMCaretDown, XIMNextLine, XIMPreviousLine, - XIMLineStart, XIMLineEnd, + XIMLineStart, XIMLineEnd, XIMAbsolutePosition, XIMDontChange } XIMCaretDirection; typedef enum { - XIMIsInvisible, /* Disable caret feedback */ + XIMIsInvisible, /* Disable caret feedback */ XIMIsPrimary, /* UI defined caret feedback */ XIMIsSecondary /* UI defined caret feedback */ } XIMCaretStyle; @@ -1173,7 +1173,7 @@ XIMTextType, XIMBitmapType } XIMStatusDataType; - + typedef struct _XIMStatusDrawCallbackStruct { XIMStatusDataType type; union { diff -Nru critcl-3.1.9/lib/critcl/critcl_c/tcl8.5/X11/Xutil.h critcl-3.1.17+dfsg/lib/critcl/critcl_c/tcl8.5/X11/Xutil.h --- critcl-3.1.9/lib/critcl/critcl_c/tcl8.5/X11/Xutil.h 2013-05-10 05:57:04.000000000 +0000 +++ critcl-3.1.17+dfsg/lib/critcl/critcl_c/tcl8.5/X11/Xutil.h 2017-10-14 02:48:11.000000000 +0000 @@ -6,13 +6,13 @@ All Rights Reserved -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in +both that copyright notice and this permission notice appear in supporting documentation, and that the names of Digital or MIT not be used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. +software without specific, written prior permission. DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL @@ -33,7 +33,7 @@ # define Region XRegion #endif -/* +/* * Bitmask returned by XParseGeometry(). Each bit tells if the corresponding * value (x, y, width, height) was found in the parsed string. */ @@ -128,7 +128,7 @@ /* - * new structure for manipulating TEXT properties; used with WM_NAME, + * new structure for manipulating TEXT properties; used with WM_NAME, * WM_ICON_NAME, WM_CLIENT_MACHINE, and WM_COMMAND. */ typedef struct { @@ -206,16 +206,16 @@ || ((unsigned)(keysym) == XK_Mode_switch) \ || ((unsigned)(keysym) == XK_Num_Lock)) /* - * opaque reference to Region data type + * opaque reference to Region data type */ -typedef struct _XRegion *Region; +typedef struct _XRegion *Region; /* Return values from XRectInRegion() */ - + #define RectangleOut 0 #define RectangleIn 1 #define RectanglePart 2 - + /* * Information used by the visual utility routines to find desired visual @@ -364,13 +364,13 @@ #endif ); -extern void XEmptyRegion( +extern Bool XEmptyRegion( #if NeedFunctionPrototypes Region /* r */ #endif ); -extern void XEqualRegion( +extern Bool XEqualRegion( #if NeedFunctionPrototypes Region /* r1 */, Region /* r2 */ @@ -435,7 +435,7 @@ Display* /* display */, Window /* w */, XStandardColormap* /* colormap_return */, - Atom /* property */ + Atom /* property */ #endif ); @@ -460,7 +460,7 @@ extern XWMHints *XGetWMHints( #if NeedFunctionPrototypes Display* /* display */, - Window /* w */ + Window /* w */ #endif ); @@ -485,7 +485,7 @@ Display* /* display */, Window /* w */, XSizeHints* /* hints_return */, - long* /* supplied_return */ + long* /* supplied_return */ #endif ); @@ -591,7 +591,7 @@ Display* /* display */, Window /* w */, XIconSize* /* size_list */, - int /* count */ + int /* count */ #endif ); diff -Nru critcl-3.1.9/lib/critcl/critcl_c/tcl8.6/tclDecls.h critcl-3.1.17+dfsg/lib/critcl/critcl_c/tcl8.6/tclDecls.h --- critcl-3.1.9/lib/critcl/critcl_c/tcl8.6/tclDecls.h 2013-05-10 05:57:04.000000000 +0000 +++ critcl-3.1.17+dfsg/lib/critcl/critcl_c/tcl8.6/tclDecls.h 2017-10-14 02:48:11.000000000 +0000 @@ -7,8 +7,6 @@ * * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tclDecls.h,v 1.188 2010/11/04 21:48:23 nijtmans Exp $ */ #ifndef _TCLDECLS @@ -33,6 +31,10 @@ /* !BEGIN!: Do not edit below this line. */ +#ifdef __cplusplus +extern "C" { +#endif + /* * Exported function declarations: */ @@ -46,7 +48,7 @@ const char *name, const char *version, int exact, void *clientDataPtr); /* 2 */ -EXTERN void Tcl_Panic(const char *format, ...); +EXTERN void Tcl_Panic(const char *format, ...) TCL_FORMAT_PRINTF(1, 2); /* 3 */ EXTERN char * Tcl_Alloc(unsigned int size); /* 4 */ @@ -61,7 +63,7 @@ /* 8 */ EXTERN char * Tcl_DbCkrealloc(char *ptr, unsigned int size, const char *file, int line); -#if !defined(__WIN32__) && !defined(MAC_OSX_TCL) /* UNIX */ +#if !defined(_WIN32) && !defined(MAC_OSX_TCL) /* UNIX */ /* 9 */ EXTERN void Tcl_CreateFileHandler(int fd, int mask, Tcl_FileProc *proc, ClientData clientData); @@ -71,7 +73,7 @@ EXTERN void Tcl_CreateFileHandler(int fd, int mask, Tcl_FileProc *proc, ClientData clientData); #endif /* MACOSX */ -#if !defined(__WIN32__) && !defined(MAC_OSX_TCL) /* UNIX */ +#if !defined(_WIN32) && !defined(MAC_OSX_TCL) /* UNIX */ /* 10 */ EXTERN void Tcl_DeleteFileHandler(int fd); #endif /* UNIX */ @@ -509,7 +511,7 @@ EXTERN const char * Tcl_GetNameOfExecutable(void); /* 166 */ EXTERN Tcl_Obj * Tcl_GetObjResult(Tcl_Interp *interp); -#if !defined(__WIN32__) && !defined(MAC_OSX_TCL) /* UNIX */ +#if !defined(_WIN32) && !defined(MAC_OSX_TCL) /* UNIX */ /* 167 */ EXTERN int Tcl_GetOpenFile(Tcl_Interp *interp, const char *chanID, int forWriting, @@ -653,9 +655,9 @@ /* 217 */ EXTERN void Tcl_ResetResult(Tcl_Interp *interp); /* 218 */ -EXTERN int Tcl_ScanElement(const char *str, int *flagPtr); +EXTERN int Tcl_ScanElement(const char *src, int *flagPtr); /* 219 */ -EXTERN int Tcl_ScanCountedElement(const char *str, int length, +EXTERN int Tcl_ScanCountedElement(const char *src, int length, int *flagPtr); /* 220 */ EXTERN int Tcl_SeekOld(Tcl_Channel chan, int offset, int mode); @@ -1664,10 +1666,10 @@ Tcl_Obj *objPtr, const char *format, int objc, Tcl_Obj *const objv[]); /* 578 */ -EXTERN Tcl_Obj * Tcl_ObjPrintf(const char *format, ...); +EXTERN Tcl_Obj * Tcl_ObjPrintf(const char *format, ...) TCL_FORMAT_PRINTF(1, 2); /* 579 */ EXTERN void Tcl_AppendPrintfToObj(Tcl_Obj *objPtr, - const char *format, ...); + const char *format, ...) TCL_FORMAT_PRINTF(2, 3); /* 580 */ EXTERN int Tcl_CancelEval(Tcl_Interp *interp, Tcl_Obj *resultObjPtr, ClientData clientData, @@ -1804,13 +1806,17 @@ const char *const symv[], int flags, void *procPtrs, Tcl_LoadHandle *handlePtr); /* 628 */ -EXTERN void* Tcl_FindSymbol(Tcl_Interp *interp, +EXTERN void * Tcl_FindSymbol(Tcl_Interp *interp, Tcl_LoadHandle handle, const char *symbol); /* 629 */ EXTERN int Tcl_FSUnloadFile(Tcl_Interp *interp, Tcl_LoadHandle handlePtr); +/* 630 */ +EXTERN void Tcl_ZlibStreamSetCompressionDictionary( + Tcl_ZlibStream zhandle, + Tcl_Obj *compressionDictionaryObj); -typedef struct TclStubHooks { +typedef struct { const struct TclPlatStubs *tclPlatStubs; const struct TclIntStubs *tclIntStubs; const struct TclIntPlatStubs *tclIntPlatStubs; @@ -1818,30 +1824,30 @@ typedef struct TclStubs { int magic; - const struct TclStubHooks *hooks; + const TclStubHooks *hooks; int (*tcl_PkgProvideEx) (Tcl_Interp *interp, const char *name, const char *version, const void *clientData); /* 0 */ CONST84_RETURN char * (*tcl_PkgRequireEx) (Tcl_Interp *interp, const char *name, const char *version, int exact, void *clientDataPtr); /* 1 */ - void (*tcl_Panic) (const char *format, ...); /* 2 */ + void (*tcl_Panic) (const char *format, ...) TCL_FORMAT_PRINTF(1, 2); /* 2 */ char * (*tcl_Alloc) (unsigned int size); /* 3 */ void (*tcl_Free) (char *ptr); /* 4 */ char * (*tcl_Realloc) (char *ptr, unsigned int size); /* 5 */ char * (*tcl_DbCkalloc) (unsigned int size, const char *file, int line); /* 6 */ void (*tcl_DbCkfree) (char *ptr, const char *file, int line); /* 7 */ char * (*tcl_DbCkrealloc) (char *ptr, unsigned int size, const char *file, int line); /* 8 */ -#if !defined(__WIN32__) && !defined(MAC_OSX_TCL) /* UNIX */ +#if !defined(_WIN32) && !defined(MAC_OSX_TCL) /* UNIX */ void (*tcl_CreateFileHandler) (int fd, int mask, Tcl_FileProc *proc, ClientData clientData); /* 9 */ #endif /* UNIX */ -#ifdef __WIN32__ /* WIN */ +#if defined(_WIN32) /* WIN */ void (*reserved9)(void); #endif /* WIN */ #ifdef MAC_OSX_TCL /* MACOSX */ void (*tcl_CreateFileHandler) (int fd, int mask, Tcl_FileProc *proc, ClientData clientData); /* 9 */ #endif /* MACOSX */ -#if !defined(__WIN32__) && !defined(MAC_OSX_TCL) /* UNIX */ +#if !defined(_WIN32) && !defined(MAC_OSX_TCL) /* UNIX */ void (*tcl_DeleteFileHandler) (int fd); /* 10 */ #endif /* UNIX */ -#ifdef __WIN32__ /* WIN */ +#if defined(_WIN32) /* WIN */ void (*reserved10)(void); #endif /* WIN */ #ifdef MAC_OSX_TCL /* MACOSX */ @@ -2003,10 +2009,10 @@ Tcl_Interp * (*tcl_GetMaster) (Tcl_Interp *interp); /* 164 */ const char * (*tcl_GetNameOfExecutable) (void); /* 165 */ Tcl_Obj * (*tcl_GetObjResult) (Tcl_Interp *interp); /* 166 */ -#if !defined(__WIN32__) && !defined(MAC_OSX_TCL) /* UNIX */ +#if !defined(_WIN32) && !defined(MAC_OSX_TCL) /* UNIX */ int (*tcl_GetOpenFile) (Tcl_Interp *interp, const char *chanID, int forWriting, int checkUsage, ClientData *filePtr); /* 167 */ #endif /* UNIX */ -#ifdef __WIN32__ /* WIN */ +#if defined(_WIN32) /* WIN */ void (*reserved167)(void); #endif /* WIN */ #ifdef MAC_OSX_TCL /* MACOSX */ @@ -2062,8 +2068,8 @@ void (*tcl_RegExpRange) (Tcl_RegExp regexp, int index, CONST84 char **startPtr, CONST84 char **endPtr); /* 215 */ void (*tcl_Release) (ClientData clientData); /* 216 */ void (*tcl_ResetResult) (Tcl_Interp *interp); /* 217 */ - int (*tcl_ScanElement) (const char *str, int *flagPtr); /* 218 */ - int (*tcl_ScanCountedElement) (const char *str, int length, int *flagPtr); /* 219 */ + int (*tcl_ScanElement) (const char *src, int *flagPtr); /* 218 */ + int (*tcl_ScanCountedElement) (const char *src, int length, int *flagPtr); /* 219 */ int (*tcl_SeekOld) (Tcl_Channel chan, int offset, int mode); /* 220 */ int (*tcl_ServiceAll) (void); /* 221 */ int (*tcl_ServiceEvent) (int flags); /* 222 */ @@ -2422,8 +2428,8 @@ void (*tcl_AppendLimitedToObj) (Tcl_Obj *objPtr, const char *bytes, int length, int limit, const char *ellipsis); /* 575 */ Tcl_Obj * (*tcl_Format) (Tcl_Interp *interp, const char *format, int objc, Tcl_Obj *const objv[]); /* 576 */ int (*tcl_AppendFormatToObj) (Tcl_Interp *interp, Tcl_Obj *objPtr, const char *format, int objc, Tcl_Obj *const objv[]); /* 577 */ - Tcl_Obj * (*tcl_ObjPrintf) (const char *format, ...); /* 578 */ - void (*tcl_AppendPrintfToObj) (Tcl_Obj *objPtr, const char *format, ...); /* 579 */ + Tcl_Obj * (*tcl_ObjPrintf) (const char *format, ...) TCL_FORMAT_PRINTF(1, 2); /* 578 */ + void (*tcl_AppendPrintfToObj) (Tcl_Obj *objPtr, const char *format, ...) TCL_FORMAT_PRINTF(2, 3); /* 579 */ int (*tcl_CancelEval) (Tcl_Interp *interp, Tcl_Obj *resultObjPtr, ClientData clientData, int flags); /* 580 */ int (*tcl_Canceled) (Tcl_Interp *interp, int flags); /* 581 */ int (*tcl_CreatePipe) (Tcl_Interp *interp, Tcl_Channel *rchan, Tcl_Channel *wchan, int flags); /* 582 */ @@ -2472,14 +2478,13 @@ int (*tcl_NRExprObj) (Tcl_Interp *interp, Tcl_Obj *objPtr, Tcl_Obj *resultPtr); /* 625 */ int (*tcl_NRSubstObj) (Tcl_Interp *interp, Tcl_Obj *objPtr, int flags); /* 626 */ int (*tcl_LoadFile) (Tcl_Interp *interp, Tcl_Obj *pathPtr, const char *const symv[], int flags, void *procPtrs, Tcl_LoadHandle *handlePtr); /* 627 */ - void* (*tcl_FindSymbol) (Tcl_Interp *interp, Tcl_LoadHandle handle, const char *symbol); /* 628 */ + void * (*tcl_FindSymbol) (Tcl_Interp *interp, Tcl_LoadHandle handle, const char *symbol); /* 628 */ int (*tcl_FSUnloadFile) (Tcl_Interp *interp, Tcl_LoadHandle handlePtr); /* 629 */ + void (*tcl_ZlibStreamSetCompressionDictionary) (Tcl_ZlibStream zhandle, Tcl_Obj *compressionDictionaryObj); /* 630 */ } TclStubs; -#ifdef __cplusplus -extern "C" { -#endif extern const TclStubs *tclStubsPtr; + #ifdef __cplusplus } #endif @@ -2508,7 +2513,7 @@ (tclStubsPtr->tcl_DbCkfree) /* 7 */ #define Tcl_DbCkrealloc \ (tclStubsPtr->tcl_DbCkrealloc) /* 8 */ -#if !defined(__WIN32__) && !defined(MAC_OSX_TCL) /* UNIX */ +#if !defined(_WIN32) && !defined(MAC_OSX_TCL) /* UNIX */ #define Tcl_CreateFileHandler \ (tclStubsPtr->tcl_CreateFileHandler) /* 9 */ #endif /* UNIX */ @@ -2516,7 +2521,7 @@ #define Tcl_CreateFileHandler \ (tclStubsPtr->tcl_CreateFileHandler) /* 9 */ #endif /* MACOSX */ -#if !defined(__WIN32__) && !defined(MAC_OSX_TCL) /* UNIX */ +#if !defined(_WIN32) && !defined(MAC_OSX_TCL) /* UNIX */ #define Tcl_DeleteFileHandler \ (tclStubsPtr->tcl_DeleteFileHandler) /* 10 */ #endif /* UNIX */ @@ -2836,7 +2841,7 @@ (tclStubsPtr->tcl_GetNameOfExecutable) /* 165 */ #define Tcl_GetObjResult \ (tclStubsPtr->tcl_GetObjResult) /* 166 */ -#if !defined(__WIN32__) && !defined(MAC_OSX_TCL) /* UNIX */ +#if !defined(_WIN32) && !defined(MAC_OSX_TCL) /* UNIX */ #define Tcl_GetOpenFile \ (tclStubsPtr->tcl_GetOpenFile) /* 167 */ #endif /* UNIX */ @@ -3766,6 +3771,8 @@ (tclStubsPtr->tcl_FindSymbol) /* 628 */ #define Tcl_FSUnloadFile \ (tclStubsPtr->tcl_FSUnloadFile) /* 629 */ +#define Tcl_ZlibStreamSetCompressionDictionary \ + (tclStubsPtr->tcl_ZlibStreamSetCompressionDictionary) /* 630 */ #endif /* defined(USE_TCL_STUBS) */ @@ -3778,6 +3785,7 @@ # undef Tcl_Init # undef Tcl_SetPanicProc # undef Tcl_SetVar +# undef Tcl_ObjSetVar2 # undef Tcl_StaticPackage # undef TclFSGetNativePath # define Tcl_CreateInterp() (tclStubsPtr->tcl_CreateInterp()) @@ -3786,6 +3794,8 @@ # define Tcl_SetPanicProc(proc) (tclStubsPtr->tcl_SetPanicProc(proc)) # define Tcl_SetVar(interp, varName, newValue, flags) \ (tclStubsPtr->tcl_SetVar(interp, varName, newValue, flags)) +# define Tcl_ObjSetVar2(interp, part1, part2, newValue, flags) \ + (tclStubsPtr->tcl_ObjSetVar2(interp, part1, part2, newValue, flags)) #endif #if defined(_WIN32) && defined(UNICODE) @@ -3793,11 +3803,115 @@ # define Tcl_MainEx Tcl_MainExW EXTERN void Tcl_MainExW(int argc, wchar_t **argv, Tcl_AppInitProc *appInitProc, Tcl_Interp *interp); -# define Tcl_Main(argc, argv, proc) Tcl_MainExW(argc, argv, proc, \ - (Tcl_FindExecutable(argv[0]), (Tcl_CreateInterp)())) #endif #undef TCL_STORAGE_CLASS #define TCL_STORAGE_CLASS DLLIMPORT +#undef Tcl_SeekOld +#undef Tcl_TellOld + +#undef Tcl_PkgPresent +#define Tcl_PkgPresent(interp, name, version, exact) \ + Tcl_PkgPresentEx(interp, name, version, exact, NULL) +#undef Tcl_PkgProvide +#define Tcl_PkgProvide(interp, name, version) \ + Tcl_PkgProvideEx(interp, name, version, NULL) +#undef Tcl_PkgRequire +#define Tcl_PkgRequire(interp, name, version, exact) \ + Tcl_PkgRequireEx(interp, name, version, exact, NULL) +#undef Tcl_GetIndexFromObj +#define Tcl_GetIndexFromObj(interp, objPtr, tablePtr, msg, flags, indexPtr) \ + Tcl_GetIndexFromObjStruct(interp, objPtr, tablePtr, \ + sizeof(char *), msg, flags, indexPtr) +#undef Tcl_NewBooleanObj +#define Tcl_NewBooleanObj(boolValue) \ + Tcl_NewIntObj((boolValue)!=0) +#undef Tcl_DbNewBooleanObj +#define Tcl_DbNewBooleanObj(boolValue, file, line) \ + Tcl_DbNewLongObj((boolValue)!=0, file, line) +#undef Tcl_SetBooleanObj +#define Tcl_SetBooleanObj(objPtr, boolValue) \ + Tcl_SetIntObj((objPtr), (boolValue)!=0) +#undef Tcl_SetVar +#define Tcl_SetVar(interp, varName, newValue, flags) \ + Tcl_SetVar2(interp, varName, NULL, newValue, flags) +#undef Tcl_UnsetVar +#define Tcl_UnsetVar(interp, varName, flags) \ + Tcl_UnsetVar2(interp, varName, NULL, flags) +#undef Tcl_GetVar +#define Tcl_GetVar(interp, varName, flags) \ + Tcl_GetVar2(interp, varName, NULL, flags) +#undef Tcl_TraceVar +#define Tcl_TraceVar(interp, varName, flags, proc, clientData) \ + Tcl_TraceVar2(interp, varName, NULL, flags, proc, clientData) +#undef Tcl_UntraceVar +#define Tcl_UntraceVar(interp, varName, flags, proc, clientData) \ + Tcl_UntraceVar2(interp, varName, NULL, flags, proc, clientData) +#undef Tcl_VarTraceInfo +#define Tcl_VarTraceInfo(interp, varName, flags, proc, prevClientData) \ + Tcl_VarTraceInfo2(interp, varName, NULL, flags, proc, prevClientData) +#undef Tcl_UpVar +#define Tcl_UpVar(interp, frameName, varName, localName, flags) \ + Tcl_UpVar2(interp, frameName, varName, NULL, localName, flags) + +#if defined(USE_TCL_STUBS) && !defined(USE_TCL_STUB_PROCS) +# if defined(__CYGWIN__) && defined(TCL_WIDE_INT_IS_LONG) +/* On Cygwin64, long is 64-bit while on Win64 long is 32-bit. Therefore + * we have to make sure that all stub entries on Cygwin64 follow the + * Win64 signature. Cygwin64 stubbed extensions cannot use those stub + * entries any more, they should use the 64-bit alternatives where + * possible. Tcl 9 must find a better solution, but that cannot be done + * without introducing a binary incompatibility. + */ +# undef Tcl_DbNewLongObj +# undef Tcl_GetLongFromObj +# undef Tcl_NewLongObj +# undef Tcl_SetLongObj +# undef Tcl_ExprLong +# undef Tcl_ExprLongObj +# undef Tcl_UniCharNcmp +# undef Tcl_UtfNcmp +# undef Tcl_UtfNcasecmp +# undef Tcl_UniCharNcasecmp +# define Tcl_DbNewLongObj ((Tcl_Obj*(*)(long,const char*,int))Tcl_DbNewWideIntObj) +# define Tcl_GetLongFromObj ((int(*)(Tcl_Interp*,Tcl_Obj*,long*))Tcl_GetWideIntFromObj) +# define Tcl_NewLongObj ((Tcl_Obj*(*)(long))Tcl_NewWideIntObj) +# define Tcl_SetLongObj ((void(*)(Tcl_Obj*,long))Tcl_SetWideIntObj) +# define Tcl_ExprLong TclExprLong + static inline int TclExprLong(Tcl_Interp *interp, const char *string, long *ptr){ + int intValue; + int result = tclStubsPtr->tcl_ExprLong(interp, string, (long *)&intValue); + if (result == TCL_OK) *ptr = (long)intValue; + return result; + } +# define Tcl_ExprLongObj TclExprLongObj + static inline int TclExprLongObj(Tcl_Interp *interp, Tcl_Obj *obj, long *ptr){ + int intValue; + int result = tclStubsPtr->tcl_ExprLongObj(interp, obj, (long *)&intValue); + if (result == TCL_OK) *ptr = (long)intValue; + return result; + } +# define Tcl_UniCharNcmp(ucs,uct,n) \ + ((int(*)(const Tcl_UniChar*,const Tcl_UniChar*,unsigned int))tclStubsPtr->tcl_UniCharNcmp)(ucs,uct,(unsigned int)(n)) +# define Tcl_UtfNcmp(s1,s2,n) \ + ((int(*)(const char*,const char*,unsigned int))tclStubsPtr->tcl_UtfNcmp)(s1,s2,(unsigned int)(n)) +# define Tcl_UtfNcasecmp(s1,s2,n) \ + ((int(*)(const char*,const char*,unsigned int))tclStubsPtr->tcl_UtfNcasecmp)(s1,s2,(unsigned int)(n)) +# define Tcl_UniCharNcasecmp(ucs,uct,n) \ + ((int(*)(const Tcl_UniChar*,const Tcl_UniChar*,unsigned int))tclStubsPtr->tcl_UniCharNcasecmp)(ucs,uct,(unsigned int)(n)) +# endif +#endif + +/* + * Deprecated Tcl procedures: + */ + +#undef Tcl_EvalObj +#define Tcl_EvalObj(interp,objPtr) \ + Tcl_EvalObjEx((interp),(objPtr),0) +#undef Tcl_GlobalEvalObj +#define Tcl_GlobalEvalObj(interp,objPtr) \ + Tcl_EvalObjEx((interp),(objPtr),TCL_EVAL_GLOBAL) + #endif /* _TCLDECLS */ diff -Nru critcl-3.1.9/lib/critcl/critcl_c/tcl8.6/tcl.h critcl-3.1.17+dfsg/lib/critcl/critcl_c/tcl8.6/tcl.h --- critcl-3.1.9/lib/critcl/critcl_c/tcl8.6/tcl.h 2013-05-10 05:57:04.000000000 +0000 +++ critcl-3.1.17+dfsg/lib/critcl/critcl_c/tcl8.6/tcl.h 2017-10-14 02:48:11.000000000 +0000 @@ -12,8 +12,6 @@ * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tcl.h,v 1.311 2010/12/14 21:51:53 nijtmans Exp $ */ #ifndef _TCL @@ -53,17 +51,15 @@ * win/README (not patchlevel) (sections 0 and 2) * unix/tcl.spec (1 LOC patch) * tools/tcl.hpj.in (not patchlevel, for windows installer) - * tools/tcl.wse.in (for windows installer) - * tools/tclSplash.bmp (not patchlevel) */ #define TCL_MAJOR_VERSION 8 #define TCL_MINOR_VERSION 6 -#define TCL_RELEASE_LEVEL TCL_BETA_RELEASE -#define TCL_RELEASE_SERIAL 1 +#define TCL_RELEASE_LEVEL TCL_FINAL_RELEASE +#define TCL_RELEASE_SERIAL 4 #define TCL_VERSION "8.6" -#define TCL_PATCH_LEVEL "8.6b1.2" +#define TCL_PATCH_LEVEL "8.6.4" /* *---------------------------------------------------------------------------- @@ -71,27 +67,14 @@ * We use this method because there is no autoconf equivalent. */ -#ifndef __WIN32__ -# if defined(_WIN32) || defined(WIN32) || defined(__MINGW32__) || defined(__BORLANDC__) || (defined(__WATCOMC__) && defined(__WINDOWS_386__)) +#ifdef _WIN32 +# ifndef __WIN32__ # define __WIN32__ -# ifndef WIN32 -# define WIN32 -# endif -# ifndef _WIN32 -# define _WIN32 -# endif # endif -#endif - -/* - * STRICT: See MSDN Article Q83456 - */ - -#ifdef __WIN32__ -# ifndef STRICT -# define STRICT +# ifndef WIN32 +# define WIN32 # endif -#endif /* __WIN32__ */ +#endif /* * Utility macros: STRINGIFY takes an argument and wraps it in "" (double @@ -158,6 +141,28 @@ # define TCL_VARARGS_DEF(type, name) (type name, ...) # define TCL_VARARGS_START(type, name, list) (va_start(list, name), name) #endif +#if defined(__GNUC__) && (__GNUC__ > 2) +# define TCL_FORMAT_PRINTF(a,b) __attribute__ ((__format__ (__printf__, a, b))) +#else +# define TCL_FORMAT_PRINTF(a,b) +#endif + +/* + * Allow a part of Tcl's API to be explicitly marked as deprecated. + * + * Used to make TIP 330/336 generate moans even if people use the + * compatibility macros. Change your code, guys! We won't support you forever. + */ + +#if defined(__GNUC__) && ((__GNUC__ >= 4) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 1))) +# if (__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 5)) +# define TCL_DEPRECATED_API(msg) __attribute__ ((__deprecated__ (msg))) +# else +# define TCL_DEPRECATED_API(msg) __attribute__ ((__deprecated__)) +# endif +#else +# define TCL_DEPRECATED_API(msg) /* nothing portable */ +#endif /* *---------------------------------------------------------------------------- @@ -173,7 +178,7 @@ * MSVCRT. */ -#if (defined(__WIN32__) && (defined(_MSC_VER) || (__BORLANDC__ >= 0x0550) || defined(__LCC__) || defined(__WATCOMC__) || (defined(__GNUC__) && defined(__declspec)))) +#if (defined(_WIN32) && (defined(_MSC_VER) || (defined(__BORLANDC__) && (__BORLANDC__ >= 0x0550)) || defined(__LCC__) || defined(__WATCOMC__) || (defined(__GNUC__) && defined(__declspec)))) # define HAVE_DECLSPEC 1 # ifdef STATIC_BUILD # define DLLIMPORT @@ -190,7 +195,7 @@ # endif #else # define DLLIMPORT -# if defined(__GNUC__) && !defined(NO_VIZ) && !defined(STATIC_BUILD) +# if defined(__GNUC__) && __GNUC__ > 3 # define DLLEXPORT __attribute__ ((visibility("default"))) # else # define DLLEXPORT @@ -297,24 +302,26 @@ * VOID. This block is skipped under Cygwin and Mingw. */ -#if defined(__WIN32__) && !defined(HAVE_WINNT_IGNORE_VOID) +#if defined(_WIN32) && !defined(HAVE_WINNT_IGNORE_VOID) #ifndef VOID #define VOID void typedef char CHAR; typedef short SHORT; typedef long LONG; #endif -#endif /* __WIN32__ && !HAVE_WINNT_IGNORE_VOID */ +#endif /* _WIN32 && !HAVE_WINNT_IGNORE_VOID */ /* * Macro to use instead of "void" for arguments that must have type "void *" * in ANSI C; maps them to type "char *" in non-ANSI systems. */ -#ifndef NO_VOID -# define VOID void -#else -# define VOID char +#ifndef __VXWORKS__ +# ifndef NO_VOID +# define VOID void +# else +# define VOID char +# endif #endif /* @@ -370,43 +377,28 @@ */ #if !defined(TCL_WIDE_INT_TYPE)&&!defined(TCL_WIDE_INT_IS_LONG) -# if defined(__GNUC__) -# define TCL_WIDE_INT_TYPE long long -# if defined(__WIN32__) && !defined(__CYGWIN__) -# define TCL_LL_MODIFIER "I64" -# else -# define TCL_LL_MODIFIER "ll" -# endif -typedef struct stat Tcl_StatBuf; -# elif defined(__WIN32__) +# if defined(_WIN32) # define TCL_WIDE_INT_TYPE __int64 # ifdef __BORLANDC__ -typedef struct stati64 Tcl_StatBuf; # define TCL_LL_MODIFIER "L" # else /* __BORLANDC__ */ -# if _MSC_VER < 1400 || !defined(_M_IX86) -typedef struct _stati64 Tcl_StatBuf; -# else -typedef struct _stat64 Tcl_StatBuf; -# endif /* _MSC_VER < 1400 */ # define TCL_LL_MODIFIER "I64" # endif /* __BORLANDC__ */ -# else /* __WIN32__ */ +# elif defined(__GNUC__) +# define TCL_WIDE_INT_TYPE long long +# define TCL_LL_MODIFIER "ll" +# else /* ! _WIN32 && ! __GNUC__ */ /* * Don't know what platform it is and configure hasn't discovered what is * going on for us. Try to guess... */ -# ifdef NO_LIMITS_H -# error please define either TCL_WIDE_INT_TYPE or TCL_WIDE_INT_IS_LONG -# else /* !NO_LIMITS_H */ -# include -# if (INT_MAX < LONG_MAX) -# define TCL_WIDE_INT_IS_LONG 1 -# else -# define TCL_WIDE_INT_TYPE long long -# endif -# endif /* NO_LIMITS_H */ -# endif /* __WIN32__ */ +# include +# if (INT_MAX < LONG_MAX) +# define TCL_WIDE_INT_IS_LONG 1 +# else +# define TCL_WIDE_INT_TYPE long long +# endif +# endif /* _WIN32 */ #endif /* !TCL_WIDE_INT_TYPE & !TCL_WIDE_INT_IS_LONG */ #ifdef TCL_WIDE_INT_IS_LONG # undef TCL_WIDE_INT_TYPE @@ -417,7 +409,6 @@ typedef unsigned TCL_WIDE_INT_TYPE Tcl_WideUInt; #ifdef TCL_WIDE_INT_IS_LONG -typedef struct stat Tcl_StatBuf; # define Tcl_WideAsLong(val) ((long)(val)) # define Tcl_LongAsWide(val) ((long)(val)) # define Tcl_WideAsDouble(val) ((double)((long)(val))) @@ -431,11 +422,6 @@ * or some other strange platform. */ # ifndef TCL_LL_MODIFIER -# ifdef HAVE_STRUCT_STAT64 -typedef struct stat64 Tcl_StatBuf; -# else -typedef struct stat Tcl_StatBuf; -# endif /* HAVE_STRUCT_STAT64 */ # define TCL_LL_MODIFIER "ll" # endif /* !TCL_LL_MODIFIER */ # define Tcl_WideAsLong(val) ((long)((Tcl_WideInt)(val))) @@ -443,6 +429,39 @@ # define Tcl_WideAsDouble(val) ((double)((Tcl_WideInt)(val))) # define Tcl_DoubleAsWide(val) ((Tcl_WideInt)((double)(val))) #endif /* TCL_WIDE_INT_IS_LONG */ + +#if defined(_WIN32) +# ifdef __BORLANDC__ + typedef struct stati64 Tcl_StatBuf; +# elif defined(_WIN64) + typedef struct __stat64 Tcl_StatBuf; +# elif (defined(_MSC_VER) && (_MSC_VER < 1400)) || defined(_USE_32BIT_TIME_T) + typedef struct _stati64 Tcl_StatBuf; +# else + typedef struct _stat32i64 Tcl_StatBuf; +# endif /* _MSC_VER < 1400 */ +#elif defined(__CYGWIN__) + typedef struct { + dev_t st_dev; + unsigned short st_ino; + unsigned short st_mode; + short st_nlink; + short st_uid; + short st_gid; + /* Here is a 2-byte gap */ + dev_t st_rdev; + /* Here is a 4-byte gap */ + long long st_size; + struct {long tv_sec;} st_atim; + struct {long tv_sec;} st_mtim; + struct {long tv_sec;} st_ctim; + /* Here is a 4-byte gap */ + } Tcl_StatBuf; +#elif defined(HAVE_STRUCT_STAT64) && !defined(__APPLE__) + typedef struct stat64 Tcl_StatBuf; +#else + typedef struct stat Tcl_StatBuf; +#endif /* *---------------------------------------------------------------------------- @@ -464,13 +483,17 @@ * accessed with Tcl_GetObjResult() and Tcl_SetObjResult(). */ -typedef struct Tcl_Interp { +typedef struct Tcl_Interp +#ifndef TCL_NO_DEPRECATED +{ /* TIP #330: Strongly discourage extensions from using the string * result. */ #ifdef USE_INTERP_RESULT - char *result; /* If the last command returned a string + char *result TCL_DEPRECATED_API("use Tcl_GetStringResult/Tcl_SetResult"); + /* If the last command returned a string * result, this points to it. */ - void (*freeProc) (char *blockPtr); + void (*freeProc) (char *blockPtr) + TCL_DEPRECATED_API("use Tcl_GetStringResult/Tcl_SetResult"); /* Zero means the string result is statically * allocated. TCL_DYNAMIC means it was * allocated with ckalloc and should be freed @@ -479,17 +502,20 @@ * Tcl_Eval must free it before executing next * command. */ #else - char *unused3; - void (*unused4) (char *); + char *resultDontUse; /* Don't use in extensions! */ + void (*freeProcDontUse) (char *); /* Don't use in extensions! */ #endif #ifdef USE_INTERP_ERRORLINE - int errorLine; /* When TCL_ERROR is returned, this gives the + int errorLine TCL_DEPRECATED_API("use Tcl_GetErrorLine/Tcl_SetErrorLine"); + /* When TCL_ERROR is returned, this gives the * line number within the command where the * error occurred (1 if first line). */ #else - int unused5; + int errorLineDontUse; /* Don't use in extensions! */ #endif -} Tcl_Interp; +} +#endif /* TCL_NO_DEPRECATED */ +Tcl_Interp; typedef struct Tcl_AsyncHandler_ *Tcl_AsyncHandler; typedef struct Tcl_Channel_ *Tcl_Channel; @@ -519,7 +545,7 @@ * will be called as the main fuction of the new thread created by that call. */ -#if defined __WIN32__ +#if defined _WIN32 typedef unsigned (__stdcall Tcl_ThreadCreateProc) (ClientData clientData); #else typedef void (Tcl_ThreadCreateProc) (ClientData clientData); @@ -531,7 +557,7 @@ * in generic/tclThreadTest.c for it's usage. */ -#if defined __WIN32__ +#if defined _WIN32 # define Tcl_ThreadCreateType unsigned __stdcall # define TCL_THREAD_CREATE_RETURN return 0 #else @@ -796,11 +822,14 @@ void *ptr1; void *ptr2; } twoPtrValue; - struct { /* - internal rep as a wide int, tightly - * packed fields. */ - void *ptr; /* Pointer to digits. */ - unsigned long value;/* Alloc, used, and signum packed into a - * single word. */ + struct { /* - internal rep as a pointer and a long, + * the main use of which is a bignum's + * tightly packed fields, where the alloc, + * used and signum flags are packed into a + * single word with everything else hung + * off the pointer. */ + void *ptr; + unsigned long value; } ptrAndLongRep; } internalRep; } Tcl_Obj; @@ -810,10 +839,7 @@ * whether an object is shared (i.e. has reference count > 1). Note: clients * should use Tcl_DecrRefCount() when they are finished using an object, and * should never call TclFreeObj() directly. TclFreeObj() is only defined and - * made public in tcl.h to support Tcl_DecrRefCount's macro definition. Note - * also that Tcl_DecrRefCount() refers to the parameter "obj" twice. This - * means that you should avoid calling it with an expression that is expensive - * to compute or has side effects. + * made public in tcl.h to support Tcl_DecrRefCount's macro definition. */ void Tcl_IncrRefCount(Tcl_Obj *objPtr); @@ -987,8 +1013,6 @@ * is safe to leave the hash unquoted when the element is not the first * element of a list, and this flag can be used by the caller to indicate * that condition. - * (Careful! If you change these flag values be sure to change the definitions - * at the front of tclUtil.c). */ #define TCL_DONT_USE_BRACES 1 @@ -2106,11 +2130,28 @@ * substituting one or more "close" characters in * the destination buffer and then continue to * convert the source. + * TCL_ENCODING_NO_TERMINATE - If set, Tcl_ExternalToUtf will not append a + * terminating NUL byte. Knowing that it will + * not need space to do so, it will fill all + * dstLen bytes with encoded UTF-8 content, as + * other circumstances permit. If clear, the + * default behavior is to reserve a byte in + * the dst space for NUL termination, and to + * append the NUL byte. + * TCL_ENCODING_CHAR_LIMIT - If set and dstCharsPtr is not NULL, then + * Tcl_ExternalToUtf takes the initial value + * of *dstCharsPtr is taken as a limit of the + * maximum number of chars to produce in the + * encoded UTF-8 content. Otherwise, the + * number of chars produced is controlled only + * by other limiting factors. */ #define TCL_ENCODING_START 0x01 #define TCL_ENCODING_END 0x02 #define TCL_ENCODING_STOPONERROR 0x04 +#define TCL_ENCODING_NO_TERMINATE 0x08 +#define TCL_ENCODING_CHAR_LIMIT 0x10 /* * The following definitions are the error codes returned by the conversion @@ -2147,12 +2188,12 @@ /* * The maximum number of bytes that are necessary to represent a single - * Unicode character in UTF-8. The valid values should be 3 or 6 (or perhaps 1 - * if we want to support a non-unicode enabled core). If 3, then Tcl_UniChar - * must be 2-bytes in size (UCS-2) (the default). If 6, then Tcl_UniChar must - * be 4-bytes in size (UCS-4). At this time UCS-2 mode is the default and - * recommended mode. UCS-4 is experimental and not recommended. It works for - * the core, but most extensions expect UCS-2. + * Unicode character in UTF-8. The valid values should be 3, 4 or 6 + * (or perhaps 1 if we want to support a non-unicode enabled core). If 3 or + * 4, then Tcl_UniChar must be 2-bytes in size (UCS-2) (the default). If 6, + * then Tcl_UniChar must be 4-bytes in size (UCS-4). At this time UCS-2 mode + * is the default and recommended mode. UCS-4 is experimental and not + * recommended. It works for the core, but most extensions expect UCS-2. */ #ifndef TCL_UTF_MAX @@ -2164,7 +2205,7 @@ * reflected in regcustom.h. */ -#if TCL_UTF_MAX > 3 +#if TCL_UTF_MAX > 4 /* * unsigned int isn't 100% accurate as it should be a strict 4-byte value * (perhaps wchar_t). 64-bit systems may have troubles. The size of this @@ -2270,12 +2311,12 @@ #define TCL_ARGV_AUTO_HELP \ {TCL_ARGV_HELP, "-help", NULL, NULL, \ - "Print summary of command-line options and abort"} + "Print summary of command-line options and abort", NULL} #define TCL_ARGV_AUTO_REST \ {TCL_ARGV_REST, "--", NULL, NULL, \ - "Marks the end of the options"} + "Marks the end of the options", NULL} #define TCL_ARGV_TABLE_END \ - {TCL_ARGV_END} + {TCL_ARGV_END, NULL, NULL, NULL, NULL, NULL} /* *---------------------------------------------------------------------------- @@ -2320,6 +2361,14 @@ /* *---------------------------------------------------------------------------- + * Definitions needed for the Tcl_LoadFile function. [TIP #416] + */ + +#define TCL_LOAD_GLOBAL 1 +#define TCL_LOAD_LAZY 2 + +/* + *---------------------------------------------------------------------------- * Single public declaration for NRE. */ @@ -2367,13 +2416,13 @@ * Tcl_GetMemoryInfo is needed for AOLserver. [Bug 1868171] */ -EXTERN void Tcl_Main(int argc, char **argv, - Tcl_AppInitProc *appInitProc); +#define Tcl_Main(argc, argv, proc) Tcl_MainEx(argc, argv, proc, \ + ((Tcl_CreateInterp)())) +EXTERN void Tcl_MainEx(int argc, char **argv, + Tcl_AppInitProc *appInitProc, Tcl_Interp *interp); EXTERN const char * Tcl_PkgInitStubsCheck(Tcl_Interp *interp, const char *version, int exact); -#if defined(TCL_THREADS) && defined(USE_THREAD_ALLOC) EXTERN void Tcl_GetMemoryInfo(Tcl_DString *dsPtr); -#endif /* *---------------------------------------------------------------------------- @@ -2385,9 +2434,15 @@ /* * Include platform specific public function declarations that are accessible - * via the stubs table. + * via the stubs table. Make all TclOO symbols MODULE_SCOPE (which only + * has effect on building it as a shared library). See ticket [3010352]. */ +#if defined(BUILD_tcl) +# undef TCLAPI +# define TCLAPI MODULE_SCOPE +#endif + #include "tclPlatDecls.h" /* @@ -2399,11 +2454,16 @@ #ifdef TCL_MEM_DEBUG -# define ckalloc(x) Tcl_DbCkalloc(x, __FILE__, __LINE__) -# define ckfree(x) Tcl_DbCkfree(x, __FILE__, __LINE__) -# define ckrealloc(x,y) Tcl_DbCkrealloc((x), (y),__FILE__, __LINE__) -# define attemptckalloc(x) Tcl_AttemptDbCkalloc(x, __FILE__, __LINE__) -# define attemptckrealloc(x,y) Tcl_AttemptDbCkrealloc((x), (y), __FILE__, __LINE__) +# define ckalloc(x) \ + ((void *) Tcl_DbCkalloc((unsigned)(x), __FILE__, __LINE__)) +# define ckfree(x) \ + Tcl_DbCkfree((char *)(x), __FILE__, __LINE__) +# define ckrealloc(x,y) \ + ((void *) Tcl_DbCkrealloc((char *)(x), (unsigned)(y), __FILE__, __LINE__)) +# define attemptckalloc(x) \ + ((void *) Tcl_AttemptDbCkalloc((unsigned)(x), __FILE__, __LINE__)) +# define attemptckrealloc(x,y) \ + ((void *) Tcl_AttemptDbCkrealloc((char *)(x), (unsigned)(y), __FILE__, __LINE__)) #else /* !TCL_MEM_DEBUG */ @@ -2413,11 +2473,16 @@ * memory allocator both inside and outside of the Tcl library. */ -# define ckalloc(x) Tcl_Alloc(x) -# define ckfree(x) Tcl_Free(x) -# define ckrealloc(x,y) Tcl_Realloc(x,y) -# define attemptckalloc(x) Tcl_AttemptAlloc(x) -# define attemptckrealloc(x,y) Tcl_AttemptRealloc(x,y) +# define ckalloc(x) \ + ((void *) Tcl_Alloc((unsigned)(x))) +# define ckfree(x) \ + Tcl_Free((char *)(x)) +# define ckrealloc(x,y) \ + ((void *) Tcl_Realloc((char *)(x), (unsigned)(y))) +# define attemptckalloc(x) \ + ((void *) Tcl_AttemptAlloc((unsigned)(x))) +# define attemptckrealloc(x,y) \ + ((void *) Tcl_AttemptRealloc((char *)(x), (unsigned)(y))) # undef Tcl_InitMemory # define Tcl_InitMemory(x) # undef Tcl_DumpActiveMemory @@ -2442,7 +2507,12 @@ * http://c2.com/cgi/wiki?TrivialDoWhileLoop */ # define Tcl_DecrRefCount(objPtr) \ - do { if (--(objPtr)->refCount <= 0) TclFreeObj(objPtr); } while(0) + do { \ + Tcl_Obj *_objPtr = (objPtr); \ + if (--(_objPtr)->refCount <= 0) { \ + TclFreeObj(_objPtr); \ + } \ + } while(0) # define Tcl_IsShared(objPtr) \ ((objPtr)->refCount > 1) #endif @@ -2538,13 +2608,6 @@ */ #ifndef TCL_NO_DEPRECATED -# undef Tcl_EvalObj -# define Tcl_EvalObj(interp,objPtr) \ - Tcl_EvalObjEx((interp),(objPtr),0) -# undef Tcl_GlobalEvalObj -# define Tcl_GlobalEvalObj(interp,objPtr) \ - Tcl_EvalObjEx((interp),(objPtr),TCL_EVAL_GLOBAL) - /* * These function have been renamed. The old names are deprecated, but we * define these macros for backwards compatibilty. diff -Nru critcl-3.1.9/lib/critcl/critcl_c/tcl8.6/tclPlatDecls.h critcl-3.1.17+dfsg/lib/critcl/critcl_c/tcl8.6/tclPlatDecls.h --- critcl-3.1.9/lib/critcl/critcl_c/tcl8.6/tclPlatDecls.h 2013-05-10 05:57:04.000000000 +0000 +++ critcl-3.1.17+dfsg/lib/critcl/critcl_c/tcl8.6/tclPlatDecls.h 2017-10-14 02:48:11.000000000 +0000 @@ -5,8 +5,6 @@ * * Copyright (c) 1998-1999 by Scriptics Corporation. * All rights reserved. - * - * RCS: @(#) $Id: tclPlatDecls.h,v 1.40 2010/08/19 04:26:03 nijtmans Exp $ */ #ifndef _TCLPLATDECLS @@ -33,7 +31,7 @@ * TCHAR is needed here for win32, so if it is not defined yet do it here. * This way, we don't need to include just for one define. */ -#if defined(_WIN32) && !defined(_TCHAR_DEFINED) +#if (defined(_WIN32) || defined(__CYGWIN__)) && !defined(_TCHAR_DEFINED) # if defined(_UNICODE) typedef wchar_t TCHAR; # else @@ -44,11 +42,15 @@ /* !BEGIN!: Do not edit below this line. */ +#ifdef __cplusplus +extern "C" { +#endif + /* * Exported function declarations: */ -#ifdef __WIN32__ /* WIN */ +#if defined(_WIN32) || defined(__CYGWIN__) /* WIN */ /* 0 */ EXTERN TCHAR * Tcl_WinUtfToTChar(const char *str, int len, Tcl_DString *dsPtr); @@ -71,9 +73,9 @@ typedef struct TclPlatStubs { int magic; - const struct TclPlatStubHooks *hooks; + void *hooks; -#ifdef __WIN32__ /* WIN */ +#if defined(_WIN32) || defined(__CYGWIN__) /* WIN */ TCHAR * (*tcl_WinUtfToTChar) (const char *str, int len, Tcl_DString *dsPtr); /* 0 */ char * (*tcl_WinTCharToUtf) (const TCHAR *str, int len, Tcl_DString *dsPtr); /* 1 */ #endif /* WIN */ @@ -83,10 +85,8 @@ #endif /* MACOSX */ } TclPlatStubs; -#ifdef __cplusplus -extern "C" { -#endif extern const TclPlatStubs *tclPlatStubsPtr; + #ifdef __cplusplus } #endif @@ -97,7 +97,7 @@ * Inline function declarations: */ -#ifdef __WIN32__ /* WIN */ +#if defined(_WIN32) || defined(__CYGWIN__) /* WIN */ #define Tcl_WinUtfToTChar \ (tclPlatStubsPtr->tcl_WinUtfToTChar) /* 0 */ #define Tcl_WinTCharToUtf \ diff -Nru critcl-3.1.9/lib/critcl/critcl_c/tcl8.6/tkDecls.h critcl-3.1.17+dfsg/lib/critcl/critcl_c/tcl8.6/tkDecls.h --- critcl-3.1.9/lib/critcl/critcl_c/tcl8.6/tkDecls.h 2013-05-10 05:57:04.000000000 +0000 +++ critcl-3.1.17+dfsg/lib/critcl/critcl_c/tcl8.6/tkDecls.h 2017-10-14 02:48:11.000000000 +0000 @@ -7,8 +7,6 @@ * * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tkDecls.h,v 1.51 2010/10/11 21:50:46 nijtmans Exp $ */ #ifndef _TKDECLS @@ -27,6 +25,10 @@ /* !BEGIN!: Do not edit below this line. */ +#ifdef __cplusplus +extern "C" { +#endif + /* * Exported function declarations: */ @@ -183,9 +185,8 @@ Tk_Window tkwin, const char *pathName, const char *screenName); /* 44 */ -EXTERN int Tk_OldDefineBitmap(Tcl_Interp *interp, - const char *name, const char *source, - int width, int height); +EXTERN int Tk_DefineBitmap(Tcl_Interp *interp, const char *name, + const void *source, int width, int height); /* 45 */ EXTERN void Tk_DefineCursor(Tk_Window window, Tk_Cursor cursor); /* 46 */ @@ -306,8 +307,8 @@ EXTERN Pixmap Tk_GetBitmap(Tcl_Interp *interp, Tk_Window tkwin, const char *str); /* 86 */ -EXTERN Pixmap Tk_OldGetBitmapFromData(Tcl_Interp *interp, - Tk_Window tkwin, const char *source, +EXTERN Pixmap Tk_GetBitmapFromData(Tcl_Interp *interp, + Tk_Window tkwin, const void *source, int width, int height); /* 87 */ EXTERN int Tk_GetCapStyle(Tcl_Interp *interp, const char *str, @@ -863,15 +864,8 @@ /* 273 */ EXTERN void Tk_CreateOldPhotoImageFormat( const Tk_PhotoImageFormat *formatPtr); -/* 274 */ -EXTERN int Tk_DefineBitmap(Tcl_Interp *interp, const char *name, - const void *source, int width, int height); -/* 275 */ -EXTERN Pixmap Tk_GetBitmapFromData(Tcl_Interp *interp, - Tk_Window tkwin, const void *source, - int width, int height); -typedef struct TkStubHooks { +typedef struct { const struct TkPlatStubs *tkPlatStubs; const struct TkIntStubs *tkIntStubs; const struct TkIntPlatStubs *tkIntPlatStubs; @@ -880,7 +874,7 @@ typedef struct TkStubs { int magic; - const struct TkStubHooks *hooks; + const TkStubHooks *hooks; void (*tk_MainLoop) (void); /* 0 */ XColor * (*tk_3DBorderColor) (Tk_3DBorder border); /* 1 */ @@ -926,7 +920,7 @@ void (*tk_CreateSelHandler) (Tk_Window tkwin, Atom selection, Atom target, Tk_SelectionProc *proc, ClientData clientData, Atom format); /* 41 */ Tk_Window (*tk_CreateWindow) (Tcl_Interp *interp, Tk_Window parent, const char *name, const char *screenName); /* 42 */ Tk_Window (*tk_CreateWindowFromPath) (Tcl_Interp *interp, Tk_Window tkwin, const char *pathName, const char *screenName); /* 43 */ - int (*tk_OldDefineBitmap) (Tcl_Interp *interp, const char *name, const char *source, int width, int height); /* 44 */ + int (*tk_DefineBitmap) (Tcl_Interp *interp, const char *name, const void *source, int width, int height); /* 44 */ void (*tk_DefineCursor) (Tk_Window window, Tk_Cursor cursor); /* 45 */ void (*tk_DeleteAllBindings) (Tk_BindingTable bindingTable, ClientData object); /* 46 */ int (*tk_DeleteBinding) (Tcl_Interp *interp, Tk_BindingTable bindingTable, ClientData object, const char *eventStr); /* 47 */ @@ -968,7 +962,7 @@ CONST84_RETURN char * (*tk_GetAtomName) (Tk_Window tkwin, Atom atom); /* 83 */ CONST84_RETURN char * (*tk_GetBinding) (Tcl_Interp *interp, Tk_BindingTable bindingTable, ClientData object, const char *eventStr); /* 84 */ Pixmap (*tk_GetBitmap) (Tcl_Interp *interp, Tk_Window tkwin, const char *str); /* 85 */ - Pixmap (*tk_OldGetBitmapFromData) (Tcl_Interp *interp, Tk_Window tkwin, const char *source, int width, int height); /* 86 */ + Pixmap (*tk_GetBitmapFromData) (Tcl_Interp *interp, Tk_Window tkwin, const void *source, int width, int height); /* 86 */ int (*tk_GetCapStyle) (Tcl_Interp *interp, const char *str, int *capPtr); /* 87 */ XColor * (*tk_GetColor) (Tcl_Interp *interp, Tk_Window tkwin, Tk_Uid name); /* 88 */ XColor * (*tk_GetColorByValue) (Tk_Window tkwin, XColor *colorPtr); /* 89 */ @@ -1156,14 +1150,10 @@ Tcl_Interp * (*tk_Interp) (Tk_Window tkwin); /* 271 */ void (*tk_CreateOldImageType) (const Tk_ImageType *typePtr); /* 272 */ void (*tk_CreateOldPhotoImageFormat) (const Tk_PhotoImageFormat *formatPtr); /* 273 */ - int (*tk_DefineBitmap) (Tcl_Interp *interp, const char *name, const void *source, int width, int height); /* 274 */ - Pixmap (*tk_GetBitmapFromData) (Tcl_Interp *interp, Tk_Window tkwin, const void *source, int width, int height); /* 275 */ } TkStubs; -#ifdef __cplusplus -extern "C" { -#endif extern const TkStubs *tkStubsPtr; + #ifdef __cplusplus } #endif @@ -1262,8 +1252,8 @@ (tkStubsPtr->tk_CreateWindow) /* 42 */ #define Tk_CreateWindowFromPath \ (tkStubsPtr->tk_CreateWindowFromPath) /* 43 */ -#define Tk_OldDefineBitmap \ - (tkStubsPtr->tk_OldDefineBitmap) /* 44 */ +#define Tk_DefineBitmap \ + (tkStubsPtr->tk_DefineBitmap) /* 44 */ #define Tk_DefineCursor \ (tkStubsPtr->tk_DefineCursor) /* 45 */ #define Tk_DeleteAllBindings \ @@ -1346,8 +1336,8 @@ (tkStubsPtr->tk_GetBinding) /* 84 */ #define Tk_GetBitmap \ (tkStubsPtr->tk_GetBitmap) /* 85 */ -#define Tk_OldGetBitmapFromData \ - (tkStubsPtr->tk_OldGetBitmapFromData) /* 86 */ +#define Tk_GetBitmapFromData \ + (tkStubsPtr->tk_GetBitmapFromData) /* 86 */ #define Tk_GetCapStyle \ (tkStubsPtr->tk_GetCapStyle) /* 87 */ #define Tk_GetColor \ @@ -1720,10 +1710,6 @@ (tkStubsPtr->tk_CreateOldImageType) /* 272 */ #define Tk_CreateOldPhotoImageFormat \ (tkStubsPtr->tk_CreateOldPhotoImageFormat) /* 273 */ -#define Tk_DefineBitmap \ - (tkStubsPtr->tk_DefineBitmap) /* 274 */ -#define Tk_GetBitmapFromData \ - (tkStubsPtr->tk_GetBitmapFromData) /* 275 */ #endif /* defined(USE_TK_STUBS) */ @@ -1736,8 +1722,9 @@ #undef Tk_CreateConsoleWindow #if defined(_WIN32) && defined(UNICODE) -EXTERN void Tk_MainExW(int, TCHAR **, Tcl_AppInitProc *, Tcl_Interp *); # define Tk_MainEx Tk_MainExW + EXTERN void Tk_MainExW(int argc, wchar_t **argv, + Tcl_AppInitProc *appInitProc, Tcl_Interp *interp); #endif #undef TCL_STORAGE_CLASS diff -Nru critcl-3.1.9/lib/critcl/critcl_c/tcl8.6/tk.h critcl-3.1.17+dfsg/lib/critcl/critcl_c/tcl8.6/tk.h --- critcl-3.1.9/lib/critcl/critcl_c/tcl8.6/tk.h 2013-05-10 05:57:04.000000000 +0000 +++ critcl-3.1.17+dfsg/lib/critcl/critcl_c/tcl8.6/tk.h 2017-10-14 02:48:11.000000000 +0000 @@ -11,8 +11,6 @@ * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tk.h,v 1.138 2010/12/16 09:03:07 nijtmans Exp $ */ #ifndef _TK @@ -22,7 +20,32 @@ #if (TCL_MAJOR_VERSION != 8) || (TCL_MINOR_VERSION < 6) # error Tk 8.6 must be compiled with tcl.h from Tcl 8.6 or better #endif - + +#ifndef CONST84 +# define CONST84 const +# define CONST84_RETURN const +#endif +#ifndef CONST86 +# define CONST86 CONST84 +#endif +#ifndef EXTERN +# define EXTERN extern TCL_STORAGE_CLASS +#endif + +/* + * Utility macros: STRINGIFY takes an argument and wraps it in "" (double + * quotation marks), JOIN joins two arguments. + */ + +#ifndef STRINGIFY +# define STRINGIFY(x) STRINGIFY1(x) +# define STRINGIFY1(x) #x +#endif +#ifndef JOIN +# define JOIN(a,b) JOIN1(a,b) +# define JOIN1(a,b) a##b +#endif + /* * For C++ compilers, use extern "C" */ @@ -51,11 +74,11 @@ #define TK_MAJOR_VERSION 8 #define TK_MINOR_VERSION 6 -#define TK_RELEASE_LEVEL TCL_BETA_RELEASE -#define TK_RELEASE_SERIAL 1 +#define TK_RELEASE_LEVEL TCL_FINAL_RELEASE +#define TK_RELEASE_SERIAL 4 #define TK_VERSION "8.6" -#define TK_PATCH_LEVEL "8.6b1.2" +#define TK_PATCH_LEVEL "8.6.4" /* * A special definition used to allow this header file to be included from @@ -183,7 +206,7 @@ * the record. */ int flags; /* Any combination of the values defined * below. */ - ClientData clientData; /* An alternate place to put option-specific + const void *clientData; /* An alternate place to put option-specific * data. Used for the monochrome default value * for colors, etc. */ int typeMask; /* An arbitrary bit mask defined by the class @@ -1473,7 +1496,7 @@ #define Tk_Release Tcl_Release /* Removed Tk_Main, use macro instead */ -#ifdef _WIN32 +#if defined(_WIN32) || defined(__CYGWIN__) #define Tk_Main(argc, argv, proc) Tk_MainEx(argc, argv, proc, \ (Tcl_FindExecutable(0), (Tcl_CreateInterp)())) #else diff -Nru critcl-3.1.9/lib/critcl/critcl_c/tcl8.6/tkPlatDecls.h critcl-3.1.17+dfsg/lib/critcl/critcl_c/tcl8.6/tkPlatDecls.h --- critcl-3.1.9/lib/critcl/critcl_c/tcl8.6/tkPlatDecls.h 2013-05-10 05:57:04.000000000 +0000 +++ critcl-3.1.17+dfsg/lib/critcl/critcl_c/tcl8.6/tkPlatDecls.h 2017-10-14 02:48:11.000000000 +0000 @@ -7,8 +7,6 @@ * * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tkPlatDecls.h,v 1.25 2010/08/19 05:05:55 nijtmans Exp $ */ #ifndef _TKPLATDECLS @@ -31,11 +29,15 @@ /* !BEGIN!: Do not edit below this line. */ +#ifdef __cplusplus +extern "C" { +#endif + /* * Exported function declarations: */ -#ifdef __WIN32__ /* WIN */ +#if defined(_WIN32) || defined(__CYGWIN__) /* WIN */ /* 0 */ EXTERN Window Tk_AttachHWND(Tk_Window tkwin, HWND hwnd); /* 1 */ @@ -84,9 +86,9 @@ typedef struct TkPlatStubs { int magic; - const struct TkPlatStubHooks *hooks; + void *hooks; -#ifdef __WIN32__ /* WIN */ +#if defined(_WIN32) || defined(__CYGWIN__) /* WIN */ Window (*tk_AttachHWND) (Tk_Window tkwin, HWND hwnd); /* 0 */ HINSTANCE (*tk_GetHINSTANCE) (void); /* 1 */ HWND (*tk_GetHWND) (Window window); /* 2 */ @@ -109,10 +111,8 @@ #endif /* AQUA */ } TkPlatStubs; -#ifdef __cplusplus -extern "C" { -#endif extern const TkPlatStubs *tkPlatStubsPtr; + #ifdef __cplusplus } #endif @@ -123,7 +123,7 @@ * Inline function declarations: */ -#ifdef __WIN32__ /* WIN */ +#if defined(_WIN32) || defined(__CYGWIN__) /* WIN */ #define Tk_AttachHWND \ (tkPlatStubsPtr->tk_AttachHWND) /* 0 */ #define Tk_GetHINSTANCE \ diff -Nru critcl-3.1.9/lib/critcl/critcl_c/tcl8.6/X11/keysym.h critcl-3.1.17+dfsg/lib/critcl/critcl_c/tcl8.6/X11/keysym.h --- critcl-3.1.9/lib/critcl/critcl_c/tcl8.6/X11/keysym.h 2013-05-10 05:57:04.000000000 +0000 +++ critcl-3.1.17+dfsg/lib/critcl/critcl_c/tcl8.6/X11/keysym.h 2017-10-14 02:48:11.000000000 +0000 @@ -6,13 +6,13 @@ All Rights Reserved -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in +both that copyright notice and this permission notice appear in supporting documentation, and that the names of Digital or MIT not be used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. +software without specific, written prior permission. DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL diff -Nru critcl-3.1.9/lib/critcl/critcl_c/tcl8.6/X11/tk.h critcl-3.1.17+dfsg/lib/critcl/critcl_c/tcl8.6/X11/tk.h --- critcl-3.1.9/lib/critcl/critcl_c/tcl8.6/X11/tk.h 2013-05-10 05:57:04.000000000 +0000 +++ critcl-3.1.17+dfsg/lib/critcl/critcl_c/tcl8.6/X11/tk.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,1596 +0,0 @@ -/* - * tk.h -- - * - * Declarations for Tk-related things that are visible outside of the Tk - * module itself. - * - * Copyright (c) 1989-1994 The Regents of the University of California. - * Copyright (c) 1994 The Australian National University. - * Copyright (c) 1994-1998 Sun Microsystems, Inc. - * Copyright (c) 1998-2000 Ajuba Solutions. - * - * See the file "license.terms" for information on usage and redistribution of - * this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tk.h,v 1.138 2010/12/16 09:03:07 nijtmans Exp $ - */ - -#ifndef _TK -#define _TK - -#include -#if (TCL_MAJOR_VERSION != 8) || (TCL_MINOR_VERSION < 6) -# error Tk 8.6 must be compiled with tcl.h from Tcl 8.6 or better -#endif - -/* - * For C++ compilers, use extern "C" - */ - -#ifdef __cplusplus -extern "C" { -#endif - -/* - * When version numbers change here, you must also go into the following files - * and update the version numbers: - * - * library/tk.tcl (1 LOC patch) - * unix/configure.in (2 LOC Major, 2 LOC minor, 1 LOC patch) - * win/configure.in (as above) - * README (sections 0 and 1) - * macosx/Tk-Common.xcconfig (not patchlevel) 1 LOC - * win/README (not patchlevel) - * unix/README (not patchlevel) - * unix/tk.spec (1 LOC patch) - * win/tcl.m4 (not patchlevel) - * - * You may also need to update some of these files when the numbers change for - * the version of Tcl that this release of Tk is compiled against. - */ - -#define TK_MAJOR_VERSION 8 -#define TK_MINOR_VERSION 6 -#define TK_RELEASE_LEVEL TCL_BETA_RELEASE -#define TK_RELEASE_SERIAL 1 - -#define TK_VERSION "8.6" -#define TK_PATCH_LEVEL "8.6b1.2" - -/* - * A special definition used to allow this header file to be included from - * windows or mac resource files so that they can obtain version information. - * RC_INVOKED is defined by default by the windows RC tool and manually set - * for macintosh. - * - * Resource compilers don't like all the C stuff, like typedefs and procedure - * declarations, that occur below, so block them out. - */ - -#ifndef RC_INVOKED - -#ifndef _XLIB_H -# include -# ifdef MAC_OSX_TK -# include -# endif -#endif -#ifdef __STDC__ -# include -#endif - -#ifdef BUILD_tk -#undef TCL_STORAGE_CLASS -#define TCL_STORAGE_CLASS DLLEXPORT -#endif - -/* - *---------------------------------------------------------------------- - * - * Decide whether or not to use input methods. - */ - -#ifdef XNQueryInputStyle -#define TK_USE_INPUT_METHODS -#endif - -/* - * Dummy types that are used by clients: - */ - -typedef struct Tk_BindingTable_ *Tk_BindingTable; -typedef struct Tk_Canvas_ *Tk_Canvas; -typedef struct Tk_Cursor_ *Tk_Cursor; -typedef struct Tk_ErrorHandler_ *Tk_ErrorHandler; -typedef struct Tk_Font_ *Tk_Font; -typedef struct Tk_Image__ *Tk_Image; -typedef struct Tk_ImageMaster_ *Tk_ImageMaster; -typedef struct Tk_OptionTable_ *Tk_OptionTable; -typedef struct Tk_PostscriptInfo_ *Tk_PostscriptInfo; -typedef struct Tk_TextLayout_ *Tk_TextLayout; -typedef struct Tk_Window_ *Tk_Window; -typedef struct Tk_3DBorder_ *Tk_3DBorder; -typedef struct Tk_Style_ *Tk_Style; -typedef struct Tk_StyleEngine_ *Tk_StyleEngine; -typedef struct Tk_StyledElement_ *Tk_StyledElement; - -/* - * Additional types exported to clients. - */ - -typedef const char *Tk_Uid; - -/* - *---------------------------------------------------------------------- - * - * The enum below defines the valid types for Tk configuration options as - * implemented by Tk_InitOptions, Tk_SetOptions, etc. - */ - -typedef enum { - TK_OPTION_BOOLEAN, - TK_OPTION_INT, - TK_OPTION_DOUBLE, - TK_OPTION_STRING, - TK_OPTION_STRING_TABLE, - TK_OPTION_COLOR, - TK_OPTION_FONT, - TK_OPTION_BITMAP, - TK_OPTION_BORDER, - TK_OPTION_RELIEF, - TK_OPTION_CURSOR, - TK_OPTION_JUSTIFY, - TK_OPTION_ANCHOR, - TK_OPTION_SYNONYM, - TK_OPTION_PIXELS, - TK_OPTION_WINDOW, - TK_OPTION_END, - TK_OPTION_CUSTOM, - TK_OPTION_STYLE -} Tk_OptionType; - -/* - * Structures of the following type are used by widgets to specify their - * configuration options. Typically each widget has a static array of these - * structures, where each element of the array describes a single - * configuration option. The array is passed to Tk_CreateOptionTable. - */ - -typedef struct Tk_OptionSpec { - Tk_OptionType type; /* Type of option, such as TK_OPTION_COLOR; - * see definitions above. Last option in table - * must have type TK_OPTION_END. */ - const char *optionName; /* Name used to specify option in Tcl - * commands. */ - const char *dbName; /* Name for option in option database. */ - const char *dbClass; /* Class for option in database. */ - const char *defValue; /* Default value for option if not specified - * in command line, the option database, or - * the system. */ - int objOffset; /* Where in record to store a Tcl_Obj * that - * holds the value of this option, specified - * as an offset in bytes from the start of the - * record. Use the Tk_Offset macro to generate - * values for this. -1 means don't store the - * Tcl_Obj in the record. */ - int internalOffset; /* Where in record to store the internal - * representation of the value of this option, - * such as an int or XColor *. This field is - * specified as an offset in bytes from the - * start of the record. Use the Tk_Offset - * macro to generate values for it. -1 means - * don't store the internal representation in - * the record. */ - int flags; /* Any combination of the values defined - * below. */ - ClientData clientData; /* An alternate place to put option-specific - * data. Used for the monochrome default value - * for colors, etc. */ - int typeMask; /* An arbitrary bit mask defined by the class - * manager; typically bits correspond to - * certain kinds of options such as all those - * that require a redisplay when they change. - * Tk_SetOptions returns the bit-wise OR of - * the typeMasks of all options that were - * changed. */ -} Tk_OptionSpec; - -/* - * Flag values for Tk_OptionSpec structures. These flags are shared by - * Tk_ConfigSpec structures, so be sure to coordinate any changes carefully. - */ - -#define TK_OPTION_NULL_OK (1 << 0) -#define TK_OPTION_DONT_SET_DEFAULT (1 << 3) - -/* - * The following structure and function types are used by TK_OPTION_CUSTOM - * options; the structure holds pointers to the functions needed by the Tk - * option config code to handle a custom option. - */ - -typedef int (Tk_CustomOptionSetProc) (ClientData clientData, - Tcl_Interp *interp, Tk_Window tkwin, Tcl_Obj **value, char *widgRec, - int offset, char *saveInternalPtr, int flags); -typedef Tcl_Obj *(Tk_CustomOptionGetProc) (ClientData clientData, - Tk_Window tkwin, char *widgRec, int offset); -typedef void (Tk_CustomOptionRestoreProc) (ClientData clientData, - Tk_Window tkwin, char *internalPtr, char *saveInternalPtr); -typedef void (Tk_CustomOptionFreeProc) (ClientData clientData, Tk_Window tkwin, - char *internalPtr); - -typedef struct Tk_ObjCustomOption { - const char *name; /* Name of the custom option. */ - Tk_CustomOptionSetProc *setProc; - /* Function to use to set a record's option - * value from a Tcl_Obj */ - Tk_CustomOptionGetProc *getProc; - /* Function to use to get a Tcl_Obj - * representation from an internal - * representation of an option. */ - Tk_CustomOptionRestoreProc *restoreProc; - /* Function to use to restore a saved value - * for the internal representation. */ - Tk_CustomOptionFreeProc *freeProc; - /* Function to use to free the internal - * representation of an option. */ - ClientData clientData; /* Arbitrary one-word value passed to the - * handling procs. */ -} Tk_ObjCustomOption; - -/* - * Macro to use to fill in "offset" fields of the Tk_OptionSpec structure. - * Computes number of bytes from beginning of structure to a given field. - */ - -#ifdef offsetof -#define Tk_Offset(type, field) ((int) offsetof(type, field)) -#else -#define Tk_Offset(type, field) ((int) ((char *) &((type *) 0)->field)) -#endif - -/* - * The following two structures are used for error handling. When config - * options are being modified, the old values are saved in a Tk_SavedOptions - * structure. If an error occurs, then the contents of the structure can be - * used to restore all of the old values. The contents of this structure are - * for the private use Tk. No-one outside Tk should ever read or write any of - * the fields of these structures. - */ - -typedef struct Tk_SavedOption { - struct TkOption *optionPtr; /* Points to information that describes the - * option. */ - Tcl_Obj *valuePtr; /* The old value of the option, in the form of - * a Tcl object; may be NULL if the value was - * not saved as an object. */ - double internalForm; /* The old value of the option, in some - * internal representation such as an int or - * (XColor *). Valid only if the field - * optionPtr->specPtr->objOffset is < 0. The - * space must be large enough to accommodate a - * double, a long, or a pointer; right now it - * looks like a double (i.e., 8 bytes) is big - * enough. Also, using a double guarantees - * that the field is properly aligned for - * storing large values. */ -} Tk_SavedOption; - -#ifdef TCL_MEM_DEBUG -# define TK_NUM_SAVED_OPTIONS 2 -#else -# define TK_NUM_SAVED_OPTIONS 20 -#endif - -typedef struct Tk_SavedOptions { - char *recordPtr; /* The data structure in which to restore - * configuration options. */ - Tk_Window tkwin; /* Window associated with recordPtr; needed to - * restore certain options. */ - int numItems; /* The number of valid items in items field. */ - Tk_SavedOption items[TK_NUM_SAVED_OPTIONS]; - /* Items used to hold old values. */ - struct Tk_SavedOptions *nextPtr; - /* Points to next structure in list; needed if - * too many options changed to hold all the - * old values in a single structure. NULL - * means no more structures. */ -} Tk_SavedOptions; - -/* - * Structure used to describe application-specific configuration options: - * indicates procedures to call to parse an option and to return a text string - * describing an option. THESE ARE DEPRECATED; PLEASE USE THE NEW STRUCTURES - * LISTED ABOVE. - */ - -/* - * This is a temporary flag used while tkObjConfig and new widgets are in - * development. - */ - -#ifndef __NO_OLD_CONFIG - -typedef int (Tk_OptionParseProc) (ClientData clientData, Tcl_Interp *interp, - Tk_Window tkwin, CONST84 char *value, char *widgRec, int offset); -typedef CONST86 char *(Tk_OptionPrintProc) (ClientData clientData, - Tk_Window tkwin, char *widgRec, int offset, Tcl_FreeProc **freeProcPtr); - -typedef struct Tk_CustomOption { - Tk_OptionParseProc *parseProc; - /* Procedure to call to parse an option and - * store it in converted form. */ - Tk_OptionPrintProc *printProc; - /* Procedure to return a printable string - * describing an existing option. */ - ClientData clientData; /* Arbitrary one-word value used by option - * parser: passed to parseProc and - * printProc. */ -} Tk_CustomOption; - -/* - * Structure used to specify information for Tk_ConfigureWidget. Each - * structure gives complete information for one option, including how the - * option is specified on the command line, where it appears in the option - * database, etc. - */ - -typedef struct Tk_ConfigSpec { - int type; /* Type of option, such as TK_CONFIG_COLOR; - * see definitions below. Last option in table - * must have type TK_CONFIG_END. */ - CONST86 char *argvName; /* Switch used to specify option in argv. NULL - * means this spec is part of a group. */ - Tk_Uid dbName; /* Name for option in option database. */ - Tk_Uid dbClass; /* Class for option in database. */ - Tk_Uid defValue; /* Default value for option if not specified - * in command line or database. */ - int offset; /* Where in widget record to store value; use - * Tk_Offset macro to generate values for - * this. */ - int specFlags; /* Any combination of the values defined - * below; other bits are used internally by - * tkConfig.c. */ - CONST86 Tk_CustomOption *customPtr; - /* If type is TK_CONFIG_CUSTOM then this is a - * pointer to info about how to parse and - * print the option. Otherwise it is - * irrelevant. */ -} Tk_ConfigSpec; - -/* - * Type values for Tk_ConfigSpec structures. See the user documentation for - * details. - */ - -typedef enum { - TK_CONFIG_BOOLEAN, TK_CONFIG_INT, TK_CONFIG_DOUBLE, TK_CONFIG_STRING, - TK_CONFIG_UID, TK_CONFIG_COLOR, TK_CONFIG_FONT, TK_CONFIG_BITMAP, - TK_CONFIG_BORDER, TK_CONFIG_RELIEF, TK_CONFIG_CURSOR, - TK_CONFIG_ACTIVE_CURSOR, TK_CONFIG_JUSTIFY, TK_CONFIG_ANCHOR, - TK_CONFIG_SYNONYM, TK_CONFIG_CAP_STYLE, TK_CONFIG_JOIN_STYLE, - TK_CONFIG_PIXELS, TK_CONFIG_MM, TK_CONFIG_WINDOW, TK_CONFIG_CUSTOM, - TK_CONFIG_END -} Tk_ConfigTypes; - -/* - * Possible values for flags argument to Tk_ConfigureWidget: - */ - -#define TK_CONFIG_ARGV_ONLY 1 -#define TK_CONFIG_OBJS 0x80 - -/* - * Possible flag values for Tk_ConfigSpec structures. Any bits at or above - * TK_CONFIG_USER_BIT may be used by clients for selecting certain entries. - * Before changing any values here, coordinate with tkOldConfig.c - * (internal-use-only flags are defined there). - */ - -#define TK_CONFIG_NULL_OK (1 << 0) -#define TK_CONFIG_COLOR_ONLY (1 << 1) -#define TK_CONFIG_MONO_ONLY (1 << 2) -#define TK_CONFIG_DONT_SET_DEFAULT (1 << 3) -#define TK_CONFIG_OPTION_SPECIFIED (1 << 4) -#define TK_CONFIG_USER_BIT 0x100 -#endif /* __NO_OLD_CONFIG */ - -/* - * Structure used to specify how to handle argv options. - */ - -typedef struct { - CONST86 char *key; /* The key string that flags the option in the - * argv array. */ - int type; /* Indicates option type; see below. */ - char *src; /* Value to be used in setting dst; usage - * depends on type. */ - char *dst; /* Address of value to be modified; usage - * depends on type. */ - CONST86 char *help; /* Documentation message describing this - * option. */ -} Tk_ArgvInfo; - -/* - * Legal values for the type field of a Tk_ArgvInfo: see the user - * documentation for details. - */ - -#define TK_ARGV_CONSTANT 15 -#define TK_ARGV_INT 16 -#define TK_ARGV_STRING 17 -#define TK_ARGV_UID 18 -#define TK_ARGV_REST 19 -#define TK_ARGV_FLOAT 20 -#define TK_ARGV_FUNC 21 -#define TK_ARGV_GENFUNC 22 -#define TK_ARGV_HELP 23 -#define TK_ARGV_CONST_OPTION 24 -#define TK_ARGV_OPTION_VALUE 25 -#define TK_ARGV_OPTION_NAME_VALUE 26 -#define TK_ARGV_END 27 - -/* - * Flag bits for passing to Tk_ParseArgv: - */ - -#define TK_ARGV_NO_DEFAULTS 0x1 -#define TK_ARGV_NO_LEFTOVERS 0x2 -#define TK_ARGV_NO_ABBREV 0x4 -#define TK_ARGV_DONT_SKIP_FIRST_ARG 0x8 - -/* - * Enumerated type for describing actions to be taken in response to a - * restrictProc established by Tk_RestrictEvents. - */ - -typedef enum { - TK_DEFER_EVENT, TK_PROCESS_EVENT, TK_DISCARD_EVENT -} Tk_RestrictAction; - -/* - * Priority levels to pass to Tk_AddOption: - */ - -#define TK_WIDGET_DEFAULT_PRIO 20 -#define TK_STARTUP_FILE_PRIO 40 -#define TK_USER_DEFAULT_PRIO 60 -#define TK_INTERACTIVE_PRIO 80 -#define TK_MAX_PRIO 100 - -/* - * Relief values returned by Tk_GetRelief: - */ - -#define TK_RELIEF_NULL -1 -#define TK_RELIEF_FLAT 0 -#define TK_RELIEF_GROOVE 1 -#define TK_RELIEF_RAISED 2 -#define TK_RELIEF_RIDGE 3 -#define TK_RELIEF_SOLID 4 -#define TK_RELIEF_SUNKEN 5 - -/* - * "Which" argument values for Tk_3DBorderGC: - */ - -#define TK_3D_FLAT_GC 1 -#define TK_3D_LIGHT_GC 2 -#define TK_3D_DARK_GC 3 - -/* - * Special EnterNotify/LeaveNotify "mode" for use in events generated by - * tkShare.c. Pick a high enough value that it's unlikely to conflict with - * existing values (like NotifyNormal) or any new values defined in the - * future. - */ - -#define TK_NOTIFY_SHARE 20 - -/* - * Enumerated type for describing a point by which to anchor something: - */ - -typedef enum { - TK_ANCHOR_N, TK_ANCHOR_NE, TK_ANCHOR_E, TK_ANCHOR_SE, - TK_ANCHOR_S, TK_ANCHOR_SW, TK_ANCHOR_W, TK_ANCHOR_NW, - TK_ANCHOR_CENTER -} Tk_Anchor; - -/* - * Enumerated type for describing a style of justification: - */ - -typedef enum { - TK_JUSTIFY_LEFT, TK_JUSTIFY_RIGHT, TK_JUSTIFY_CENTER -} Tk_Justify; - -/* - * The following structure is used by Tk_GetFontMetrics() to return - * information about the properties of a Tk_Font. - */ - -typedef struct Tk_FontMetrics { - int ascent; /* The amount in pixels that the tallest - * letter sticks up above the baseline, plus - * any extra blank space added by the designer - * of the font. */ - int descent; /* The largest amount in pixels that any - * letter sticks below the baseline, plus any - * extra blank space added by the designer of - * the font. */ - int linespace; /* The sum of the ascent and descent. How far - * apart two lines of text in the same font - * should be placed so that none of the - * characters in one line overlap any of the - * characters in the other line. */ -} Tk_FontMetrics; - -/* - * Flags passed to Tk_MeasureChars: - */ - -#define TK_WHOLE_WORDS 1 -#define TK_AT_LEAST_ONE 2 -#define TK_PARTIAL_OK 4 - -/* - * Flags passed to Tk_ComputeTextLayout: - */ - -#define TK_IGNORE_TABS 8 -#define TK_IGNORE_NEWLINES 16 - -/* - * Widget class procedures used to implement platform specific widget - * behavior. - */ - -typedef Window (Tk_ClassCreateProc) (Tk_Window tkwin, Window parent, - ClientData instanceData); -typedef void (Tk_ClassWorldChangedProc) (ClientData instanceData); -typedef void (Tk_ClassModalProc) (Tk_Window tkwin, XEvent *eventPtr); - -typedef struct Tk_ClassProcs { - unsigned int size; - Tk_ClassWorldChangedProc *worldChangedProc; - /* Procedure to invoke when the widget needs - * to respond in some way to a change in the - * world (font changes, etc.) */ - Tk_ClassCreateProc *createProc; - /* Procedure to invoke when the platform- - * dependent window needs to be created. */ - Tk_ClassModalProc *modalProc; - /* Procedure to invoke after all bindings on a - * widget have been triggered in order to - * handle a modal loop. */ -} Tk_ClassProcs; - -/* - * Simple accessor for Tk_ClassProcs structure. Checks that the structure is - * not NULL, then checks the size field and returns either the requested - * field, if present, or NULL if the structure is too small to have the field - * (or NULL if the structure is NULL). - * - * A more general version of this function may be useful if other - * size-versioned structure pop up in the future: - * - * #define Tk_GetField(name, who, which) \ - * (((who) == NULL) ? NULL : - * (((who)->size <= Tk_Offset(name, which)) ? NULL :(name)->which)) - */ - -#define Tk_GetClassProc(procs, which) \ - (((procs) == NULL) ? NULL : \ - (((procs)->size <= Tk_Offset(Tk_ClassProcs, which)) ? NULL:(procs)->which)) - -/* - * Each geometry manager (the packer, the placer, etc.) is represented by a - * structure of the following form, which indicates procedures to invoke in - * the geometry manager to carry out certain functions. - */ - -typedef void (Tk_GeomRequestProc) (ClientData clientData, Tk_Window tkwin); -typedef void (Tk_GeomLostSlaveProc) (ClientData clientData, Tk_Window tkwin); - -typedef struct Tk_GeomMgr { - const char *name; /* Name of the geometry manager (command used - * to invoke it, or name of widget class that - * allows embedded widgets). */ - Tk_GeomRequestProc *requestProc; - /* Procedure to invoke when a slave's - * requested geometry changes. */ - Tk_GeomLostSlaveProc *lostSlaveProc; - /* Procedure to invoke when a slave is taken - * away from one geometry manager by another. - * NULL means geometry manager doesn't care - * when slaves are lost. */ -} Tk_GeomMgr; - -/* - * Result values returned by Tk_GetScrollInfo: - */ - -#define TK_SCROLL_MOVETO 1 -#define TK_SCROLL_PAGES 2 -#define TK_SCROLL_UNITS 3 -#define TK_SCROLL_ERROR 4 - -/* - *---------------------------------------------------------------------- - * - * Extensions to the X event set - * - *---------------------------------------------------------------------- - */ - -#define VirtualEvent (MappingNotify + 1) -#define ActivateNotify (MappingNotify + 2) -#define DeactivateNotify (MappingNotify + 3) -#define MouseWheelEvent (MappingNotify + 4) -#define TK_LASTEVENT (MappingNotify + 5) - -#define MouseWheelMask (1L << 28) -#define ActivateMask (1L << 29) -#define VirtualEventMask (1L << 30) - -/* - * A virtual event shares most of its fields with the XKeyEvent and - * XButtonEvent structures. 99% of the time a virtual event will be an - * abstraction of a key or button event, so this structure provides the most - * information to the user. The only difference is the changing of the detail - * field for a virtual event so that it holds the name of the virtual event - * being triggered. - * - * When using this structure, you should ensure that you zero out all the - * fields first using memset() or bzero(). - */ - -typedef struct { - int type; - unsigned long serial; /* # of last request processed by server. */ - Bool send_event; /* True if this came from a SendEvent - * request. */ - Display *display; /* Display the event was read from. */ - Window event; /* Window on which event was requested. */ - Window root; /* Root window that the event occured on. */ - Window subwindow; /* Child window. */ - Time time; /* Milliseconds. */ - int x, y; /* Pointer x, y coordinates in event - * window. */ - int x_root, y_root; /* Coordinates relative to root. */ - unsigned int state; /* Key or button mask */ - Tk_Uid name; /* Name of virtual event. */ - Bool same_screen; /* Same screen flag. */ - Tcl_Obj *user_data; /* Application-specific data reference; Tk - * will decrement the reference count *once* - * when it has finished processing the - * event. */ -} XVirtualEvent; - -typedef struct { - int type; - unsigned long serial; /* # of last request processed by server. */ - Bool send_event; /* True if this came from a SendEvent - * request. */ - Display *display; /* Display the event was read from. */ - Window window; /* Window in which event occurred. */ -} XActivateDeactivateEvent; -typedef XActivateDeactivateEvent XActivateEvent; -typedef XActivateDeactivateEvent XDeactivateEvent; - -/* - *---------------------------------------------------------------------- - * - * Macros for querying Tk_Window structures. See the manual entries for - * documentation. - * - *---------------------------------------------------------------------- - */ - -#define Tk_Display(tkwin) (((Tk_FakeWin *) (tkwin))->display) -#define Tk_ScreenNumber(tkwin) (((Tk_FakeWin *) (tkwin))->screenNum) -#define Tk_Screen(tkwin) \ - (ScreenOfDisplay(Tk_Display(tkwin), Tk_ScreenNumber(tkwin))) -#define Tk_Depth(tkwin) (((Tk_FakeWin *) (tkwin))->depth) -#define Tk_Visual(tkwin) (((Tk_FakeWin *) (tkwin))->visual) -#define Tk_WindowId(tkwin) (((Tk_FakeWin *) (tkwin))->window) -#define Tk_PathName(tkwin) (((Tk_FakeWin *) (tkwin))->pathName) -#define Tk_Name(tkwin) (((Tk_FakeWin *) (tkwin))->nameUid) -#define Tk_Class(tkwin) (((Tk_FakeWin *) (tkwin))->classUid) -#define Tk_X(tkwin) (((Tk_FakeWin *) (tkwin))->changes.x) -#define Tk_Y(tkwin) (((Tk_FakeWin *) (tkwin))->changes.y) -#define Tk_Width(tkwin) (((Tk_FakeWin *) (tkwin))->changes.width) -#define Tk_Height(tkwin) \ - (((Tk_FakeWin *) (tkwin))->changes.height) -#define Tk_Changes(tkwin) (&((Tk_FakeWin *) (tkwin))->changes) -#define Tk_Attributes(tkwin) (&((Tk_FakeWin *) (tkwin))->atts) -#define Tk_IsEmbedded(tkwin) \ - (((Tk_FakeWin *) (tkwin))->flags & TK_EMBEDDED) -#define Tk_IsContainer(tkwin) \ - (((Tk_FakeWin *) (tkwin))->flags & TK_CONTAINER) -#define Tk_IsMapped(tkwin) \ - (((Tk_FakeWin *) (tkwin))->flags & TK_MAPPED) -#define Tk_IsTopLevel(tkwin) \ - (((Tk_FakeWin *) (tkwin))->flags & TK_TOP_LEVEL) -#define Tk_HasWrapper(tkwin) \ - (((Tk_FakeWin *) (tkwin))->flags & TK_HAS_WRAPPER) -#define Tk_WinManaged(tkwin) \ - (((Tk_FakeWin *) (tkwin))->flags & TK_WIN_MANAGED) -#define Tk_TopWinHierarchy(tkwin) \ - (((Tk_FakeWin *) (tkwin))->flags & TK_TOP_HIERARCHY) -#define Tk_IsManageable(tkwin) \ - (((Tk_FakeWin *) (tkwin))->flags & TK_WM_MANAGEABLE) -#define Tk_ReqWidth(tkwin) (((Tk_FakeWin *) (tkwin))->reqWidth) -#define Tk_ReqHeight(tkwin) (((Tk_FakeWin *) (tkwin))->reqHeight) -/* Tk_InternalBorderWidth is deprecated */ -#define Tk_InternalBorderWidth(tkwin) \ - (((Tk_FakeWin *) (tkwin))->internalBorderLeft) -#define Tk_InternalBorderLeft(tkwin) \ - (((Tk_FakeWin *) (tkwin))->internalBorderLeft) -#define Tk_InternalBorderRight(tkwin) \ - (((Tk_FakeWin *) (tkwin))->internalBorderRight) -#define Tk_InternalBorderTop(tkwin) \ - (((Tk_FakeWin *) (tkwin))->internalBorderTop) -#define Tk_InternalBorderBottom(tkwin) \ - (((Tk_FakeWin *) (tkwin))->internalBorderBottom) -#define Tk_MinReqWidth(tkwin) (((Tk_FakeWin *) (tkwin))->minReqWidth) -#define Tk_MinReqHeight(tkwin) (((Tk_FakeWin *) (tkwin))->minReqHeight) -#define Tk_Parent(tkwin) (((Tk_FakeWin *) (tkwin))->parentPtr) -#define Tk_Colormap(tkwin) (((Tk_FakeWin *) (tkwin))->atts.colormap) - -/* - * The structure below is needed by the macros above so that they can access - * the fields of a Tk_Window. The fields not needed by the macros are declared - * as "dummyX". The structure has its own type in order to prevent apps from - * accessing Tk_Window fields except using official macros. WARNING!! The - * structure definition must be kept consistent with the TkWindow structure in - * tkInt.h. If you change one, then change the other. See the declaration in - * tkInt.h for documentation on what the fields are used for internally. - */ - -typedef struct Tk_FakeWin { - Display *display; - char *dummy1; /* dispPtr */ - int screenNum; - Visual *visual; - int depth; - Window window; - char *dummy2; /* childList */ - char *dummy3; /* lastChildPtr */ - Tk_Window parentPtr; /* parentPtr */ - char *dummy4; /* nextPtr */ - char *dummy5; /* mainPtr */ - char *pathName; - Tk_Uid nameUid; - Tk_Uid classUid; - XWindowChanges changes; - unsigned int dummy6; /* dirtyChanges */ - XSetWindowAttributes atts; - unsigned long dummy7; /* dirtyAtts */ - unsigned int flags; - char *dummy8; /* handlerList */ -#ifdef TK_USE_INPUT_METHODS - XIC dummy9; /* inputContext */ -#endif /* TK_USE_INPUT_METHODS */ - ClientData *dummy10; /* tagPtr */ - int dummy11; /* numTags */ - int dummy12; /* optionLevel */ - char *dummy13; /* selHandlerList */ - char *dummy14; /* geomMgrPtr */ - ClientData dummy15; /* geomData */ - int reqWidth, reqHeight; - int internalBorderLeft; - char *dummy16; /* wmInfoPtr */ - char *dummy17; /* classProcPtr */ - ClientData dummy18; /* instanceData */ - char *dummy19; /* privatePtr */ - int internalBorderRight; - int internalBorderTop; - int internalBorderBottom; - int minReqWidth; - int minReqHeight; - char *dummy20; /* geometryMaster */ -} Tk_FakeWin; - -/* - * Flag values for TkWindow (and Tk_FakeWin) structures are: - * - * TK_MAPPED: 1 means window is currently mapped, - * 0 means unmapped. - * TK_TOP_LEVEL: 1 means this is a top-level widget. - * TK_ALREADY_DEAD: 1 means the window is in the process of - * being destroyed already. - * TK_NEED_CONFIG_NOTIFY: 1 means that the window has been reconfigured - * before it was made to exist. At the time of - * making it exist a ConfigureNotify event needs - * to be generated. - * TK_GRAB_FLAG: Used to manage grabs. See tkGrab.c for details - * TK_CHECKED_IC: 1 means we've already tried to get an input - * context for this window; if the ic field is - * NULL it means that there isn't a context for - * the field. - * TK_DONT_DESTROY_WINDOW: 1 means that Tk_DestroyWindow should not - * invoke XDestroyWindow to destroy this widget's - * X window. The flag is set when the window has - * already been destroyed elsewhere (e.g. by - * another application) or when it will be - * destroyed later (e.g. by destroying its parent) - * TK_WM_COLORMAP_WINDOW: 1 means that this window has at some time - * appeared in the WM_COLORMAP_WINDOWS property - * for its toplevel, so we have to remove it from - * that property if the window is deleted and the - * toplevel isn't. - * TK_EMBEDDED: 1 means that this window (which must be a - * toplevel) is not a free-standing window but - * rather is embedded in some other application. - * TK_CONTAINER: 1 means that this window is a container, and - * that some other application (either in this - * process or elsewhere) may be embedding itself - * inside the window. - * TK_BOTH_HALVES: 1 means that this window is used for - * application embedding (either as container or - * embedded application), and both the containing - * and embedded halves are associated with - * windows in this particular process. - * TK_WRAPPER: 1 means that this window is the extra wrapper - * window created around a toplevel to hold the - * menubar under Unix. See tkUnixWm.c for more - * information. - * TK_REPARENTED: 1 means that this window has been reparented - * so that as far as the window system is - * concerned it isn't a child of its Tk parent. - * Initially this is used only for special Unix - * menubar windows. - * TK_ANONYMOUS_WINDOW: 1 means that this window has no name, and is - * thus not accessible from Tk. - * TK_HAS_WRAPPER 1 means that this window has a wrapper window - * TK_WIN_MANAGED 1 means that this window is a child of the root - * window, and is managed by the window manager. - * TK_TOP_HIERARCHY 1 means this window is at the top of a physical - * window hierarchy within this process, i.e. the - * window's parent either doesn't exist or is not - * owned by this Tk application. - * TK_PROP_PROPCHANGE 1 means that PropertyNotify events in the - * window's children should propagate up to this - * window. - * TK_WM_MANAGEABLE 1 marks a window as capable of being converted - * into a toplevel using [wm manage]. - */ - -#define TK_MAPPED 1 -#define TK_TOP_LEVEL 2 -#define TK_ALREADY_DEAD 4 -#define TK_NEED_CONFIG_NOTIFY 8 -#define TK_GRAB_FLAG 0x10 -#define TK_CHECKED_IC 0x20 -#define TK_DONT_DESTROY_WINDOW 0x40 -#define TK_WM_COLORMAP_WINDOW 0x80 -#define TK_EMBEDDED 0x100 -#define TK_CONTAINER 0x200 -#define TK_BOTH_HALVES 0x400 -#define TK_WRAPPER 0x1000 -#define TK_REPARENTED 0x2000 -#define TK_ANONYMOUS_WINDOW 0x4000 -#define TK_HAS_WRAPPER 0x8000 -#define TK_WIN_MANAGED 0x10000 -#define TK_TOP_HIERARCHY 0x20000 -#define TK_PROP_PROPCHANGE 0x40000 -#define TK_WM_MANAGEABLE 0x80000 - -/* - *---------------------------------------------------------------------- - * - * Procedure prototypes and structures used for defining new canvas items: - * - *---------------------------------------------------------------------- - */ - -typedef enum { - TK_STATE_NULL = -1, TK_STATE_ACTIVE, TK_STATE_DISABLED, - TK_STATE_NORMAL, TK_STATE_HIDDEN -} Tk_State; - -typedef struct Tk_SmoothMethod { - CONST86 char *name; - int (*coordProc) (Tk_Canvas canvas, double *pointPtr, int numPoints, - int numSteps, XPoint xPoints[], double dblPoints[]); - void (*postscriptProc) (Tcl_Interp *interp, Tk_Canvas canvas, - double *coordPtr, int numPoints, int numSteps); -} Tk_SmoothMethod; - -/* - * For each item in a canvas widget there exists one record with the following - * structure. Each actual item is represented by a record with the following - * stuff at its beginning, plus additional type-specific stuff after that. - */ - -#define TK_TAG_SPACE 3 - -typedef struct Tk_Item { - int id; /* Unique identifier for this item (also - * serves as first tag for item). */ - struct Tk_Item *nextPtr; /* Next in display list of all items in this - * canvas. Later items in list are drawn on - * top of earlier ones. */ - Tk_Uid staticTagSpace[TK_TAG_SPACE]; - /* Built-in space for limited # of tags. */ - Tk_Uid *tagPtr; /* Pointer to array of tags. Usually points to - * staticTagSpace, but may point to malloc-ed - * space if there are lots of tags. */ - int tagSpace; /* Total amount of tag space available at - * tagPtr. */ - int numTags; /* Number of tag slots actually used at - * *tagPtr. */ - struct Tk_ItemType *typePtr;/* Table of procedures that implement this - * type of item. */ - int x1, y1, x2, y2; /* Bounding box for item, in integer canvas - * units. Set by item-specific code and - * guaranteed to contain every pixel drawn in - * item. Item area includes x1 and y1 but not - * x2 and y2. */ - struct Tk_Item *prevPtr; /* Previous in display list of all items in - * this canvas. Later items in list are drawn - * just below earlier ones. */ - Tk_State state; /* State of item. */ - char *reserved1; /* reserved for future use */ - int redraw_flags; /* Some flags used in the canvas */ - - /* - *------------------------------------------------------------------ - * Starting here is additional type-specific stuff; see the declarations - * for individual types to see what is part of each type. The actual space - * below is determined by the "itemInfoSize" of the type's Tk_ItemType - * record. - *------------------------------------------------------------------ - */ -} Tk_Item; - -/* - * Flag bits for canvases (redraw_flags): - * - * TK_ITEM_STATE_DEPENDANT - 1 means that object needs to be redrawn if the - * canvas state changes. - * TK_ITEM_DONT_REDRAW - 1 means that the object redraw is already been - * prepared, so the general canvas code doesn't - * need to do that any more. - */ - -#define TK_ITEM_STATE_DEPENDANT 1 -#define TK_ITEM_DONT_REDRAW 2 - -/* - * Records of the following type are used to describe a type of item (e.g. - * lines, circles, etc.) that can form part of a canvas widget. - */ - -#ifdef USE_OLD_CANVAS -typedef int (Tk_ItemCreateProc)(Tcl_Interp *interp, Tk_Canvas canvas, - Tk_Item *itemPtr, int argc, char **argv); -typedef int (Tk_ItemConfigureProc)(Tcl_Interp *interp, Tk_Canvas canvas, - Tk_Item *itemPtr, int argc, char **argv, int flags); -typedef int (Tk_ItemCoordProc)(Tcl_Interp *interp, Tk_Canvas canvas, - Tk_Item *itemPtr, int argc, char **argv); -#else -typedef int (Tk_ItemCreateProc)(Tcl_Interp *interp, Tk_Canvas canvas, - Tk_Item *itemPtr, int argc, Tcl_Obj *const objv[]); -typedef int (Tk_ItemConfigureProc)(Tcl_Interp *interp, Tk_Canvas canvas, - Tk_Item *itemPtr, int argc, Tcl_Obj *const objv[], - int flags); -typedef int (Tk_ItemCoordProc)(Tcl_Interp *interp, Tk_Canvas canvas, - Tk_Item *itemPtr, int argc, Tcl_Obj *const argv[]); -#endif /* USE_OLD_CANVAS */ -typedef void (Tk_ItemDeleteProc)(Tk_Canvas canvas, Tk_Item *itemPtr, - Display *display); -typedef void (Tk_ItemDisplayProc)(Tk_Canvas canvas, Tk_Item *itemPtr, - Display *display, Drawable dst, int x, int y, int width, - int height); -typedef double (Tk_ItemPointProc)(Tk_Canvas canvas, Tk_Item *itemPtr, - double *pointPtr); -typedef int (Tk_ItemAreaProc)(Tk_Canvas canvas, Tk_Item *itemPtr, - double *rectPtr); -typedef int (Tk_ItemPostscriptProc)(Tcl_Interp *interp, Tk_Canvas canvas, - Tk_Item *itemPtr, int prepass); -typedef void (Tk_ItemScaleProc)(Tk_Canvas canvas, Tk_Item *itemPtr, - double originX, double originY, double scaleX, - double scaleY); -typedef void (Tk_ItemTranslateProc)(Tk_Canvas canvas, Tk_Item *itemPtr, - double deltaX, double deltaY); -#ifdef USE_OLD_CANVAS -typedef int (Tk_ItemIndexProc)(Tcl_Interp *interp, Tk_Canvas canvas, - Tk_Item *itemPtr, char *indexString, int *indexPtr); -#else -typedef int (Tk_ItemIndexProc)(Tcl_Interp *interp, Tk_Canvas canvas, - Tk_Item *itemPtr, Tcl_Obj *indexString, int *indexPtr); -#endif /* USE_OLD_CANVAS */ -typedef void (Tk_ItemCursorProc)(Tk_Canvas canvas, Tk_Item *itemPtr, - int index); -typedef int (Tk_ItemSelectionProc)(Tk_Canvas canvas, Tk_Item *itemPtr, - int offset, char *buffer, int maxBytes); -#ifdef USE_OLD_CANVAS -typedef void (Tk_ItemInsertProc)(Tk_Canvas canvas, Tk_Item *itemPtr, - int beforeThis, char *string); -#else -typedef void (Tk_ItemInsertProc)(Tk_Canvas canvas, Tk_Item *itemPtr, - int beforeThis, Tcl_Obj *string); -#endif /* USE_OLD_CANVAS */ -typedef void (Tk_ItemDCharsProc)(Tk_Canvas canvas, Tk_Item *itemPtr, - int first, int last); - -#ifndef __NO_OLD_CONFIG - -typedef struct Tk_ItemType { - CONST86 char *name; /* The name of this type of item, such as - * "line". */ - int itemSize; /* Total amount of space needed for item's - * record. */ - Tk_ItemCreateProc *createProc; - /* Procedure to create a new item of this - * type. */ - CONST86 Tk_ConfigSpec *configSpecs; /* Pointer to array of configuration specs for - * this type. Used for returning configuration - * info. */ - Tk_ItemConfigureProc *configProc; - /* Procedure to call to change configuration - * options. */ - Tk_ItemCoordProc *coordProc;/* Procedure to call to get and set the item's - * coordinates. */ - Tk_ItemDeleteProc *deleteProc; - /* Procedure to delete existing item of this - * type. */ - Tk_ItemDisplayProc *displayProc; - /* Procedure to display items of this type. */ - int alwaysRedraw; /* Non-zero means displayProc should be called - * even when the item has been moved - * off-screen. */ - Tk_ItemPointProc *pointProc;/* Computes distance from item to a given - * point. */ - Tk_ItemAreaProc *areaProc; /* Computes whether item is inside, outside, - * or overlapping an area. */ - Tk_ItemPostscriptProc *postscriptProc; - /* Procedure to write a Postscript description - * for items of this type. */ - Tk_ItemScaleProc *scaleProc;/* Procedure to rescale items of this type. */ - Tk_ItemTranslateProc *translateProc; - /* Procedure to translate items of this - * type. */ - Tk_ItemIndexProc *indexProc;/* Procedure to determine index of indicated - * character. NULL if item doesn't support - * indexing. */ - Tk_ItemCursorProc *icursorProc; - /* Procedure to set insert cursor posn to just - * before a given position. */ - Tk_ItemSelectionProc *selectionProc; - /* Procedure to return selection (in STRING - * format) when it is in this item. */ - Tk_ItemInsertProc *insertProc; - /* Procedure to insert something into an - * item. */ - Tk_ItemDCharsProc *dCharsProc; - /* Procedure to delete characters from an - * item. */ - struct Tk_ItemType *nextPtr;/* Used to link types together into a list. */ - char *reserved1; /* Reserved for future extension. */ - int reserved2; /* Carefully compatible with */ - char *reserved3; /* Jan Nijtmans dash patch */ - char *reserved4; -} Tk_ItemType; - -/* - * Flag (used in the alwaysRedraw field) to say whether an item supports - * point-level manipulation like the line and polygon items. - */ - -#define TK_MOVABLE_POINTS 2 - -#endif /* __NO_OLD_CONFIG */ - -/* - * The following structure provides information about the selection and the - * insertion cursor. It is needed by only a few items, such as those that - * display text. It is shared by the generic canvas code and the item-specific - * code, but most of the fields should be written only by the canvas generic - * code. - */ - -typedef struct Tk_CanvasTextInfo { - Tk_3DBorder selBorder; /* Border and background for selected - * characters. Read-only to items.*/ - int selBorderWidth; /* Width of border around selection. Read-only - * to items. */ - XColor *selFgColorPtr; /* Foreground color for selected text. - * Read-only to items. */ - Tk_Item *selItemPtr; /* Pointer to selected item. NULL means - * selection isn't in this canvas. Writable by - * items. */ - int selectFirst; /* Character index of first selected - * character. Writable by items. */ - int selectLast; /* Character index of last selected character. - * Writable by items. */ - Tk_Item *anchorItemPtr; /* Item corresponding to "selectAnchor": not - * necessarily selItemPtr. Read-only to - * items. */ - int selectAnchor; /* Character index of fixed end of selection - * (i.e. "select to" operation will use this - * as one end of the selection). Writable by - * items. */ - Tk_3DBorder insertBorder; /* Used to draw vertical bar for insertion - * cursor. Read-only to items. */ - int insertWidth; /* Total width of insertion cursor. Read-only - * to items. */ - int insertBorderWidth; /* Width of 3-D border around insert cursor. - * Read-only to items. */ - Tk_Item *focusItemPtr; /* Item that currently has the input focus, or - * NULL if no such item. Read-only to items. */ - int gotFocus; /* Non-zero means that the canvas widget has - * the input focus. Read-only to items.*/ - int cursorOn; /* Non-zero means that an insertion cursor - * should be displayed in focusItemPtr. - * Read-only to items.*/ -} Tk_CanvasTextInfo; - -/* - * Structures used for Dashing and Outline. - */ - -typedef struct Tk_Dash { - int number; - union { - char *pt; - char array[sizeof(char *)]; - } pattern; -} Tk_Dash; - -typedef struct Tk_TSOffset { - int flags; /* Flags; see below for possible values */ - int xoffset; /* x offset */ - int yoffset; /* y offset */ -} Tk_TSOffset; - -/* - * Bit fields in Tk_Offset->flags: - */ - -#define TK_OFFSET_INDEX 1 -#define TK_OFFSET_RELATIVE 2 -#define TK_OFFSET_LEFT 4 -#define TK_OFFSET_CENTER 8 -#define TK_OFFSET_RIGHT 16 -#define TK_OFFSET_TOP 32 -#define TK_OFFSET_MIDDLE 64 -#define TK_OFFSET_BOTTOM 128 - -typedef struct Tk_Outline { - GC gc; /* Graphics context. */ - double width; /* Width of outline. */ - double activeWidth; /* Width of outline. */ - double disabledWidth; /* Width of outline. */ - int offset; /* Dash offset. */ - Tk_Dash dash; /* Dash pattern. */ - Tk_Dash activeDash; /* Dash pattern if state is active. */ - Tk_Dash disabledDash; /* Dash pattern if state is disabled. */ - void *reserved1; /* Reserved for future expansion. */ - void *reserved2; - void *reserved3; - Tk_TSOffset tsoffset; /* Stipple offset for outline. */ - XColor *color; /* Outline color. */ - XColor *activeColor; /* Outline color if state is active. */ - XColor *disabledColor; /* Outline color if state is disabled. */ - Pixmap stipple; /* Outline Stipple pattern. */ - Pixmap activeStipple; /* Outline Stipple pattern if state is - * active. */ - Pixmap disabledStipple; /* Outline Stipple pattern if state is - * disabled. */ -} Tk_Outline; - -/* - *---------------------------------------------------------------------- - * - * Procedure prototypes and structures used for managing images: - * - *---------------------------------------------------------------------- - */ - -typedef struct Tk_ImageType Tk_ImageType; -#ifdef USE_OLD_IMAGE -typedef int (Tk_ImageCreateProc) (Tcl_Interp *interp, char *name, int argc, - char **argv, Tk_ImageType *typePtr, Tk_ImageMaster master, - ClientData *masterDataPtr); -#else -typedef int (Tk_ImageCreateProc) (Tcl_Interp *interp, CONST86 char *name, int objc, - Tcl_Obj *const objv[], CONST86 Tk_ImageType *typePtr, Tk_ImageMaster master, - ClientData *masterDataPtr); -#endif /* USE_OLD_IMAGE */ -typedef ClientData (Tk_ImageGetProc) (Tk_Window tkwin, ClientData masterData); -typedef void (Tk_ImageDisplayProc) (ClientData instanceData, Display *display, - Drawable drawable, int imageX, int imageY, int width, int height, - int drawableX, int drawableY); -typedef void (Tk_ImageFreeProc) (ClientData instanceData, Display *display); -typedef void (Tk_ImageDeleteProc) (ClientData masterData); -typedef void (Tk_ImageChangedProc) (ClientData clientData, int x, int y, - int width, int height, int imageWidth, int imageHeight); -typedef int (Tk_ImagePostscriptProc) (ClientData clientData, - Tcl_Interp *interp, Tk_Window tkwin, Tk_PostscriptInfo psinfo, - int x, int y, int width, int height, int prepass); - -/* - * The following structure represents a particular type of image (bitmap, xpm - * image, etc.). It provides information common to all images of that type, - * such as the type name and a collection of procedures in the image manager - * that respond to various events. Each image manager is represented by one of - * these structures. - */ - -struct Tk_ImageType { - CONST86 char *name; /* Name of image type. */ - Tk_ImageCreateProc *createProc; - /* Procedure to call to create a new image of - * this type. */ - Tk_ImageGetProc *getProc; /* Procedure to call the first time - * Tk_GetImage is called in a new way (new - * visual or screen). */ - Tk_ImageDisplayProc *displayProc; - /* Call to draw image, in response to - * Tk_RedrawImage calls. */ - Tk_ImageFreeProc *freeProc; /* Procedure to call whenever Tk_FreeImage is - * called to release an instance of an - * image. */ - Tk_ImageDeleteProc *deleteProc; - /* Procedure to call to delete image. It will - * not be called until after freeProc has been - * called for each instance of the image. */ - Tk_ImagePostscriptProc *postscriptProc; - /* Procedure to call to produce postscript - * output for the image. */ - struct Tk_ImageType *nextPtr; - /* Next in list of all image types currently - * known. Filled in by Tk, not by image - * manager. */ - char *reserved; /* reserved for future expansion */ -}; - -/* - *---------------------------------------------------------------------- - * - * Additional definitions used to manage images of type "photo". - * - *---------------------------------------------------------------------- - */ - -/* - * The following type is used to identify a particular photo image to be - * manipulated: - */ - -typedef void *Tk_PhotoHandle; - -/* - * The following structure describes a block of pixels in memory: - */ - -typedef struct Tk_PhotoImageBlock { - unsigned char *pixelPtr; /* Pointer to the first pixel. */ - int width; /* Width of block, in pixels. */ - int height; /* Height of block, in pixels. */ - int pitch; /* Address difference between corresponding - * pixels in successive lines. */ - int pixelSize; /* Address difference between successive - * pixels in the same line. */ - int offset[4]; /* Address differences between the red, green, - * blue and alpha components of the pixel and - * the pixel as a whole. */ -} Tk_PhotoImageBlock; - -/* - * The following values control how blocks are combined into photo images when - * the alpha component of a pixel is not 255, a.k.a. the compositing rule. - */ - -#define TK_PHOTO_COMPOSITE_OVERLAY 0 -#define TK_PHOTO_COMPOSITE_SET 1 - -/* - * Procedure prototypes and structures used in reading and writing photo - * images: - */ - -typedef struct Tk_PhotoImageFormat Tk_PhotoImageFormat; -#ifdef USE_OLD_IMAGE -typedef int (Tk_ImageFileMatchProc) (Tcl_Channel chan, char *fileName, - char *formatString, int *widthPtr, int *heightPtr); -typedef int (Tk_ImageStringMatchProc) (char *string, char *formatString, - int *widthPtr, int *heightPtr); -typedef int (Tk_ImageFileReadProc) (Tcl_Interp *interp, Tcl_Channel chan, - char *fileName, char *formatString, Tk_PhotoHandle imageHandle, - int destX, int destY, int width, int height, int srcX, int srcY); -typedef int (Tk_ImageStringReadProc) (Tcl_Interp *interp, char *string, - char *formatString, Tk_PhotoHandle imageHandle, int destX, int destY, - int width, int height, int srcX, int srcY); -typedef int (Tk_ImageFileWriteProc) (Tcl_Interp *interp, char *fileName, - char *formatString, Tk_PhotoImageBlock *blockPtr); -typedef int (Tk_ImageStringWriteProc) (Tcl_Interp *interp, - Tcl_DString *dataPtr, char *formatString, Tk_PhotoImageBlock *blockPtr); -#else -typedef int (Tk_ImageFileMatchProc) (Tcl_Channel chan, const char *fileName, - Tcl_Obj *format, int *widthPtr, int *heightPtr, Tcl_Interp *interp); -typedef int (Tk_ImageStringMatchProc) (Tcl_Obj *dataObj, Tcl_Obj *format, - int *widthPtr, int *heightPtr, Tcl_Interp *interp); -typedef int (Tk_ImageFileReadProc) (Tcl_Interp *interp, Tcl_Channel chan, - const char *fileName, Tcl_Obj *format, Tk_PhotoHandle imageHandle, - int destX, int destY, int width, int height, int srcX, int srcY); -typedef int (Tk_ImageStringReadProc) (Tcl_Interp *interp, Tcl_Obj *dataObj, - Tcl_Obj *format, Tk_PhotoHandle imageHandle, int destX, int destY, - int width, int height, int srcX, int srcY); -typedef int (Tk_ImageFileWriteProc) (Tcl_Interp *interp, const char *fileName, - Tcl_Obj *format, Tk_PhotoImageBlock *blockPtr); -typedef int (Tk_ImageStringWriteProc) (Tcl_Interp *interp, Tcl_Obj *format, - Tk_PhotoImageBlock *blockPtr); -#endif /* USE_OLD_IMAGE */ - -/* - * The following structure represents a particular file format for storing - * images (e.g., PPM, GIF, JPEG, etc.). It provides information to allow image - * files of that format to be recognized and read into a photo image. - */ - -struct Tk_PhotoImageFormat { - CONST86 char *name; /* Name of image file format */ - Tk_ImageFileMatchProc *fileMatchProc; - /* Procedure to call to determine whether an - * image file matches this format. */ - Tk_ImageStringMatchProc *stringMatchProc; - /* Procedure to call to determine whether the - * data in a string matches this format. */ - Tk_ImageFileReadProc *fileReadProc; - /* Procedure to call to read data from an - * image file into a photo image. */ - Tk_ImageStringReadProc *stringReadProc; - /* Procedure to call to read data from a - * string into a photo image. */ - Tk_ImageFileWriteProc *fileWriteProc; - /* Procedure to call to write data from a - * photo image to a file. */ - Tk_ImageStringWriteProc *stringWriteProc; - /* Procedure to call to obtain a string - * representation of the data in a photo - * image.*/ - struct Tk_PhotoImageFormat *nextPtr; - /* Next in list of all photo image formats - * currently known. Filled in by Tk, not by - * image format handler. */ -}; - -/* - *---------------------------------------------------------------------- - * - * Procedure prototypes and structures used for managing styles: - * - *---------------------------------------------------------------------- - */ - -/* - * Style support version tag. - */ - -#define TK_STYLE_VERSION_1 0x1 -#define TK_STYLE_VERSION TK_STYLE_VERSION_1 - -/* - * The following structures and prototypes are used as static templates to - * declare widget elements. - */ - -typedef void (Tk_GetElementSizeProc) (ClientData clientData, char *recordPtr, - const Tk_OptionSpec **optionsPtr, Tk_Window tkwin, int width, - int height, int inner, int *widthPtr, int *heightPtr); -typedef void (Tk_GetElementBoxProc) (ClientData clientData, char *recordPtr, - const Tk_OptionSpec **optionsPtr, Tk_Window tkwin, int x, int y, - int width, int height, int inner, int *xPtr, int *yPtr, int *widthPtr, - int *heightPtr); -typedef int (Tk_GetElementBorderWidthProc) (ClientData clientData, - char *recordPtr, const Tk_OptionSpec **optionsPtr, Tk_Window tkwin); -typedef void (Tk_DrawElementProc) (ClientData clientData, char *recordPtr, - const Tk_OptionSpec **optionsPtr, Tk_Window tkwin, Drawable d, int x, - int y, int width, int height, int state); - -typedef struct Tk_ElementOptionSpec { - char *name; /* Name of the required option. */ - Tk_OptionType type; /* Accepted option type. TK_OPTION_END means - * any. */ -} Tk_ElementOptionSpec; - -typedef struct Tk_ElementSpec { - int version; /* Version of the style support. */ - char *name; /* Name of element. */ - Tk_ElementOptionSpec *options; - /* List of required options. Last one's name - * must be NULL. */ - Tk_GetElementSizeProc *getSize; - /* Compute the external (resp. internal) size - * of the element from its desired internal - * (resp. external) size. */ - Tk_GetElementBoxProc *getBox; - /* Compute the inscribed or bounding boxes - * within a given area. */ - Tk_GetElementBorderWidthProc *getBorderWidth; - /* Return the element's internal border width. - * Mostly useful for widgets. */ - Tk_DrawElementProc *draw; /* Draw the element in the given bounding - * box. */ -} Tk_ElementSpec; - -/* - * Element state flags. Can be OR'ed. - */ - -#define TK_ELEMENT_STATE_ACTIVE 1<<0 -#define TK_ELEMENT_STATE_DISABLED 1<<1 -#define TK_ELEMENT_STATE_FOCUS 1<<2 -#define TK_ELEMENT_STATE_PRESSED 1<<3 - -/* - *---------------------------------------------------------------------- - * - * The definitions below provide backward compatibility for functions and - * types related to event handling that used to be in Tk but have moved to - * Tcl. - * - *---------------------------------------------------------------------- - */ - -#define TK_READABLE TCL_READABLE -#define TK_WRITABLE TCL_WRITABLE -#define TK_EXCEPTION TCL_EXCEPTION - -#define TK_DONT_WAIT TCL_DONT_WAIT -#define TK_X_EVENTS TCL_WINDOW_EVENTS -#define TK_WINDOW_EVENTS TCL_WINDOW_EVENTS -#define TK_FILE_EVENTS TCL_FILE_EVENTS -#define TK_TIMER_EVENTS TCL_TIMER_EVENTS -#define TK_IDLE_EVENTS TCL_IDLE_EVENTS -#define TK_ALL_EVENTS TCL_ALL_EVENTS - -#define Tk_IdleProc Tcl_IdleProc -#define Tk_FileProc Tcl_FileProc -#define Tk_TimerProc Tcl_TimerProc -#define Tk_TimerToken Tcl_TimerToken - -#define Tk_BackgroundError Tcl_BackgroundError -#define Tk_CancelIdleCall Tcl_CancelIdleCall -#define Tk_CreateFileHandler Tcl_CreateFileHandler -#define Tk_CreateTimerHandler Tcl_CreateTimerHandler -#define Tk_DeleteFileHandler Tcl_DeleteFileHandler -#define Tk_DeleteTimerHandler Tcl_DeleteTimerHandler -#define Tk_DoOneEvent Tcl_DoOneEvent -#define Tk_DoWhenIdle Tcl_DoWhenIdle -#define Tk_Sleep Tcl_Sleep - -/* Additional stuff that has moved to Tcl: */ - -#define Tk_EventuallyFree Tcl_EventuallyFree -#define Tk_FreeProc Tcl_FreeProc -#define Tk_Preserve Tcl_Preserve -#define Tk_Release Tcl_Release - -/* Removed Tk_Main, use macro instead */ -#ifdef _WIN32 -#define Tk_Main(argc, argv, proc) Tk_MainEx(argc, argv, proc, \ - (Tcl_FindExecutable(0), (Tcl_CreateInterp)())) -#else -#define Tk_Main(argc, argv, proc) Tk_MainEx(argc, argv, proc, \ - (Tcl_FindExecutable(argv[0]), (Tcl_CreateInterp)())) -#endif -const char * Tk_InitStubs(Tcl_Interp *interp, const char *version, - int exact); -EXTERN const char * Tk_PkgInitStubsCheck(Tcl_Interp *interp, - const char *version, int exact); - -#ifndef USE_TK_STUBS -#define Tk_InitStubs(interp, version, exact) \ - Tk_PkgInitStubsCheck(interp, version, exact) -#endif /* USE_TK_STUBS */ - -#define Tk_InitImageArgs(interp, argc, argv) /**/ - -/* - *---------------------------------------------------------------------- - * - * Additional procedure types defined by Tk. - * - *---------------------------------------------------------------------- - */ - -typedef int (Tk_ErrorProc) (ClientData clientData, XErrorEvent *errEventPtr); -typedef void (Tk_EventProc) (ClientData clientData, XEvent *eventPtr); -typedef int (Tk_GenericProc) (ClientData clientData, XEvent *eventPtr); -typedef int (Tk_ClientMessageProc) (Tk_Window tkwin, XEvent *eventPtr); -typedef int (Tk_GetSelProc) (ClientData clientData, Tcl_Interp *interp, - CONST86 char *portion); -typedef void (Tk_LostSelProc) (ClientData clientData); -typedef Tk_RestrictAction (Tk_RestrictProc) (ClientData clientData, - XEvent *eventPtr); -typedef int (Tk_SelectionProc) (ClientData clientData, int offset, - char *buffer, int maxBytes); - -/* - *---------------------------------------------------------------------- - * - * Platform independent exported procedures and variables. - * - *---------------------------------------------------------------------- - */ - -#include "tkDecls.h" - -#ifdef USE_OLD_IMAGE -#undef Tk_CreateImageType -#define Tk_CreateImageType Tk_CreateOldImageType -#undef Tk_CreatePhotoImageFormat -#define Tk_CreatePhotoImageFormat Tk_CreateOldPhotoImageFormat -#endif /* USE_OLD_IMAGE */ - -/* - *---------------------------------------------------------------------- - * - * Allow users to say that they don't want to alter their source to add extra - * arguments to Tk_PhotoPutBlock() et al; DO NOT DEFINE THIS WHEN BUILDING TK. - * - * This goes after the inclusion of the stubbed-decls so that the declarations - * of what is actually there can be correct. - */ - -#ifdef USE_COMPOSITELESS_PHOTO_PUT_BLOCK -# ifdef Tk_PhotoPutBlock -# undef Tk_PhotoPutBlock -# endif -# define Tk_PhotoPutBlock Tk_PhotoPutBlock_NoComposite -# ifdef Tk_PhotoPutZoomedBlock -# undef Tk_PhotoPutZoomedBlock -# endif -# define Tk_PhotoPutZoomedBlock Tk_PhotoPutZoomedBlock_NoComposite -# define USE_PANIC_ON_PHOTO_ALLOC_FAILURE -#else /* !USE_COMPOSITELESS_PHOTO_PUT_BLOCK */ -# ifdef USE_PANIC_ON_PHOTO_ALLOC_FAILURE -# ifdef Tk_PhotoPutBlock -# undef Tk_PhotoPutBlock -# endif -# define Tk_PhotoPutBlock Tk_PhotoPutBlock_Panic -# ifdef Tk_PhotoPutZoomedBlock -# undef Tk_PhotoPutZoomedBlock -# endif -# define Tk_PhotoPutZoomedBlock Tk_PhotoPutZoomedBlock_Panic -# endif /* USE_PANIC_ON_PHOTO_ALLOC_FAILURE */ -#endif /* USE_COMPOSITELESS_PHOTO_PUT_BLOCK */ -#ifdef USE_PANIC_ON_PHOTO_ALLOC_FAILURE -# ifdef Tk_PhotoExpand -# undef Tk_PhotoExpand -# endif -# define Tk_PhotoExpand Tk_PhotoExpand_Panic -# ifdef Tk_PhotoSetSize -# undef Tk_PhotoSetSize -# endif -# define Tk_PhotoSetSize Tk_PhotoSetSize_Panic -#endif /* USE_PANIC_ON_PHOTO_ALLOC_FAILURE */ - -#undef TCL_STORAGE_CLASS -#define TCL_STORAGE_CLASS DLLIMPORT - -#endif /* RC_INVOKED */ - -/* - * end block for C++ - */ - -#ifdef __cplusplus -} -#endif - -#endif /* _TK */ - -/* - * Local Variables: - * mode: c - * c-basic-offset: 4 - * fill-column: 78 - * End: - */ diff -Nru critcl-3.1.9/lib/critcl/critcl_c/tcl8.6/X11/tkIntXlibDecls.h critcl-3.1.17+dfsg/lib/critcl/critcl_c/tcl8.6/X11/tkIntXlibDecls.h --- critcl-3.1.9/lib/critcl/critcl_c/tcl8.6/X11/tkIntXlibDecls.h 2013-05-10 05:57:04.000000000 +0000 +++ critcl-3.1.17+dfsg/lib/critcl/critcl_c/tcl8.6/X11/tkIntXlibDecls.h 2017-10-14 02:48:11.000000000 +0000 @@ -8,8 +8,6 @@ * * Copyright (c) 1998-1999 by Scriptics Corporation. * All rights reserved. - * - * RCS: @(#) $Id: tkIntXlibDecls.h,v 1.32 2010/08/21 16:35:33 nijtmans Exp $ */ #ifndef _TKINTXLIBDECLS @@ -32,15 +30,23 @@ #define TCL_STORAGE_CLASS DLLEXPORT #endif +typedef int (*XAfterFunction) ( /* WARNING, this type not in Xlib spec */ + Display* /* display */ +); + /* !BEGIN!: Do not edit below this line. */ +#ifdef __cplusplus +extern "C" { +#endif + /* * Exported function declarations: */ -#ifdef __WIN32__ /* WIN */ +#if defined(_WIN32) || defined(__CYGWIN__) /* WIN */ /* 0 */ -EXTERN void XSetDashes(Display *display, GC gc, int dash_offset, +EXTERN int XSetDashes(Display *display, GC gc, int dash_offset, _Xconst char *dash_list, int n); /* 1 */ EXTERN XModifierKeymap * XGetModifierMapping(Display *d); @@ -66,7 +72,7 @@ /* 8 */ EXTERN Cursor XCreateGlyphCursor(Display *d, Font f1, Font f2, unsigned int ui1, unsigned int ui2, - XColor *x1, XColor *x2); + XColor _Xconst *x1, XColor _Xconst *x2); /* 9 */ EXTERN GContext XGContextFromGC(GC g); /* 10 */ @@ -89,25 +95,25 @@ /* 18 */ EXTERN Status XAllocColor(Display *d, Colormap c, XColor *xp); /* 19 */ -EXTERN void XBell(Display *d, int i); +EXTERN int XBell(Display *d, int i); /* 20 */ -EXTERN void XChangeProperty(Display *d, Window w, Atom a1, +EXTERN int XChangeProperty(Display *d, Window w, Atom a1, Atom a2, int i1, int i2, _Xconst unsigned char *c, int i3); /* 21 */ -EXTERN void XChangeWindowAttributes(Display *d, Window w, +EXTERN int XChangeWindowAttributes(Display *d, Window w, unsigned long ul, XSetWindowAttributes *x); /* 22 */ -EXTERN void XClearWindow(Display *d, Window w); +EXTERN int XClearWindow(Display *d, Window w); /* 23 */ -EXTERN void XConfigureWindow(Display *d, Window w, +EXTERN int XConfigureWindow(Display *d, Window w, unsigned int i, XWindowChanges *x); /* 24 */ -EXTERN void XCopyArea(Display *d, Drawable dr1, Drawable dr2, +EXTERN int XCopyArea(Display *d, Drawable dr1, Drawable dr2, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2, int i3, int i4); /* 25 */ -EXTERN void XCopyPlane(Display *d, Drawable dr1, Drawable dr2, +EXTERN int XCopyPlane(Display *d, Drawable dr1, Drawable dr2, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2, int i3, int i4, unsigned long ul); @@ -116,49 +122,49 @@ _Xconst char *data, unsigned int width, unsigned int height); /* 27 */ -EXTERN void XDefineCursor(Display *d, Window w, Cursor c); +EXTERN int XDefineCursor(Display *d, Window w, Cursor c); /* 28 */ -EXTERN void XDeleteProperty(Display *d, Window w, Atom a); +EXTERN int XDeleteProperty(Display *d, Window w, Atom a); /* 29 */ -EXTERN void XDestroyWindow(Display *d, Window w); +EXTERN int XDestroyWindow(Display *d, Window w); /* 30 */ -EXTERN void XDrawArc(Display *d, Drawable dr, GC g, int i1, +EXTERN int XDrawArc(Display *d, Drawable dr, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2, int i3, int i4); /* 31 */ -EXTERN void XDrawLines(Display *d, Drawable dr, GC g, XPoint *x, +EXTERN int XDrawLines(Display *d, Drawable dr, GC g, XPoint *x, int i1, int i2); /* 32 */ -EXTERN void XDrawRectangle(Display *d, Drawable dr, GC g, int i1, +EXTERN int XDrawRectangle(Display *d, Drawable dr, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2); /* 33 */ -EXTERN void XFillArc(Display *d, Drawable dr, GC g, int i1, +EXTERN int XFillArc(Display *d, Drawable dr, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2, int i3, int i4); /* 34 */ -EXTERN void XFillPolygon(Display *d, Drawable dr, GC g, +EXTERN int XFillPolygon(Display *d, Drawable dr, GC g, XPoint *x, int i1, int i2, int i3); /* 35 */ -EXTERN void XFillRectangles(Display *d, Drawable dr, GC g, +EXTERN int XFillRectangles(Display *d, Drawable dr, GC g, XRectangle *x, int i); /* 36 */ -EXTERN void XForceScreenSaver(Display *d, int i); +EXTERN int XForceScreenSaver(Display *d, int i); /* 37 */ -EXTERN void XFreeColormap(Display *d, Colormap c); +EXTERN int XFreeColormap(Display *d, Colormap c); /* 38 */ -EXTERN void XFreeColors(Display *d, Colormap c, +EXTERN int XFreeColors(Display *d, Colormap c, unsigned long *ulp, int i, unsigned long ul); /* 39 */ -EXTERN void XFreeCursor(Display *d, Cursor c); +EXTERN int XFreeCursor(Display *d, Cursor c); /* 40 */ -EXTERN void XFreeModifiermap(XModifierKeymap *x); +EXTERN int XFreeModifiermap(XModifierKeymap *x); /* 41 */ EXTERN Status XGetGeometry(Display *d, Drawable dr, Window *w, int *i1, int *i2, unsigned int *ui1, unsigned int *ui2, unsigned int *ui3, unsigned int *ui4); /* 42 */ -EXTERN void XGetInputFocus(Display *d, Window *w, int *i); +EXTERN int XGetInputFocus(Display *d, Window *w, int *i); /* 43 */ EXTERN int XGetWindowProperty(Display *d, Window w, Atom a1, long l1, long l2, Bool b, Atom a2, Atom *ap, @@ -180,18 +186,18 @@ EXTERN Status XLookupColor(Display *d, Colormap c1, _Xconst char *c2, XColor *x1, XColor *x2); /* 49 */ -EXTERN void XMapWindow(Display *d, Window w); +EXTERN int XMapWindow(Display *d, Window w); /* 50 */ -EXTERN void XMoveResizeWindow(Display *d, Window w, int i1, +EXTERN int XMoveResizeWindow(Display *d, Window w, int i1, int i2, unsigned int ui1, unsigned int ui2); /* 51 */ -EXTERN void XMoveWindow(Display *d, Window w, int i1, int i2); +EXTERN int XMoveWindow(Display *d, Window w, int i1, int i2); /* 52 */ -EXTERN void XNextEvent(Display *d, XEvent *x); +EXTERN int XNextEvent(Display *d, XEvent *x); /* 53 */ -EXTERN void XPutBackEvent(Display *d, XEvent *x); +EXTERN int XPutBackEvent(Display *d, XEvent *x); /* 54 */ -EXTERN void XQueryColors(Display *d, Colormap c, XColor *x, +EXTERN int XQueryColors(Display *d, Colormap c, XColor *x, int i); /* 55 */ EXTERN Bool XQueryPointer(Display *d, Window w1, Window *w2, @@ -201,56 +207,55 @@ EXTERN Status XQueryTree(Display *d, Window w1, Window *w2, Window *w3, Window **w4, unsigned int *ui); /* 57 */ -EXTERN void XRaiseWindow(Display *d, Window w); +EXTERN int XRaiseWindow(Display *d, Window w); /* 58 */ -EXTERN void XRefreshKeyboardMapping(XMappingEvent *x); +EXTERN int XRefreshKeyboardMapping(XMappingEvent *x); /* 59 */ -EXTERN void XResizeWindow(Display *d, Window w, unsigned int ui1, +EXTERN int XResizeWindow(Display *d, Window w, unsigned int ui1, unsigned int ui2); /* 60 */ -EXTERN void XSelectInput(Display *d, Window w, long l); +EXTERN int XSelectInput(Display *d, Window w, long l); /* 61 */ EXTERN Status XSendEvent(Display *d, Window w, Bool b, long l, XEvent *x); /* 62 */ -EXTERN void XSetCommand(Display *d, Window w, const char **c, - int i); +EXTERN int XSetCommand(Display *d, Window w, char **c, int i); /* 63 */ -EXTERN void XSetIconName(Display *d, Window w, _Xconst char *c); +EXTERN int XSetIconName(Display *d, Window w, _Xconst char *c); /* 64 */ -EXTERN void XSetInputFocus(Display *d, Window w, int i, Time t); +EXTERN int XSetInputFocus(Display *d, Window w, int i, Time t); /* 65 */ -EXTERN void XSetSelectionOwner(Display *d, Atom a, Window w, +EXTERN int XSetSelectionOwner(Display *d, Atom a, Window w, Time t); /* 66 */ -EXTERN void XSetWindowBackground(Display *d, Window w, +EXTERN int XSetWindowBackground(Display *d, Window w, unsigned long ul); /* 67 */ -EXTERN void XSetWindowBackgroundPixmap(Display *d, Window w, +EXTERN int XSetWindowBackgroundPixmap(Display *d, Window w, Pixmap p); /* 68 */ -EXTERN void XSetWindowBorder(Display *d, Window w, +EXTERN int XSetWindowBorder(Display *d, Window w, unsigned long ul); /* 69 */ -EXTERN void XSetWindowBorderPixmap(Display *d, Window w, +EXTERN int XSetWindowBorderPixmap(Display *d, Window w, Pixmap p); /* 70 */ -EXTERN void XSetWindowBorderWidth(Display *d, Window w, +EXTERN int XSetWindowBorderWidth(Display *d, Window w, unsigned int ui); /* 71 */ -EXTERN void XSetWindowColormap(Display *d, Window w, Colormap c); +EXTERN int XSetWindowColormap(Display *d, Window w, Colormap c); /* 72 */ EXTERN Bool XTranslateCoordinates(Display *d, Window w1, Window w2, int i1, int i2, int *i3, int *i4, Window *w3); /* 73 */ -EXTERN void XUngrabKeyboard(Display *d, Time t); +EXTERN int XUngrabKeyboard(Display *d, Time t); /* 74 */ -EXTERN void XUngrabPointer(Display *d, Time t); +EXTERN int XUngrabPointer(Display *d, Time t); /* 75 */ -EXTERN void XUnmapWindow(Display *d, Window w); +EXTERN int XUnmapWindow(Display *d, Window w); /* 76 */ -EXTERN void XWindowEvent(Display *d, Window w, long l, XEvent *x); +EXTERN int XWindowEvent(Display *d, Window w, long l, XEvent *x); /* 77 */ EXTERN void XDestroyIC(XIC x); /* 78 */ @@ -259,7 +264,7 @@ EXTERN int XmbLookupString(XIC xi, XKeyPressedEvent *xk, char *c, int i, KeySym *k, Status *s); /* 80 */ -EXTERN void TkPutImage(unsigned long *colors, int ncolors, +EXTERN int TkPutImage(unsigned long *colors, int ncolors, Display *display, Drawable d, GC gc, XImage *image, int src_x, int src_y, int dest_x, int dest_y, unsigned int width, @@ -272,48 +277,48 @@ EXTERN GC XCreateGC(Display *display, Drawable d, unsigned long valuemask, XGCValues *values); /* 84 */ -EXTERN void XFreeGC(Display *display, GC gc); +EXTERN int XFreeGC(Display *display, GC gc); /* 85 */ EXTERN Atom XInternAtom(Display *display, _Xconst char *atom_name, Bool only_if_exists); /* 86 */ -EXTERN void XSetBackground(Display *display, GC gc, +EXTERN int XSetBackground(Display *display, GC gc, unsigned long foreground); /* 87 */ -EXTERN void XSetForeground(Display *display, GC gc, +EXTERN int XSetForeground(Display *display, GC gc, unsigned long foreground); /* 88 */ -EXTERN void XSetClipMask(Display *display, GC gc, Pixmap pixmap); +EXTERN int XSetClipMask(Display *display, GC gc, Pixmap pixmap); /* 89 */ -EXTERN void XSetClipOrigin(Display *display, GC gc, +EXTERN int XSetClipOrigin(Display *display, GC gc, int clip_x_origin, int clip_y_origin); /* 90 */ -EXTERN void XSetTSOrigin(Display *display, GC gc, +EXTERN int XSetTSOrigin(Display *display, GC gc, int ts_x_origin, int ts_y_origin); /* 91 */ -EXTERN void XChangeGC(Display *d, GC gc, unsigned long mask, +EXTERN int XChangeGC(Display *d, GC gc, unsigned long mask, XGCValues *values); /* 92 */ -EXTERN void XSetFont(Display *display, GC gc, Font font); +EXTERN int XSetFont(Display *display, GC gc, Font font); /* 93 */ -EXTERN void XSetArcMode(Display *display, GC gc, int arc_mode); +EXTERN int XSetArcMode(Display *display, GC gc, int arc_mode); /* 94 */ -EXTERN void XSetStipple(Display *display, GC gc, Pixmap stipple); +EXTERN int XSetStipple(Display *display, GC gc, Pixmap stipple); /* 95 */ -EXTERN void XSetFillRule(Display *display, GC gc, int fill_rule); +EXTERN int XSetFillRule(Display *display, GC gc, int fill_rule); /* 96 */ -EXTERN void XSetFillStyle(Display *display, GC gc, +EXTERN int XSetFillStyle(Display *display, GC gc, int fill_style); /* 97 */ -EXTERN void XSetFunction(Display *display, GC gc, int function); +EXTERN int XSetFunction(Display *display, GC gc, int function); /* 98 */ -EXTERN void XSetLineAttributes(Display *display, GC gc, +EXTERN int XSetLineAttributes(Display *display, GC gc, unsigned int line_width, int line_style, int cap_style, int join_style); /* 99 */ EXTERN int _XInitImageFuncPtrs(XImage *image); /* 100 */ -EXTERN XIC XCreateIC(void); +EXTERN XIC XCreateIC(XIM xim, ...); /* 101 */ EXTERN XVisualInfo * XGetVisualInfo(Display *display, long vinfo_mask, XVisualInfo *vinfo_template, @@ -325,20 +330,36 @@ EXTERN Status XStringListToTextProperty(char **list, int count, XTextProperty *text_prop_return); /* 104 */ -EXTERN void XDrawLine(Display *d, Drawable dr, GC g, int x1, +EXTERN int XDrawLine(Display *d, Drawable dr, GC g, int x1, int y1, int x2, int y2); /* 105 */ -EXTERN void XWarpPointer(Display *d, Window s, Window dw, int sx, +EXTERN int XWarpPointer(Display *d, Window s, Window dw, int sx, int sy, unsigned int sw, unsigned int sh, int dx, int dy); /* 106 */ -EXTERN void XFillRectangle(Display *display, Drawable d, GC gc, +EXTERN int XFillRectangle(Display *display, Drawable d, GC gc, int x, int y, unsigned int width, unsigned int height); +/* 107 */ +EXTERN int XFlush(Display *display); +/* 108 */ +EXTERN int XGrabServer(Display *display); +/* 109 */ +EXTERN int XUngrabServer(Display *display); +/* 110 */ +EXTERN int XFree(void *data); +/* 111 */ +EXTERN int XNoOp(Display *display); +/* 112 */ +EXTERN XAfterFunction XSynchronize(Display *display, Bool onoff); +/* 113 */ +EXTERN int XSync(Display *display, Bool discard); +/* 114 */ +EXTERN VisualID XVisualIDFromVisual(Visual *visual); #endif /* WIN */ #ifdef MAC_OSX_TK /* AQUA */ /* 0 */ -EXTERN void XSetDashes(Display *display, GC gc, int dash_offset, +EXTERN int XSetDashes(Display *display, GC gc, int dash_offset, _Xconst char *dash_list, int n); /* 1 */ EXTERN XModifierKeymap * XGetModifierMapping(Display *d); @@ -370,7 +391,7 @@ /* 12 */ EXTERN Status XAllocColor(Display *d, Colormap c, XColor *xp); /* 13 */ -EXTERN void XBell(Display *d, int i); +EXTERN int XBell(Display *d, int i); /* 14 */ EXTERN void XChangeProperty(Display *d, Window w, Atom a1, Atom a2, int i1, int i2, @@ -395,7 +416,7 @@ _Xconst char *data, unsigned int width, unsigned int height); /* 20 */ -EXTERN void XDefineCursor(Display *d, Window w, Cursor c); +EXTERN int XDefineCursor(Display *d, Window w, Cursor c); /* 21 */ EXTERN void XDestroyWindow(Display *d, Window w); /* 22 */ @@ -403,7 +424,7 @@ int i2, unsigned int ui1, unsigned int ui2, int i3, int i4); /* 23 */ -EXTERN void XDrawLines(Display *d, Drawable dr, GC g, XPoint *x, +EXTERN int XDrawLines(Display *d, Drawable dr, GC g, XPoint *x, int i1, int i2); /* 24 */ EXTERN void XDrawRectangle(Display *d, Drawable dr, GC g, int i1, @@ -416,15 +437,15 @@ EXTERN void XFillPolygon(Display *d, Drawable dr, GC g, XPoint *x, int i1, int i2, int i3); /* 27 */ -EXTERN void XFillRectangles(Display *d, Drawable dr, GC g, +EXTERN int XFillRectangles(Display *d, Drawable dr, GC g, XRectangle *x, int i); /* 28 */ -EXTERN void XFreeColormap(Display *d, Colormap c); +EXTERN int XFreeColormap(Display *d, Colormap c); /* 29 */ -EXTERN void XFreeColors(Display *d, Colormap c, +EXTERN int XFreeColors(Display *d, Colormap c, unsigned long *ulp, int i, unsigned long ul); /* 30 */ -EXTERN void XFreeModifiermap(XModifierKeymap *x); +EXTERN int XFreeModifiermap(XModifierKeymap *x); /* 31 */ EXTERN Status XGetGeometry(Display *d, Drawable dr, Window *w, int *i1, int *i2, unsigned int *ui1, @@ -472,7 +493,7 @@ /* 46 */ EXTERN void XSetInputFocus(Display *d, Window w, int i, Time t); /* 47 */ -EXTERN void XSetSelectionOwner(Display *d, Atom a, Window w, +EXTERN int XSetSelectionOwner(Display *d, Atom a, Window w, Time t); /* 48 */ EXTERN void XSetWindowBackground(Display *d, Window w, @@ -494,11 +515,11 @@ /* 54 */ EXTERN void XUngrabKeyboard(Display *d, Time t); /* 55 */ -EXTERN void XUngrabPointer(Display *d, Time t); +EXTERN int XUngrabPointer(Display *d, Time t); /* 56 */ EXTERN void XUnmapWindow(Display *d, Window w); /* 57 */ -EXTERN void TkPutImage(unsigned long *colors, int ncolors, +EXTERN int TkPutImage(unsigned long *colors, int ncolors, Display *display, Drawable d, GC gc, XImage *image, int src_x, int src_y, int dest_x, int dest_y, unsigned int width, @@ -510,42 +531,42 @@ EXTERN GC XCreateGC(Display *display, Drawable d, unsigned long valuemask, XGCValues *values); /* 60 */ -EXTERN void XFreeGC(Display *display, GC gc); +EXTERN int XFreeGC(Display *display, GC gc); /* 61 */ EXTERN Atom XInternAtom(Display *display, _Xconst char *atom_name, Bool only_if_exists); /* 62 */ -EXTERN void XSetBackground(Display *display, GC gc, +EXTERN int XSetBackground(Display *display, GC gc, unsigned long foreground); /* 63 */ -EXTERN void XSetForeground(Display *display, GC gc, +EXTERN int XSetForeground(Display *display, GC gc, unsigned long foreground); /* 64 */ -EXTERN void XSetClipMask(Display *display, GC gc, Pixmap pixmap); +EXTERN int XSetClipMask(Display *display, GC gc, Pixmap pixmap); /* 65 */ -EXTERN void XSetClipOrigin(Display *display, GC gc, +EXTERN int XSetClipOrigin(Display *display, GC gc, int clip_x_origin, int clip_y_origin); /* 66 */ -EXTERN void XSetTSOrigin(Display *display, GC gc, +EXTERN int XSetTSOrigin(Display *display, GC gc, int ts_x_origin, int ts_y_origin); /* 67 */ -EXTERN void XChangeGC(Display *d, GC gc, unsigned long mask, +EXTERN int XChangeGC(Display *d, GC gc, unsigned long mask, XGCValues *values); /* 68 */ -EXTERN void XSetFont(Display *display, GC gc, Font font); +EXTERN int XSetFont(Display *display, GC gc, Font font); /* 69 */ -EXTERN void XSetArcMode(Display *display, GC gc, int arc_mode); +EXTERN int XSetArcMode(Display *display, GC gc, int arc_mode); /* 70 */ -EXTERN void XSetStipple(Display *display, GC gc, Pixmap stipple); +EXTERN int XSetStipple(Display *display, GC gc, Pixmap stipple); /* 71 */ -EXTERN void XSetFillRule(Display *display, GC gc, int fill_rule); +EXTERN int XSetFillRule(Display *display, GC gc, int fill_rule); /* 72 */ -EXTERN void XSetFillStyle(Display *display, GC gc, +EXTERN int XSetFillStyle(Display *display, GC gc, int fill_style); /* 73 */ -EXTERN void XSetFunction(Display *display, GC gc, int function); +EXTERN int XSetFunction(Display *display, GC gc, int function); /* 74 */ -EXTERN void XSetLineAttributes(Display *display, GC gc, +EXTERN int XSetLineAttributes(Display *display, GC gc, unsigned int line_width, int line_style, int cap_style, int join_style); /* 75 */ @@ -568,10 +589,10 @@ /* 81 */ EXTERN void XForceScreenSaver(Display *display, int mode); /* 82 */ -EXTERN void XDrawLine(Display *d, Drawable dr, GC g, int x1, +EXTERN int XDrawLine(Display *d, Drawable dr, GC g, int x1, int y1, int x2, int y2); /* 83 */ -EXTERN void XFillRectangle(Display *display, Drawable d, GC gc, +EXTERN int XFillRectangle(Display *display, Drawable d, GC gc, int x, int y, unsigned int width, unsigned int height); /* 84 */ @@ -583,7 +604,7 @@ EXTERN void XDrawPoints(Display *display, Drawable d, GC gc, XPoint *points, int npoints, int mode); /* 87 */ -EXTERN void XWarpPointer(Display *display, Window src_w, +EXTERN int XWarpPointer(Display *display, Window src_w, Window dest_w, int src_x, int src_y, unsigned int src_width, unsigned int src_height, int dest_x, @@ -603,10 +624,10 @@ typedef struct TkIntXlibStubs { int magic; - const struct TkIntXlibStubHooks *hooks; + void *hooks; -#ifdef __WIN32__ /* WIN */ - void (*xSetDashes) (Display *display, GC gc, int dash_offset, _Xconst char *dash_list, int n); /* 0 */ +#if defined(_WIN32) || defined(__CYGWIN__) /* WIN */ + int (*xSetDashes) (Display *display, GC gc, int dash_offset, _Xconst char *dash_list, int n); /* 0 */ XModifierKeymap * (*xGetModifierMapping) (Display *d); /* 1 */ XImage * (*xCreateImage) (Display *d, Visual *v, unsigned int ui1, int i1, int i2, char *cp, unsigned int ui2, unsigned int ui3, int i3, int i4); /* 2 */ XImage * (*xGetImage) (Display *d, Drawable dr, int i1, int i2, unsigned int ui1, unsigned int ui2, unsigned long ul, int i3); /* 3 */ @@ -614,7 +635,7 @@ char * (*xKeysymToString) (KeySym k); /* 5 */ Colormap (*xCreateColormap) (Display *d, Window w, Visual *v, int i); /* 6 */ Cursor (*xCreatePixmapCursor) (Display *d, Pixmap p1, Pixmap p2, XColor *x1, XColor *x2, unsigned int ui1, unsigned int ui2); /* 7 */ - Cursor (*xCreateGlyphCursor) (Display *d, Font f1, Font f2, unsigned int ui1, unsigned int ui2, XColor *x1, XColor *x2); /* 8 */ + Cursor (*xCreateGlyphCursor) (Display *d, Font f1, Font f2, unsigned int ui1, unsigned int ui2, XColor _Xconst *x1, XColor _Xconst *x2); /* 8 */ GContext (*xGContextFromGC) (GC g); /* 9 */ XHostAddress * (*xListHosts) (Display *d, int *i, Bool *b); /* 10 */ KeySym (*xKeycodeToKeysym) (Display *d, unsigned int k, int i); /* 11 */ @@ -625,97 +646,105 @@ Status (*xWithdrawWindow) (Display *d, Window w, int i); /* 16 */ Status (*xGetWMColormapWindows) (Display *d, Window w, Window **wpp, int *ip); /* 17 */ Status (*xAllocColor) (Display *d, Colormap c, XColor *xp); /* 18 */ - void (*xBell) (Display *d, int i); /* 19 */ - void (*xChangeProperty) (Display *d, Window w, Atom a1, Atom a2, int i1, int i2, _Xconst unsigned char *c, int i3); /* 20 */ - void (*xChangeWindowAttributes) (Display *d, Window w, unsigned long ul, XSetWindowAttributes *x); /* 21 */ - void (*xClearWindow) (Display *d, Window w); /* 22 */ - void (*xConfigureWindow) (Display *d, Window w, unsigned int i, XWindowChanges *x); /* 23 */ - void (*xCopyArea) (Display *d, Drawable dr1, Drawable dr2, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2, int i3, int i4); /* 24 */ - void (*xCopyPlane) (Display *d, Drawable dr1, Drawable dr2, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2, int i3, int i4, unsigned long ul); /* 25 */ + int (*xBell) (Display *d, int i); /* 19 */ + int (*xChangeProperty) (Display *d, Window w, Atom a1, Atom a2, int i1, int i2, _Xconst unsigned char *c, int i3); /* 20 */ + int (*xChangeWindowAttributes) (Display *d, Window w, unsigned long ul, XSetWindowAttributes *x); /* 21 */ + int (*xClearWindow) (Display *d, Window w); /* 22 */ + int (*xConfigureWindow) (Display *d, Window w, unsigned int i, XWindowChanges *x); /* 23 */ + int (*xCopyArea) (Display *d, Drawable dr1, Drawable dr2, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2, int i3, int i4); /* 24 */ + int (*xCopyPlane) (Display *d, Drawable dr1, Drawable dr2, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2, int i3, int i4, unsigned long ul); /* 25 */ Pixmap (*xCreateBitmapFromData) (Display *display, Drawable d, _Xconst char *data, unsigned int width, unsigned int height); /* 26 */ - void (*xDefineCursor) (Display *d, Window w, Cursor c); /* 27 */ - void (*xDeleteProperty) (Display *d, Window w, Atom a); /* 28 */ - void (*xDestroyWindow) (Display *d, Window w); /* 29 */ - void (*xDrawArc) (Display *d, Drawable dr, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2, int i3, int i4); /* 30 */ - void (*xDrawLines) (Display *d, Drawable dr, GC g, XPoint *x, int i1, int i2); /* 31 */ - void (*xDrawRectangle) (Display *d, Drawable dr, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2); /* 32 */ - void (*xFillArc) (Display *d, Drawable dr, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2, int i3, int i4); /* 33 */ - void (*xFillPolygon) (Display *d, Drawable dr, GC g, XPoint *x, int i1, int i2, int i3); /* 34 */ - void (*xFillRectangles) (Display *d, Drawable dr, GC g, XRectangle *x, int i); /* 35 */ - void (*xForceScreenSaver) (Display *d, int i); /* 36 */ - void (*xFreeColormap) (Display *d, Colormap c); /* 37 */ - void (*xFreeColors) (Display *d, Colormap c, unsigned long *ulp, int i, unsigned long ul); /* 38 */ - void (*xFreeCursor) (Display *d, Cursor c); /* 39 */ - void (*xFreeModifiermap) (XModifierKeymap *x); /* 40 */ + int (*xDefineCursor) (Display *d, Window w, Cursor c); /* 27 */ + int (*xDeleteProperty) (Display *d, Window w, Atom a); /* 28 */ + int (*xDestroyWindow) (Display *d, Window w); /* 29 */ + int (*xDrawArc) (Display *d, Drawable dr, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2, int i3, int i4); /* 30 */ + int (*xDrawLines) (Display *d, Drawable dr, GC g, XPoint *x, int i1, int i2); /* 31 */ + int (*xDrawRectangle) (Display *d, Drawable dr, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2); /* 32 */ + int (*xFillArc) (Display *d, Drawable dr, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2, int i3, int i4); /* 33 */ + int (*xFillPolygon) (Display *d, Drawable dr, GC g, XPoint *x, int i1, int i2, int i3); /* 34 */ + int (*xFillRectangles) (Display *d, Drawable dr, GC g, XRectangle *x, int i); /* 35 */ + int (*xForceScreenSaver) (Display *d, int i); /* 36 */ + int (*xFreeColormap) (Display *d, Colormap c); /* 37 */ + int (*xFreeColors) (Display *d, Colormap c, unsigned long *ulp, int i, unsigned long ul); /* 38 */ + int (*xFreeCursor) (Display *d, Cursor c); /* 39 */ + int (*xFreeModifiermap) (XModifierKeymap *x); /* 40 */ Status (*xGetGeometry) (Display *d, Drawable dr, Window *w, int *i1, int *i2, unsigned int *ui1, unsigned int *ui2, unsigned int *ui3, unsigned int *ui4); /* 41 */ - void (*xGetInputFocus) (Display *d, Window *w, int *i); /* 42 */ + int (*xGetInputFocus) (Display *d, Window *w, int *i); /* 42 */ int (*xGetWindowProperty) (Display *d, Window w, Atom a1, long l1, long l2, Bool b, Atom a2, Atom *ap, int *ip, unsigned long *ulp1, unsigned long *ulp2, unsigned char **cpp); /* 43 */ Status (*xGetWindowAttributes) (Display *d, Window w, XWindowAttributes *x); /* 44 */ int (*xGrabKeyboard) (Display *d, Window w, Bool b, int i1, int i2, Time t); /* 45 */ int (*xGrabPointer) (Display *d, Window w1, Bool b, unsigned int ui, int i1, int i2, Window w2, Cursor c, Time t); /* 46 */ KeyCode (*xKeysymToKeycode) (Display *d, KeySym k); /* 47 */ Status (*xLookupColor) (Display *d, Colormap c1, _Xconst char *c2, XColor *x1, XColor *x2); /* 48 */ - void (*xMapWindow) (Display *d, Window w); /* 49 */ - void (*xMoveResizeWindow) (Display *d, Window w, int i1, int i2, unsigned int ui1, unsigned int ui2); /* 50 */ - void (*xMoveWindow) (Display *d, Window w, int i1, int i2); /* 51 */ - void (*xNextEvent) (Display *d, XEvent *x); /* 52 */ - void (*xPutBackEvent) (Display *d, XEvent *x); /* 53 */ - void (*xQueryColors) (Display *d, Colormap c, XColor *x, int i); /* 54 */ + int (*xMapWindow) (Display *d, Window w); /* 49 */ + int (*xMoveResizeWindow) (Display *d, Window w, int i1, int i2, unsigned int ui1, unsigned int ui2); /* 50 */ + int (*xMoveWindow) (Display *d, Window w, int i1, int i2); /* 51 */ + int (*xNextEvent) (Display *d, XEvent *x); /* 52 */ + int (*xPutBackEvent) (Display *d, XEvent *x); /* 53 */ + int (*xQueryColors) (Display *d, Colormap c, XColor *x, int i); /* 54 */ Bool (*xQueryPointer) (Display *d, Window w1, Window *w2, Window *w3, int *i1, int *i2, int *i3, int *i4, unsigned int *ui); /* 55 */ Status (*xQueryTree) (Display *d, Window w1, Window *w2, Window *w3, Window **w4, unsigned int *ui); /* 56 */ - void (*xRaiseWindow) (Display *d, Window w); /* 57 */ - void (*xRefreshKeyboardMapping) (XMappingEvent *x); /* 58 */ - void (*xResizeWindow) (Display *d, Window w, unsigned int ui1, unsigned int ui2); /* 59 */ - void (*xSelectInput) (Display *d, Window w, long l); /* 60 */ + int (*xRaiseWindow) (Display *d, Window w); /* 57 */ + int (*xRefreshKeyboardMapping) (XMappingEvent *x); /* 58 */ + int (*xResizeWindow) (Display *d, Window w, unsigned int ui1, unsigned int ui2); /* 59 */ + int (*xSelectInput) (Display *d, Window w, long l); /* 60 */ Status (*xSendEvent) (Display *d, Window w, Bool b, long l, XEvent *x); /* 61 */ - void (*xSetCommand) (Display *d, Window w, const char **c, int i); /* 62 */ - void (*xSetIconName) (Display *d, Window w, _Xconst char *c); /* 63 */ - void (*xSetInputFocus) (Display *d, Window w, int i, Time t); /* 64 */ - void (*xSetSelectionOwner) (Display *d, Atom a, Window w, Time t); /* 65 */ - void (*xSetWindowBackground) (Display *d, Window w, unsigned long ul); /* 66 */ - void (*xSetWindowBackgroundPixmap) (Display *d, Window w, Pixmap p); /* 67 */ - void (*xSetWindowBorder) (Display *d, Window w, unsigned long ul); /* 68 */ - void (*xSetWindowBorderPixmap) (Display *d, Window w, Pixmap p); /* 69 */ - void (*xSetWindowBorderWidth) (Display *d, Window w, unsigned int ui); /* 70 */ - void (*xSetWindowColormap) (Display *d, Window w, Colormap c); /* 71 */ + int (*xSetCommand) (Display *d, Window w, char **c, int i); /* 62 */ + int (*xSetIconName) (Display *d, Window w, _Xconst char *c); /* 63 */ + int (*xSetInputFocus) (Display *d, Window w, int i, Time t); /* 64 */ + int (*xSetSelectionOwner) (Display *d, Atom a, Window w, Time t); /* 65 */ + int (*xSetWindowBackground) (Display *d, Window w, unsigned long ul); /* 66 */ + int (*xSetWindowBackgroundPixmap) (Display *d, Window w, Pixmap p); /* 67 */ + int (*xSetWindowBorder) (Display *d, Window w, unsigned long ul); /* 68 */ + int (*xSetWindowBorderPixmap) (Display *d, Window w, Pixmap p); /* 69 */ + int (*xSetWindowBorderWidth) (Display *d, Window w, unsigned int ui); /* 70 */ + int (*xSetWindowColormap) (Display *d, Window w, Colormap c); /* 71 */ Bool (*xTranslateCoordinates) (Display *d, Window w1, Window w2, int i1, int i2, int *i3, int *i4, Window *w3); /* 72 */ - void (*xUngrabKeyboard) (Display *d, Time t); /* 73 */ - void (*xUngrabPointer) (Display *d, Time t); /* 74 */ - void (*xUnmapWindow) (Display *d, Window w); /* 75 */ - void (*xWindowEvent) (Display *d, Window w, long l, XEvent *x); /* 76 */ + int (*xUngrabKeyboard) (Display *d, Time t); /* 73 */ + int (*xUngrabPointer) (Display *d, Time t); /* 74 */ + int (*xUnmapWindow) (Display *d, Window w); /* 75 */ + int (*xWindowEvent) (Display *d, Window w, long l, XEvent *x); /* 76 */ void (*xDestroyIC) (XIC x); /* 77 */ Bool (*xFilterEvent) (XEvent *x, Window w); /* 78 */ int (*xmbLookupString) (XIC xi, XKeyPressedEvent *xk, char *c, int i, KeySym *k, Status *s); /* 79 */ - void (*tkPutImage) (unsigned long *colors, int ncolors, Display *display, Drawable d, GC gc, XImage *image, int src_x, int src_y, int dest_x, int dest_y, unsigned int width, unsigned int height); /* 80 */ + int (*tkPutImage) (unsigned long *colors, int ncolors, Display *display, Drawable d, GC gc, XImage *image, int src_x, int src_y, int dest_x, int dest_y, unsigned int width, unsigned int height); /* 80 */ void (*reserved81)(void); Status (*xParseColor) (Display *display, Colormap map, _Xconst char *spec, XColor *colorPtr); /* 82 */ GC (*xCreateGC) (Display *display, Drawable d, unsigned long valuemask, XGCValues *values); /* 83 */ - void (*xFreeGC) (Display *display, GC gc); /* 84 */ + int (*xFreeGC) (Display *display, GC gc); /* 84 */ Atom (*xInternAtom) (Display *display, _Xconst char *atom_name, Bool only_if_exists); /* 85 */ - void (*xSetBackground) (Display *display, GC gc, unsigned long foreground); /* 86 */ - void (*xSetForeground) (Display *display, GC gc, unsigned long foreground); /* 87 */ - void (*xSetClipMask) (Display *display, GC gc, Pixmap pixmap); /* 88 */ - void (*xSetClipOrigin) (Display *display, GC gc, int clip_x_origin, int clip_y_origin); /* 89 */ - void (*xSetTSOrigin) (Display *display, GC gc, int ts_x_origin, int ts_y_origin); /* 90 */ - void (*xChangeGC) (Display *d, GC gc, unsigned long mask, XGCValues *values); /* 91 */ - void (*xSetFont) (Display *display, GC gc, Font font); /* 92 */ - void (*xSetArcMode) (Display *display, GC gc, int arc_mode); /* 93 */ - void (*xSetStipple) (Display *display, GC gc, Pixmap stipple); /* 94 */ - void (*xSetFillRule) (Display *display, GC gc, int fill_rule); /* 95 */ - void (*xSetFillStyle) (Display *display, GC gc, int fill_style); /* 96 */ - void (*xSetFunction) (Display *display, GC gc, int function); /* 97 */ - void (*xSetLineAttributes) (Display *display, GC gc, unsigned int line_width, int line_style, int cap_style, int join_style); /* 98 */ + int (*xSetBackground) (Display *display, GC gc, unsigned long foreground); /* 86 */ + int (*xSetForeground) (Display *display, GC gc, unsigned long foreground); /* 87 */ + int (*xSetClipMask) (Display *display, GC gc, Pixmap pixmap); /* 88 */ + int (*xSetClipOrigin) (Display *display, GC gc, int clip_x_origin, int clip_y_origin); /* 89 */ + int (*xSetTSOrigin) (Display *display, GC gc, int ts_x_origin, int ts_y_origin); /* 90 */ + int (*xChangeGC) (Display *d, GC gc, unsigned long mask, XGCValues *values); /* 91 */ + int (*xSetFont) (Display *display, GC gc, Font font); /* 92 */ + int (*xSetArcMode) (Display *display, GC gc, int arc_mode); /* 93 */ + int (*xSetStipple) (Display *display, GC gc, Pixmap stipple); /* 94 */ + int (*xSetFillRule) (Display *display, GC gc, int fill_rule); /* 95 */ + int (*xSetFillStyle) (Display *display, GC gc, int fill_style); /* 96 */ + int (*xSetFunction) (Display *display, GC gc, int function); /* 97 */ + int (*xSetLineAttributes) (Display *display, GC gc, unsigned int line_width, int line_style, int cap_style, int join_style); /* 98 */ int (*_XInitImageFuncPtrs) (XImage *image); /* 99 */ - XIC (*xCreateIC) (void); /* 100 */ + XIC (*xCreateIC) (XIM xim, ...); /* 100 */ XVisualInfo * (*xGetVisualInfo) (Display *display, long vinfo_mask, XVisualInfo *vinfo_template, int *nitems_return); /* 101 */ void (*xSetWMClientMachine) (Display *display, Window w, XTextProperty *text_prop); /* 102 */ Status (*xStringListToTextProperty) (char **list, int count, XTextProperty *text_prop_return); /* 103 */ - void (*xDrawLine) (Display *d, Drawable dr, GC g, int x1, int y1, int x2, int y2); /* 104 */ - void (*xWarpPointer) (Display *d, Window s, Window dw, int sx, int sy, unsigned int sw, unsigned int sh, int dx, int dy); /* 105 */ - void (*xFillRectangle) (Display *display, Drawable d, GC gc, int x, int y, unsigned int width, unsigned int height); /* 106 */ + int (*xDrawLine) (Display *d, Drawable dr, GC g, int x1, int y1, int x2, int y2); /* 104 */ + int (*xWarpPointer) (Display *d, Window s, Window dw, int sx, int sy, unsigned int sw, unsigned int sh, int dx, int dy); /* 105 */ + int (*xFillRectangle) (Display *display, Drawable d, GC gc, int x, int y, unsigned int width, unsigned int height); /* 106 */ + int (*xFlush) (Display *display); /* 107 */ + int (*xGrabServer) (Display *display); /* 108 */ + int (*xUngrabServer) (Display *display); /* 109 */ + int (*xFree) (void *data); /* 110 */ + int (*xNoOp) (Display *display); /* 111 */ + XAfterFunction (*xSynchronize) (Display *display, Bool onoff); /* 112 */ + int (*xSync) (Display *display, Bool discard); /* 113 */ + VisualID (*xVisualIDFromVisual) (Visual *visual); /* 114 */ #endif /* WIN */ #ifdef MAC_OSX_TK /* AQUA */ - void (*xSetDashes) (Display *display, GC gc, int dash_offset, _Xconst char *dash_list, int n); /* 0 */ + int (*xSetDashes) (Display *display, GC gc, int dash_offset, _Xconst char *dash_list, int n); /* 0 */ XModifierKeymap * (*xGetModifierMapping) (Display *d); /* 1 */ XImage * (*xCreateImage) (Display *d, Visual *v, unsigned int ui1, int i1, int i2, char *cp, unsigned int ui2, unsigned int ui3, int i3, int i4); /* 2 */ XImage * (*xGetImage) (Display *d, Drawable dr, int i1, int i2, unsigned int ui1, unsigned int ui2, unsigned long ul, int i3); /* 3 */ @@ -728,24 +757,24 @@ Window (*xRootWindow) (Display *d, int i); /* 10 */ XErrorHandler (*xSetErrorHandler) (XErrorHandler x); /* 11 */ Status (*xAllocColor) (Display *d, Colormap c, XColor *xp); /* 12 */ - void (*xBell) (Display *d, int i); /* 13 */ + int (*xBell) (Display *d, int i); /* 13 */ void (*xChangeProperty) (Display *d, Window w, Atom a1, Atom a2, int i1, int i2, _Xconst unsigned char *c, int i3); /* 14 */ void (*xChangeWindowAttributes) (Display *d, Window w, unsigned long ul, XSetWindowAttributes *x); /* 15 */ void (*xConfigureWindow) (Display *d, Window w, unsigned int i, XWindowChanges *x); /* 16 */ void (*xCopyArea) (Display *d, Drawable dr1, Drawable dr2, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2, int i3, int i4); /* 17 */ void (*xCopyPlane) (Display *d, Drawable dr1, Drawable dr2, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2, int i3, int i4, unsigned long ul); /* 18 */ Pixmap (*xCreateBitmapFromData) (Display *display, Drawable d, _Xconst char *data, unsigned int width, unsigned int height); /* 19 */ - void (*xDefineCursor) (Display *d, Window w, Cursor c); /* 20 */ + int (*xDefineCursor) (Display *d, Window w, Cursor c); /* 20 */ void (*xDestroyWindow) (Display *d, Window w); /* 21 */ void (*xDrawArc) (Display *d, Drawable dr, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2, int i3, int i4); /* 22 */ - void (*xDrawLines) (Display *d, Drawable dr, GC g, XPoint *x, int i1, int i2); /* 23 */ + int (*xDrawLines) (Display *d, Drawable dr, GC g, XPoint *x, int i1, int i2); /* 23 */ void (*xDrawRectangle) (Display *d, Drawable dr, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2); /* 24 */ void (*xFillArc) (Display *d, Drawable dr, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2, int i3, int i4); /* 25 */ void (*xFillPolygon) (Display *d, Drawable dr, GC g, XPoint *x, int i1, int i2, int i3); /* 26 */ - void (*xFillRectangles) (Display *d, Drawable dr, GC g, XRectangle *x, int i); /* 27 */ - void (*xFreeColormap) (Display *d, Colormap c); /* 28 */ - void (*xFreeColors) (Display *d, Colormap c, unsigned long *ulp, int i, unsigned long ul); /* 29 */ - void (*xFreeModifiermap) (XModifierKeymap *x); /* 30 */ + int (*xFillRectangles) (Display *d, Drawable dr, GC g, XRectangle *x, int i); /* 27 */ + int (*xFreeColormap) (Display *d, Colormap c); /* 28 */ + int (*xFreeColors) (Display *d, Colormap c, unsigned long *ulp, int i, unsigned long ul); /* 29 */ + int (*xFreeModifiermap) (XModifierKeymap *x); /* 30 */ Status (*xGetGeometry) (Display *d, Drawable dr, Window *w, int *i1, int *i2, unsigned int *ui1, unsigned int *ui2, unsigned int *ui3, unsigned int *ui4); /* 31 */ int (*xGetWindowProperty) (Display *d, Window w, Atom a1, long l1, long l2, Bool b, Atom a2, Atom *ap, int *ip, unsigned long *ulp1, unsigned long *ulp2, unsigned char **cpp); /* 32 */ int (*xGrabKeyboard) (Display *d, Window w, Bool b, int i1, int i2, Time t); /* 33 */ @@ -762,7 +791,7 @@ Status (*xSendEvent) (Display *d, Window w, Bool b, long l, XEvent *x); /* 44 */ void (*xSetIconName) (Display *d, Window w, _Xconst char *c); /* 45 */ void (*xSetInputFocus) (Display *d, Window w, int i, Time t); /* 46 */ - void (*xSetSelectionOwner) (Display *d, Atom a, Window w, Time t); /* 47 */ + int (*xSetSelectionOwner) (Display *d, Atom a, Window w, Time t); /* 47 */ void (*xSetWindowBackground) (Display *d, Window w, unsigned long ul); /* 48 */ void (*xSetWindowBackgroundPixmap) (Display *d, Window w, Pixmap p); /* 49 */ void (*xSetWindowBorder) (Display *d, Window w, unsigned long ul); /* 50 */ @@ -770,26 +799,26 @@ void (*xSetWindowBorderWidth) (Display *d, Window w, unsigned int ui); /* 52 */ void (*xSetWindowColormap) (Display *d, Window w, Colormap c); /* 53 */ void (*xUngrabKeyboard) (Display *d, Time t); /* 54 */ - void (*xUngrabPointer) (Display *d, Time t); /* 55 */ + int (*xUngrabPointer) (Display *d, Time t); /* 55 */ void (*xUnmapWindow) (Display *d, Window w); /* 56 */ - void (*tkPutImage) (unsigned long *colors, int ncolors, Display *display, Drawable d, GC gc, XImage *image, int src_x, int src_y, int dest_x, int dest_y, unsigned int width, unsigned int height); /* 57 */ + int (*tkPutImage) (unsigned long *colors, int ncolors, Display *display, Drawable d, GC gc, XImage *image, int src_x, int src_y, int dest_x, int dest_y, unsigned int width, unsigned int height); /* 57 */ Status (*xParseColor) (Display *display, Colormap map, _Xconst char *spec, XColor *colorPtr); /* 58 */ GC (*xCreateGC) (Display *display, Drawable d, unsigned long valuemask, XGCValues *values); /* 59 */ - void (*xFreeGC) (Display *display, GC gc); /* 60 */ + int (*xFreeGC) (Display *display, GC gc); /* 60 */ Atom (*xInternAtom) (Display *display, _Xconst char *atom_name, Bool only_if_exists); /* 61 */ - void (*xSetBackground) (Display *display, GC gc, unsigned long foreground); /* 62 */ - void (*xSetForeground) (Display *display, GC gc, unsigned long foreground); /* 63 */ - void (*xSetClipMask) (Display *display, GC gc, Pixmap pixmap); /* 64 */ - void (*xSetClipOrigin) (Display *display, GC gc, int clip_x_origin, int clip_y_origin); /* 65 */ - void (*xSetTSOrigin) (Display *display, GC gc, int ts_x_origin, int ts_y_origin); /* 66 */ - void (*xChangeGC) (Display *d, GC gc, unsigned long mask, XGCValues *values); /* 67 */ - void (*xSetFont) (Display *display, GC gc, Font font); /* 68 */ - void (*xSetArcMode) (Display *display, GC gc, int arc_mode); /* 69 */ - void (*xSetStipple) (Display *display, GC gc, Pixmap stipple); /* 70 */ - void (*xSetFillRule) (Display *display, GC gc, int fill_rule); /* 71 */ - void (*xSetFillStyle) (Display *display, GC gc, int fill_style); /* 72 */ - void (*xSetFunction) (Display *display, GC gc, int function); /* 73 */ - void (*xSetLineAttributes) (Display *display, GC gc, unsigned int line_width, int line_style, int cap_style, int join_style); /* 74 */ + int (*xSetBackground) (Display *display, GC gc, unsigned long foreground); /* 62 */ + int (*xSetForeground) (Display *display, GC gc, unsigned long foreground); /* 63 */ + int (*xSetClipMask) (Display *display, GC gc, Pixmap pixmap); /* 64 */ + int (*xSetClipOrigin) (Display *display, GC gc, int clip_x_origin, int clip_y_origin); /* 65 */ + int (*xSetTSOrigin) (Display *display, GC gc, int ts_x_origin, int ts_y_origin); /* 66 */ + int (*xChangeGC) (Display *d, GC gc, unsigned long mask, XGCValues *values); /* 67 */ + int (*xSetFont) (Display *display, GC gc, Font font); /* 68 */ + int (*xSetArcMode) (Display *display, GC gc, int arc_mode); /* 69 */ + int (*xSetStipple) (Display *display, GC gc, Pixmap stipple); /* 70 */ + int (*xSetFillRule) (Display *display, GC gc, int fill_rule); /* 71 */ + int (*xSetFillStyle) (Display *display, GC gc, int fill_style); /* 72 */ + int (*xSetFunction) (Display *display, GC gc, int function); /* 73 */ + int (*xSetLineAttributes) (Display *display, GC gc, unsigned int line_width, int line_style, int cap_style, int join_style); /* 74 */ int (*_XInitImageFuncPtrs) (XImage *image); /* 75 */ XIC (*xCreateIC) (void); /* 76 */ XVisualInfo * (*xGetVisualInfo) (Display *display, long vinfo_mask, XVisualInfo *vinfo_template, int *nitems_return); /* 77 */ @@ -797,12 +826,12 @@ Status (*xStringListToTextProperty) (char **list, int count, XTextProperty *text_prop_return); /* 79 */ void (*xDrawSegments) (Display *display, Drawable d, GC gc, XSegment *segments, int nsegments); /* 80 */ void (*xForceScreenSaver) (Display *display, int mode); /* 81 */ - void (*xDrawLine) (Display *d, Drawable dr, GC g, int x1, int y1, int x2, int y2); /* 82 */ - void (*xFillRectangle) (Display *display, Drawable d, GC gc, int x, int y, unsigned int width, unsigned int height); /* 83 */ + int (*xDrawLine) (Display *d, Drawable dr, GC g, int x1, int y1, int x2, int y2); /* 82 */ + int (*xFillRectangle) (Display *display, Drawable d, GC gc, int x, int y, unsigned int width, unsigned int height); /* 83 */ void (*xClearWindow) (Display *d, Window w); /* 84 */ void (*xDrawPoint) (Display *display, Drawable d, GC gc, int x, int y); /* 85 */ void (*xDrawPoints) (Display *display, Drawable d, GC gc, XPoint *points, int npoints, int mode); /* 86 */ - void (*xWarpPointer) (Display *display, Window src_w, Window dest_w, int src_x, int src_y, unsigned int src_width, unsigned int src_height, int dest_x, int dest_y); /* 87 */ + int (*xWarpPointer) (Display *display, Window src_w, Window dest_w, int src_x, int src_y, unsigned int src_width, unsigned int src_height, int dest_x, int dest_y); /* 87 */ void (*xQueryColor) (Display *display, Colormap colormap, XColor *def_in_out); /* 88 */ void (*xQueryColors) (Display *display, Colormap colormap, XColor *defs_in_out, int ncolors); /* 89 */ Status (*xQueryTree) (Display *d, Window w1, Window *w2, Window *w3, Window **w4, unsigned int *ui); /* 90 */ @@ -810,10 +839,8 @@ #endif /* AQUA */ } TkIntXlibStubs; -#ifdef __cplusplus -extern "C" { -#endif extern const TkIntXlibStubs *tkIntXlibStubsPtr; + #ifdef __cplusplus } #endif @@ -824,7 +851,7 @@ * Inline function declarations: */ -#ifdef __WIN32__ /* WIN */ +#if defined(_WIN32) || defined(__CYGWIN__) /* WIN */ #define XSetDashes \ (tkIntXlibStubsPtr->xSetDashes) /* 0 */ #define XGetModifierMapping \ @@ -1038,6 +1065,22 @@ (tkIntXlibStubsPtr->xWarpPointer) /* 105 */ #define XFillRectangle \ (tkIntXlibStubsPtr->xFillRectangle) /* 106 */ +#define XFlush \ + (tkIntXlibStubsPtr->xFlush) /* 107 */ +#define XGrabServer \ + (tkIntXlibStubsPtr->xGrabServer) /* 108 */ +#define XUngrabServer \ + (tkIntXlibStubsPtr->xUngrabServer) /* 109 */ +#define XFree \ + (tkIntXlibStubsPtr->xFree) /* 110 */ +#define XNoOp \ + (tkIntXlibStubsPtr->xNoOp) /* 111 */ +#define XSynchronize \ + (tkIntXlibStubsPtr->xSynchronize) /* 112 */ +#define XSync \ + (tkIntXlibStubsPtr->xSync) /* 113 */ +#define XVisualIDFromVisual \ + (tkIntXlibStubsPtr->xVisualIDFromVisual) /* 114 */ #endif /* WIN */ #ifdef MAC_OSX_TK /* AQUA */ #define XSetDashes \ diff -Nru critcl-3.1.9/lib/critcl/critcl_c/tcl8.6/X11/Xfuncproto.h critcl-3.1.17+dfsg/lib/critcl/critcl_c/tcl8.6/X11/Xfuncproto.h --- critcl-3.1.9/lib/critcl/critcl_c/tcl8.6/X11/Xfuncproto.h 2013-05-10 05:57:04.000000000 +0000 +++ critcl-3.1.17+dfsg/lib/critcl/critcl_c/tcl8.6/X11/Xfuncproto.h 2017-10-14 02:48:11.000000000 +0000 @@ -1,14 +1,14 @@ /* $XConsortium: Xfuncproto.h,v 1.7 91/05/13 20:49:21 rws Exp $ */ -/* +/* * Copyright 1989, 1991 by the Massachusetts Institute of Technology * * Permission to use, copy, modify, and distribute this software and its - * documentation for any purpose and without fee is hereby granted, provided - * that the above copyright notice appear in all copies and that both that - * copyright notice and this permission notice appear in supporting + * documentation for any purpose and without fee is hereby granted, provided + * that the above copyright notice appear in all copies and that both that + * copyright notice and this permission notice appear in supporting * documentation, and that the name of M.I.T. not be used in advertising - * or publicity pertaining to distribution of the software without specific, - * written prior permission. M.I.T. makes no representations about the + * or publicity pertaining to distribution of the software without specific, + * written prior permission. M.I.T. makes no representations about the * suitability of this software for any purpose. It is provided "as is" * without express or implied warranty. * diff -Nru critcl-3.1.9/lib/critcl/critcl_c/tcl8.6/X11/X.h critcl-3.1.17+dfsg/lib/critcl/critcl_c/tcl8.6/X11/X.h --- critcl-3.1.9/lib/critcl/critcl_c/tcl8.6/X11/X.h 2013-05-10 05:57:04.000000000 +0000 +++ critcl-3.1.17+dfsg/lib/critcl/critcl_c/tcl8.6/X11/X.h 2017-10-14 02:48:11.000000000 +0000 @@ -13,13 +13,13 @@ All Rights Reserved -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in +both that copyright notice and this permission notice appear in supporting documentation, and that the names of Digital or MIT not be used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. +software without specific, written prior permission. DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL @@ -100,39 +100,39 @@ #define NoSymbol 0L /* special KeySym */ -/***************************************************************** - * EVENT DEFINITIONS +/***************************************************************** + * EVENT DEFINITIONS *****************************************************************/ /* Input Event Masks. Used as event-mask window attribute and as arguments to Grab requests. Not to be confused with event names. */ #define NoEventMask 0L -#define KeyPressMask (1L<<0) -#define KeyReleaseMask (1L<<1) -#define ButtonPressMask (1L<<2) -#define ButtonReleaseMask (1L<<3) -#define EnterWindowMask (1L<<4) -#define LeaveWindowMask (1L<<5) -#define PointerMotionMask (1L<<6) -#define PointerMotionHintMask (1L<<7) -#define Button1MotionMask (1L<<8) -#define Button2MotionMask (1L<<9) -#define Button3MotionMask (1L<<10) -#define Button4MotionMask (1L<<11) -#define Button5MotionMask (1L<<12) -#define ButtonMotionMask (1L<<13) +#define KeyPressMask (1L<<0) +#define KeyReleaseMask (1L<<1) +#define ButtonPressMask (1L<<2) +#define ButtonReleaseMask (1L<<3) +#define EnterWindowMask (1L<<4) +#define LeaveWindowMask (1L<<5) +#define PointerMotionMask (1L<<6) +#define PointerMotionHintMask (1L<<7) +#define Button1MotionMask (1L<<8) +#define Button2MotionMask (1L<<9) +#define Button3MotionMask (1L<<10) +#define Button4MotionMask (1L<<11) +#define Button5MotionMask (1L<<12) +#define ButtonMotionMask (1L<<13) #define KeymapStateMask (1L<<14) -#define ExposureMask (1L<<15) -#define VisibilityChangeMask (1L<<16) -#define StructureNotifyMask (1L<<17) -#define ResizeRedirectMask (1L<<18) -#define SubstructureNotifyMask (1L<<19) -#define SubstructureRedirectMask (1L<<20) -#define FocusChangeMask (1L<<21) -#define PropertyChangeMask (1L<<22) -#define ColormapChangeMask (1L<<23) -#define OwnerGrabButtonMask (1L<<24) +#define ExposureMask (1L<<15) +#define VisibilityChangeMask (1L<<16) +#define StructureNotifyMask (1L<<17) +#define ResizeRedirectMask (1L<<18) +#define SubstructureNotifyMask (1L<<19) +#define SubstructureRedirectMask (1L<<20) +#define FocusChangeMask (1L<<21) +#define PropertyChangeMask (1L<<22) +#define ColormapChangeMask (1L<<23) +#define OwnerGrabButtonMask (1L<<24) /* Event names. Used in "type" field in XEvent structures. Not to be confused with event masks above. They start from 2 because 0 and 1 @@ -229,7 +229,7 @@ #define NotifyWhileGrabbed 3 #define NotifyHint 1 /* for MotionNotify events */ - + /* Notify detail */ #define NotifyAncestor 0 @@ -299,7 +299,7 @@ #define RevertToParent 2 /***************************************************************** - * ERROR CODES + * ERROR CODES *****************************************************************/ #define Success 0 /* everything's okay */ @@ -314,9 +314,9 @@ #define BadDrawable 9 /* parameter not a Pixmap or Window */ #define BadAccess 10 /* depending on context: - key/button already grabbed - - attempt to free an illegal - cmap entry - - attempt to store into a read-only + - attempt to free an illegal + cmap entry + - attempt to store into a read-only color map entry. - attempt to modify the access control list from other than the local host. @@ -333,7 +333,7 @@ #define LastExtensionError 255 /***************************************************************** - * WINDOW DEFINITIONS + * WINDOW DEFINITIONS *****************************************************************/ /* Window classes used by CreateWindow */ @@ -525,7 +525,7 @@ #define GCCapStyle (1L<<6) #define GCJoinStyle (1L<<7) #define GCFillStyle (1L<<8) -#define GCFillRule (1L<<9) +#define GCFillRule (1L<<9) #define GCTile (1L<<10) #define GCStipple (1L<<11) #define GCTileStipXOrigin (1L<<12) @@ -542,7 +542,7 @@ #define GCLastBit 22 /***************************************************************** - * FONTS + * FONTS *****************************************************************/ /* used in QueryFont -- draw direction */ @@ -553,7 +553,7 @@ #define FontChange 255 /***************************************************************** - * IMAGING + * IMAGING *****************************************************************/ /* ImageFormat -- PutImage, GetImage */ @@ -563,7 +563,7 @@ #define ZPixmap 2 /* depth == drawable depth */ /***************************************************************** - * COLOR MAP STUFF + * COLOR MAP STUFF *****************************************************************/ /* For CreateColormap */ @@ -588,7 +588,7 @@ #define TileShape 1 /* size tiled fastest */ #define StippleShape 2 /* size stippled fastest */ -/***************************************************************** +/***************************************************************** * KEYBOARD/POINTER STUFF *****************************************************************/ @@ -619,7 +619,7 @@ #define MappingPointer 2 /***************************************************************** - * SCREEN SAVER STUFF + * SCREEN SAVER STUFF *****************************************************************/ #define DontPreferBlanking 0 @@ -649,10 +649,10 @@ /* for ChangeAccessControl */ -#define EnableAccess 1 +#define EnableAccess 1 #define DisableAccess 0 -/* Display classes used in opening the connection +/* Display classes used in opening the connection * Note that the statically allocated ones are even numbered and the * dynamically changeable ones are odd numbered */ diff -Nru critcl-3.1.9/lib/critcl/critcl_c/tcl8.6/X11/Xlib.h critcl-3.1.17+dfsg/lib/critcl/critcl_c/tcl8.6/X11/Xlib.h --- critcl-3.1.9/lib/critcl/critcl_c/tcl8.6/X11/Xlib.h 2013-05-10 05:57:04.000000000 +0000 +++ critcl-3.1.17+dfsg/lib/critcl/critcl_c/tcl8.6/X11/Xlib.h 2017-10-14 02:48:11.000000000 +0000 @@ -1,14 +1,14 @@ /* $XConsortium: Xlib.h,v 11.221 93/07/02 14:13:28 gildea Exp $ */ -/* +/* * Copyright 1985, 1986, 1987, 1991 by the Massachusetts Institute of Technology * * Permission to use, copy, modify, and distribute this software and its - * documentation for any purpose and without fee is hereby granted, provided - * that the above copyright notice appear in all copies and that both that - * copyright notice and this permission notice appear in supporting + * documentation for any purpose and without fee is hereby granted, provided + * that the above copyright notice appear in all copies and that both that + * copyright notice and this permission notice appear in supporting * documentation, and that the name of M.I.T. not be used in advertising - * or publicity pertaining to distribution of the software without specific, - * written prior permission. M.I.T. makes no representations about the + * or publicity pertaining to distribution of the software without specific, + * written prior permission. M.I.T. makes no representations about the * suitability of this software for any purpose. It is provided "as is" * without express or implied warranty. * @@ -163,10 +163,10 @@ unsigned long background;/* background pixel */ int line_width; /* line width */ int line_style; /* LineSolid, LineOnOffDash, LineDoubleDash */ - int cap_style; /* CapNotLast, CapButt, + int cap_style; /* CapNotLast, CapButt, CapRound, CapProjecting */ int join_style; /* JoinMiter, JoinRound, JoinBevel */ - int fill_style; /* FillSolid, FillTiled, + int fill_style; /* FillSolid, FillTiled, FillStippled, FillOpaeueStippled */ int fill_rule; /* EvenOddRule, WindingRule */ int arc_mode; /* ArcChord, ArcPieSlice */ @@ -209,7 +209,7 @@ /* * Depth structure; contains information for each possible depth. - */ + */ typedef struct { int depth; /* this depth (Z) of the depth */ int nvisuals; /* number of Visual types at this depth */ @@ -237,7 +237,7 @@ unsigned long black_pixel; /* White and Black pixel values */ int max_maps, min_maps; /* max and min color maps */ int backing_store; /* Never, WhenMapped, Always */ - Bool save_unders; + Bool save_unders; long root_input_mask; /* initial root input mask */ } Screen; @@ -348,7 +348,7 @@ } f; } XImage; -/* +/* * Data structure for XReconfigureWindow */ typedef struct { @@ -369,7 +369,7 @@ char pad; } XColor; -/* +/* * Data structures for graphics operations. On most machines, these are * congruent with the wire protocol structures, so reformatting the data * can be avoided on these architectures. @@ -381,12 +381,12 @@ typedef struct { short x, y; } XPoint; - + typedef struct { short x, y; unsigned short width, height; } XRectangle; - + typedef struct { short x, y; unsigned short width, height; @@ -487,7 +487,7 @@ struct _XExten *ext_procs; /* extensions initialized on this display */ /* * the following can be fixed size, as the protocol defines how - * much address space is available. + * much address space is available. * While this could be done using the extension vector, there * may be MANY events processed, so a search through the extension * list to find the right procedure for each event might be @@ -602,7 +602,7 @@ int mode; /* NotifyNormal, NotifyGrab, NotifyUngrab */ int detail; /* - * NotifyAncestor, NotifyVirtual, NotifyInferior, + * NotifyAncestor, NotifyVirtual, NotifyInferior, * NotifyNonlinear,NotifyNonlinearVirtual */ Bool same_screen; /* same screen flag */ @@ -621,9 +621,9 @@ int mode; /* NotifyNormal, NotifyGrab, NotifyUngrab */ int detail; /* - * NotifyAncestor, NotifyVirtual, NotifyInferior, + * NotifyAncestor, NotifyVirtual, NotifyInferior, * NotifyNonlinear,NotifyNonlinearVirtual, NotifyPointer, - * NotifyPointerRoot, NotifyDetailNone + * NotifyPointerRoot, NotifyDetailNone */ } XFocusChangeEvent; typedef XFocusChangeEvent XFocusInEvent; @@ -637,7 +637,7 @@ Display *display; /* Display the event was read from */ Window window; char key_vector[32]; -} XKeymapEvent; +} XKeymapEvent; typedef struct { int type; @@ -1124,7 +1124,7 @@ typedef unsigned long XIMFeedback; #define XIMReverse 1 -#define XIMUnderline (1<<1) +#define XIMUnderline (1<<1) #define XIMHighlight (1<<2) #define XIMPrimary (1<<5) #define XIMSecondary (1<<6) @@ -1133,11 +1133,11 @@ typedef struct _XIMText { unsigned short length; XIMFeedback *feedback; - Bool encoding_is_wchar; + Bool encoding_is_wchar; union { char *multi_byte; wchar_t *wide_char; - } string; + } string; } XIMText; typedef struct _XIMPreeditDrawCallbackStruct { @@ -1152,13 +1152,13 @@ XIMForwardWord, XIMBackwardWord, XIMCaretUp, XIMCaretDown, XIMNextLine, XIMPreviousLine, - XIMLineStart, XIMLineEnd, + XIMLineStart, XIMLineEnd, XIMAbsolutePosition, XIMDontChange } XIMCaretDirection; typedef enum { - XIMIsInvisible, /* Disable caret feedback */ + XIMIsInvisible, /* Disable caret feedback */ XIMIsPrimary, /* UI defined caret feedback */ XIMIsSecondary /* UI defined caret feedback */ } XIMCaretStyle; @@ -1173,7 +1173,7 @@ XIMTextType, XIMBitmapType } XIMStatusDataType; - + typedef struct _XIMStatusDrawCallbackStruct { XIMStatusDataType type; union { diff -Nru critcl-3.1.9/lib/critcl/critcl_c/tcl8.6/X11/Xutil.h critcl-3.1.17+dfsg/lib/critcl/critcl_c/tcl8.6/X11/Xutil.h --- critcl-3.1.9/lib/critcl/critcl_c/tcl8.6/X11/Xutil.h 2013-05-10 05:57:04.000000000 +0000 +++ critcl-3.1.17+dfsg/lib/critcl/critcl_c/tcl8.6/X11/Xutil.h 2017-10-14 02:48:11.000000000 +0000 @@ -6,13 +6,13 @@ All Rights Reserved -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in +both that copyright notice and this permission notice appear in supporting documentation, and that the names of Digital or MIT not be used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. +software without specific, written prior permission. DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL @@ -33,7 +33,7 @@ # define Region XRegion #endif -/* +/* * Bitmask returned by XParseGeometry(). Each bit tells if the corresponding * value (x, y, width, height) was found in the parsed string. */ @@ -128,7 +128,7 @@ /* - * new structure for manipulating TEXT properties; used with WM_NAME, + * new structure for manipulating TEXT properties; used with WM_NAME, * WM_ICON_NAME, WM_CLIENT_MACHINE, and WM_COMMAND. */ typedef struct { @@ -206,16 +206,16 @@ || ((unsigned)(keysym) == XK_Mode_switch) \ || ((unsigned)(keysym) == XK_Num_Lock)) /* - * opaque reference to Region data type + * opaque reference to Region data type */ -typedef struct _XRegion *Region; +typedef struct _XRegion *Region; /* Return values from XRectInRegion() */ - + #define RectangleOut 0 #define RectangleIn 1 #define RectanglePart 2 - + /* * Information used by the visual utility routines to find desired visual @@ -364,13 +364,13 @@ #endif ); -extern void XEmptyRegion( +extern Bool XEmptyRegion( #if NeedFunctionPrototypes Region /* r */ #endif ); -extern void XEqualRegion( +extern Bool XEqualRegion( #if NeedFunctionPrototypes Region /* r1 */, Region /* r2 */ @@ -435,7 +435,7 @@ Display* /* display */, Window /* w */, XStandardColormap* /* colormap_return */, - Atom /* property */ + Atom /* property */ #endif ); @@ -460,7 +460,7 @@ extern XWMHints *XGetWMHints( #if NeedFunctionPrototypes Display* /* display */, - Window /* w */ + Window /* w */ #endif ); @@ -485,7 +485,7 @@ Display* /* display */, Window /* w */, XSizeHints* /* hints_return */, - long* /* supplied_return */ + long* /* supplied_return */ #endif ); @@ -591,7 +591,7 @@ Display* /* display */, Window /* w */, XIconSize* /* size_list */, - int /* count */ + int /* count */ #endif ); diff -Nru critcl-3.1.9/lib/critcl/critcl_c/tkstubs_noconst.c critcl-3.1.17+dfsg/lib/critcl/critcl_c/tkstubs_noconst.c --- critcl-3.1.9/lib/critcl/critcl_c/tkstubs_noconst.c 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/lib/critcl/critcl_c/tkstubs_noconst.c 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,27 @@ + +#if USE_TK_STUBS + /* Pre 8.6 two of the variables are not declared const. + * Prevent mismatch with tkDecls.h + */ + + TkStubs *tkStubsPtr; + const struct TkPlatStubs *tkPlatStubsPtr; + const struct TkIntStubs *tkIntStubsPtr; + const struct TkIntPlatStubs *tkIntPlatStubsPtr; + struct TkIntXlibStubs *tkIntXlibStubsPtr; + + static int + MyInitTkStubs (Tcl_Interp *ip) + { + if (Tcl_PkgRequireEx(ip, "Tk", "8.1", 0, (ClientData*) &tkStubsPtr) == NULL) return 0; + if (tkStubsPtr == NULL || tkStubsPtr->hooks == NULL) { + Tcl_SetResult(ip, "This extension requires Tk stubs-support.", TCL_STATIC); + return 0; + } + tkPlatStubsPtr = tkStubsPtr->hooks->tkPlatStubs; + tkIntStubsPtr = tkStubsPtr->hooks->tkIntStubs; + tkIntPlatStubsPtr = tkStubsPtr->hooks->tkIntPlatStubs; + tkIntXlibStubsPtr = tkStubsPtr->hooks->tkIntXlibStubs; + return 1; + } +#endif diff -Nru critcl-3.1.9/lib/critcl/critcl.tcl critcl-3.1.17+dfsg/lib/critcl/critcl.tcl --- critcl-3.1.9/lib/critcl/critcl.tcl 2013-05-10 05:57:04.000000000 +0000 +++ critcl-3.1.17+dfsg/lib/critcl/critcl.tcl 2017-10-14 02:48:11.000000000 +0000 @@ -3,10 +3,17 @@ # Pragmas for MetaData Scanner. # @mdgen OWNER: Config # @mdgen OWNER: critcl_c +# +# Copyright (c) 2001-20?? Jean-Claude Wippler +# Copyright (c) 2002-20?? Steve Landers +# Copyright (c) 20??-2017 Andreas Kupries +# # ## ### ##### ######## ############# ##################### # CriTcl Core. -package provide critcl 3.1.8 +package provide critcl 3.1.17 + +namespace eval ::critcl {} # # ## ### ##### ######## ############# ##################### ## Requirements. @@ -15,61 +22,41 @@ if {[catch { package require platform 1.0.2 ; # Determine current platform. }]} { - # Fall back to our internal copy (currently at platform 1.0.11 - # equivalent) if the environment does not have the official + # Fall back to our internal copy (currently equivalent to platform + # 1.0.14(+)) if the environment does not have the official # package. package require critcl::platform +} elseif { + [string match freebsd* [platform::generic]] && + ([platform::generic] eq [platform::identify]) +} { + # Again fall back to the internal package if we are on FreeBSD and + # the official package does not properly identify the OS ABI + # version. + package require critcl::platform } +# # ## ### ##### ######## ############# ##################### # Ensure forward compatibility of commands defined in 8.5+. package require lassign84 package require dict84 +package require lmap84 -catch { interp debug {} -frame 1 } +# # ## ### ##### ######## ############# ##################### +## Ensure that we have maximal 'info frame' data, if supported -# md5 could be a cmd or a pkg, or be in a separate namespace -if {[catch { md5 "" }]} { - # Do *not* use "package require md5c" since critcl is not loaded - # yet, but do look for a compiled one, in case object code already - # exists. - - if {![catch { md5c "" }]} { - interp alias {} md5 {} md5c - } elseif {[catch {package require Trf 2.0}] || [catch {::md5 -- test}]} { - # Else try to load the Tcl version in tcllib - catch { package require md5 } - if {![catch { md5::md5 "" }]} { - interp alias {} md5 {} md5::md5 - } else { - # Last resort: package require or source Don Libes' - # md5pure script +catch { interp debug {} -frame 1 } - if {[catch { package require md5pure }]} { - if {[file exists md5pure.tcl]} { - source md5pure.tcl - interp alias {} md5 {} md5pure::md5 - } else { - # XXX: Note the assumption here, that the md5 - # XXX: package is found relative to critcl itself, - # XXX: in the critcl starkit. +# # ## ### ##### ######## ############# ##################### +# This is the md5 package bundled with critcl. +# No need to look for fallbacks. - source [file join [file dirname [info script]] ../md5/md5.tcl] - interp alias {} md5 {} md5::md5 - } - } else { - interp alias {} md5 {} md5pure::md5 - } - } +proc ::critcl::md5_hex {s} { + if {$v::uuidcounter} { + return [format %032d [incr v::uuidcounter]] } -} - -namespace eval ::critcl {} - -# ouch, some md5 implementations return hex, others binary -if {[string length [md5 ""]] == 32} { - proc ::critcl::md5_hex {s} { return [md5 $s] } -} else { - proc ::critcl::md5_hex {s} { binary scan [md5 $s] H* md; return $md } + package require critcl_md5c + binary scan [md5c $s] H* md; return $md } # # ## ### ##### ######## ############# ##################### @@ -94,7 +81,7 @@ } # # ## ### ##### ######## ############# ##################### -## +## proc ::critcl::buildrequirement {script} { # In regular code this does nothing. It is a marker for @@ -165,12 +152,17 @@ proc ::critcl::ccode {text} { set file [SkipIgnored [This]] - AbortWhenCalledAfterBuild + HandleDeclAfterBuild + CCodeCore $file $text + return +} + +proc ::critcl::CCodeCore {file text} { set digest [UUID.extend $file .ccode $text] set block {} lassign [HeaderLines $text] leadoffset text - append block [at::CPragma $leadoffset -2 $file] $text \n + append block [at::CPragma $leadoffset -3 $file] $text \n dict update v::code($file) config c { dict lappend c fragments $digest @@ -182,7 +174,10 @@ proc ::critcl::ccommand {name anames args} { SkipIgnored [set file [This]] - AbortWhenCalledAfterBuild + HandleDeclAfterBuild + + # Basic key for the clientdata and delproc arrays. + set cname $name[UUID.serial $file] if {[llength $args]} { set body [lindex $args 0] @@ -191,31 +186,44 @@ set body {} } - set clientdata NULL - set delproc 0 + set clientdata NULL ;# Default: ClientData expression + set delproc NULL ;# Default: Function pointer expression set acname 0 + set tname "" while {[string match "-*" $args]} { switch -- [set opt [lindex $args 0]] { -clientdata { set clientdata [lindex $args 1] } -delproc { set delproc [lindex $args 1] } -cname { set acname [lindex $args 1] } + -tracename { set tname [lindex $args 1] } default { - error "Unknown option $opt, expected one of -clientdata, -cname, or -delproc" + error "Unknown option $opt, expected one of -clientdata, -cname, -delproc" } } set args [lrange $args 2 end] } + # Put body back into args for integration into the MD5 uuid + # generated for mode compile&run. Bug and fix reported by Peter + # Spjuth. + lappend args $body + if {$acname} { BeginCommand static $name $anames $args - set ns {} - set cns {} - set key $name + set ns {} + set cns {} + set key $cname set wname $name + if {$tname ne {}} { + set traceref \"$tname\" + } else { + set traceref \"$name\" + } } else { lassign [BeginCommand public $name $anames $args] ns cns name cname - set key [string map {:: _} $ns$name] + set key [string map {:: _} $ns$cname] set wname tcl_$cns$cname + set traceref ns_$cns$cname } # XXX clientdata/delproc, either note clashes, or keep information per-file. @@ -234,7 +242,14 @@ set ca "(ClientData $cd, Tcl_Interp *$ip, int $oc, Tcl_Obj *CONST $ov\[])" - Emitln "static int $wname$ca" + if {$v::options(trace)} { + # For ccommand tracing we will emit a shim after the implementation. + # Give the implementation a different name. + Emitln "static int\n${wname}_actual$ca" + } else { + Emitln "static int\n$wname$ca" + } + Emit \{\n lassign [HeaderLines $body] leadoffset body if {$v::options(lines)} { @@ -242,6 +257,19 @@ } Emit $body Emitln \n\} + + # Now emit the call to the ccommand tracing shim. It simply + # calls the regular implementation and places the tracing + # around that. + if {$v::options(trace)} { + Emitln "\nstatic int\n$wname$ca" + Emitln \{ + Emitln " int _rv;" + Emitln " critcl_trace_cmd_args ($traceref, $oc, $ov);" + Emitln " _rv = ${wname}_actual ($cd, $ip, $oc, $ov);" + Emitln " return critcl_trace_cmd_result (_rv, $ip);" + Emitln \} + } } else { # if no body is specified, then $anames is alias for the real cmd proc Emitln "#define $wname $anames" @@ -253,7 +281,7 @@ proc ::critcl::cdata {name data} { SkipIgnored [This] - AbortWhenCalledAfterBuild + HandleDeclAfterBuild binary scan $data c* bytes ;# split as bytes, not (unicode) chars set inittext "" @@ -280,7 +308,7 @@ proc ::critcl::cdefines {defines {namespace "::"}} { set file [SkipIgnored [This]] - AbortWhenCalledAfterBuild + HandleDeclAfterBuild set digest [UUID.extend $file .cdefines [list $defines $namespace]] dict update v::code($file) config c { @@ -291,6 +319,391 @@ return } +proc ::critcl::MakeVariadicTypeFor {type} { + # Note: The type "Tcl_Obj*" required special treatment and is + # directly defined as a builtin, see 'Initialize'. The has-argtype + # check below will prevent us from trying to create something + # generic, and wrong. + + set ltype variadic_$type + if {![has-argtype $ltype]} { + # Generate a type representing a list/array of + # elements, plus conversion code. Similar to the 'list' type, + # except for custom C types, and conversion assumes variadic, + # not single argument. + + lappend one @@ src + lappend one &@A dst + lappend one @A *dst + lappend one @A. dst-> + lappend map @1conv@ [Deline [string map $one [ArgumentConversion $type]]] + + lappend map @type@ [ArgumentCType $type] + lappend map @ltype@ $ltype + + argtype $ltype [string map $map { + int src, dst, leftovers = @C; + @A.c = leftovers; + @A.v = (@type@*) ((!leftovers) ? 0 : ckalloc (leftovers * sizeof (@type@))); + for (src = @I, dst = 0; leftovers > 0; dst++, src++, leftovers--) { + if (_critcl_variadic_@type@_item (interp, ov[src], &(@A.v[dst])) != TCL_OK) { + ckfree ((char*) @A.v); /* Cleanup partial work */ + return TCL_ERROR; + } + } + }] critcl_$ltype critcl_$ltype + + argtypesupport $ltype [string map $map { + /* NOTE: Array 'v' is allocated on the heap. The argument + // release code is used to free it after the worker + // function returned. Depending on type and what is done + // by the worker it may have to make copies of the data. + */ + + typedef struct critcl_@ltype@ { + int c; /* Element count */ + @type@* v; /* Allocated array of the elements */ + } critcl_@ltype@; + + static int + _critcl_variadic_@type@_item (Tcl_Interp* interp, Tcl_Obj* src, @type@* dst) { + @1conv@ + return TCL_OK; + } + }] + + argtyperelease $ltype [string map $map { + if (@A.c) { ckfree ((char*) @A.v); } + }] + } + return $ltype +} + +proc ::critcl::ArgsInprocess {adefs skip} { + # Convert the regular arg spec from the API into a dictionary + # containing all the derived data we need in the various places of + # the cproc implementation. + + set db {} + + set names {} ; # list of raw argument names + set cnames {} ; # list of C var names for the arguments. + set optional {} ; # list of flags signaling optional args. + set variadic {} ; # list of flags signaling variadic args. + set islast {} ; # list of flags signaling the last arg. + set varargs no ; # flag signaling 'args' collector. + set defaults {} ; # list of default values. + set csig {} ; # C signature of worker function. + set tsig {} ; # Tcl signature for frontend/shim command. + set vardecls {} ; # C variables for arg conversion in the shim. + set support {} ; # Conversion support code for arguments. + set has {} ; # Types for which we have emitted the support + # code already. (dict: type -> '.' (presence)) + set hasopt no ; # Overall flag - Have optionals ... + set min 0 ; # Count required args - minimal needed. + set max 0 ; # Count all args - maximal allowed. + set aconv {} ; # list of the basic argument conversions. + set achdr {} ; # list of arg conversion annotations. + set arel {} ; # List of arg release code fragments, for those which have them. + + # A 1st argument matching "Tcl_Interp*" does not count as a user + # visible command argument. But appears in both signature and + # actual list of arguments. + if {[lindex $adefs 0] eq "Tcl_Interp*"} { + lappend csig [lrange $adefs 0 1] + lappend cnames interp;#Fixed name for cproc[lindex $adefs 1] + set adefs [lrange $adefs 2 end] + } + + set last [expr {[llength $adefs]/2-1}] + set current 0 + + foreach {t a} $adefs { + # t = type + # a = name | {name default} + + # Base type support + if {![dict exists $has $t]} { + dict set has $t . + lappend support "[ArgumentSupport $t]" + } + + lassign $a name defaultvalue + set hasdefault [expr {[llength $a] == 2}] + + lappend islast [expr {$current == $last}] + + # Cases to consider: + # 1. 'args' as the last argument, without a default. + # 2. Any argument with a default value. + # 3. Any argument. + + if {($current == $last) && ($name eq "args") && !$hasdefault} { + set hdr " /* ($t $name, ...) - - -- --- ----- -------- */" + lappend optional 0 + lappend variadic 1 + lappend defaults n/a + lappend tsig ?${name}...? + set varargs yes + set max Inf ; # No limit on the number of args. + + # Dynamically create an arg-type for "variadic list of T". + set t [MakeVariadicTypeFor $t] + # List support. + if {![dict exists $has $t]} { + dict set has $t . + lappend support "[ArgumentSupport $t]" + } + + } elseif {$hasdefault} { + incr max + set hasopt yes + set hdr " /* ($t $name, optional, default $defaultvalue) - - -- --- ----- -------- */" + lappend tsig ?${name}? + lappend optional 1 + lappend variadic 0 + lappend defaults $defaultvalue + lappend cnames _has_$name + # Argument to signal if the optional argument was set + # (true) or is the default (false). + lappend csig "int has_$name" + lappend vardecls "int _has_$name = 0;" + + } else { + set hdr " /* ($t $name) - - -- --- ----- -------- */" + lappend tsig $name + incr max + incr min + lappend optional 0 + lappend variadic 0 + lappend defaults n/a + } + + lappend achdr $hdr + lappend csig "[ArgumentCTypeB $t] $name" + lappend vardecls "[ArgumentCType $t] _$name;" + + lappend names $name + lappend cnames _$name + lappend aconv [TraceReturns "\"$t\" argument" [ArgumentConversion $t]] + + set rel [ArgumentRelease $t] + if {$rel ne {}} { + set rel [string map [list @A _$name] $rel] + set hdr [string map {( {(Release: }} $hdr] + lappend arel "$hdr$rel" + } + + incr current + } + + set thresholds {} + if {$hasopt} { + # Compute thresholds for optional arguments. The threshold T + # of an optional argument A is the number of required + # arguments _after_ A. If during arg processing more than T + # arguments are left then A can take the current word, + # otherwise A is left to its default. We compute them from the + # end. + set t 0 + foreach o [lreverse $optional] { + if {$o} { + lappend thresholds $t + } else { + lappend thresholds - + incr t + } + } + set thresholds [lreverse $thresholds] + } + + set tsig [join $tsig { }] + if {$tsig eq {}} { + set tsig NULL + } else { + set tsig \"$tsig\" + } + + # Generate code for wrong#args checking, based on the collected + # min/max information. Cases to consider: + # + # a. max == Inf && min == 0 <=> All argc allowed. + # b. max == Inf && min > 0 <=> Fail argc < min. + # c. max < Inf && min == max <=> Fail argc != min. + # d. max < Inf && min < max <=> Fail argc < min || max < argc + + if {$max == Inf} { + # a, b + if {!$min} { + # a: nothing to check. + set wacondition {} + } else { + # b: argc < min + set wacondition {oc < MIN_ARGS} + } + } else { + # c, d + if {$min == $max} { + # c: argc != min + set wacondition {oc != MIN_ARGS} + } else { + # d: argc < min || max < argc + set wacondition {(oc < MIN_ARGS) || (MAX_ARGS < oc)} + } + } + + # Generate conversion code for arguments. Use the threshold + # information to handle optional arguments at all positions. + # The code is executed after the wrong#args check. + # That means we have at least 'min' arguments, enough to fill + # all the required parameters. + + set map {} + set conv {} + set opt no + set idx $skip + set prefix " idx_ = $idx;" ; # Start at skip offset! + append prefix "\n argc_ = oc - $idx;" + foreach \ + name $names \ + t $thresholds \ + o $optional \ + v $variadic \ + l $islast \ + h $achdr \ + c $aconv \ + d $defaults { + + # Things to consider: + # 1. Required variables at the beginning. + # We can access these using fixed indices. + # 2. Any other variable require access using a dynamic index + # (idx_). During (1) we maintain the code initializing + # this. + + set useindex [expr {!$l}] ;# last arg => no need for idx/argc updates + + if {$v} { + # Variadic argument. Can only be last. + # opt => dynamic access at idx_..., collect argc_ + # !opt => static access at $idx ..., collect oc-$idx + + unset map + lappend map @A _$name + if {$opt} { + lappend map @I idx_ @C argc_ + } else { + lappend map @I $idx @C (oc-$idx) + } + + set c [string map $map $c] + + lappend conv $h + lappend conv $c + lappend conv {} + lappend conv {} + break + } + + if {$o} { + # Optional argument. Anywhere. Check threshold. + + unset map + lappend map @@ "ov\[idx_\]" + lappend map @A _$name + + set c [string map $map $c] + + if {$prefix ne {}} { lappend conv $prefix\n } + lappend conv $h + lappend conv " if (argc_ > $t) \{" + lappend conv $c + if {$useindex} { + lappend conv " idx_++;" + lappend conv " argc_--;" + } + lappend conv " _has_$name = 1;" + lappend conv " \} else \{" + lappend conv " _$name = $d;" + lappend conv " \}" + lappend conv {} + lappend conv {} + + set prefix {} + set opt yes + continue + } + + if {$opt} { + # Required argument, after one or more optional arguments + # were processed. Access to current word is dynamic. + + unset map + lappend map @@ "ov\[idx_\]" + lappend map @A _$name + + set c [string map $map $c] + + lappend conv $h + lappend conv $c + lappend conv {} + if {$useindex} { + lappend conv " idx_++;" + lappend conv " argc_--;" + } + lappend conv {} + lappend conv {} + continue + } + + # Required argument. No optionals processed yet. Access to + # current word is via static index. + + unset map + lappend map @@ "ov\[$idx\]" + lappend map @A _$name + + set c [string map $map $c] + + lappend conv $h + lappend conv $c + lappend conv {} + lappend conv {} + + incr idx + set prefix " idx_ = $idx;" + append prefix "\n argc_ = oc - $idx;" + } + set conv [Deline [join $conv \n]] + + # Save results ... + + dict set db skip $skip + dict set db aconv $conv + dict set db arelease $arel + dict set db thresholds $thresholds + dict set db wacondition $wacondition + dict set db min $min + dict set db max $max + dict set db tsignature $tsig + dict set db names $names + dict set db cnames $cnames + dict set db optional $optional + dict set db variadic $variadic + dict set db islast $islast + dict set db defaults $defaults + dict set db varargs $varargs + dict set db csignature $csig + dict set db vardecls $vardecls + dict set db support $support + dict set db hasoptional $hasopt + + #puts ___________________________________________________________|$adefs + #array set __ $db ; parray __ + #puts _______________________________________________________________\n + return $db +} + proc ::critcl::argoptional {adefs} { set optional {} @@ -359,6 +772,7 @@ foreach {t a} $adefs { if {[llength $a] == 2} { set a [lindex $a 0] + lappend cnames _has_$a } lappend cnames _$a } @@ -382,6 +796,9 @@ foreach {t a} $adefs { if {[llength $a] == 2} { set a [lindex $a 0] + # Argument to signal if the optional argument was set + # (true) or is the default (false). + lappend cargs "int has_$a" } lappend cargs "[ArgumentCTypeB $t] $a" } @@ -402,8 +819,10 @@ foreach {t a} $adefs { if {[llength $a] == 2} { set a [lindex $a 0] + lappend result "[ArgumentCType $t] _$a;\n int _has_$a = 0;" + } else { + lappend result "[ArgumentCType $t] _$a;" } - lappend result "[ArgumentCType $t] _$a;" } return $result @@ -457,7 +876,7 @@ set map [list @@ "ov\[idx_\]" @A _$a] set code [string map $map [ArgumentConversion $t]] - set code "${prefix} if (oc > $min) \{\n$code\n idx_++;\n \} else \{\n _$a = $default;\n \}" + set code "${prefix} if (oc > $min) \{\n$code\n idx_++;\n _has_$a = 1;\n \} else \{\n _$a = $default;\n \}" incr min lappend result " /* ($t $a, optional, default $default) - - -- --- ----- -------- */" @@ -487,27 +906,50 @@ } } - return $result + return [Deline $result] +} + +proc ::critcl::has-argtype {name} { + variable v::aconv + return [info exists aconv($name)] +} + +proc ::critcl::argtype-def {name} { + lappend def [ArgumentCType $name] + lappend def [ArgumentCTypeB $name] + lappend def [ArgumentConversion $name] + lappend def [ArgumentRelease $name] + lappend def [ArgumentSupport $name] + return $def } proc ::critcl::argtype {name conversion {ctype {}} {ctypeb {}}} { variable v::actype variable v::actypeb variable v::aconv + variable v::acrel + variable v::acsup # ctype Type of variable holding the argument. # ctypeb Type of formal C function argument. - if {[info exists aconv($name)]} { - return -code error "Illegal duplicate definition of '$name'." - } - # Handle aliases by copying the original definition. if {$conversion eq "="} { if {![info exists aconv($ctype)]} { return -code error "Unable to alias unknown type '$ctype'." } - set conversion $aconv($ctype) + + # Do not forget to copy support and release code, if present. + if {[info exists acsup($ctype)]} { + #puts COPY/S:$ctype + set acsup($name) $acsup($ctype) + } + if {[info exists acrel($ctype)]} { + #puts COPY/R:$ctype + set acrel($name) $acrel($ctype) + } + + set conversion $aconv($ctype) set ctypeb $actypeb($ctype) set ctype $actype($ctype) } else { @@ -520,45 +962,77 @@ if {$ctypeb eq {}} { set ctypeb $name } - set aconv($name) $conversion - set actype($name) $ctype + + if {[info exists aconv($name)] && + (($aconv($name) ne $conversion) || + ($actype($name) ne $ctype) || + ($actypeb($name) ne $ctypeb)) + } { + return -code error "Illegal duplicate definition of '$name'." + } + + set aconv($name) $conversion + set actype($name) $ctype set actypeb($name) $ctypeb return } -proc ::critcl::argtypesupport {name code} { +proc ::critcl::argtypesupport {name code {guard {}}} { variable v::aconv variable v::acsup if {![info exists aconv($name)]} { return -code error "No definition for '$name'." } - if {[info exists acsup($name)]} { + if {$guard eq {}} { + set guard $name ; # Handle non-identifier chars! + } + lappend lines "#ifndef CRITCL_$guard" + lappend lines "#define CRITCL_$guard" + lappend lines $code + lappend lines "#endif /* CRITCL_$guard _________ */" + set support [join $lines \n]\n + + if {[info exists acsup($name)] && + ($acsup($name) ne $support) + } { return -code error "Illegal duplicate support of '$name'." } - lappend lines "#ifndef CRITCL_$name" - lappend lines "#define CRITCL_$name" - lappend lines $code - lappend lines "#endif" + set acsup($name) $support + return +} - set acsup($name) [join $lines \n] +proc ::critcl::argtyperelease {name code} { + variable v::aconv + variable v::acrel + if {![info exists aconv($name)]} { + return -code error "No definition for '$name'." + } + if {[info exists acrel($name)] && + ($acrel($name) ne $code) + } { + return -code error "Illegal duplicate release of '$name'." + } + + set acrel($name) $code return } +proc ::critcl::has-resulttype {name} { + variable v::rconv + return [info exists rconv($name)] +} + proc ::critcl::resulttype {name conversion {ctype {}}} { variable v::rctype variable v::rconv - if {[info exists rconv($name)]} { - return -code error "Illegal duplicate definition of '$name'." - } - # Handle aliases by copying the original definition. if {$conversion eq "="} { if {![info exists rconv($ctype)]} { return -code error "Unable to alias unknown type '$ctype'." } - set conversion $rconv($ctype) + set conversion $rconv($ctype) set ctype $rctype($ctype) } else { lassign [HeaderLines $conversion] leadoffset conversion @@ -567,23 +1041,83 @@ if {$ctype eq {}} { set ctype $name } + + if {[info exists rconv($name)] && + (($rconv($name) ne $conversion) || + ($rctype($name) ne $ctype)) + } { + return -code error "Illegal duplicate definition of '$name'." + } + set rconv($name) $conversion set rctype($name) $ctype return } +proc ::critcl::cconst {name rtype rvalue} { + # The semantics are equivalent to + # + # cproc $name {} $rtype { return $rvalue ; } + # + # The main feature of this new command is the knowledge of a + # constant return value, which allows the optimization of the + # generated code. Only the shim is emitted, with the return value + # in place. No need for a lower-level C function containing a + # function body. + + SkipIgnored [set file [This]] + HandleDeclAfterBuild + + # A void result does not make sense for constants. + if {$rtype eq "void"} { + error "Constants cannot be of type \"void\"" + } + + lassign [BeginCommand public $name $rtype $rvalue] ns cns name cname + set traceref ns_$cns$cname + set wname tcl_$cns$cname + set cname c_$cns$cname + + # Construct the shim handling the conversion between Tcl and C + # realms. + + set adb [ArgsInprocess {} 1] + + EmitShimHeader $wname + EmitShimVariables $adb $rtype + EmitArgTracing $traceref + EmitWrongArgsCheck $adb + EmitConst $rtype $rvalue + EmitShimFooter $adb $rtype + EndCommand + return +} + +proc ::critcl::CheckForTracing {} { + if {!$v::options(trace)} return + if {[info exists ::critcl::v::__trace__]} return + + package require critcl::cutil + ::critcl::cutil::tracer on + set ::critcl::v::__trace__ marker ;# See above + return +} + proc ::critcl::cproc {name adefs rtype {body "#"} args} { SkipIgnored [set file [This]] - AbortWhenCalledAfterBuild + HandleDeclAfterBuild + CheckForTracing set acname 0 set passcd 0 set aoffset 0 + set tname "" while {[string match "-*" $args]} { switch -- [set opt [lindex $args 0]] { -cname { set acname [lindex $args 1] } -pass-cdata { set passcd [lindex $args 1] } -arg-offset { set aoffset [lindex $args 1] } + -tracename { set tname [lindex $args 1] } default { error "Unknown option $opt, expected one of -cname, or -pass-cdata" } @@ -591,17 +1125,8 @@ set args [lrange $args 2 end] } - switch -regexp -- [join [argoptional $adefs] {}] { - ^0*$ - - ^0*1+0*$ { - # no optional arguments, or a single optional block at the - # beginning, middle, or end of the argument list is what - # we are able to handle. - } - default { - error "Unable to handle multiple segments of optional arguments" - } - } + incr aoffset ; # always include the command name. + set adb [ArgsInprocess $adefs $aoffset] if {$acname} { BeginCommand static $name $adefs $rtype $body @@ -609,22 +1134,30 @@ set cns {} set wname $name set cname c_$name + if {$tname ne {}} { + set traceref \"$tname\" + } else { + set traceref \"$name\" + } } else { lassign [BeginCommand public $name $adefs $rtype $body] ns cns name cname - set wname tcl_$cns$cname - set cname c_$cns$cname + set traceref ns_$cns$cname + set wname tcl_$cns$cname + set cname c_$cns$cname } - set names [argnames $adefs] - set cargs [argcsignature $adefs] - set cnames [argcnames $adefs] + set names [dict get $adb names] + set cargs [dict get $adb csignature] + set cnames [dict get $adb cnames] if {$passcd} { set cargs [linsert $cargs 0 {ClientData clientdata}] set cnames [linsert $cnames 0 cd] } - Emit [join [argsupport $adefs] \n] + # Support code for argument conversions (i.e. structures, helper + # functions, etc. ...) + EmitSupport $adb # Emit either the low-level function, or, if it wasn't defined # here, a reference to the shim we can use. @@ -647,19 +1180,24 @@ # realms. EmitShimHeader $wname - EmitShimVariables $adefs $rtype - EmitWrongArgsCheck $adefs $aoffset - EmitArgumentConversion $adefs $aoffset + EmitShimVariables $adb $rtype + EmitArgTracing $traceref + EmitWrongArgsCheck $adb + Emit [dict get $adb aconv] EmitCall $cname $cnames $rtype - EmitShimFooter $rtype + EmitShimFooter $adb $rtype EndCommand return } proc ::critcl::cinit {text edecls} { set file [SkipIgnored [set file [This]]] - AbortWhenCalledAfterBuild + HandleDeclAfterBuild + CInitCore $file $text $edecls + return +} +proc ::critcl::CInitCore {file text edecls} { set digesta [UUID.extend $file .cinit.f $text] set digestb [UUID.extend $file .cinit.e $edecls] @@ -739,6 +1277,9 @@ proc ::critcl::at::get* {} { variable where + if {!$::critcl::v::options(lines)} { + return {} + } if {![info exists where]} { return -code error "No location defined" } @@ -842,12 +1383,33 @@ return $slot } +proc ::critcl::include {path args} { + # Include headers or other C files into the current code. + set args [linsert $args 0 $path] + msg -nonewline " (include <[join $args ">) (include <"]>)" + ccode "#include <[join $args ">\n#include <"]>" +} + +proc ::critcl::make {path contents} { + # Generate a header or other C file for pickup by other parts of + # the current package. Stored in the cache dir, making it local. + file mkdir [cache] + set cname [file join [cache] $path] + + set c [open $cname.[pid] w] + puts -nonewline $c $contents\n\n + close $c + file rename -force $cname.[pid] $cname + + return $path +} + proc ::critcl::source {path} { # Source a critcl file in the context of the current file, # i.e. [This]. Enables the factorization of a large critcl # file into smaller, easier to read pieces. SkipIgnored [set file [This]] - AbortWhenCalledAfterBuild + HandleDeclAfterBuild msg -nonewline " (importing $path)" @@ -900,56 +1462,67 @@ proc ::critcl::cheaders {args} { SkipIgnored [This] - AbortWhenCalledAfterBuild + HandleDeclAfterBuild return [SetParam cheaders $args] } proc ::critcl::csources {args} { SkipIgnored [This] - AbortWhenCalledAfterBuild - return [SetParam csources $args 1 1] + HandleDeclAfterBuild + return [SetParam csources $args 1 1 1] } proc ::critcl::clibraries {args} { SkipIgnored [This] - AbortWhenCalledAfterBuild + HandleDeclAfterBuild return [SetParam clibraries $args] } proc ::critcl::cobjects {args} { SkipIgnored [This] - AbortWhenCalledAfterBuild + HandleDeclAfterBuild return [SetParam cobjects $args] } proc ::critcl::tsources {args} { set file [SkipIgnored [This]] - AbortWhenCalledAfterBuild + HandleDeclAfterBuild # This, 'license', 'meta?' and 'meta' are the only places where we # are not extending the UUID. Because the companion Tcl sources # (count, order, and content) have no bearing on the binary at # all. InitializeFile $file + set dfiles {} dict update v::code($file) config c { foreach f $args { foreach e [Expand $file $f] { dict lappend c tsources $e - ScanDependencies $file $e + lappend dfiles $e } } } + # Attention: The actual scanning is done outside of the `dict + # update`, because it makes changes to the dictionary which would + # be revert on exiting the update. + foreach e $dfiles { + ScanDependencies $file $e + } return } proc ::critcl::cflags {args} { set file [SkipIgnored [This]] - AbortWhenCalledAfterBuild + HandleDeclAfterBuild if {![llength $args]} return + CFlagsCore $file $args + return +} - UUID.extend $file .cflags $args +proc ::critcl::CFlagsCore {file flags} { + UUID.extend $file .cflags $flags dict update v::code($file) config c { - foreach flag $args { + foreach flag $flags { dict lappend c cflags $flag } } @@ -958,7 +1531,7 @@ proc ::critcl::ldflags {args} { set file [SkipIgnored [This]] - AbortWhenCalledAfterBuild + HandleDeclAfterBuild if {![llength $args]} return UUID.extend $file .ldflags $args @@ -975,7 +1548,7 @@ proc ::critcl::framework {args} { SkipIgnored [This] - AbortWhenCalledAfterBuild + HandleDeclAfterBuild # Check if we are building for OSX and ignore the command if we # are not. Our usage of "actualtarget" means that we allow for a @@ -996,7 +1569,7 @@ proc ::critcl::tcl {version} { set file [SkipIgnored [This]] - AbortWhenCalledAfterBuild + HandleDeclAfterBuild UUID.extend $file .mintcl $version dict set v::code($file) config mintcl $version @@ -1011,7 +1584,7 @@ proc ::critcl::tk {} { set file [SkipIgnored [This]] - AbortWhenCalledAfterBuild + HandleDeclAfterBuild UUID.extend $file .tk 1 dict set v::code($file) config tk 1 @@ -1028,7 +1601,7 @@ # redundant when TIP #239 is widely available proc ::critcl::preload {args} { set file [SkipIgnored [This]] - AbortWhenCalledAfterBuild + HandleDeclAfterBuild if {![llength $args]} return UUID.extend $file .preload $args @@ -1042,7 +1615,7 @@ proc ::critcl::license {who args} { set file [SkipIgnored [This]] - AbortWhenCalledAfterBuild + HandleDeclAfterBuild set who [string trim $who] if {$who ne ""} { @@ -1089,7 +1662,7 @@ proc ::critcl::description {text} { set file [SkipIgnored [This]] - AbortWhenCalledAfterBuild + HandleDeclAfterBuild InitializeFile $file ImetaSet $file description [Text2Words $text] @@ -1098,7 +1671,7 @@ proc ::critcl::summary {text} { set file [SkipIgnored [This]] - AbortWhenCalledAfterBuild + HandleDeclAfterBuild InitializeFile $file ImetaSet $file summary [Text2Words $text] @@ -1107,7 +1680,7 @@ proc ::critcl::subject {args} { set file [SkipIgnored [This]] - AbortWhenCalledAfterBuild + HandleDeclAfterBuild InitializeFile $file ImetaAdd $file subject $args @@ -1116,7 +1689,7 @@ proc ::critcl::meta {key args} { set file [SkipIgnored [This]] - AbortWhenCalledAfterBuild + HandleDeclAfterBuild # This, 'meta?', 'license', and 'tsources' are the only places # where we are not extending the UUID. Because the meta data has @@ -1133,7 +1706,7 @@ proc ::critcl::meta? {key} { set file [SkipIgnored [This]] - AbortWhenCalledAfterBuild + HandleDeclAfterBuild # This, 'meta', 'license', and 'tsources' are the only places # where we are not extending the UUID. Because the meta data has @@ -1163,7 +1736,7 @@ } } } - #puts |||$key|+|[dict get $v::code($file) config package $key]| + #puts XXX|$file||$key|+|[dict get $v::code($file) config package $key]| return } @@ -1203,6 +1776,24 @@ set result [dict merge $result [dict get $v::code($file) config package]] } + # A few keys need a cleanup, i.e. removal of duplicates, and the like + catch { + dict set result require [lsort -dict -unique [dict get $result require]] + } + catch { + dict set result build::require [lsort -dict -unique [dict get $result build::require]] + } + catch { + dict set result platform [lindex [dict get $result platform] 0] + } + catch { + dict set result generated::by [lrange [dict get $result generated::by] 0 1] + } + catch { + dict set result generated::date [lindex [dict get $result generated::by] 0] + } + + #array set ___M $result ; parray ___M ; unset ___M return $result } @@ -1211,7 +1802,7 @@ proc ::critcl::userconfig {cmd args} { set file [SkipIgnored [This]] - AbortWhenCalledAfterBuild + HandleDeclAfterBuild InitializeFile $file if {![llength [info commands ::critcl::UC$cmd]]} { @@ -1316,7 +1907,7 @@ proc ::critcl::api {cmd args} { set file [SkipIgnored [This]] - AbortWhenCalledAfterBuild + HandleDeclAfterBuild if {![llength [info commands ::critcl::API$cmd]]} { return -code error "Unknown method \"$cmd\"" @@ -1478,10 +2069,10 @@ #include <$cname/${cname}Decls.h> }] append prefix \n$import - ccode $import + CCodeCore $file $import # TODO :: DOCUMENT environment of the cinit code. - cinit [subst -nocommands { + CInitCore $file [subst -nocommands { if (!${capname}_InitStubs (ip, "$iversion", 0)) { return TCL_ERROR; } @@ -1522,7 +2113,7 @@ #include <$cname/${cname}Decls.h> }] append prefix \n$import - ccode $import + CCodeCore $file $import # Generate the necessary header files. @@ -1533,7 +2124,7 @@ if {[dict exists $v::code($file) config api_ehdrs]} { append sdecls "\n" - file mkdir $v::cache/$cname + file mkdir [cache]/$cname foreach hdr [dict get $v::code($file) config api_ehdrs] { append sdecls "\#include \"[file tail $hdr]\"\n" } @@ -1541,9 +2132,9 @@ if {[dict exists $v::code($file) config api_hdrs]} { append sdecls "\n" - file mkdir $v::cache/$cname + file mkdir [cache]/$cname foreach hdr [dict get $v::code($file) config api_hdrs] { - Copy $hdr $v::cache/$cname + Copy $hdr [cache]/$cname append sdecls "\#include \"[file tail $hdr]\"\n" } } @@ -1583,7 +2174,7 @@ } append sdecls "\n" append sdecls [stubs::gen::header::gen $T $cname] - } + } append sdecls "\#endif /* ${cname}_DECLS_H */\n" @@ -1609,11 +2200,11 @@ WriteCache $cname/${cname}.decls $thedecls dict update v::code($file) result r { - dict lappend r apiheader [file join $v::cache $cname] + dict lappend r apiheader [file join [cache] $cname] } - cinit $sinitrun $sinitstatic - cflags -DBUILD_$cname + CInitCore $file $sinitrun $sinitstatic + CFlagsCore $file [list -DBUILD_$cname] return $prefix } @@ -1623,7 +2214,7 @@ proc ::critcl::check {args} { set file [SkipIgnored [This] 0] - AbortWhenCalledAfterBuild + HandleDeclAfterBuild switch -exact -- [llength $args] { 1 { @@ -1663,7 +2254,7 @@ proc ::critcl::checklink {args} { set file [SkipIgnored [This] 0] - AbortWhenCalledAfterBuild + HandleDeclAfterBuild switch -exact -- [llength $args] { 1 { @@ -1702,7 +2293,7 @@ return 0 } - set out [file join $v::cache a_[pid].out] + set out [file join [cache] a_[pid].out] set cmdline [getconfigvalue link] if {$option::debug_symbols} { @@ -1729,13 +2320,13 @@ proc ::critcl::compiled {} { SkipIgnored [This] 1 - AbortWhenCalledAfterBuild + HandleDeclAfterBuild return 0 } proc ::critcl::compiling {} { SkipIgnored [This] 0 - AbortWhenCalledAfterBuild + HandleDeclAfterBuild # Check that we can indeed run a compiler # Should only need to do this if we have to compile the code? if {[auto_execok [lindex [getconfigvalue compile] 0]] eq ""} { @@ -1925,7 +2516,7 @@ # PLATFORM. # (4c) PLATFORM copy PARENT... - Copies the currently defined # configuration variables and - # values to the settings for + # values to the settings for # this platform. # (5.) VAR VALUE............... - Default configuration # variable, and value. @@ -2081,7 +2672,7 @@ lappend out "Config: $plat (built on $gen)" } lappend out "Origin: $configfile" - lappend out " [format %-15s cache] [critcl::cache]" + lappend out " [format %-15s cache] [cache]" foreach var [lsort $v::configvars] { set val [getconfigvalue $var] set line " [format %-15s $var]" @@ -2096,7 +2687,7 @@ } lappend out $line } - # Tcl variables + # Tcl variables - Combined LengthLongestWord (all), and filtering set vars [list] set max 0 foreach idx [array names v::toolchain $v::targetplatform,*] { @@ -2117,7 +2708,7 @@ # values - e.g. "Windows NT" set val [lindex $val 0] } - lappend out " [format %-${max}s $var] $val" + lappend out " [PadRight $max $var] $val" } } set out [join $out \n] @@ -2193,9 +2784,19 @@ set c::sharedlibext [info sharedlibextension] } - cache [file join ~ .critcl $v::targetplatform] + # The following definition of the cache directory is only relevant + # for mode "compile & run". The critcl application handling the + # package mode places the cache in a process-specific location + # without care about platforms. For here this means that we can + # ignore both cross-compilation, and the user choosing a target + # for us, as neither happens nor works for "compile & run". We can + # assume that build and target platforms will be the same, be the + # current platform, and we can make a simple choice for the + # directory. + + cache [file join ~ .critcl [platform::identify]] - # set any Tcl variables + # Initialize Tcl variables based on the chosen tooling foreach idx [array names v::toolchain $v::targetplatform,*] { set var [lindex [split $idx ,] 1] if {![info exists c::$var]} { @@ -2323,6 +2924,11 @@ return } +proc ::critcl::fastuuid {} { + set v::uuidcounter 1 ;# Activates it. + return +} + proc ::critcl::cbuild {file {load 1}} { if {[info exists v::code($file,failed)] && !$load} { set v::buildforpackage 0 @@ -2352,6 +2958,9 @@ dict set v::code($file) result tsources [GetParam $file tsources] dict set v::code($file) result mintcl [MinTclVersion $file] + set emsg {} + set msgs {} + if {$v::options(force) || ![file exists $shlib]} { LogOpen $file set base [BaseOf $file] @@ -2362,7 +2971,7 @@ # Generate the main C file CollectEmbeddedSources $file $base.c $object $initname $placestubs - # Set the marker for critcl::done and its user, AbortWhenCalledAfterBuild. + # Set the marker for critcl::done and its user, HandleDeclAfterBuild. dict set v::code($file) result closed mark # Compile main file @@ -2395,16 +3004,17 @@ Link $file } - set msgs [LogClose] + lassign [LogClose] msgs emsg - dict set v::code($file) result warnings [CheckForWarnings $msgs] + dict set v::code($file) result warnings [CheckForWarnings $emsg] } + dict set v::code($file) result log $msgs + dict set v::code($file) result exl $emsg + if {$v::failed} { if {!$buildforpackage} { print stderr "$msgs\ncritcl build failed ($file)" - } else { - dict set v::code($file) result log $msgs } } elseif {$load && !$buildforpackage} { Load $file @@ -2772,7 +3382,9 @@ ImetaAdd $dfile $k $vlist if {$k ne "require"} continue - msg -nonewline " ($k [join $vlist {}])" + # vlist = package list, each element a package name, + # and optional version. + msg -nonewline " ([file tail $file]: require [join [lsort -dict -unique $vlist] {, }])" } # The above information also goes into the teapot meta data of @@ -2784,7 +3396,7 @@ return } -proc critcl::ScanCore {lines theconfig} { +proc ::critcl::ScanCore {lines theconfig} { # config = dictionary # - => mode (ok, warn, sub) # Unlisted commands are ignored. @@ -2993,7 +3605,7 @@ variable ::critcl::scan::capture dict set capture org $who - print "\tOrganization: $who" + ::critcl::print "\tOrganization: $who" # Meta data. set elicense [::critcl::LicenseText $args] @@ -3090,7 +3702,6 @@ ## Implementation -- Internals - cproc conversion helpers. proc ::critcl::EmitShimHeader {wname} { - # Function head set ca "(ClientData cd, Tcl_Interp *interp, int oc, Tcl_Obj *CONST ov\[])" Emitln @@ -3100,75 +3711,63 @@ return } -proc ::critcl::EmitShimVariables {adefs rtype} { - set opt 0 - foreach d [argvardecls $adefs] o [argoptional $adefs] { +proc ::critcl::EmitShimVariables {adb rtype} { + foreach d [dict get $adb vardecls] { Emitln " $d" - if {$o} {set opt 1} } - if {$opt} { Emitln " int idx_;" } + if {[dict get $adb hasoptional]} { + Emitln " int idx_;" + Emitln " int argc_;" + } # Result variable, source for the C -> Tcl conversion. if {$rtype ne "void"} { Emit " [ResultCType $rtype] rv;" } return } -proc ::critcl::EmitWrongArgsCheck {adefs offset} { +proc ::critcl::EmitArgTracing {fun} { + if {!$v::options(trace)} return + Emitln "\n critcl_trace_cmd_args ($fun, oc, ov);" + return +} + +proc ::critcl::EmitWrongArgsCheck {adb} { # Code checking for the correct count of arguments, and generating # the proper error if not. - # A 1st argument matching "Tcl_Interp*" does not count as a user - # visible command argument. - if {[lindex $adefs 0] eq "Tcl_Interp*"} { - set adefs [lrange $adefs 2 end] - } + set wac [dict get $adb wacondition] + if {$wac eq {}} return - set min 0 ; # count all non-optional argument. min required. - set max 0 ; # count all arguments. max allowed. - set names {} - foreach {t a} $adefs { - incr max - if {[llength $a] == 1} { - incr min - lappend names $a - } else { - lappend names ?[lindex $a 0]? - } - } - - incr min - incr max - incr min $offset - incr max $offset + # Have a check, put the pieces together. - set keep 1 - incr keep $offset + set offset [dict get $adb skip] + set tsig [dict get $adb tsignature] + set min [dict get $adb min] + set max [dict get $adb max] - set names [join $names { }] - if {$names eq {}} { - set names NULL - } else { - set names \"$names\" + incr min $offset + if {$max != Inf} { + incr max $offset } + lappend map MIN_ARGS $min + lappend map MAX_ARGS $max + set wac [string map $map $wac] + Emitln "" - if {$min == $max} { - Emitln " if (oc != $min) \{" - } else { - Emitln " if ((oc < $min) || ($max < oc)) \{" - } - Emitln " Tcl_WrongNumArgs(interp, $keep, ov, $names);" - Emitln " return TCL_ERROR;" + Emitln " if ($wac) \{" + Emitln " Tcl_WrongNumArgs(interp, $offset, ov, $tsig);" + Emitln [TraceReturns "wrong-arg-num check" " return TCL_ERROR;"] Emitln " \}" Emitln "" return } -proc ::critcl::EmitArgumentConversion {adefs offset} { - incr offset - foreach c [argconversion $adefs $offset] { - Emitln $c - } +proc ::critcl::EmitSupport {adb} { + set s [dict get $adb support] + if {![llength $s]} return + if {[join $s {}] eq {}} return + Emit [join $s \n]\n return } @@ -3183,12 +3782,56 @@ return } -proc ::critcl::EmitShimFooter {rtype} { +proc ::critcl::EmitConst {rtype rvalue} { + # Assign the constant directly to the shim's result variable. + + Emitln " /* Const - - -- --- ----- -------- */" + Emit " " + if {$rtype ne "void"} { Emit "rv = " } + Emitln "${rvalue};" + Emitln + return +} + +proc ::critcl::TraceReturns {label code} { + if {!$v::options(trace)} { + return $code + } + + # Inject tracing into the 'return's. + regsub -all \ + {return[[:space:]]*([^;]*);} $code \ + {return critcl_trace_cmd_result (\1, interp);} newcode + if {[string match {*return *} $code] && ($newcode eq $code)} { + error "Failed to inject tracing code into $label" + } + return $newcode +} + +proc ::critcl::EmitShimFooter {adb rtype} { + # Run release code for arguments which allocated temp memory. + set arelease [dict get $adb arelease] + if {[llength $arelease]} { + Emit "[join $arelease "\n "]\n" + } + # Convert the returned low-level result from C to Tcl, if required. # Return a standard status, if required. - set code [ResultConversion $rtype] - if {$code ne {}} { Emitln $code } + set code [Deline [ResultConversion $rtype]] + if {$code ne {}} { + set code [TraceReturns "\"$rtype\" result" $code] + Emitln " /* ($rtype return) - - -- --- ----- -------- */" + Emitln $code + } else { + if {$v::options(trace)} { + Emitln " critcl_trace_header (1, 0, 0);" + Emitln " critcl_trace_printf (1, \"RETURN (void)\");" + Emitln " critcl_trace_closer (1);" + Emitln " critcl_trace_pop();" + Emitln " return;" + } + } Emitln \} return } @@ -3198,33 +3841,38 @@ return {} } +proc ::critcl::ArgumentRelease {type} { + if {[info exists v::acrel($type)]} { return $v::acrel($type) } + return {} +} + proc ::critcl::ArgumentCType {type} { if {[info exists v::actype($type)]} { return $v::actype($type) } - return -code error "Unknown argument type $type" + return -code error "Unknown argument type \"$type\"" } proc ::critcl::ArgumentCTypeB {type} { if {[info exists v::actypeb($type)]} { return $v::actypeb($type) } - return -code error "Unknown argument type $type" + return -code error "Unknown argument type \"$type\"" } proc ::critcl::ArgumentConversion {type} { if {[info exists v::aconv($type)]} { return $v::aconv($type) } - return -code error "Unknown argument type $type" + return -code error "Unknown argument type \"$type\"" } proc ::critcl::ResultCType {type} { if {[info exists v::rctype($type)]} { return $v::rctype($type) } - return -code error "Unknown result type $type" + return -code error "Unknown result type \"$type\"" } proc ::critcl::ResultConversion {type} { if {[info exists v::rconv($type)]} { return $v::rconv($type) } - return -code error "Unknown result type $type" + return -code error "Unknown result type \"$type\"" } # # ## ### ##### ######## ############# ##################### @@ -3239,7 +3887,7 @@ } } -proc ::critcl::SetParam {type values {expand 1} {uuid 0}} { +proc ::critcl::SetParam {type values {expand 1} {uuid 0} {unique 0}} { set file [This] if {![llength $values]} return @@ -3249,22 +3897,30 @@ # Process the list of flags, treat non-option arguments as # glob patterns and expand them to a set of files, stored as # absolute paths. + + set have {} + if {$unique && [dict exists $v::code($file) config $type]} { + foreach v [dict get $v::code($file) config $type] { + dict set have $v . + } + } + set tmp {} foreach v $values { if {[string match "-*" $v]} { lappend tmp $v } else { if {$expand} { - if {$uuid} { - foreach f [Expand $file $v] { - lappend tmp $f - UUID.extend $file .$type.$f [Cat $f] - } - } else { - lappendlist tmp [Expand $file $v] + foreach f [Expand $file $v] { + if {$unique && [dict exists $have $f]} continue + lappend tmp $f + if {$unique} { dict set have $f . } + if {$uuid} { UUID.extend $file .$type.$f [Cat $f] } } } else { + if {$unique && [dict exists $have $v]} continue lappend tmp $v + if {$unique} { dict set have $v . } } } } @@ -3469,7 +4125,7 @@ #puts "XXX-WHERE-($leadoffset $level $file)" #set ::errorInfo {} if {[catch { - #SHOWFRAMES $level 0 + #::critcl::msg [SHOWFRAMES $level 0] array set loc [info frame $level] #puts XXX-TYPE-$loc(type) }]} { @@ -3542,19 +4198,20 @@ } proc ::critcl::at::SHOWFRAMES {level {all 1}} { + set lines {} set n [info frame] set i 0 set id 1 while {$n} { - ::critcl::msg "[expr {$level == $id ? "**" : " "}] frame [format %3d $id]: [info frame $i]" + lappend lines "[expr {$level == $id ? "**" : " "}] frame [format %3d $id]: [info frame $i]" ::incr i -1 ::incr id -1 ::incr n -1 if {($level > $id) && !$all} break } - return + return [join $lines \n] } - + # # ## ### ##### ######## ############# ##################### proc ::critcl::CollectEmbeddedSources {file destination libfile ininame placestubs} { @@ -3593,16 +4250,16 @@ # itself, build in mode "compile & run". set stubs [TclDecls $file] set platstubs [TclPlatDecls $file] - puts -nonewline $fd [subst [Cat [Template stubs.c]]] - # ^=> mintcl, stubs, platstubs + puts -nonewline $fd [Deline [subst [Cat [Template stubs.c]]]] + # ^=> mintcl, stubs, platstubs } else { # Declarations only, for linking, in the sub-packages. - puts -nonewline $fd [subst [Cat [Template stubs_e.c]]] - # ^=> mintcl + puts -nonewline $fd [Deline [subst [Cat [Template stubs_e.c]]]] + # ^=> mintcl } if {[UsingTk $file]} { - SetupTkStubs $fd + SetupTkStubs $fd $mintcl } # Initialization boilerplate. This ends in the middle of the @@ -3628,7 +4285,9 @@ # Take the names collected earlier and register them as Tcl # commands. - foreach name [lsort [GetParam $file functions]] { + set names [lsort [GetParam $file functions]] + set max [LengthLongestWord $names] + foreach name $names { if {[info exists v::clientdata($name)]} { set cd $v::clientdata($name) } else { @@ -3639,7 +4298,7 @@ } else { set dp 0 } - puts $fd " Tcl_CreateObjCommand(ip, ns_$name, tcl_$name, $cd, $dp);" + puts $fd " Tcl_CreateObjCommand(interp, [PadRight [expr {$max+4}] ns_$name,] [PadRight [expr {$max+5}] tcl_$name,] $cd, $dp);" } # Complete the trailer and be done. @@ -3675,8 +4334,8 @@ # The critcl package is wrapped. Copy the relevant headers out # to disk and change the include path appropriately. - Copy $path $v::cache - set path [file join $v::cache $hdrs] + Copy $path [cache] + set path [file join [cache] $hdrs] } return [list $c::include$path] @@ -3709,7 +4368,7 @@ } # Result cache. - lappend paths $v::cache + lappend paths [cache] # critcl::cheaders foreach flag [GetParam $file cheaders] { @@ -3822,7 +4481,7 @@ # compile and link the preload support, if necessary, i.e. not yet # done. - set shlib [file join $v::cache preload[getconfigvalue sharedlibext]] + set shlib [file join [cache] preload[getconfigvalue sharedlibext]] if {[file exists $shlib]} return # Operate like TclIncludes. Use the template file directly, if @@ -3831,14 +4490,14 @@ set src [Template preload.c] if {[file system $src] ne "native"} { - file mkdir $v::cache - file copy -force $src $v::cache - set src [file join $v::cache preload.c] + file mkdir [cache] + file copy -force $src [cache] + set src [file join [cache] preload.c] } # Build the object for the helper package, 'preload' ... - set obj [file join $v::cache preload.o] + set obj [file join [cache] preload.o] Compile $file $src $src $obj # ... and link it. @@ -3928,11 +4587,11 @@ set tail [file tail $src] set srcbase [file rootname $tail] - if {$v::cache ne [file dirname $src]} { + if {[cache] ne [file dirname $src]} { set srcbase [file tail [file dirname $src]]_$srcbase } - return [file join $v::cache ${srcbase}[getconfigvalue object]] + return [file join [cache] ${srcbase}[getconfigvalue object]] } proc ::critcl::CompileResult {object} { @@ -4023,8 +4682,15 @@ return -l:$name } -proc ::critcl::SetupTkStubs {fd} { - puts -nonewline $fd [Cat [Template tkstubs.c]] +proc ::critcl::SetupTkStubs {fd mintcl} { + if {[package vcompare $mintcl 8.6] != 0} { + # Not 8.6. tkStubsPtr and tkIntXlibStubsPtr are not const yet. + set contents [Cat [Template tkstubs_noconst.c]] + } else { + set contents [Cat [Template tkstubs.c]] + } + + puts -nonewline $fd $contents return } @@ -4176,24 +4842,21 @@ # 'compile & run' we now source the companion files directly. foreach t $tsrc { Ignore $t - source $t + ::source $t } return } -proc ::critcl::AbortWhenCalledAfterBuild {} { - if {![done]} return - set cloc {} - if {![catch { - array set loc [info frame -2] - } msg]} { - if {$loc(type) eq "source"} { - set cloc "@$loc(file):$loc(line)" - } else { - set cloc " ([array get loc])" - } - } ;#else { set cloc " ($msg)" } - error "[lindex [info level -1] 0]$cloc: Illegal attempt to define C code in [This] after it was built." +proc ::critcl::HandleDeclAfterBuild {} { + # Hook default, mode "compile & run". Clear existing build results + # for the file, make way for new declarations. + + set fx [This] + if {[info exists v::code($fx)] && + [dict exists $v::code($fx) result]} { + dict unset v::code($fx) result + } + return } # XXX Refactor to avoid duplication of the memoization code. @@ -4291,12 +4954,22 @@ # # ## ### ##### ######## ############# ##################### ## Implementation -- Internals - Access to the log file -proc ::critcl::LogOpen {file} { - file mkdir $v::cache +proc ::critcl::LogFile {} { + file mkdir [cache] + return [file join [cache] [pid].log] +} + +proc ::critcl::LogFileExec {} { + file mkdir [cache] + return [file join [cache] [pid]_exec.log] +} - set v::logfile [file join $v::cache [pid].log] +proc ::critcl::LogOpen {file} { + set v::logfile [LogFile] set v::log [open $v::logfile w] puts $v::log "\n[clock format [clock seconds]] - $file" + # Create secondary file as well, leave empty, may not be used. + close [open ${v::logfile}_ w] return } @@ -4322,11 +4995,14 @@ close $v::log set msgs [Cat $v::logfile] + set emsg [Cat ${v::logfile}_] + AppendCache $v::prefix.log $msgs - file delete -force $v::logfile + file delete -force $v::logfile ${v::logfile}_ unset v::log v::logfile - return $msgs + + return [list $msgs $emsg] } # # ## ### ##### ######## ############# ##################### @@ -4363,7 +5039,7 @@ } set base [file normalize \ - [file join $v::cache ${v::prefix}_[UUID $f]]] + [file join [cache] ${v::prefix}_[UUID $f]]] dict set v::code($f) result base $base return $base @@ -4372,6 +5048,13 @@ # # ## ### ##### ######## ############# ##################### ## Implementation -- Internals - Miscellanea +proc ::critcl::Deline {text} { + if {![config lines]} { + set text [join [GrepV "\#line*" [split $text \n]] \n] + } + return $text +} + proc ::critcl::Separator {} { return "/* [string repeat - 70] */" } @@ -4404,7 +5087,7 @@ } proc ::critcl::WriteCache {name content} { - set dst [file join $v::cache $name] + set dst [file join [cache] $name] file mkdir [file dirname $dst] ;# just in case return [Write [file normalize $dst] $content] } @@ -4417,8 +5100,8 @@ } proc ::critcl::AppendCache {name content} { - file mkdir $v::cache ;# just in case - return [Append [file normalize [file join $v::cache $name]] $content] + file mkdir [cache] ;# just in case + return [Append [file normalize [file join [cache] $name]] $content] } proc ::critcl::Append {path content} { @@ -4479,14 +5162,26 @@ LogCmdline $cmdline # Extend the command, redirect all of its output (stdout and - # stderr) into the current log. - lappend cmdline >&@ $v::log + # stderr) into a temp log. + set elogfile [LogFileExec] + set elog [open $elogfile w] - interp transfer {} $v::log $run + lappend cmdline >&@ $elog + interp transfer {} $elog $run set ok [Exec $cmdline] - interp transfer $run $v::log {} + interp transfer $run $elog {} + close $elog + + # Put the command output into the main log ... + set msgs [Cat $elogfile] + Log $msgs + + # ... as well as into a separate execution log. + Append ${v::logfile}_ $msgs + + file delete -force $elogfile if {$ok} { Log [uplevel 1 [list subst $okmsg]] @@ -4501,7 +5196,7 @@ proc ::critcl::BuildPlatform {} { set platform [::platform::generic] - # Behave like a autoconf generated configure + # Behave like an autoconf generated configure # - $CC (user's choice first) # - gcc, if available. # - cc/cl otherwise (without further check for availability) @@ -4523,12 +5218,12 @@ } } - # The cc may be a full path, through the CC environment variable, - # which is bad for use in the platform code. Use only the last - # element of said path, without extensions (.exe). And it may be - # followed by options too, so look for and strip these off as - # well. This last part assumes that the path of the compiler - # itself doesn't contain spaces. + # The cc may be specified with a full path, through the CC + # environment variable, which cannot be used as is in the platform + # code. Use only the last element of the path, without extensions + # (.exe). And it may be followed by options too, so look for and + # strip these off as well. This last part assumes that the path of + # the compiler itself doesn't contain spaces. regsub {( .*)$} [file tail $cc] {} cc append platform -[file rootname $cc] @@ -4560,14 +5255,14 @@ } proc ::critcl::TclDecls {file} { - return [TclDef $file tclDecls.h tclStubsPtr] + return [TclDef $file tclDecls.h tclStubsPtr {tclStubsPtr }] } proc ::critcl::TclPlatDecls {file} { - return [TclDef $file tclPlatDecls.h tclPlatStubsPtr] + return [TclDef $file tclPlatDecls.h tclPlatStubsPtr tclPlatStubsPtr] } -proc ::critcl::TclDef {file hdr var} { +proc ::critcl::TclDef {file hdr var varlabel} { #puts F|$file set hdr [TclHeader $file $hdr] @@ -4598,7 +5293,7 @@ } set def [string map {extern {}} [lindex $vardecl 0]] - msg " ($var => $def)" + msg " ($varlabel => $def)" return $def } @@ -4611,6 +5306,30 @@ return $r } +proc ::critcl::GrepV {pattern lines} { + set r {} + foreach line $lines { + if {[string match $pattern $line]} continue + lappend r $line + } + return $r +} + +proc ::critcl::PadRight {len w} { + # <=> Left justified + format %-${len}s $w +} + +proc ::critcl::LengthLongestWord {words} { + set max 0 + foreach w $words { + set n [string length $w] + if {$n <= $max} continue + set max $n + } + return $max +} + # # ## ### ##### ######## ############# ##################### ## Initialization @@ -4621,6 +5340,7 @@ variable v::buildplatform [BuildPlatform] variable v::hdrdir [file join $mydir critcl_c] variable v::hdrsavailable + variable v::storageclass [Cat [file join $hdrdir storageclass.c]] # Scan the directory holding the C fragments and our copies of the # Tcl header and determine for which versions of Tcl we actually @@ -4667,6 +5387,10 @@ if (Tcl_GetLongFromObj(interp, @@, &@A) != TCL_OK) return TCL_ERROR; } + argtype wideint { + if (Tcl_GetWideIntFromObj(interp, @@, &@A) != TCL_OK) return TCL_ERROR; + } Tcl_WideInt Tcl_WideInt + argtype double { if (Tcl_GetDoubleFromObj(interp, @@, &@A) != TCL_OK) return TCL_ERROR; } @@ -4682,20 +5406,54 @@ argtype pstring { @A.s = Tcl_GetStringFromObj(@@, &(@A.len)); + @A.o = @@; } critcl_pstring critcl_pstring argtypesupport pstring { typedef struct critcl_pstring { - char* s; - int len; + Tcl_Obj* o; + char* s; + int len; } critcl_pstring; } + argtype list { + if (Tcl_ListObjGetElements (interp, @@, &(@A.c), &(@A.v)) != TCL_OK) return TCL_ERROR; + @A.o = @@; + } critcl_list critcl_list + + argtypesupport list { + typedef struct critcl_list { + Tcl_Obj* o; + Tcl_Obj** v; + int c; + } critcl_list; + } + argtype Tcl_Obj* { @A = @@; } argtype object = Tcl_Obj* + # Predefined variadic type for the special Tcl_Obj*. + # - No actual conversion, nor allocation, copying, release needed. + # - Just point into and reuse the incoming ov[] array. + # This shortcuts the operation of 'MakeVariadicTypeFor'. + + argtype variadic_object { + @A.c = @C; + @A.v = &ov[@I]; + } critcl_variadic_object critcl_variadic_object + + argtypesupport variadic_object { + typedef struct critcl_variadic_object { + int c; + Tcl_Obj* const* v; + } critcl_variadic_object; + } + + argtype variadic_Tcl_Obj* = variadic_object + ## The next set of argument types looks to be very broken. We are ## keeping them for now, but declare them as DEPRECATED. Their ## documentation will be removed in version 3.2, and their @@ -4714,14 +5472,32 @@ /* Raw pointer in binary Tcl value */ @A = (double*) Tcl_GetByteArrayFromObj(@@, NULL); } + + # OLD Raw binary string. Length information is _NOT_ propagated + argtype bytearray { /* Raw binary string. Length information is _NOT_ propagated */ @A = (char*) Tcl_GetByteArrayFromObj(@@, NULL); - Tcl_InvalidateStringRep(@@); } char* char* argtype rawchar = bytearray argtype rawchar* = bytearray + # NEW Raw binary string _with_ length information. + + argtype bytes { + /* Raw binary string _with_ length information */ + @A.s = (char*) Tcl_GetByteArrayFromObj(@@, &(@A.len)); + @A.o = @@; + } critcl_bytes critcl_bytes + + argtypesupport bytes { + typedef struct critcl_bytes { + Tcl_Obj* o; + char* s; + int len; + } critcl_bytes; + } + # Declare the standard result types for cproc. # System still has special case code for: # - void (no rv result variable). @@ -4746,6 +5522,11 @@ return TCL_OK; } + resulttype wideint { + Tcl_SetObjResult(interp, Tcl_NewWideIntObj(rv)); + return TCL_OK; + } Tcl_WideInt + resulttype double { Tcl_SetObjResult(interp, Tcl_NewDoubleObj(rv)); return TCL_OK; @@ -4787,6 +5568,14 @@ } resulttype object = Tcl_Obj* + critcl::resulttype Tcl_Obj*0 { + if (rv == NULL) { return TCL_ERROR; } + Tcl_SetObjResult(interp, rv); + /* No refcount adjustment */ + return TCL_OK; + } Tcl_Obj* + resulttype object0 = Tcl_Obj*0 + rename ::critcl::Initialize {} return } @@ -4834,12 +5623,12 @@ # similar to "target identifier". variable targetconfig ;# Target identifier. The chosen configuration. - variable targetplatform ;# Platform identifier. We generate binaries for there. + variable targetplatform ;# Platform identifier. Type of generated binaries. variable buildplatform ;# Platform identifier. We run here. variable knowntargets {} ;# List of all target identifiers found # in the configuration file last processed by "readconfig". - + variable xtargets ;# Cross-compile targets. This array maps from array set xtargets {} ;# the target identifier to the actual platform # identifier of the target platform in question. If a target identifier @@ -4886,6 +5675,16 @@ # emit #line-directives to help locating # C code in the .tcl in case of compile # warnings and errors. + set options(trace) 0 ;# - Boolean. If set the generator will + # emit code tracing command entry + # and return, for all cprocs and + # ccommands. The latter is done by + # creating a shim function. For + # cprocs their regular shim + # function is used and modified. + # The functionality is based on + # 'critcl::cutil's 'tracer' + # command and C code. # XXX clientdata() per-command (See ccommand). per-file+ccommand better? # XXX delproc() per-command (See ccommand). s.a @@ -4932,34 +5731,7 @@ variable rconv array set rconv {} - variable storageclass { -/* - * These macros are used to control whether functions are being declared for - * import or export. If a function is being declared while it is being built - * to be included in a shared library, then it should have the DLLEXPORT - * storage class. If is being declared for use by a module that is going to - * link against the shared library, then it should have the DLLIMPORT storage - * class. If the symbol is beind declared for a static build or for use from a - * stub library, then the storage class should be empty. - * - * The convention is that a macro called BUILD_xxxx, where xxxx is the name of - * a library we are building, is set on the compile line for sources that are - * to be placed in the library. When this macro is set, the storage class will - * be set to DLLEXPORT. At the end of the header file, the storage class will - * be reset to DLLIMPORT. - */ - -#undef TCL_STORAGE_CLASS -#ifdef BUILD_@cname@ -# define TCL_STORAGE_CLASS DLLEXPORT -#else -# ifdef USE_@up@_STUBS -# define TCL_STORAGE_CLASS -# else -# define TCL_STORAGE_CLASS DLLIMPORT -# endif -#endif - } + variable storageclass {} ;# See Initialize for setup. variable code ;# This array collects all code snippets and # data about them. @@ -5042,6 +5814,9 @@ variable failed 0 ;# Build status. Used by "Status*" variable err "" ;# and "Exec*". Build error text. + variable uuidcounter 0 ;# Counter for uuid generation in package mode. + ;# md5 is bypassed when used. + variable buildforpackage 0 ;# Boolean flag controlling # cbuild's behaviour. Named after # the mode 'generate package'. @@ -5135,7 +5910,8 @@ at cache ccode ccommand cdata cdefines cflags cheaders \ check cinit clibraries compiled compiling config cproc \ csources debug done failed framework ldflags platform \ - tk tsources preload license load tcl api userconfig meta + tk tsources preload license load tcl api userconfig meta \ + source include make # This is exported for critcl::app to pick up when generating the # dummy commands in the runtime support of a generated package. namespace export Ignore diff -Nru critcl-3.1.9/lib/critcl/pkgIndex.tcl critcl-3.1.17+dfsg/lib/critcl/pkgIndex.tcl --- critcl-3.1.9/lib/critcl/pkgIndex.tcl 2013-05-10 05:57:04.000000000 +0000 +++ critcl-3.1.17+dfsg/lib/critcl/pkgIndex.tcl 2017-10-14 02:48:11.000000000 +0000 @@ -1 +1 @@ -package ifneeded critcl 3.1.8 [list source [file join $dir critcl.tcl]] +package ifneeded critcl 3.1.17 [list source [file join $dir critcl.tcl]] diff -Nru critcl-3.1.9/lib/critcl-bitmap/bitmap.tcl critcl-3.1.17+dfsg/lib/critcl-bitmap/bitmap.tcl --- critcl-3.1.9/lib/critcl-bitmap/bitmap.tcl 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/lib/critcl-bitmap/bitmap.tcl 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,227 @@ +## -*- tcl -*- +# # ## ### ##### ######## ############# ##################### +# Pragmas for MetaData Scanner. +# n/a + +# CriTcl Utility Package for bitmap en- and decoder. +# Based on i-assoc. + +package provide critcl::bitmap 1.0.1 + +# # ## ### ##### ######## ############# ##################### +## Requirements. + +package require Tcl 8.4 ; # Min supported version. +package require critcl 3.1.11 ; # make, include -- dict portability +package require critcl::iassoc + +namespace eval ::critcl::bitmap {} + +# # ## ### ##### ######## ############# ##################### +## Implementation -- API: Embed C Code + +proc critcl::bitmap::def {name dict {exclusions {}}} { + # dict: Tcl symbolic name -> (C bit-mask (1)) + # + # (Ad 1) Can be numeric, or symbolic, as long as it is a C int + # expression in the end. + # + # (Ad exclusions) + # Excluded bit-masks cannot be converted back to Tcl + # symbols.THese are usually masks with multiple bits + # set. Conversion back delivers the individual elements + # instead of the combined mask. + # + # If no exclusions are specified the generated code is + # simpler, i.e. not containing anything for dealing with + # exclusions at runtime. + + # For the C level opt array we want the elements sorted alphabetically. + set symbols [lsort -dict [dict keys $dict]] + set i 0 + foreach s $symbols { + set id($s) $i + incr i + } + set last $i + + set hasexcl [llength $exclusions] + set excl {} + foreach e $exclusions { + dict set excl $e . + } + + dict for {sym mask} $dict { + set receivable [expr {![dict exists $excl $mask]}] + + set map [list @ID@ $id($sym) @SYM@ $sym @MASK@ $mask @RECV@ $receivable] + + if {$hasexcl} { + append init \n[critcl::at::here!][string map $map { + data->c [@ID@] = "@SYM@"; + data->mask [@ID@] = @MASK@; + data->recv [@ID@] = @RECV@; + data->tcl [@ID@] = Tcl_NewStringObj ("@SYM@", -1); + Tcl_IncrRefCount (data->tcl [@ID@]); + }] + } else { + append init \n[critcl::at::here!][string map $map { + data->c [@ID@] = "@SYM@"; + data->mask [@ID@] = @MASK@; + data->tcl [@ID@] = Tcl_NewStringObj ("@SYM@", -1); + Tcl_IncrRefCount (data->tcl [@ID@]); + }] + } + + append final \n[critcl::at::here!][string map $map { + Tcl_DecrRefCount (data->tcl [@ID@]); + }] + } + append init \n " data->c \[$last\] = NULL;" + + lappend map @NAME@ $name + lappend map @UNAME@ [string toupper $name] + lappend map @LAST@ $last + + # I. Generate a header file for inclusion by other parts of the + # package, i.e. csources. Include the header here as well, for + # the following blocks of code. + # + # Declaration of the en- and decoder functions. + + critcl::include [critcl::make ${name}.h \n[critcl::at::here!][string map $map { + #ifndef @NAME@_HEADER + #define @NAME@_HEADER + + /* Encode a flag list into the corresponding bitset */ + extern int + @NAME@_encode (Tcl_Interp* interp, + Tcl_Obj* flags, + int* result); + + /* Decode a bitset into the corresponding flag list */ + extern Tcl_Obj* + @NAME@_decode (Tcl_Interp* interp, + int mask); + + #endif + }]] + + # II: Generate the interp association holding the various + # conversion maps. + + if {$hasexcl} { + critcl::iassoc def ${name}_iassoc {} \n[critcl::at::here!][string map $map { + const char* c [@LAST@+1]; /* Bit name, C string */ + Tcl_Obj* tcl [@LAST@]; /* Bit name, Tcl_Obj*, sharable */ + int mask [@LAST@]; /* Bit mask */ + int recv [@LAST@]; /* Flag, true for receivable event */ + }] $init $final + } else { + critcl::iassoc def ${name}_iassoc {} \n[critcl::at::here!][string map $map { + const char* c [@LAST@+1]; /* Bit name, C string */ + Tcl_Obj* tcl [@LAST@]; /* Bit name, Tcl_Obj*, sharable */ + int mask [@LAST@]; /* Bit mask */ + }] $init $final + } + + # III: Generate encoder function: Conversion of list of flag names + # into corresponding bitset. + + critcl::ccode \n[critcl::at::here!][string map $map { + int + @NAME@_encode (Tcl_Interp* interp, + Tcl_Obj* flags, + int* result) + { + @NAME@_iassoc_data context = @NAME@_iassoc (interp); + int mask, lc, i, id; + Tcl_Obj** lv; + + if (Tcl_ListObjGetElements (interp, flags, &lc, &lv) != TCL_OK) { + return TCL_ERROR; + } + + mask = 0; + for (i = 0; i < lc; i++) { + if (Tcl_GetIndexFromObj (interp, lv[i], context->c, "@NAME@", 0, + &id) != TCL_OK) { + Tcl_SetErrorCode (interp, "@UNAME@", "FLAG", NULL); + return TCL_ERROR; + } + mask |= context->mask [id]; + } + + *result = mask; + return TCL_OK; + } + }] + + # IV: Generate decoder function: Convert bitset into the + # corresponding list of flag names. + + if {$hasexcl} { + critcl::ccode \n[critcl::at::here!][string map $map { + Tcl_Obj* + @NAME@_decode (Tcl_Interp* interp, int mask) + { + int i; + @NAME@_iassoc_data context = @NAME@_iassoc (interp); + Tcl_Obj* res = Tcl_NewListObj (0, NULL); + + for (i = 0; i < @LAST@; i++) { + if (!context->recv[i]) continue; + if (!(mask & context->mask[i])) continue; + (void) Tcl_ListObjAppendElement (interp, res, context->tcl [i]); + } + return res; + } + }] + } else { + critcl::ccode \n[critcl::at::here!][string map $map { + Tcl_Obj* + @NAME@_decode (Tcl_Interp* interp, int mask) + { + int i; + @NAME@_iassoc_data context = @NAME@_iassoc (interp); + Tcl_Obj* res = Tcl_NewListObj (0, NULL); + + for (i = 0; i < @LAST@; i++) { + if (!(mask & context->mask[i])) continue; + (void) Tcl_ListObjAppendElement (interp, res, context->tcl [i]); + } + return res; + } + }] + } + + # V. Define convenient argument- and result-type definitions + # wrapping the de- and encoder functions for use by cprocs. + + critcl::argtype $name \n[critcl::at::here!][string map $map { + if (@NAME@_encode (interp, @@, &@A) != TCL_OK) return TCL_ERROR; + }] int int + + critcl::resulttype $name \n[critcl::at::here!][string map $map { + /* @NAME@_decode result is 0-refcount */ + Tcl_SetObjResult (interp, @NAME@_decode (interp, rv)); + return TCL_OK; + }] int +} + +# # ## ### ##### ######## ############# ##################### +## Export API + +namespace eval ::critcl::bitmap { + namespace export def + catch { namespace ensemble create } +} + +namespace eval ::critcl { + namespace export bitmap + catch { namespace ensemble create } +} + +# # ## ### ##### ######## ############# ##################### +## Ready +return diff -Nru critcl-3.1.9/lib/critcl-bitmap/pkgIndex.tcl critcl-3.1.17+dfsg/lib/critcl-bitmap/pkgIndex.tcl --- critcl-3.1.9/lib/critcl-bitmap/pkgIndex.tcl 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/lib/critcl-bitmap/pkgIndex.tcl 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1 @@ +package ifneeded critcl::bitmap 1.0.1 [list source [file join $dir bitmap.tcl]] diff -Nru critcl-3.1.9/lib/critcl-class/class.tcl critcl-3.1.17+dfsg/lib/critcl-class/class.tcl --- critcl-3.1.9/lib/critcl-class/class.tcl 2013-05-10 05:57:04.000000000 +0000 +++ critcl-3.1.17+dfsg/lib/critcl-class/class.tcl 2017-10-14 02:48:11.000000000 +0000 @@ -7,15 +7,17 @@ # class made easy, with code for object command and method dispatch # generated. -package provide critcl::class 1.0.6 +package provide critcl::class 1.0.7 # # ## ### ##### ######## ############# ##################### ## Requirements. -package require Tcl 8.4 ; # Min supported version. -package require critcl 3.1.6 ; # Need 'meta?' to get the package name. - # Need 'name2c' returning 4 values. -package require critcl::util ; # Use the package's Get/Put commands. +package require Tcl 8.4 ; # Min supported version. +package require critcl 3.1.17 ; # Need 'meta?' to get the package name. + # Need 'name2c' returning 4 values. + # Need 'Deline' helper. + # Need cproc -tracename +package require critcl::util ; # Use the package's Get/Put commands. namespace eval ::critcl::class {} @@ -313,7 +315,7 @@ set header [file join [critcl::cache] $hdr] file mkdir [critcl::cache] - set template [Template class.h] + set template [critcl::Deline [Template class.h]] #puts T=[string length $template] critcl::util::Put $header [string map [MakeMap] $template] @@ -525,11 +527,13 @@ proc ::critcl::class::MethodExplicit {name mtype arguments args} { # mtype in {proc, command} MethodCheck method instance $name + variable state set bloc [critcl::at::get] set enum [MethodEnum method $name] set function ${enum}_Cmd set cdimport "[critcl::at::here!] @instancetype@ instance = (@instancetype@) clientdata;" + set tname "[dict get $state class] M $name" if {$mtype eq "proc"} { # Method is cproc. @@ -551,7 +555,8 @@ set body "\n $syntax\n$cdimport\n $body" set code [critcl::collect { - critcl::cproc $function $arguments $rtype $body -cname 1 -pass-cdata 1 -arg-offset 1 + critcl::cproc $function $arguments $rtype $body \ + -cname 1 -pass-cdata 1 -arg-offset 1 -tracename $tname }] } else { @@ -565,7 +570,8 @@ set body "\n $syntax\n$cdimport\n $body" set code [critcl::collect { - critcl::ccommand $function {} $body -cname 1 + critcl::ccommand $function {} $body \ + -cname 1 -tracename $tname }] } @@ -589,11 +595,13 @@ proc ::critcl::class::ClassMethodExplicit {name mtype arguments args} { # mtype in {proc, command} MethodCheck classmethod class $name + variable state set bloc [critcl::at::get] set enum [MethodEnum classmethod $name] set function ${enum}_Cmd set cdimport "[critcl::at::here!] @classtype@ class = (@classtype@) clientdata;" + set tname "[dict get $state class] CM $name" if {$mtype eq "proc"} { # Method is cproc. @@ -615,7 +623,9 @@ set body "\n $syntax\n$cdimport\n $body" set code [critcl::collect { - critcl::cproc $function $arguments $rtype $body -cname 1 -pass-cdata 1 -arg-offset 1 + critcl::cproc $function $arguments $rtype $body \ + -cname 1 -pass-cdata 1 -arg-offset 1 \ + -tracename $tname }] } else { @@ -629,7 +639,8 @@ set body "\n $syntax\n$cdimport\n $body" set code [critcl::collect { - critcl::ccommand $function {} $body -cname 1 + critcl::ccommand $function {} $body \ + -cname 1 -tracename $tname }] } diff -Nru critcl-3.1.9/lib/critcl-class/pkgIndex.tcl critcl-3.1.17+dfsg/lib/critcl-class/pkgIndex.tcl --- critcl-3.1.9/lib/critcl-class/pkgIndex.tcl 2013-05-10 05:57:04.000000000 +0000 +++ critcl-3.1.17+dfsg/lib/critcl-class/pkgIndex.tcl 2017-10-14 02:48:11.000000000 +0000 @@ -1 +1 @@ -package ifneeded critcl::class 1.0.6 [list source [file join $dir class.tcl]] +package ifneeded critcl::class 1.0.7 [list source [file join $dir class.tcl]] diff -Nru critcl-3.1.9/lib/critcl-cutil/allocs/critcl_alloc.h critcl-3.1.17+dfsg/lib/critcl-cutil/allocs/critcl_alloc.h --- critcl-3.1.9/lib/critcl-cutil/allocs/critcl_alloc.h 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/lib/critcl-cutil/allocs/critcl_alloc.h 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,48 @@ +#ifndef __CRITCL_UTIL_ALLOC_H +#define __CRITCL_UTIL_ALLOC_H 1 + +/* + * = = == === ===== ======== ============= ===================== + */ + +#include + +/* + * Helper macros for easy allocation of structures and arrays. + */ + +#define ALLOC(type) (type *) ckalloc (sizeof (type)) +#define NALLOC(type,n) (type *) ckalloc (sizeof (type) * (n)) +#define REALLOC(x,type,n) (type *) ckrealloc ((char*) x, sizeof (type) * (n)) + +#define FREE(p) ckfree ((char*)(p)) + +/* + * Macros to properly set a string rep from a string or DString. The main + * point is adding the terminating \0 character. The Tcl core checks for that. + */ + +#define STREP(o,str,len) \ + (o)->length = (len); \ + (o)->bytes = ckalloc((len)+1); \ + memcpy ((o)->bytes, (str), (len)); \ + (o)->bytes[(len)] = '\0' + +#define STREP_DS(o,ds) { \ + int length = Tcl_DStringLength (ds); \ + STREP(o, Tcl_DStringValue (ds), length); \ + } + +/* + * = = == === ===== ======== ============= ===================== + */ + +#endif /* __CRITCL_UTIL_ALLOC_H */ + +/* + * Local Variables: + * mode: c + * c-basic-offset: 4 + * fill-column: 78 + * End: + */ diff -Nru critcl-3.1.9/lib/critcl-cutil/asserts/critcl_assert.h critcl-3.1.17+dfsg/lib/critcl-cutil/asserts/critcl_assert.h --- critcl-3.1.9/lib/critcl-cutil/asserts/critcl_assert.h 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/lib/critcl-cutil/asserts/critcl_assert.h 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,56 @@ +#ifndef __CRITCL_UTIL_ASSERT_H +#define __CRITCL_UTIL_ASSERT_H 1 + +/* + * = = == === ===== ======== ============= ===================== + */ + +#include + +/* + * Macros for assertions, controlled via CRITCL_ASSERT. + * Especially a helper to check array bounds, and counted + * abort. + */ + +#ifdef CRITCL_ASSERT + +#define CRITCL_UTIL_ASSERT_XSTR(x) #x +#define CRITCL_UTIL_ASSERT_STR(x) CRITCL_UTIL_ASSERT_XSTR(x) +#define CRITCL_UTIL_ASSERT_RANGEOK(i,n) ((0 <= (i)) && ((i) < (n))) + +#define ASSERT(x,msg) if (!(x)) { \ + Tcl_Panic (msg " (" #x "), in file " __FILE__ " @line " CRITCL_UTIL_ASSERT_STR(__LINE__)); \ + } + +#define ASSERT_BOUNDS(i,n) \ + ASSERT (CRITCL_UTIL_ASSERT_RANGEOK(i,n), \ + "array index out of bounds: " CRITCL_UTIL_ASSERT_STR(i) " >= " CRITCL_UTIL_ASSERT_STR(n)) + +#define STOPAFTER(x) { \ + static int count = (x); \ + count --; \ + if (!count) { Tcl_Panic ("stop"); } \ + } + +#else /* ! CRITCL_ASSERT */ + +#define ASSERT(x,msg) +#define ASSERT_BOUNDS(i,n) +#define STOPAFTER(x) + +#endif + +/* + * = = == === ===== ======== ============= ===================== + */ + +#endif /* __CRITCL_UTIL_ASSERT_H */ + +/* + * Local Variables: + * mode: c + * c-basic-offset: 4 + * fill-column: 78 + * End: + */ diff -Nru critcl-3.1.9/lib/critcl-cutil/cutil.tcl critcl-3.1.17+dfsg/lib/critcl-cutil/cutil.tcl --- critcl-3.1.9/lib/critcl-cutil/cutil.tcl 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/lib/critcl-cutil/cutil.tcl 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,75 @@ +## -*- tcl -*- +# # ## ### ##### ######## ############# ##################### +# Pragmas for MetaData Scanner. +# n/a + +# CriTcl Utility Commands To Provide Common C-level utility functions. +# +# Copyright (c) 2017 Andreas Kupries + +package provide critcl::cutil 0.1 + +# # ## ### ##### ######## ############# ##################### +## Requirements. + +package require Tcl 8.4 ; # Min supported version. + +if {[catch { + package require critcl 3 +}]} { + package require critcl 2.1 + # Only this and higher has the enhanced check, and checklink. +} + +namespace eval ::critcl::cutil {} + +# # ## ### ##### ######## ############# ##################### +## Implementation -- API: Embed C Code + +# # ## ### ##### ######## ############# ##################### + +proc critcl::cutil::alloc {} { + variable selfdir + critcl::cheaders -I$selfdir/allocs + critcl::include critcl_alloc.h + return +} + +proc critcl::cutil::assertions {{enable 0}} { + variable selfdir + critcl::cheaders -I$selfdir/asserts + critcl::include critcl_assert.h + if {!$enable} return + critcl::cflags -DCRITCL_ASSERT + return +} + +proc critcl::cutil::tracer {{enable 0}} { + variable selfdir + alloc ;# Tracer uses the allocation utilities in its implementation + critcl::cheaders -I$selfdir/trace + critcl::include critcl_trace.h + critcl::csources $selfdir/trace/trace.c + if {!$enable} return + critcl::cflags -DCRITCL_TRACER + return +} + +# # ## ### ##### ######## ############# ##################### +## State + +namespace eval ::critcl::cutil { + variable selfdir [file dirname [file normalize [info script]]] +} + +# # ## ### ##### ######## ############# ##################### +## Export API + +namespace eval ::critcl::cutil { + namespace export alloc assert tracer + catch { namespace ensemble create } +} + +# # ## ### ##### ######## ############# ##################### +## Ready +return diff -Nru critcl-3.1.9/lib/critcl-cutil/pkgIndex.tcl critcl-3.1.17+dfsg/lib/critcl-cutil/pkgIndex.tcl --- critcl-3.1.9/lib/critcl-cutil/pkgIndex.tcl 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/lib/critcl-cutil/pkgIndex.tcl 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1 @@ +package ifneeded critcl::cutil 0.1 [list source [file join $dir cutil.tcl]] diff -Nru critcl-3.1.9/lib/critcl-cutil/trace/critcl_trace.h critcl-3.1.17+dfsg/lib/critcl-cutil/trace/critcl_trace.h --- critcl-3.1.9/lib/critcl-cutil/trace/critcl_trace.h 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/lib/critcl-cutil/trace/critcl_trace.h 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,147 @@ +#ifndef __CRITCL_UTIL_TRACE_H +#define __CRITCL_UTIL_TRACE_H 1 + +/* + * Narrative tracing support, controlled by CRITCL_TRACER + * = = == === ===== ======== ============= ===================== + * + * Further control of the active logical sub-streams is done via the + * declarators + * - TRACE_ON + * - TRACE_OFF + * - TRACE_TAG_ON + * - TRACE_TAG_OFF + * + * The macros make use of the standard macros __FILE__ and __LINE__ + * to identify traced locations (physically). + * + * ATTENTION: The trace facility assumes a C99 compiler to have + * access to the __func__ string which holds the name + * of the current function. + */ + +#include + +/* + * Main (convenience) commands: + * + * - TRACE_FUNC :: Function entry, formatted parameters + * - TRACE_FUNC_VOID :: Function entry, no parameters + * - TRACE_RETURN :: Function exit, formatted result + * - TRACE_RETURN_VOID :: Function exit, no result + * - TRACE :: Additional trace line. + * + * The above commands are composed from the lower level commands below. + * + * Scoping + * - TRACE_PUSH_SCOPE :: Start a named scope, no output + * - TRACE_PUSH_FUNC :: Start a scope, named by the current function, no output + * - TRACE_POP :: End a scope, no output + + * Tracing + * - TRACE_HEADER :: Start of trace line (location, indentation, scope) + * - TRACE_ADD :: Extend trace line, formatted information + * - TRACE_CLOSER :: End of trace line + * + * All of the tracing command also come in TRACE_TAG_ forms which take an + * additional 1st argument, the tag of the stream. The scoping commands do not + * take tags. They manage indentation without generating output on their own. + */ + +#ifndef CRITCL_TRACER +/* Tracing disabled. All macros vanish */ +#define TRACE_PUSH_SCOPE(string) +#define TRACE_PUSH_FUNC +#define TRACE_POP +#define TRACE_ON +#define TRACE_OFF +#define TRACE_HEADER(indent) +#define TRACE_ADD(format, ...) +#define TRACE_CLOSER +#define TRACE_TAG_ON(tag) +#define TRACE_TAG_OFF(tag) +#define TRACE_TAG_HEADER(tag,indent) +#define TRACE_TAG_ADD(tag, format, ...) +#define TRACE_TAG_CLOSER(tag) +#define TRACE_FUNC(format, ...) +#define TRACE_FUNC_VOID +#define TRACE_RETURN(format,x) return (x); +#define TRACE_RETURN_VOID return; +#define TRACE(format, ...) +#define TRACE_TAG_FUNC(tag, format, ...) +#define TRACE_TAG_FUNC_VOID(tag) +#define TRACE_TAG_RETURN(tag, format, x) return (x); +#define TRACE_TAG_RETURN_VOID(tag) return; +#define TRACE_TAG(tag, format, ...) +#define TRACE_RUN(code) +#define TRACE_DO(code) +#define TRACE_TAG_DO(tag, code) +#define TRACE_TAG_VAR(tag) 0 +#endif + +#ifdef CRITCL_TRACER +/* Tracing active. Macros expand to content. + */ +#define TRACE_PUSH_SCOPE(string) critcl_trace_push (string) +#define TRACE_PUSH_FUNC TRACE_PUSH_SCOPE (__func__) +#define TRACE_POP critcl_trace_pop() + +#define TRACE_ON TRACE_TAG_ON (THIS_FILE) +#define TRACE_OFF TRACE_TAG_OFF (THIS_FILE) + +#define TRACE_HEADER(indent) TRACE_TAG_HEADER (THIS_FILE, indent) +#define TRACE_ADD(format, ...) TRACE_TAG_ADD (THIS_FILE, format, __VA_ARGS__) +#define TRACE_CLOSER TRACE_TAG_CLOSER (THIS_FILE) + +#define TRACE_TAG_ON(tag) static int TRACE_TAG_VAR (tag) = 1 +#define TRACE_TAG_OFF(tag) static int TRACE_TAG_VAR (tag) = 0 +#define TRACE_TAG_VAR(tag) __critcl_tag_ ## tag ## _status + +#define TRACE_TAG_HEADER(tag, indent) critcl_trace_header (TRACE_TAG_VAR (tag), (indent), __FILE__, __LINE__) +#define TRACE_TAG_ADD(tag, format, ...) critcl_trace_printf (TRACE_TAG_VAR (tag), format, __VA_ARGS__) +#define TRACE_TAG_CLOSER(tag) critcl_trace_closer (TRACE_TAG_VAR (tag)) + +/* Highlevel (convenience) tracing. + */ + +#define TRACE_FUNC(format, ...) TRACE_TAG_FUNC (THIS_FILE, format, __VA_ARGS__) +#define TRACE_FUNC_VOID TRACE_TAG_FUNC_VOID (THIS_FILE) +#define TRACE_RETURN(format,x) TRACE_TAG_RETURN (THIS_FILE, format, x) +#define TRACE_RETURN_VOID TRACE_TAG_RETURN_VOID (THIS_FILE) +#define TRACE(format, ...) TRACE_TAG (THIS_FILE, format, __VA_ARGS__) + +#define TRACE_TAG_FUNC(tag, format, ...) TRACE_PUSH_FUNC; TRACE_TAG_HEADER (tag,1); TRACE_TAG_ADD (tag, format, __VA_ARGS__); TRACE_TAG_CLOSER (tag) +#define TRACE_TAG_FUNC_VOID(tag) TRACE_PUSH_FUNC; TRACE_TAG_HEADER (tag,1); TRACE_TAG_ADD (tag, "(%s)", "void"); TRACE_TAG_CLOSER (tag) +#define TRACE_TAG_RETURN(tag, format, x) TRACE_TAG_HEADER (tag,1); TRACE_TAG_ADD (tag, "%s", "RETURN = ") ; TRACE_TAG_ADD (tag, format, x) ; TRACE_TAG_CLOSER (tag) ; TRACE_POP ; return (x) +#define TRACE_TAG_RETURN_VOID(tag) TRACE_TAG_HEADER (tag,1); TRACE_TAG_ADD (tag, "RETURN %s", "(void)") ; TRACE_TAG_CLOSER (tag) ; TRACE_POP ; return +#define TRACE_TAG(tag, format, ...) TRACE_TAG_HEADER (tag,1); TRACE_TAG_ADD (tag, format, __VA_ARGS__) ; TRACE_TAG_CLOSER (tag) + +#define TRACE_RUN(code) code +#define TRACE_DO(code) TRACE_TAG_DO (THIS_FILE, code) +#define TRACE_TAG_DO(tag, code) if (TRACE_TAG_VAR (tag)) { code ; } + +/* Support functions used in the macros. + */ + +extern void critcl_trace_push (const char* scope); +extern void critcl_trace_pop (void); +extern void critcl_trace_header (int on, int indent, const char *filename, int line); +extern void critcl_trace_printf (int on, const char *pat, ...); +extern void critcl_trace_closer (int on); + +/* Support functions used by the implementation of "critcl::cproc". + */ + +extern void critcl_trace_cmd_args (const char* scope, int oc, Tcl_Obj*const* ov); +extern int critcl_trace_cmd_result (int status, Tcl_Interp* ip); + +#endif +#endif /* __CRITCL_UTIL_TRACE_H */ + +/* + * Local Variables: + * mode: c + * c-basic-offset: 4 + * fill-column: 78 + * End: + */ diff -Nru critcl-3.1.9/lib/critcl-cutil/trace/trace.c critcl-3.1.17+dfsg/lib/critcl-cutil/trace/trace.c --- critcl-3.1.9/lib/critcl-cutil/trace/trace.c 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/lib/critcl-cutil/trace/trace.c 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,186 @@ +/* + * = = == === ===== ======== ============= ===================== + */ + +#include +#include + +/* + * = = == === ===== ======== ============= ===================== + */ + +#ifdef CRITCL_TRACER + +/* Tracking the stack of scopes, + * single-linked list, + * top to bottom. + */ + +typedef struct scope_stack { + const char* scope; + struct scope_stack* down; +} scope_stack; + +/* + * = = == === ===== ======== ============= ===================== + * Tracing state (stack of scopes, associated indentation level) + * + * API regexp for trace output: + * (header printf* closer)* + * + * - closed == 1 :: post (closer) + * - closed == 0 :: post (header) + * + * [1] in (header) && !closed + * => starting a new line in the middle of an incomplete line + * => force closer + * [2] in (printf) && closed + * => continuing a line which was interrupted by another (see [1]) + * => force header + */ + +static scope_stack* top = 0; +static int level = 0; +static int closed = 1; + +/* + * = = == === ===== ======== ============= ===================== + * Internals + */ + +static void +indent (void) +{ + int i; + for (i = 0; i < level; i++) { fwrite(" ", 1, 1, stdout); } + fflush (stdout); +} + +static void +scope (void) +{ + if (!top) return; + fwrite (top->scope, 1, strlen(top->scope), stdout); + fflush (stdout); +} + +static void +separator (void) +{ + fwrite(" | ", 1, 3, stdout); + fflush (stdout); +} + +/* + * = = == === ===== ======== ============= ===================== + * API + */ + +void +critcl_trace_push (const char* scope) +{ + scope_stack* new = ALLOC (scope_stack); + new->scope = scope; + new->down = top; + top = new; + level += 4; +} + +void +critcl_trace_pop (void) +{ + scope_stack* next = top->down; + level -= 4; + ckfree ((char*)top); + top = next; +} + +void +critcl_trace_closer (int on) +{ + if (!on) return; + fwrite ("\n", 1, 1, stdout); + fflush (stdout); + closed = 1; +} + +void +critcl_trace_header (int on, int ind, const char* filename, int line) +{ + if (!on) return; + if (!closed) critcl_trace_closer (1); + // location prefix +#if 0 /* varying path length breaks indenting by call level :( */ + if (filename) { + fprintf (stdout, "%s:%6d", filename, line); + fflush (stdout); + } +#endif + // indentation, scope, separator + if (ind) { indent (); } + scope (); + separator(); + closed = 0; +} + +void +critcl_trace_printf (int on, const char *format, ...) +{ + /* + * 1MB output-buffer. We may trace large data structures. This is also a + * reason why the implementation can be compiled out entirely. + */ +#define MSGMAX (1024*1024) + static char msg [MSGMAX]; + int len; + va_list args; + if (!on) return; + if (closed) critcl_trace_header (1, 1, 0, 0); + + va_start(args, format); + len = vsnprintf(msg, MSGMAX, format, args); + va_end(args); + fwrite(msg, 1, len, stdout); + fflush (stdout); +} + +void +critcl_trace_cmd_args (const char* scopename, int argc, Tcl_Obj*const* argv) +{ + int i; + critcl_trace_push (scopename); + for (i=0; i < argc; i++) { + // No location information + indent(); + scope(); + separator(); + critcl_trace_printf (1, "ARG [%3d] = '%s'\n", + i, Tcl_GetString((Tcl_Obj*) argv[i])); + } +} + +int +critcl_trace_cmd_result (int status, Tcl_Interp* ip) +{ + char* result = Tcl_GetString (Tcl_GetObjResult (ip)); + // No location information + indent(); + scope(); + separator(); + critcl_trace_printf (1, "RESULT = %d '%s'\n", status, result); + critcl_trace_pop (); + return status; +} + +#endif /* CRITCL_TRACER */ +/* + * = = == === ===== ======== ============= ===================== + */ + +/* + * local Variables: + * mode: c + * c-basic-offset: 4 + * fill-column: 78 + * End: + */ diff -Nru critcl-3.1.9/lib/critcl-emap/emap.tcl critcl-3.1.17+dfsg/lib/critcl-emap/emap.tcl --- critcl-3.1.9/lib/critcl-emap/emap.tcl 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/lib/critcl-emap/emap.tcl 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,633 @@ +## -*- tcl -*- +# # ## ### ##### ######## ############# ##################### +# Pragmas for MetaData Scanner. +# n/a + +# CriTcl Utility Package for emap en- and decoder. +# Based on i-assoc. +# +# Copyright (c) 2014-2017 Andreas Kupries + +package provide critcl::emap 1.1 + +# # ## ### ##### ######## ############# ##################### +## Requirements. + +package require Tcl 8.4 ; # Min supported version. +package require critcl 3.1.11 ; # make, include -- dict portability +package require critcl::iassoc + +namespace eval ::critcl::emap {} + +# # ## ### ##### ######## ############# ##################### +## Implementation -- API: Embed C Code + +proc critcl::emap::def {name dict args} { + # dict: Tcl symbolic name -> (C int value (1)) + # + # (Ad 1) Can be numeric, or symbolic, as long as it is a C int + # expression in the end. + + # args = options. Currently supported: + # * -nocase : case-insensitive strings on encoding. + # * -mode : list of use cases, access case: tcl, c (default: tcl) + + Options $args + Index $dict id symbols last + # symbols :: list of words, lexicographically sorted + # id :: symbol -> index (sorted) + # last :: number of symbols + + Header $name + ConstStringTable $name $symbols $dict $nocase $last + set isdirect [DecideIfDirect $dict min max direct] + if {$isdirect} { + DecodeDirect $name $min $max id direct + } + Tcl Iassoc $name $symbols $dict $nocase $last + Tcl EncoderTcl $name $nocase + Tcl DecoderTcl $name $isdirect $last + Tcl ArgType $name + Tcl ResultType $name + C EncoderC $name $nocase $last + C DecoderC $name $isdirect $last + return +} + +# # ## ### ##### ######## ############# ##################### +## Internals + +proc critcl::emap::DecoderTcl {name isdirect last} { + if {$isdirect} { + DecoderTclDirect $name + } else { + DecoderTclSearch $name $last + } + return +} + +proc critcl::emap::DecoderTclSearch {name last} { + # Decoder based on linear search. Because we either + # - see some symbolic values (= do not know actual value) + # - the direct mapping table would be too large (> 50 entries). + lappend map @NAME@ $name + lappend map @UNAME@ [string toupper $name] + lappend map @LAST@ $last + + critcl::ccode \n[critcl::at::here!][string map $map { + Tcl_Obj* + @NAME@_decode (Tcl_Interp* interp, int state) + { + /* Decode via linear search */ + char buf [20]; + int i; + @NAME@_iassoc_data context = @NAME@_iassoc (interp); + + for (i = 0; i < @LAST@; i++) { + if (@NAME@_emap_state [i] != state) continue; + return context->tcl [i]; + } + + sprintf (buf, "%d", state); + Tcl_AppendResult (interp, "Invalid @NAME@ state code ", buf, NULL); + Tcl_SetErrorCode (interp, "@UNAME@", "STATE", NULL); + return NULL; + } + }] + return +} + +proc critcl::emap::DecodeDirect {name min max iv dv} { + upvar 1 $iv id $dv direct + # Decoder based on a direct mapping table. We can do this because + # we found that all the values are pure integers, i.e. we know + # them in detail, and that the table is not too big (< 50 entries). + + lassign [DirectTable $min $max id direct] table size + + lappend map @NAME@ $name + lappend map @DIRECT@ $table + lappend map @SIZE@ $size + lappend map @MIN@ $min + lappend map @MAX@ $max + lappend map @OFFSET@ [Offset $min] + + critcl::ccode \n[critcl::at::here!][string map $map { + static int @NAME@_direct (int state) + { + static const int direct [@SIZE@] = {@DIRECT@ + }; + /* Check limits first */ + if (state < @MIN@) { return -1; } + if (state > @MAX@) { return -1; } + /* Map to string index */ + return direct [state@OFFSET@]; + } + }] +} + +proc critcl::emap::DecoderTclDirect {name} { + lappend map @NAME@ $name + lappend map @UNAME@ [string toupper $name] + + critcl::ccode \n[critcl::at::here!][string map $map { + Tcl_Obj* + @NAME@_decode (Tcl_Interp* interp, int state) + { + /* Decode via direct mapping */ + char buf [20]; + int i; + @NAME@_iassoc_data context = @NAME@_iassoc (interp); + + i = @NAME@_direct (state); + if (i < 0) { goto error; } + + /* Return the chosen string */ + return context->tcl [i]; + + error: + sprintf (buf, "%d", state); + Tcl_AppendResult (interp, "Invalid @NAME@ state code ", buf, NULL); + Tcl_SetErrorCode (interp, "@UNAME@", "STATE", NULL); + return NULL; + } + }] + return +} + +proc critcl::emap::DirectTable {min max iv dv} { + upvar 1 $iv id $dv direct + + set table {} + set fmt %[string length $max]d + + for {set i $min} {$i <= $max} {incr i} { + if {[info exists direct($i)]} { + set sym [lindex $direct($i) 0] + set code $id($sym) + lappend table "$code,\t/* [format $fmt $i] <=> \"$sym\" */" + } else { + lappend table "-1," + } + } + + return [list "\n\t\t [join $table "\n\t\t "]" [llength $table]] +} + +proc critcl::emap::Offset {min} { + if {$min == 0} { + return "" + } elseif {$min < 0} { + return "+[expr {0-$min}]" + } else { + # Note: The 0+... ensures that we get a decimal number. + return "-[expr {0+$min}]" + } +} + +proc critcl::emap::DecideIfDirect {dict minv maxv dv} { + upvar 1 $minv min $maxv max $dv direct + + set min {} + set max {} + + dict for {sym value} $dict { + # Manage a direct mapping table from stati to strings, if we + # can see the numeric value of all stati. + if {[string is integer -strict $value]} { + if {($min eq {}) || ($value < $min)} { set min $value } + if {($max eq {}) || ($value > $max)} { set max $value } + lappend direct($value) $sym + } else { + return 0 + } + } + + if {$min eq {}} { return 0 } + if {$max eq {}} { return 0 } + if {($max-$min) >= 50} { return 0 } + return 1 +} + +proc critcl::emap::EncoderTcl {name nocase} { + if {$nocase} { + EncoderTclNocase $name + } else { + EncoderTclPlain $name + } + return +} + +proc critcl::emap::EncoderTclPlain {name} { + lappend map @NAME@ $name + lappend map @UNAME@ [string toupper $name] + + critcl::ccode \n[critcl::at::here!][string map $map { + int + @NAME@_encode (Tcl_Interp* interp, + Tcl_Obj* state, + int* result) + { + int id, res; + res = Tcl_GetIndexFromObj (interp, state, @NAME@_emap_cstr, "@NAME@", 0, &id); + if (res != TCL_OK) { + Tcl_SetErrorCode (interp, "@UNAME@", "STATE", NULL); + return TCL_ERROR; + } + + *result = @NAME@_emap_state [id]; + return TCL_OK; + } + }] + return +} + +proc critcl::emap::EncoderTclNocase {name} { + lappend map @NAME@ $name + lappend map @UNAME@ [string toupper $name] + + critcl::ccode \n[critcl::at::here!][string map $map { + int + @NAME@_encode (Tcl_Interp* interp, + Tcl_Obj* state, + int* result) + { + int id, res; + /* -nocase :: We duplicate the state string, making it unshared, + * allowing us to convert in place. As the string may change + * length (shrinking) we have to reset the length after + * conversion. + */ + state = Tcl_DuplicateObj (state); + Tcl_SetObjLength(state, Tcl_UtfToLower (Tcl_GetString (state))); + res = Tcl_GetIndexFromObj (interp, state, @NAME@_emap_cstr, "@NAME@", 0, &id); + Tcl_DecrRefCount (state); + if (res != TCL_OK) { + Tcl_SetErrorCode (interp, "@UNAME@", "STATE", NULL); + return TCL_ERROR; + } + + *result = @NAME@_emap_state [id]; + return TCL_OK; + } + }] + return +} + +proc critcl::emap::EncoderC {name nocase last} { + if {$nocase} { + EncoderCNocase $name $last + } else { + EncoderCPlain $name $last + } + return +} + +proc critcl::emap::EncoderCPlain {name last} { + lappend map @NAME@ $name + lappend map @UNAME@ [string toupper $name] + lappend map @LAST@ $last + + # case-sensitive search + critcl::ccode \n[critcl::at::here!][string map $map { + #include + + int + @NAME@_encode_cstr (const char* state) + { + int id; + /* explicit linear search */ + for (id = 0; id < @LAST@; id++) { + if (strcmp (state, @NAME@_emap_cstr [id]) != 0) continue; + return @NAME@_emap_state [id]; + } + return -1; + } + }] + return +} + +proc critcl::emap::EncoderCNocase {name last} { + lappend map @NAME@ $name + lappend map @UNAME@ [string toupper $name] + lappend map @LAST@ $last + + # case-insensitive search + critcl::ccode \n[critcl::at::here!][string map $map { + #include + + int + @NAME@_encode_cstr (const char* state) + { + /* -nocase :: We duplicate the state string, allowing us to + * convert in place. As the string may change length (shrink) + * we have to re-terminate it after conversion. + */ + int id, slen = 1 + strlen (state); + char* lower = ckalloc (slen); + + memcpy (lower, state, slen); + lower [Tcl_UtfToLower (lower)] = '\0'; + + /* explicit linear search */ + for (id = 0; id < @LAST@; id++) { + if (strcmp (lower, @NAME@_emap_cstr [id]) != 0) continue; + ckfree ((char*) lower); + return @NAME@_emap_state [id]; + } + ckfree ((char*) lower); + return -1; + } + }] + return +} + +proc critcl::emap::DecoderC {name isdirect last} { + if {$isdirect} { + DecoderCDirect $name + } else { + DecoderCSearch $name $last + } + return +} + +proc critcl::emap::DecoderCSearch {name last} { + # Decoder based on linear search. Because we either + # - see some symbolic values (= do not know actual value) + # - the direct mapping table would be too large (> 50 entries). + lappend map @NAME@ $name + lappend map @UNAME@ [string toupper $name] + lappend map @LAST@ $last + + critcl::ccode \n[critcl::at::here!][string map $map { + const char* + @NAME@_decode_cstr (int state) + { + /* Decode via linear search */ + int id; + for (id = 0; id < @LAST@; id++) { + if (@NAME@_emap_state [id] != state) continue; + return @NAME@_emap_cstr [id]; + } + return NULL; + } + }] + return +} + +proc critcl::emap::DecoderCDirect {name} { + lappend map @NAME@ $name + lappend map @UNAME@ [string toupper $name] + + critcl::ccode \n[critcl::at::here!][string map $map { + const char* + @NAME@_decode_cstr (int state) + { + /* Decode via direct mapping */ + int i = @NAME@_direct (state); + if (i < 0) { return NULL; } + /* Return the chosen string */ + return @NAME@_emap_cstr [i]; + } + }] + return +} + +proc critcl::emap::ResultType {name} { + lappend map @NAME@ $name + critcl::resulttype $name \n[critcl::at::here!][string map $map { + /* @NAME@_decode result is 0-refcount */ + { Tcl_Obj* ro = @NAME@_decode (interp, rv); + if (ro == NULL) { return TCL_ERROR; } + Tcl_SetObjResult (interp, ro); + return TCL_OK; } + }] int + return +} + +proc critcl::emap::ArgType {name} { + lappend map @NAME@ $name + critcl::argtype $name \n[critcl::at::here!][string map $map { + if (@NAME@_encode (interp, @@, &@A) != TCL_OK) return TCL_ERROR; + }] int int + return +} + +proc critcl::emap::Header {name} { + # I. Generate a header file for inclusion by other parts of the + # package, i.e. csources. Include the header here as well, for + # the following blocks of code. + # + # Declaration of the en- and decoder functions. + upvar 1 mode mode + append h [HeaderIntro $name] + append h [Tcl HeaderTcl $name] + append h [C HeaderC $name] + append h [HeaderEnd $name] + critcl::include [critcl::make ${name}.h $h] + return +} + +proc critcl::emap::HeaderIntro {name} { + lappend map @NAME@ $name + return \n[critcl::at::here!][string map $map { + #ifndef @NAME@_EMAP_HEADER + #define @NAME@_EMAP_HEADER + }] +} + +proc critcl::emap::HeaderEnd {name} { + lappend map @NAME@ $name + return [string map $map { + #endif /* @NAME@_EMAP_HEADER */ + }] +} + +proc critcl::emap::HeaderTcl {name} { + lappend map @NAME@ $name + return \n[critcl::at::here!][string map $map { + /* Encode a Tcl string into the corresponding state code */ + extern int @NAME@_encode (Tcl_Interp* interp, Tcl_Obj* state, int* result); + + /* Decode a state into the corresponding Tcl string */ + extern Tcl_Obj* @NAME@_decode (Tcl_Interp* interp, int state); + }] +} + +proc critcl::emap::HeaderC {name} { + lappend map @NAME@ $name + return \n[critcl::at::here!][string map $map { + /* Encode a C string into the corresponding state code */ + extern int @NAME@_encode_cstr (const char* state); + + /* Decode a state into the corresponding C string */ + extern const char* @NAME@_decode_cstr (int state); + }] +} + +proc critcl::emap::Iassoc {name symbols dict nocase last} { + upvar 1 mode mode + critcl::iassoc def ${name}_iassoc {} \ + [IassocStructure $last] \ + [IassocInit $name $symbols $dict $nocase $last] \ + [IassocFinal $symbols $dict] + return +} + +proc critcl::emap::IassocStructure {last} { + lappend map @LAST@ $last + return \n[critcl::at::here!][string map $map { + Tcl_Obj* tcl [@LAST@]; /* State name, Tcl_Obj*, sharable */ + }] +} + +proc critcl::emap::IassocInit {name symbols dict nocase last} { + set id -1 + foreach sym $symbols { + set value [dict get $dict $sym] + incr id + if {$nocase} { set sym [string tolower $sym] } + set map [list @ID@ $id @SYM@ $sym @VALUE@ $value @NAME@ $name] + + # iassoc initialization, direct from string, no C level + append init \n[critcl::at::here!][string map $map { + data->tcl [@ID@] = Tcl_NewStringObj (@NAME@_emap_cstr[@ID@], -1); + Tcl_IncrRefCount (data->tcl [@ID@]); + }] + } + return $init +} + +proc critcl::emap::IassocFinal {symbols dict} { + set id -1 + foreach sym $symbols { + incr id + set map [list @ID@ $id] + append final \n[critcl::at::here!][string map $map { + Tcl_DecrRefCount (data->tcl [@ID@]); + }] + } + return $final +} + +proc critcl::emap::ConstStringTable {name symbols dict nocase last} { + # C level table initialization (constant data) + foreach sym $symbols { + set value [dict get $dict $sym] + if {$nocase} { set sym [string tolower $sym] } + append ctable "\n\t \"${sym}\"," + append stable "\n\t ${value}," + } + append ctable "\n\t 0" + set stable [string trimright $stable ,] + + lappend map @NAME@ $name + lappend map @STRINGS@ $ctable + lappend map @STATES@ $stable + lappend map @LAST@ $last + + critcl::ccode [critcl::at::here!][string map $map { + /* State names, C string */ + static const char* @NAME@_emap_cstr [@LAST@+1] = {@STRINGS@ + }; + + /* State codes */ + static int @NAME@_emap_state [@LAST@] = {@STATES@ + }; + }] + return +} + +proc critcl::emap::C {args} { + upvar 1 mode mode + if {!$mode(c)} return + return [uplevel 1 $args] +} + +proc critcl::emap::!C {args} { + upvar 1 mode mode + if {$mode(c)} return + return [uplevel 1 $args] +} + +proc critcl::emap::Tcl {args} { + upvar 1 mode mode + if {!$mode(tcl)} return + return [uplevel 1 $args] +} + +proc critcl::emap::!Tcl {args} { + upvar 1 mode mode + if {$mode(tcl)} return + return [uplevel 1 $args] +} + +proc critcl::emap::Index {dict iv sv lv} { + upvar 1 $iv id $sv symbols $lv last + # For the C level search we want lexicographically sorted elements + set symbols [lsort -dict [dict keys $dict]] + set i 0 + foreach s $symbols { + set id($s) $i + incr i + } + set last $i + # id :: symbol -> index (sorted) + return +} + +proc critcl::emap::Options {options} { + upvar 1 nocase nocase mode mode + set nocase 0 + set use tcl + + while {[llength $options]} { + set options [lassign $options o] + switch -glob -- $o { + -nocase - + -nocas - + -noca - + -noc - + -no - + -n { set nocase 1 } + -mode - + -mod - + -mo - + -m { set options [lassign $options use] } + -* - + default { + return -code error -errorcode {CRITCL EMAP INVALID-OPTION} \ + "Expected option -nocase, or -use, got \"$o\"" + } + } + } + Use $use + return +} + +proc critcl::emap::Use {use} { + # Use cases: tcl, c, both + upvar 1 mode mode + set uses 0 + foreach u {c tcl} { set mode($u) 0 } + foreach u $use { set mode($u) 1 ; incr uses } + if {$uses} return + return -code error "Need at least one use case (c, or tcl)" +} + +# # ## ### ##### ######## ############# ##################### +## Export API + +namespace eval ::critcl::emap { + namespace export def + catch { namespace ensemble create } +} + +namespace eval ::critcl { + namespace export emap + catch { namespace ensemble create } +} + +# # ## ### ##### ######## ############# ##################### +## Ready +return diff -Nru critcl-3.1.9/lib/critcl-emap/pkgIndex.tcl critcl-3.1.17+dfsg/lib/critcl-emap/pkgIndex.tcl --- critcl-3.1.9/lib/critcl-emap/pkgIndex.tcl 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/lib/critcl-emap/pkgIndex.tcl 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1 @@ +package ifneeded critcl::emap 1.1 [list source [file join $dir emap.tcl]] diff -Nru critcl-3.1.9/lib/critcl-enum/enum.tcl critcl-3.1.17+dfsg/lib/critcl-enum/enum.tcl --- critcl-3.1.9/lib/critcl-enum/enum.tcl 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/lib/critcl-enum/enum.tcl 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,125 @@ +## -*- tcl -*- +# # ## ### ##### ######## ############# ##################### +# Pragmas for MetaData Scanner. +# n/a + +# CriTcl Utility Commands. Generation of functions handling conversion +# from and to a C enum. Not a full Tcl_ObjType. Based on +# Tcl_GetIndexFromObj() instead. + +package provide critcl::enum 1.0.1 + +# # ## ### ##### ######## ############# ##################### +## Requirements. + +package require Tcl 8.4 ; # Min supported version. +package require critcl 3.1.11 ; # make, include -- dict portability +package require critcl::literals 1.1 ; # String pool for conversion to Tcl. + +namespace eval ::critcl::enum {} + +# # ## ### ##### ######## ############# ##################### +## API: Generate the declaration and implementation files for the enum. + +proc ::critcl::enum::def {name dict} { + # Arguments are + # - the C name of the enumeration, and + # - dict of strings to convert. Key is the symbolic C name, value + # is the string. Numeric C value is in the order of the strings in + # the dict, treating it as list for that case. + # + # dict: C symbolic name -> Tcl string (Tcl symbolic name). + + if {![dict size $dict]} { + return -code error -errorcode {CRITCL ENUM DEF INVALID} \ + "Expected an enum definition, got empty string" + } + + critcl::literals::def ${name}_pool $dict + + # _pool_names = C enum of symbolic names, and implied numeric values. + # _pool.h = Header + # _pool ( interp, code ) => Tcl_Obj* :: up-conversion C to Tcl. + + # Exporting: + # Header .h + # Function _ToObj (interp, code) -> obj + # Function _GetFromObj (interp, obj, flags, &code) -> Tcl code + # Enum type _names + + dict for {sym str} $dict { + lappend table "\t\t\"$str\"," + } + + lappend map @NAME@ $name + lappend map @TABLE@ \n[join $table \n] + lappend map @TSIZE@ [llength $table] + lappend map @TSIZE1@ [expr {1 + [llength $table]}] + + critcl::include [critcl::make ${name}.h \n[critcl::at::here!][string map $map { + #ifndef @NAME@_HEADER + #define @NAME@_HEADER + #include <@NAME@_pool.h> + + extern int + @NAME@_GetFromObj (Tcl_Interp* interp, + Tcl_Obj* obj, + int flags, + int* literal); + + #define @NAME@_ToObj(i,l) (@NAME@_pool(i,l)) + #endif + }]] + + # Create second function, down-conversion Tcl to C. + + critcl::ccode [critcl::at::here!][string map $map { + extern int + @NAME@_GetFromObj (Tcl_Interp* interp, + Tcl_Obj* obj, + int flags, + int* literal ) + { + static const char* strings[@TSIZE1@] = {@TABLE@ + NULL + }; + + return Tcl_GetIndexFromObj (interp, obj, strings, + "@NAME@", + flags, literal); + } + }] + + + # V. Define convenient argument- and result-type definitions + # wrapping the de- and encoder functions for use by cprocs. + + critcl::argtype $name \n[critcl::at::here!][string map $map { + if (@NAME@_GetFromObj (interp, @@, TCL_EXACT, &@A) != TCL_OK) return TCL_ERROR; + }] int int + + critcl::argtype ${name}-prefix \n[critcl::at::here!][string map $map { + if (@NAME@_GetFromObj (interp, @@, 0, &@A) != TCL_OK) return TCL_ERROR; + }] int int + + # Use the underlying literal pool directly. + critcl::resulttype $name = ${name}_pool + return +} + +# # ## ### ##### ######## ############# ##################### +## Export API + +namespace eval ::critcl::enum { + namespace export def + catch { namespace ensemble create } +} + +namespace eval ::critcl { + namespace export enum + catch { namespace ensemble create } +} + +# # ## ### ##### ######## ############# ##################### +## Ready +return diff -Nru critcl-3.1.9/lib/critcl-enum/pkgIndex.tcl critcl-3.1.17+dfsg/lib/critcl-enum/pkgIndex.tcl --- critcl-3.1.9/lib/critcl-enum/pkgIndex.tcl 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/lib/critcl-enum/pkgIndex.tcl 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1 @@ +package ifneeded critcl::enum 1.0.1 [list source [file join $dir enum.tcl]] diff -Nru critcl-3.1.9/lib/critcl-iassoc/iassoc.tcl critcl-3.1.17+dfsg/lib/critcl-iassoc/iassoc.tcl --- critcl-3.1.9/lib/critcl-iassoc/iassoc.tcl 2013-05-10 05:57:04.000000000 +0000 +++ critcl-3.1.17+dfsg/lib/critcl-iassoc/iassoc.tcl 2017-10-14 02:48:11.000000000 +0000 @@ -6,14 +6,15 @@ # CriTcl Utility Commands. Specification of a C function and structure # associated with an interpreter made easy. -package provide critcl::iassoc 1.0.1 +package provide critcl::iassoc 1.0.2 # # ## ### ##### ######## ############# ##################### ## Requirements. -package require Tcl 8.4 ; # Min supported version. -package require critcl 3.1 ; # Need 'meta?' to get the package name. -package require critcl::util ; # Use the package's Get/Put commands. +package require Tcl 8.4 ; # Min supported version. +package require critcl 3.1.13 ; # Need 'meta?' to get the package name. + # Need 'Deline' helper. +package require critcl::util ; # Use the package's Get/Put commands. namespace eval ::critcl::iassoc {} @@ -30,7 +31,6 @@ set constructor $cloc$constructor set destructor $dloc$destructor - # Arguments: # - name of the C function which will provide access to the # structure. This name, with a fixed prefix is also used to @@ -46,14 +46,22 @@ # Pull the package we are working on out of the system. - set package [critcl::meta? name] + set package [critcl::meta? name] + set qpackage [expr {[string match ::* $package] + ? "$package" + : "::$package"}] + lassign [uplevel 1 [list ::critcl::name2c $qpackage]] pns pcns package cpackage + #puts "%%% pNS |$pns|" #puts "%%% Pkg |$package|" + #puts "%%% pCNS |$pcns|" + #puts "%%% cPkg |$cpackage|" + #puts "%%% Name |$name|" #puts "@@@ <<$data>>" - set stem ${package}_iassoc_${name} + set stem ${pcns}${cpackage}_iassoc_${name} set type ${name}_data set label critcl::iassoc/p=$package/a=$name @@ -80,7 +88,7 @@ set hdr ${stem}.h set header [file join [critcl::cache] $hdr] - set template [Template iassoc.h] + set template [critcl::Deline [Template iassoc.h]] #puts T=[string length $template] diff -Nru critcl-3.1.9/lib/critcl-iassoc/pkgIndex.tcl critcl-3.1.17+dfsg/lib/critcl-iassoc/pkgIndex.tcl --- critcl-3.1.9/lib/critcl-iassoc/pkgIndex.tcl 2013-05-10 05:57:04.000000000 +0000 +++ critcl-3.1.17+dfsg/lib/critcl-iassoc/pkgIndex.tcl 2017-10-14 02:48:11.000000000 +0000 @@ -1 +1 @@ -package ifneeded critcl::iassoc 1.0.1 [list source [file join $dir iassoc.tcl]] +package ifneeded critcl::iassoc 1.0.2 [list source [file join $dir iassoc.tcl]] diff -Nru critcl-3.1.9/lib/critcl-literals/literals.tcl critcl-3.1.17+dfsg/lib/critcl-literals/literals.tcl --- critcl-3.1.9/lib/critcl-literals/literals.tcl 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/lib/critcl-literals/literals.tcl 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,268 @@ +## -*- tcl -*- +# # ## ### ##### ######## ############# ##################### +# Pragmas for MetaData Scanner. +# n/a + +# CriTcl Utility Package for Shared Tcl_Obj* literals of a package. +# Based on i-assocs. +# +# Copyright (c) 20??-2017 Andreas Kupries + +package provide critcl::literals 1.2 + +# # ## ### ##### ######## ############# ##################### +## Requirements. + +package require Tcl 8.4 ; # Min supported version. +package require critcl 3.1.11 ; # make, include -- dict portability +package require critcl::iassoc + +namespace eval ::critcl::literals {} + +# # ## ### ##### ######## ############# ##################### +## Implementation -- API: Embed C Code + +proc critcl::literals::def {name dict {use tcl}} { + # dict :: map (C symbolic name -> string) + Use $use + Header $name $dict + C ConstStringTable $name $dict + C AccessorC $name + Tcl Iassoc $name $dict + Tcl AccessorTcl $name + Tcl ResultType $name + return +} + +# # ## ### ##### ######## ############# ##################### +## Internals + +proc critcl::literals::Use {use} { + # Use cases: tcl, c, both + upvar 1 mode mode + set uses 0 + foreach u {c tcl} { set mode($u) 0 } + foreach u $use { set mode($u) 1 ; incr uses } + if {$uses} return + return -code error "Need at least one use case (c, or tcl)" +} + +proc critcl::literals::ConstStringTable {name dict} { + # C level table initialization (constant data) + dict for {sym string} $dict { + append ctable "\n\t\"${string}\"," + } + append ctable "\n\t0" + + lappend map @NAME@ $name + lappend map @STRINGS@ $ctable + critcl::ccode [critcl::at::here!][string map $map { + static const char* @NAME@_literal[] = { + @STRINGS@ + }; + }] + return +} + +proc critcl::literals::Iassoc {name dict} { + upvar 1 mode mode + lappend map @NAME@ $name + critcl::iassoc def ${name}_iassoc {} \n[critcl::at::here!][string map $map { + /* Array of the string literals, indexed by the symbolic names */ + Tcl_Obj* literal [@NAME@_name_LAST]; + }] [IassocInit $name $dict] [IassocFinal $dict] + return +} + +proc critcl::literals::IassocFinal {dict} { + # Finalization code for iassoc structures + dict for {sym string} $dict { + append final "\n[critcl::at::here!]\n\tTcl_DecrRefCount (data->literal \[$sym\]);" + } + return $final +} + +proc critcl::literals::IassocInit {name dict} { + # Initialization code for iassoc structures. + # Details dependent on if C is supported together with Tcl, or not. + upvar 1 mode mode + return [C IassocInitWithC $name $dict][!C IassocInitTcl $dict] +} + +proc critcl::literals::IassocInitWithC {name dict} { + dict for {sym string} $dict { + set map [list @SYM@ $sym @NAME@ $name] + append init \n[critcl::at::here!][string map $map { + data->literal [@SYM@] = Tcl_NewStringObj (@NAME@_literal[@SYM@], -1); + Tcl_IncrRefCount (data->literal [@SYM@]); + }] + } + return $init +} + +proc critcl::literals::IassocInitTcl {dict} { + dict for {sym string} $dict { + set map [list @SYM@ $sym @STR@ $string] + append init \n[critcl::at::here!][string map $map { + data->literal [@SYM@] = Tcl_NewStringObj ("@STR@", -1); + Tcl_IncrRefCount (data->literal [@SYM@]); + }] + } + return $init +} + +proc critcl::literals::Header {name dict} { + # I. Generate a header file for inclusion by other parts of the + # package, i.e. csources. Include the header here as well, for + # the following blocks of code. + # + # Declarations of an enum of the symbolic names, plus the + # accessor function. + upvar 1 mode mode + append h [HeaderIntro $name $dict] + append h [Tcl HeaderTcl $name] + append h [C HeaderC $name] + append h [HeaderEnd $name] + critcl::include [critcl::make ${name}.h $h] + return +} + +proc critcl::literals::HeaderIntro {name dict} { + lappend map @NAME@ $name + lappend map @CODES@ [join [dict keys $dict] {, }] + return \n[critcl::at::here!][string map $map { + #ifndef @NAME@_LITERALS_HEADER + #define @NAME@_LITERALS_HEADER + + /* Symbolic names for the literals */ + typedef enum @NAME@_names { + @CODES@ + , @NAME@_name_LAST + } @NAME@_names; + }] +} + +proc critcl::literals::HeaderEnd {name} { + lappend map @NAME@ $name + return [string map $map { + #endif /* @NAME@_LITERALS_HEADER */ + }] +} + +proc critcl::literals::HeaderTcl {name} { + lappend map @NAME@ $name + return \n[critcl::at::here!][string map $map { + /* Tcl Accessor function for the literals */ + extern Tcl_Obj* + @NAME@ (Tcl_Interp* interp, @NAME@_names literal); + }] +} + +proc critcl::literals::HeaderC {name} { + lappend map @NAME@ $name + return \n[critcl::at::here!][string map $map { + /* C Accessor function for the literals */ + extern const char* @NAME@_cstr (@NAME@_names literal); + }] +} + +proc critcl::literals::ResultType {name} { + lappend map @NAME@ $name + critcl::resulttype $name \n[critcl::at::here!][string map $map { + /* @NAME@ result is effectively 0-refcount */ + Tcl_SetObjResult (interp, @NAME@ (interp, rv)); + return TCL_OK; + }] int +} + +proc critcl::literals::AccessorTcl {name} { + lappend map @NAME@ $name + critcl::ccode [critcl::at::here!][string map $map { + Tcl_Obj* + @NAME@ (Tcl_Interp* interp, @NAME@_names literal) + { + if ((literal < 0) || (literal >= @NAME@_name_LAST)) { + Tcl_Panic ("Bad @NAME@ literal"); + } + return @NAME@_iassoc (interp)->literal [literal]; + } + }] + return +} + +proc critcl::literals::AccessorC {name} { + upvar 1 mode mode + return [Tcl AccessorCWithTcl $name][!Tcl AccessorCRaw $name] +} + +proc critcl::literals::AccessorCWithTcl {name} { + # C accessor can use Tcl API + lappend map @NAME@ $name + critcl::ccode [critcl::at::here!][string map $map { + const char* + @NAME@_cstr (@NAME@_names literal) + { + if ((literal < 0) || (literal >= @NAME@_name_LAST)) { + Tcl_Panic ("Bad @NAME@ literal"); + } + return @NAME@_literal [literal]; + } + }] + return +} + +proc critcl::literals::AccessorCRaw {name} { + # C accessor has only basics + lappend map @NAME@ $name + critcl::ccode [critcl::at::here!][string map $map { + #include + const char* + @NAME@_cstr (@NAME@_names literal) + { + assert ((0 <= literal) && (literal < @NAME@_name_LAST)); + return @NAME@_literal [literal]; + } + }] + return +} + +proc critcl::literals::C {args} { + upvar 1 mode mode + if {!$mode(c)} return + return [uplevel 1 $args] +} + +proc critcl::literals::!C {args} { + upvar 1 mode mode + if {$mode(c)} return + return [uplevel 1 $args] +} + +proc critcl::literals::Tcl {args} { + upvar 1 mode mode + if {!$mode(tcl)} return + return [uplevel 1 $args] +} + +proc critcl::literals::!Tcl {args} { + upvar 1 mode mode + if {$mode(tcl)} return + return [uplevel 1 $args] +} + +# # ## ### ##### ######## ############# ##################### +## Export API + +namespace eval ::critcl::literals { + namespace export def + catch { namespace ensemble create } +} + +namespace eval ::critcl { + namespace export literals + catch { namespace ensemble create } +} + +# # ## ### ##### ######## ############# ##################### +## Ready +return diff -Nru critcl-3.1.9/lib/critcl-literals/pkgIndex.tcl critcl-3.1.17+dfsg/lib/critcl-literals/pkgIndex.tcl --- critcl-3.1.9/lib/critcl-literals/pkgIndex.tcl 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/lib/critcl-literals/pkgIndex.tcl 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1 @@ +package ifneeded critcl::literals 1.2 [list source [file join $dir literals.tcl]] diff -Nru critcl-3.1.9/lib/critcl-md5c/md5c_c/md5.c critcl-3.1.17+dfsg/lib/critcl-md5c/md5c_c/md5.c --- critcl-3.1.9/lib/critcl-md5c/md5c_c/md5.c 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/lib/critcl-md5c/md5c_c/md5.c 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,293 @@ +/* + *********************************************************************** + ** md5.c -- the source code for MD5 routines ** + ** RSA Data Security, Inc. MD5 Message-Digest Algorithm ** + ** Created: 2/17/90 RLR ** + ** Revised: 1/91 SRD,AJ,BSK,JT Reference C Version ** + *********************************************************************** + */ + +/* + * Edited 7 May 93 by CP to change the interface to match that + * of the MD5 routines in RSAREF. Due to this alteration, this + * code is "derived from the RSA Data Security, Inc. MD5 Message- + * Digest Algorithm". (See below.) + */ + +/* + *********************************************************************** + ** Copyright (C) 1990, RSA Data Security, Inc. All rights reserved. ** + ** ** + ** License to copy and use this software is granted provided that ** + ** it is identified as the "RSA Data Security, Inc. MD5 Message- ** + ** Digest Algorithm" in all material mentioning or referencing this ** + ** software or this function. ** + ** ** + ** License is also granted to make and use derivative works ** + ** provided that such works are identified as "derived from the RSA ** + ** Data Security, Inc. MD5 Message-Digest Algorithm" in all ** + ** material mentioning or referencing the derived work. ** + ** ** + ** RSA Data Security, Inc. makes no representations concerning ** + ** either the merchantability of this software or the suitability ** + ** of this software for any particular purpose. It is provided "as ** + ** is" without express or implied warranty of any kind. ** + ** ** + ** These notices must be retained in any copies of any part of this ** + ** documentation and/or software. ** + *********************************************************************** + */ + +#include "md5.h" + +/* + *********************************************************************** + ** Message-digest routines: ** + ** To form the message digest for a message M ** + ** (1) Initialize a context buffer mdContext using MD5Init ** + ** (2) Call MD5Update on mdContext and M ** + ** (3) Call MD5Final on mdContext ** + ** The message digest is now in the bugffer passed to MD5Final ** + *********************************************************************** + */ + +static unsigned char PADDING[64] = { + 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 +}; + +/* F, G, H and I are basic MD5 functions */ +#define F(x, y, z) (((x) & (y)) | ((~x) & (z))) +#define G(x, y, z) (((x) & (z)) | ((y) & (~z))) +#define H(x, y, z) ((x) ^ (y) ^ (z)) +#define I(x, y, z) ((y) ^ ((x) | (~z))) + +/* ROTATE_LEFT rotates x left n bits */ +#define ROTATE_LEFT(x, n) (((x) << (n)) | ((x) >> (32-(n)))) + +/* FF, GG, HH, and II transformations for rounds 1, 2, 3, and 4 */ +/* Rotation is separate from addition to prevent recomputation */ +#define FF(a, b, c, d, x, s, ac) \ + {(a) += F ((b), (c), (d)) + (x) + (UINT4)(ac); \ + (a) = ROTATE_LEFT ((a), (s)); \ + (a) += (b); \ + } +#define GG(a, b, c, d, x, s, ac) \ + {(a) += G ((b), (c), (d)) + (x) + (UINT4)(ac); \ + (a) = ROTATE_LEFT ((a), (s)); \ + (a) += (b); \ + } +#define HH(a, b, c, d, x, s, ac) \ + {(a) += H ((b), (c), (d)) + (x) + (UINT4)(ac); \ + (a) = ROTATE_LEFT ((a), (s)); \ + (a) += (b); \ + } +#define II(a, b, c, d, x, s, ac) \ + {(a) += I ((b), (c), (d)) + (x) + (UINT4)(ac); \ + (a) = ROTATE_LEFT ((a), (s)); \ + (a) += (b); \ + } + +/* The routine MD5Init initializes the message-digest context + mdContext. All fields are set to zero. + */ +void MD5Init (mdContext) +MD5_CTX *mdContext; +{ + mdContext->i[0] = mdContext->i[1] = (UINT4)0; + + /* Load magic initialization constants. + */ + mdContext->buf[0] = (UINT4)0x67452301L; + mdContext->buf[1] = (UINT4)0xefcdab89L; + mdContext->buf[2] = (UINT4)0x98badcfeL; + mdContext->buf[3] = (UINT4)0x10325476L; +} + +/* The routine MD5Update updates the message-digest context to + account for the presence of each of the characters inBuf[0..inLen-1] + in the message whose digest is being computed. + */ +void MD5Update (mdContext, inBuf, inLen) +register MD5_CTX *mdContext; unsigned char *inBuf; + unsigned int inLen; +{ + register int i, ii; + int mdi; + UINT4 in[16]; + + /* compute number of bytes mod 64 */ + mdi = (int)((mdContext->i[0] >> 3) & 0x3F); + + /* update number of bits */ + if ((mdContext->i[0] + ((UINT4)inLen << 3)) < mdContext->i[0]) + mdContext->i[1]++; + mdContext->i[0] += ((UINT4)inLen << 3); + mdContext->i[1] += ((UINT4)inLen >> 29); + + while (inLen--) { + /* add new character to buffer, increment mdi */ + mdContext->in[mdi++] = *inBuf++; + + /* transform if necessary */ + if (mdi == 0x40) { + for (i = 0, ii = 0; i < 16; i++, ii += 4) + in[i] = (((UINT4)mdContext->in[ii+3]) << 24) | + (((UINT4)mdContext->in[ii+2]) << 16) | + (((UINT4)mdContext->in[ii+1]) << 8) | + ((UINT4)mdContext->in[ii]); + Transform (mdContext->buf, in); + mdi = 0; + } + } +} + +/* The routine MD5Final terminates the message-digest computation and + ends with the desired message digest in mdContext->digest[0...15]. + */ +void MD5Final (digest, mdContext) +unsigned char digest[16]; MD5_CTX *mdContext; +{ + UINT4 in[16]; + int mdi; + unsigned int i, ii; + unsigned int padLen; + + /* save number of bits */ + in[14] = mdContext->i[0]; + in[15] = mdContext->i[1]; + + /* compute number of bytes mod 64 */ + mdi = (int)((mdContext->i[0] >> 3) & 0x3F); + + /* pad out to 56 mod 64 */ + padLen = (mdi < 56) ? (56 - mdi) : (120 - mdi); + MD5Update (mdContext, PADDING, padLen); + + /* append length in bits and transform */ + for (i = 0, ii = 0; i < 14; i++, ii += 4) + in[i] = (((UINT4)mdContext->in[ii+3]) << 24) | + (((UINT4)mdContext->in[ii+2]) << 16) | + (((UINT4)mdContext->in[ii+1]) << 8) | + ((UINT4)mdContext->in[ii]); + Transform (mdContext->buf, in); + + /* store buffer in digest */ + for (i = 0, ii = 0; i < 4; i++, ii += 4) { + digest[ii] = (unsigned char) (mdContext->buf[i] & 0xFF); + digest[ii+1] = (unsigned char)((mdContext->buf[i] >> 8) & 0xFF); + digest[ii+2] = (unsigned char)((mdContext->buf[i] >> 16) & 0xFF); + digest[ii+3] = (unsigned char)((mdContext->buf[i] >> 24) & 0xFF); + } +} + +/* Basic MD5 step. Transforms buf based on in. Note that if the Mysterious + Constants are arranged backwards in little-endian order and decrypted with + the DES they produce OCCULT MESSAGES! + */ +void Transform(buf, in) +register UINT4 *buf; +register UINT4 *in; +{ + register UINT4 a = buf[0], b = buf[1], c = buf[2], d = buf[3]; + + /* Round 1 */ +#define S11 7 +#define S12 12 +#define S13 17 +#define S14 22 + FF ( a, b, c, d, in[ 0], S11, 0xD76AA478L); /* 1 */ + FF ( d, a, b, c, in[ 1], S12, 0xE8C7B756L); /* 2 */ + FF ( c, d, a, b, in[ 2], S13, 0x242070DBL); /* 3 */ + FF ( b, c, d, a, in[ 3], S14, 0xC1BDCEEEL); /* 4 */ + FF ( a, b, c, d, in[ 4], S11, 0xF57C0FAFL); /* 5 */ + FF ( d, a, b, c, in[ 5], S12, 0x4787C62AL); /* 6 */ + FF ( c, d, a, b, in[ 6], S13, 0xA8304613L); /* 7 */ + FF ( b, c, d, a, in[ 7], S14, 0xFD469501L); /* 8 */ + FF ( a, b, c, d, in[ 8], S11, 0x698098D8L); /* 9 */ + FF ( d, a, b, c, in[ 9], S12, 0x8B44F7AFL); /* 10 */ + FF ( c, d, a, b, in[10], S13, 0xFFFF5BB1L); /* 11 */ + FF ( b, c, d, a, in[11], S14, 0x895CD7BEL); /* 12 */ + FF ( a, b, c, d, in[12], S11, 0x6B901122L); /* 13 */ + FF ( d, a, b, c, in[13], S12, 0xFD987193L); /* 14 */ + FF ( c, d, a, b, in[14], S13, 0xA679438EL); /* 15 */ + FF ( b, c, d, a, in[15], S14, 0x49B40821L); /* 16 */ + + /* Round 2 */ +#define S21 5 +#define S22 9 +#define S23 14 +#define S24 20 + GG ( a, b, c, d, in[ 1], S21, 0xF61E2562L); /* 17 */ + GG ( d, a, b, c, in[ 6], S22, 0xC040B340L); /* 18 */ + GG ( c, d, a, b, in[11], S23, 0x265E5A51L); /* 19 */ + GG ( b, c, d, a, in[ 0], S24, 0xE9B6C7AAL); /* 20 */ + GG ( a, b, c, d, in[ 5], S21, 0xD62F105DL); /* 21 */ + GG ( d, a, b, c, in[10], S22, 0x02441453L); /* 22 */ + GG ( c, d, a, b, in[15], S23, 0xD8A1E681L); /* 23 */ + GG ( b, c, d, a, in[ 4], S24, 0xE7D3FBC8L); /* 24 */ + GG ( a, b, c, d, in[ 9], S21, 0x21E1CDE6L); /* 25 */ + GG ( d, a, b, c, in[14], S22, 0xC33707D6L); /* 26 */ + GG ( c, d, a, b, in[ 3], S23, 0xF4D50D87L); /* 27 */ + GG ( b, c, d, a, in[ 8], S24, 0x455A14EDL); /* 28 */ + GG ( a, b, c, d, in[13], S21, 0xA9E3E905L); /* 29 */ + GG ( d, a, b, c, in[ 2], S22, 0xFCEFA3F8L); /* 30 */ + GG ( c, d, a, b, in[ 7], S23, 0x676F02D9L); /* 31 */ + GG ( b, c, d, a, in[12], S24, 0x8D2A4C8AL); /* 32 */ + + /* Round 3 */ +#define S31 4 +#define S32 11 +#define S33 16 +#define S34 23 + HH ( a, b, c, d, in[ 5], S31, 0xFFFA3942L); /* 33 */ + HH ( d, a, b, c, in[ 8], S32, 0x8771F681L); /* 34 */ + HH ( c, d, a, b, in[11], S33, 0x6D9D6122L); /* 35 */ + HH ( b, c, d, a, in[14], S34, 0xFDE5380CL); /* 36 */ + HH ( a, b, c, d, in[ 1], S31, 0xA4BEEA44L); /* 37 */ + HH ( d, a, b, c, in[ 4], S32, 0x4BDECFA9L); /* 38 */ + HH ( c, d, a, b, in[ 7], S33, 0xF6BB4B60L); /* 39 */ + HH ( b, c, d, a, in[10], S34, 0xBEBFBC70L); /* 40 */ + HH ( a, b, c, d, in[13], S31, 0x289B7EC6L); /* 41 */ + HH ( d, a, b, c, in[ 0], S32, 0xEAA127FAL); /* 42 */ + HH ( c, d, a, b, in[ 3], S33, 0xD4EF3085L); /* 43 */ + HH ( b, c, d, a, in[ 6], S34, 0x04881D05L); /* 44 */ + HH ( a, b, c, d, in[ 9], S31, 0xD9D4D039L); /* 45 */ + HH ( d, a, b, c, in[12], S32, 0xE6DB99E5L); /* 46 */ + HH ( c, d, a, b, in[15], S33, 0x1FA27CF8L); /* 47 */ + HH ( b, c, d, a, in[ 2], S34, 0xC4AC5665L); /* 48 */ + + /* Round 4 */ +#define S41 6 +#define S42 10 +#define S43 15 +#define S44 21 + II ( a, b, c, d, in[ 0], S41, 0xF4292244L); /* 49 */ + II ( d, a, b, c, in[ 7], S42, 0x432AFF97L); /* 50 */ + II ( c, d, a, b, in[14], S43, 0xAB9423A7L); /* 51 */ + II ( b, c, d, a, in[ 5], S44, 0xFC93A039L); /* 52 */ + II ( a, b, c, d, in[12], S41, 0x655B59C3L); /* 53 */ + II ( d, a, b, c, in[ 3], S42, 0x8F0CCC92L); /* 54 */ + II ( c, d, a, b, in[10], S43, 0xFFEFF47DL); /* 55 */ + II ( b, c, d, a, in[ 1], S44, 0x85845DD1L); /* 56 */ + II ( a, b, c, d, in[ 8], S41, 0x6FA87E4FL); /* 57 */ + II ( d, a, b, c, in[15], S42, 0xFE2CE6E0L); /* 58 */ + II ( c, d, a, b, in[ 6], S43, 0xA3014314L); /* 59 */ + II ( b, c, d, a, in[13], S44, 0x4E0811A1L); /* 60 */ + II ( a, b, c, d, in[ 4], S41, 0xF7537E82L); /* 61 */ + II ( d, a, b, c, in[11], S42, 0xBD3AF235L); /* 62 */ + II ( c, d, a, b, in[ 2], S43, 0x2AD7D2BBL); /* 63 */ + II ( b, c, d, a, in[ 9], S44, 0xEB86D391L); /* 64 */ + + buf[0] += a; + buf[1] += b; + buf[2] += c; + buf[3] += d; +} + diff -Nru critcl-3.1.9/lib/critcl-md5c/md5c_c/md5.h critcl-3.1.17+dfsg/lib/critcl-md5c/md5c_c/md5.h --- critcl-3.1.9/lib/critcl-md5c/md5c_c/md5.h 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/lib/critcl-md5c/md5c_c/md5.h 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,74 @@ +#ifndef MD5_H +#define MD5_H + +/* + *********************************************************************** + ** md5.h -- header file for implementation of MD5 ** + ** RSA Data Security, Inc. MD5 Message-Digest Algorithm ** + ** Created: 2/17/90 RLR ** + ** Revised: 12/27/90 SRD,AJ,BSK,JT Reference C version ** + ** Revised (for MD5): RLR 4/27/91 ** + ** -- G modified to have y&~z instead of y&z ** + ** -- FF, GG, HH modified to add in last register done ** + ** -- Access pattern: round 2 works mod 5, round 3 works mod 3 ** + ** -- distinct additive constant for each step ** + ** -- round 4 added, working mod 7 ** + *********************************************************************** + */ + +/* + * Edited 7 May 93 by CP to change the interface to match that + * of the MD5 routines in RSAREF. Due to this alteration, this + * code is "derived from the RSA Data Security, Inc. MD5 Message- + * Digest Algorithm". (See below.) Also added argument names + * to the prototypes. + */ + +/* + *********************************************************************** + ** Copyright (C) 1990, RSA Data Security, Inc. All rights reserved. ** + ** ** + ** License to copy and use this software is granted provided that ** + ** it is identified as the "RSA Data Security, Inc. MD5 Message- ** + ** Digest Algorithm" in all material mentioning or referencing this ** + ** software or this function. ** + ** ** + ** License is also granted to make and use derivative works ** + ** provided that such works are identified as "derived from the RSA ** + ** Data Security, Inc. MD5 Message-Digest Algorithm" in all ** + ** material mentioning or referencing the derived work. ** + ** ** + ** RSA Data Security, Inc. makes no representations concerning ** + ** either the merchantability of this software or the suitability ** + ** of this software for any particular purpose. It is provided "as ** + ** is" without express or implied warranty of any kind. ** + ** ** + ** These notices must be retained in any copies of any part of this ** + ** documentation and/or software. ** + *********************************************************************** + */ + +/* typedef a 32-bit unsigned integer type */ + +#include +#if UINT_MAX == 4294967295U + typedef unsigned int UINT4; +#elif ULONG_MAX == 4294967295UL + typedef unsigned long UINT4; +#else +#error "Unable to define UINT4, no 32bit unsigned integer type found" +#endif + +/* Data structure for MD5 (Message-Digest) computation */ +typedef struct { + UINT4 buf[4]; /* scratch buffer */ + UINT4 i[2]; /* number of _bits_ handled mod 2^64 */ + unsigned char in[64]; /* input buffer */ +} MD5_CTX; + +void MD5Init (MD5_CTX *mdContext); +void MD5Update (MD5_CTX *mdContext, unsigned char *buf, unsigned int len); +void MD5Final (unsigned char digest[16], MD5_CTX *mdContext); +void Transform (UINT4 *buf, UINT4 *in); + +#endif diff -Nru critcl-3.1.9/lib/critcl-md5c/md5c.tcl critcl-3.1.17+dfsg/lib/critcl-md5c/md5c.tcl --- critcl-3.1.9/lib/critcl-md5c/md5c.tcl 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/lib/critcl-md5c/md5c.tcl 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,146 @@ +# md5c.tcl - +# +# Wrapper for RSA's Message Digest in C +# +# Written by Jean-Claude Wippler +# +# $Id: md5c.tcl,v 1.5 2009/05/06 22:46:10 patthoyts Exp $ + +package require critcl +package provide critcl_md5c 0.12 + +critcl::cheaders md5c_c/md5.h; # The RSA header file +critcl::csources md5c_c/md5.c; # The RSA MD5 implementation. + +critcl::ccode { + #include + #include "md5.h" + #include + + static + Tcl_ObjType md5_type; /* fast internal access representation */ + + static void + md5_free_rep(Tcl_Obj *obj) + { + MD5_CTX *mp = (MD5_CTX *) obj->internalRep.otherValuePtr; + Tcl_Free((char*)mp); + } + + static void + md5_dup_rep(Tcl_Obj *obj, Tcl_Obj *dup) + { + MD5_CTX *mp = (MD5_CTX *) obj->internalRep.otherValuePtr; + dup->internalRep.otherValuePtr = Tcl_Alloc(sizeof *mp); + memcpy(dup->internalRep.otherValuePtr, mp, sizeof *mp); + dup->typePtr = &md5_type; + } + + static void + md5_string_rep(Tcl_Obj *obj) + { + unsigned char buf[16]; + Tcl_Obj *temp; + char *str; + MD5_CTX dup = *(MD5_CTX *) obj->internalRep.otherValuePtr; + + MD5Final(buf, &dup); + + /* convert via a byte array to properly handle null bytes */ + temp = Tcl_NewByteArrayObj(buf, sizeof buf); + Tcl_IncrRefCount(temp); + + str = Tcl_GetStringFromObj(temp, &obj->length); + obj->bytes = Tcl_Alloc(obj->length + 1); + memcpy(obj->bytes, str, obj->length + 1); + + Tcl_DecrRefCount(temp); + } + + static int + md5_from_any(Tcl_Interp* ip, Tcl_Obj* obj) + { + assert(0); + return TCL_ERROR; + } + + static + Tcl_ObjType md5_type = { + "md5c", md5_free_rep, md5_dup_rep, md5_string_rep, md5_from_any + }; +} + +critcl::ccommand md5c {dummy ip objc objv} { + MD5_CTX *mp; + unsigned char *data; + int size; + Tcl_Obj *obj; + + if (objc < 2 || objc > 3) { + Tcl_WrongNumArgs(ip, 1, objv, "data ?context?"); + return TCL_ERROR; + } + + if (objc == 3) { + if (objv[2]->typePtr != &md5_type && md5_from_any(ip, objv[2]) != TCL_OK) { + return TCL_ERROR; + } + obj = objv[2]; + if (Tcl_IsShared(obj)) { + obj = Tcl_DuplicateObj(obj); + } + } else { + mp = (MD5_CTX *)Tcl_Alloc(sizeof *mp); + MD5Init(mp); + obj = Tcl_NewObj(); + Tcl_InvalidateStringRep(obj); + obj->internalRep.otherValuePtr = mp; + obj->typePtr = &md5_type; + } + + mp = (MD5_CTX *) obj->internalRep.otherValuePtr; + data = Tcl_GetByteArrayFromObj(objv[1], &size); + + + MD5Update(mp, data, size); + Tcl_SetObjResult(ip, obj); + + return TCL_OK; +} + +if {[info exists pkgtest] && $pkgtest} { + + proc md5c_try {} { + foreach {msg expected} { + "" + "d41d8cd98f00b204e9800998ecf8427e" + "a" + "0cc175b9c0f1b6a831c399e269772661" + "abc" + "900150983cd24fb0d6963f7d28e17f72" + "message digest" + "f96b697d7cb7938d525a2f31aaf161d0" + "abcdefghijklmnopqrstuvwxyz" + "c3fcd3d76192e4007dfb496cca67e13b" + "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789" + "d174ab98d277d9f5a5611c2c9f419d9f" + "12345678901234567890123456789012345678901234567890123456789012345678901234567890" + "57edf4a22be3c955ac49da2e2107b67a" + } { + puts "testing: md5c \"$msg\"" + binary scan [md5c $msg] H* computed + puts "computed: $computed" + if {0 != [string compare $computed $expected]} { + puts "expected: $expected" + puts "FAILED" + } + } + + foreach len {10 50 100 500 1000 5000 10000} { + set blanks [format %$len.0s ""] + puts "input length $len: [time {md5c $blanks} 1000]" + } + } + + md5c_try +} diff -Nru critcl-3.1.9/lib/critcl-platform/pkgIndex.tcl critcl-3.1.17+dfsg/lib/critcl-platform/pkgIndex.tcl --- critcl-3.1.9/lib/critcl-platform/pkgIndex.tcl 2013-05-10 05:57:04.000000000 +0000 +++ critcl-3.1.17+dfsg/lib/critcl-platform/pkgIndex.tcl 2017-10-14 02:48:11.000000000 +0000 @@ -1,3 +1 @@ -package ifneeded critcl::platform 1.0.11 [list source [file join $dir platform.tcl]] -package ifneeded critcl::platform::shell 1.1.4 [list source [file join $dir shell.tcl]] - +package ifneeded critcl::platform 1.0.15 [list source [file join $dir platform.tcl]] diff -Nru critcl-3.1.9/lib/critcl-platform/platform.tcl critcl-3.1.17+dfsg/lib/critcl-platform/platform.tcl --- critcl-3.1.9/lib/critcl-platform/platform.tcl 2013-05-10 05:57:04.000000000 +0000 +++ critcl-3.1.17+dfsg/lib/critcl-platform/platform.tcl 2017-10-14 02:48:11.000000000 +0000 @@ -93,9 +93,16 @@ } } - switch -- $plat { + switch -glob -- $plat { + cygwin* { + set plat cygwin + } windows { - set plat win32 + if {$tcl_platform(platform) == "unix"} { + set plat cygwin + } else { + set plat win32 + } if {$cpu eq "amd64"} { # Do not check wordSize, win32-x64 is an IL32P64 platform. set cpu x86_64 @@ -161,6 +168,11 @@ regexp {^([^-]+)-([^-]+)$} $id -> plat cpu switch -- $plat { + freebsd { + set abi [lindex [split $tcl_platform(osVersion) .] 0] + append plat $abi + return "${plat}-${cpu}" + } solaris { regsub {^5} $tcl_platform(osVersion) 2 text append plat $text @@ -256,7 +268,7 @@ if {![catch { set vdata [lindex [split [exec $libc] \n] 0] }]} { - regexp {version ([0-9]+(\.[0-9]+)*), by} $vdata -> v + regexp {version ([0-9]+(\.[0-9]+)*)} $vdata -> v foreach {major minor} [split $v .] break set v glibc${major}.${minor} return 1 @@ -313,13 +325,25 @@ } } } + macosx-powerpc { + lappend res macosx-universal + } + macosx-x86_64 { + lappend res macosx-i386-x86_64 + } + macosx-ix86 { + lappend res macosx-universal macosx-i386-x86_64 + } macosx*-* { - # 10.5+ + # 10.5+ if {[regexp {macosx([^-]*)-(.*)} $id -> v cpu]} { switch -exact -- $cpu { - ix86 - - x86_64 { set alt i386-x86_64 } + ix86 { + lappend alt i386-x86_64 + lappend alt universal + } + x86_64 { lappend alt i386-x86_64 } default { set alt {} } } @@ -330,35 +354,26 @@ set res {} for {set j $minor} {$j >= 5} {incr j -1} { lappend res macosx${major}.${j}-${cpu} - lappend res macosx${major}.${j}-universal - if {$alt ne {}} { - lappend res macosx${major}.${j}-$alt + foreach a $alt { + lappend res macosx${major}.${j}-$a } } # Add unversioned patterns for 10.3/10.4 builds. lappend res macosx-${cpu} - lappend res macosx-universal - if {$alt ne {}} { - lappend res macosx-$alt + foreach a $alt { + lappend res macosx-$a } } else { - lappend res macosx-universal - if {$alt ne {}} { - lappend res macosx-$alt + # No version, just do unversioned patterns. + foreach a $alt { + lappend res macosx-$a } } } else { - lappend res macosx-universal + # no v, no cpu ... nothing } } - macosx-powerpc { - lappend res macosx-universal - } - macosx-x86_64 - - macosx-ix86 { - lappend res macosx-universal macosx-i386-x86_64 - } } lappend res tcl ; # Pure tcl packages are always compatible. return $res @@ -368,7 +383,7 @@ # ### ### ### ######### ######### ######### ## Ready -package provide critcl::platform 1.0.11 +package provide critcl::platform 1.0.15 # ### ### ### ######### ######### ######### ## Demo application diff -Nru critcl-3.1.9/lib/critcl-platform/shell.tcl critcl-3.1.17+dfsg/lib/critcl-platform/shell.tcl --- critcl-3.1.9/lib/critcl-platform/shell.tcl 2013-05-10 05:57:04.000000000 +0000 +++ critcl-3.1.17+dfsg/lib/critcl-platform/shell.tcl 1970-01-01 00:00:00.000000000 +0000 @@ -1,241 +0,0 @@ - -# -*- tcl -*- -# ### ### ### ######### ######### ######### -## Overview - -# Higher-level commands which invoke the functionality of this package -# for an arbitrary tcl shell (tclsh, wish, ...). This is required by a -# repository as while the tcl shell executing packages uses the same -# platform in general as a repository application there can be -# differences in detail (i.e. 32/64 bit builds). - -# ### ### ### ######### ######### ######### -## Requirements - -package require critcl::platform -namespace eval ::platform::shell {} - -# ### ### ### ######### ######### ######### -## Implementation - -# -- platform::shell::generic - -proc ::platform::shell::generic {shell} { - # Argument is the path to a tcl shell. - - CHECK $shell - LOCATE base out - - set code {} - # Forget any pre-existing platform package, it might be in - # conflict with this one. - lappend code {package forget platform} - # Inject our platform package - lappend code [list source $base] - # Query and print the architecture - lappend code {puts [platform::generic]} - # And done - lappend code {exit 0} - - set arch [RUN $shell [join $code \n]] - - if {$out} {file delete -force $base} - return $arch -} - -# -- platform::shell::identify - -proc ::platform::shell::identify {shell} { - # Argument is the path to a tcl shell. - - CHECK $shell - LOCATE base out - - set code {} - # Forget any pre-existing platform package, it might be in - # conflict with this one. - lappend code {package forget platform} - # Inject our platform package - lappend code [list source $base] - # Query and print the architecture - lappend code {puts [platform::identify]} - # And done - lappend code {exit 0} - - set arch [RUN $shell [join $code \n]] - - if {$out} {file delete -force $base} - return $arch -} - -# -- platform::shell::platform - -proc ::platform::shell::platform {shell} { - # Argument is the path to a tcl shell. - - CHECK $shell - - set code {} - lappend code {puts $tcl_platform(platform)} - lappend code {exit 0} - - return [RUN $shell [join $code \n]] -} - -# ### ### ### ######### ######### ######### -## Internal helper commands. - -proc ::platform::shell::CHECK {shell} { - if {![file exists $shell]} { - return -code error "Shell \"$shell\" does not exist" - } - if {![file executable $shell]} { - return -code error "Shell \"$shell\" is not executable (permissions)" - } - return -} - -proc ::platform::shell::LOCATE {bv ov} { - upvar 1 $bv base $ov out - - # Locate the platform package for injection into the specified - # shell. We are using package management to find it, whereever it - # is, instead of using hardwired relative paths. This allows us to - # install the two packages as TMs without breaking the code - # here. If the found package is wrapped we copy the code somewhere - # where the spawned shell will be able to read it. - - # This code is brittle, it needs has to adapt to whatever changes - # are made to the TM code, i.e. the provide statement generated by - # tm.tcl - - set pl [package ifneeded platform [package require platform]] - set base [lindex $pl end] - - set out 0 - if {[lindex [file system $base]] ne "native"} { - set temp [TEMP] - file copy -force $base $temp - set base $temp - set out 1 - } - return -} - -proc ::platform::shell::RUN {shell code} { - set c [TEMP] - set cc [open $c w] - puts $cc $code - close $cc - - set e [TEMP] - - set code [catch { - exec $shell $c 2> $e - } res] - - file delete $c - - if {$code} { - append res \n[read [set chan [open $e r]]][close $chan] - file delete $e - return -code error "Shell \"$shell\" is not executable ($res)" - } - - file delete $e - return $res -} - -proc ::platform::shell::TEMP {} { - set prefix platform - - # This code is copied out of Tcllib's fileutil package. - # (TempFile/tempfile) - - set tmpdir [DIR] - - set chars "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789" - set nrand_chars 10 - set maxtries 10 - set access [list RDWR CREAT EXCL TRUNC] - set permission 0600 - set channel "" - set checked_dir_writable 0 - set mypid [pid] - for {set i 0} {$i < $maxtries} {incr i} { - set newname $prefix - for {set j 0} {$j < $nrand_chars} {incr j} { - append newname [string index $chars \ - [expr {int(rand()*62)}]] - } - set newname [file join $tmpdir $newname] - if {[file exists $newname]} { - after 1 - } else { - if {[catch {open $newname $access $permission} channel]} { - if {!$checked_dir_writable} { - set dirname [file dirname $newname] - if {![file writable $dirname]} { - return -code error "Directory $dirname is not writable" - } - set checked_dir_writable 1 - } - } else { - # Success - close $channel - return [file normalize $newname] - } - } - } - if {[string compare $channel ""]} { - return -code error "Failed to open a temporary file: $channel" - } else { - return -code error "Failed to find an unused temporary file name" - } -} - -proc ::platform::shell::DIR {} { - # This code is copied out of Tcllib's fileutil package. - # (TempDir/tempdir) - - global tcl_platform env - - set attempdirs [list] - - foreach tmp {TMPDIR TEMP TMP} { - if { [info exists env($tmp)] } { - lappend attempdirs $env($tmp) - } - } - - switch $tcl_platform(platform) { - windows { - lappend attempdirs "C:\\TEMP" "C:\\TMP" "\\TEMP" "\\TMP" - } - macintosh { - set tmpdir $env(TRASH_FOLDER) ;# a better place? - } - default { - lappend attempdirs \ - [file join / tmp] \ - [file join / var tmp] \ - [file join / usr tmp] - } - } - - lappend attempdirs [pwd] - - foreach tmp $attempdirs { - if { [file isdirectory $tmp] && [file writable $tmp] } { - return [file normalize $tmp] - } - } - - # Fail if nothing worked. - return -code error "Unable to determine a proper directory for temporary files" -} - -# ### ### ### ######### ######### ######### -## Ready - -package provide critcl::platform::shell 1.1.4 diff -Nru critcl-3.1.9/lib/critcl-util/pkgIndex.tcl critcl-3.1.17+dfsg/lib/critcl-util/pkgIndex.tcl --- critcl-3.1.9/lib/critcl-util/pkgIndex.tcl 2013-05-10 05:57:04.000000000 +0000 +++ critcl-3.1.17+dfsg/lib/critcl-util/pkgIndex.tcl 2017-10-14 02:48:11.000000000 +0000 @@ -1 +1 @@ -package ifneeded critcl::util 1 [list source [file join $dir util.tcl]] +package ifneeded critcl::util 1.1 [list source [file join $dir util.tcl]] diff -Nru critcl-3.1.9/lib/critcl-util/util.tcl critcl-3.1.17+dfsg/lib/critcl-util/util.tcl --- critcl-3.1.9/lib/critcl-util/util.tcl 2013-05-10 05:57:04.000000000 +0000 +++ critcl-3.1.17+dfsg/lib/critcl-util/util.tcl 2017-10-14 02:48:11.000000000 +0000 @@ -5,7 +5,7 @@ # CriTcl Utility Commands. -package provide critcl::util 1 +package provide critcl::util 1.1 # # ## ### ##### ######## ############# ##################### ## Requirements. @@ -23,6 +23,30 @@ # # ## ### ##### ######## ############# ##################### ## Implementation -- API: Embed C Code +proc ::critcl::util::locate {label paths {cmd {}}} { + # Locate a file across set of paths. + # Relative paths are to "::critcl::Here". + # Paths are run through subst for dynamic construction. + # A command prefix can be specified, to further check/process each found path. + # Result is the found path, as coming from the paths argument. + # Should go into cheader or similar command. + # Failure to find is reported via critcl::error + + foreach path $paths { + if {[file pathtype $path] eq "relative"} { + set fullpath [file normalize [file join [critcl::Here] $path]] + } else { + set fullpath $path + } + if {![file exists $fullpath]} continue + if {[llength $cmd] && ![uplevel 1 [linsert $cmd end $fullpath]]} continue + critcl::msg "${label}: $path" + return $path + } + critcl::error "${label}: not found, searched [linsert [join $paths {, }] end-1 and]" + return +} + proc ::critcl::util::checkfun {name {label {}}} { variable cftemplate if {$label eq {}} { set label "Checking for function '$name'" } @@ -121,7 +145,7 @@ ## Export API namespace eval ::critcl::util { - namespace export checkfun def undef + namespace export checkfun def undef locate catch { namespace ensemble create } } diff -Nru critcl-3.1.9/lib/dict84/dict.tcl critcl-3.1.17+dfsg/lib/dict84/dict.tcl --- critcl-3.1.9/lib/dict84/dict.tcl 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/lib/dict84/dict.tcl 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,210 @@ +## -*- tcl -*- +# # ## ### ##### ######## ############# ##################### + +# Forward compatibility support for 'dict'. + +# # ## ### ##### ######## ############# ##################### +## Requirements. + +package require Tcl 8.4 ; # Minimum supported version. +package provide dict84 1 ; # What we export. + +# # ## ### ##### ######## ############# ##################### +## II. Make sure that the Tcl interpreter has a 'dict' command. + +# Bail out if we are in an environment which already provides the +# command. +if {[llength [info commands ::dict]]} return + +# First try to get the separate 'dict' package first. It is C-based, +# i.e. faster, and ActiveTcl 8.4, for example, has it. Bail out if we +# had success, for we now have the necessary commands. + +if {![catch { + package require dict +}]} return + +# Lastly use the poor man's dict -- a pure tcl [dict] emulation +# Very slow, but complete. +# Taken From http://wiki.tcl.tk/10609. +# +# Not all error checks are implemented! +# e.g. [dict create odd arguments here] will work +# +# Implementation is based on lists, [array set/get] +# and recursion + +proc dict {cmd args} { + uplevel 1 [linsert $args 0 _dict_$cmd] +} +proc _dict_get {dv args} { + if {![llength $args]} {return $dv} else { + array set dvx $dv + set key [lindex $args 0] + set dv $dvx($key) + set args [lrange $args 1 end] + return [eval [linsert $args 0 _dict_get $dv]] + } +} +proc _dict_exists {dv key args} { + array set dvx $dv + set r [info exists dvx($key)] + if {!$r} {return 0} + if {[llength $args]} { + return [eval [linsert $args 0 _dict_exists $dvx($key) ]] + } else {return 1} +} +proc _dict_set {dvar key value args } { + upvar 1 $dvar dv + if {![info exists dv]} {set dv [list]} + array set dvx $dv + if {![llength $args]} { + set dvx($key) $value + } else { + eval [linsert $args 0 _dict_set dvx($key) $value] + } + set dv [array get dvx] +} +proc _dict_unset {dvar key args} { + upvar 1 $dvar mydvar + if {![info exists mydvar]} {return} + array set dv $mydvar + if {![llength $args]} { + if {[info exists dv($key)]} { + unset dv($key) + } + } else { + eval [linsert $args 0 _dict_unset dv($key) ] + } + set mydvar [array get dv] + return {} +} +proc _dict_keys {dv {pat *}} { + array set dvx $dv + return [array names dvx $pat] +} +proc _dict_append {dvar key args} { + upvar 1 $dvar dv + if {![info exists dv]} {set dv [list]} + array set dvx $dv + eval [linsert $args 0 append dvx($key) ] + set dv [array get dvx] +} +proc _dict_create {args} { + return $args +} +proc _dict_filter {dv ftype args} { + set r [list] + foreach {globpattern} $args {break} + foreach {varlist script} $args {break} + + switch $ftype { + key { + foreach {key value} $dv { + if {[string match $globpattern $key]} { + lappend r $key $value + } + } + } + value { + foreach {key value} $dv { + if {[string match $globpattern $value]} { + lappend r $key $value + } + } + } + script { + foreach {Pkey Pval} $varlist {break} + upvar 1 $Pkey key $Pval value + foreach {key value} $dv { + if {[uplevel 1 $script]} { + lappend r $key $value + } + } + } + default { + error "Wrong filter type" + } + } + return $r +} +proc _dict_for {kv dict body} { + uplevel 1 [list foreach $kv $dict $body] +} +proc _dict_incr {dvar key {incr 1}} { + upvar 1 $dvar dv + if {![info exists dv]} {set dv [list]} + array set dvx $dv + if {![info exists dvx($key)]} {set dvx($key) 0} + incr dvx($key) $incr + set dv [array get dvx] +} +proc _dict_info {dv} { + return "Dictionary is represented as plain list" +} +proc _dict_lappend {dvar key args} { + upvar 1 $dvar dv + if {![info exists dv]} {set dv [list]} + array set dvx $dv + eval [linsert $args 0 lappend dvx($key)] + set dv [array get dvx] +} +proc _dict_merge {args} { + foreach dv $args { + array set dvx $dv + } + array get dvx +} +proc _dict_replace {dv args} { + foreach {k v} $args { + _dict_set dv $k $v + } + return $dv +} +proc _dict_remove {dv args} { + foreach k $args { + _dict_unset dv $k + } + return $dv +} +proc _dict_size {dv} { + return [expr {[llength $dv]/2}] +} +proc _dict_values {dv {gp *}} { + set r [list] + foreach {k v} $dv { + if {[string match $gp $v]} { + lappend r $v + } + } + return $r +} +proc _dict_update {dvar args} { + set name [string map {: {} ( {} ) {}} $dvar] + upvar 1 $dvar dv + upvar 1 _my_dict_array$name local + + array set local $dv + foreach {k v} [lrange $args 0 end-1] { + if {[info exists local($k)]} { + if {![uplevel 1 [list info exists $v]]} { + uplevel 1 [list upvar 0 _my_dict_array${name}($k) $v] + } else { + uplevel 1 [list set $v $local($k)] + } + } + } + set code [catch {uplevel 1 [lindex $args end]} res] + + foreach {k v} [lrange $args 0 end-1] { + if {[uplevel 1 [list info exists $v]]} { + set local($k) [uplevel 1 [list set $v]] + } else { + unset -nocomplain local($k) + } + } + set dv [array get local] + unset local + + return -code $code $res +} diff -Nru critcl-3.1.9/lib/dict84/pkgIndex.tcl critcl-3.1.17+dfsg/lib/dict84/pkgIndex.tcl --- critcl-3.1.9/lib/dict84/pkgIndex.tcl 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/lib/dict84/pkgIndex.tcl 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1 @@ +package ifneeded dict84 1 [list source [file join $dir dict.tcl]] diff -Nru critcl-3.1.9/lib/lassign84/lassign.tcl critcl-3.1.17+dfsg/lib/lassign84/lassign.tcl --- critcl-3.1.9/lib/lassign84/lassign.tcl 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/lib/lassign84/lassign.tcl 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,35 @@ +## -*- tcl -*- +# # ## ### ##### ######## ############# ##################### + +# Lassign. Forward compatibility support. + +# I.e. code implementing a number of commands for 8.4 which are +# otherwise only defined in 8.5+ + +# # ## ### ##### ######## ############# ##################### +## Requirements. + +package require Tcl 8.4 ; # Minimum supported version. +package provide lassign84 1.0.1 ; # What we export. + +# # ## ### ##### ######## ############# ##################### +## I. Make sure that the Tcl interpreter has a 'lassign' command. + +# Bail out if we are in an environment which already provides the +# command. +if {[llength [info commands ::lassign]]} return + +# Command is missing, provide our emulation. +proc lassign {valueList args} { + if {[llength $args] == 0} { + return -code error "wrong # args: lassign list varname ?varname..?" + } + foreach v $args { uplevel 1 [list set $v {}] } + uplevel 1 [list foreach $args $valueList {break}] + return [lrange $valueList [llength $args] end] +} + +## +# # ## ### ##### ######## ############# ##################### +## Ready +return diff -Nru critcl-3.1.9/lib/lassign84/pkgIndex.tcl critcl-3.1.17+dfsg/lib/lassign84/pkgIndex.tcl --- critcl-3.1.9/lib/lassign84/pkgIndex.tcl 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/lib/lassign84/pkgIndex.tcl 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1 @@ +package ifneeded lassign84 1.0.1 [list source [file join $dir lassign.tcl]] diff -Nru critcl-3.1.9/lib/lmap84/lmap.tcl critcl-3.1.17+dfsg/lib/lmap84/lmap.tcl --- critcl-3.1.9/lib/lmap84/lmap.tcl 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/lib/lmap84/lmap.tcl 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,82 @@ +# -*- tcl -*- +## +# (c) 2017 Andreas Kupries http://wiki.tcl.tk/andreas%20kupries +# http://core.tcl.tk/akupries/ +## +# Lmap. Forward compatibility support. + +# I.e. code implementing a number of commands for 8.4 which are +# otherwise only defined in 8.5+ + +# # ## ### ##### ######## ############# ##################### +## Requirements. + +package require Tcl 8.4 ; # Minimum supported version. +package provide lmap84 1 ; # What we export. + +# # ## ### ##### ######## ############# ##################### +## I. Make sure that the Tcl interpreter has a 'lmap' command. + +# Bail out if we are in an environment which already provides the +# command. +if {[llength [info commands ::lmap]]} return + +# # ## ### ##### ######## ############# +## Forward compatibility for lmap, conditional implementation + +if {[package vsatisfies [package present Tcl] 8.5]} { + # http://wiki.tcl.tk/40570 + # lmap forward compatibility + # 8.5 - We have {*} + + proc lmap {args} { + set body [lindex $args end] + set args [lrange $args 0 end-1] + set n 0 + set pairs [list] + # Import all variables into local scope + foreach {varnames listval} $args { + set varlist [list] + foreach varname $varnames { + upvar 1 $varname var$n + lappend varlist var$n + incr n + } + lappend pairs $varlist $listval + } + # Run the actual operation via foreach + set temp [list] + foreach {*}$pairs { + lappend temp [uplevel 1 $body] + } + set temp + } +} else { + # Tcl 8.4. We do not have {*}. + # Fall back to eval of a list (single command) + + proc lmap {args} { + lappend cmd foreach + set body [lindex $args end] + set args [lrange $args 0 end-1] + set n 0 + # Import all variables into local scope + foreach {varnames listval} $args { + set varlist [list] + foreach varname $varnames { + upvar 1 $varname var$n + lappend varlist var$n + incr n + } + lappend cmd $varlist $listval + } + # Run the actual operation via foreach + lappend cmd { lappend temp [uplevel 1 $body] } + set temp [list] + eval $cmd + set temp + } +} + +# # ## ### ##### ######## ############# +return diff -Nru critcl-3.1.9/lib/lmap84/pkgIndex.tcl critcl-3.1.17+dfsg/lib/lmap84/pkgIndex.tcl --- critcl-3.1.9/lib/lmap84/pkgIndex.tcl 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/lib/lmap84/pkgIndex.tcl 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1 @@ +package ifneeded lmap84 1 [list source [file join $dir lmap.tcl]] diff -Nru critcl-3.1.9/lib/md5c/md5c_c/md5.c critcl-3.1.17+dfsg/lib/md5c/md5c_c/md5.c --- critcl-3.1.9/lib/md5c/md5c_c/md5.c 2013-05-10 05:57:04.000000000 +0000 +++ critcl-3.1.17+dfsg/lib/md5c/md5c_c/md5.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,293 +0,0 @@ -/* - *********************************************************************** - ** md5.c -- the source code for MD5 routines ** - ** RSA Data Security, Inc. MD5 Message-Digest Algorithm ** - ** Created: 2/17/90 RLR ** - ** Revised: 1/91 SRD,AJ,BSK,JT Reference C Version ** - *********************************************************************** - */ - -/* - * Edited 7 May 93 by CP to change the interface to match that - * of the MD5 routines in RSAREF. Due to this alteration, this - * code is "derived from the RSA Data Security, Inc. MD5 Message- - * Digest Algorithm". (See below.) - */ - -/* - *********************************************************************** - ** Copyright (C) 1990, RSA Data Security, Inc. All rights reserved. ** - ** ** - ** License to copy and use this software is granted provided that ** - ** it is identified as the "RSA Data Security, Inc. MD5 Message- ** - ** Digest Algorithm" in all material mentioning or referencing this ** - ** software or this function. ** - ** ** - ** License is also granted to make and use derivative works ** - ** provided that such works are identified as "derived from the RSA ** - ** Data Security, Inc. MD5 Message-Digest Algorithm" in all ** - ** material mentioning or referencing the derived work. ** - ** ** - ** RSA Data Security, Inc. makes no representations concerning ** - ** either the merchantability of this software or the suitability ** - ** of this software for any particular purpose. It is provided "as ** - ** is" without express or implied warranty of any kind. ** - ** ** - ** These notices must be retained in any copies of any part of this ** - ** documentation and/or software. ** - *********************************************************************** - */ - -#include "md5.h" - -/* - *********************************************************************** - ** Message-digest routines: ** - ** To form the message digest for a message M ** - ** (1) Initialize a context buffer mdContext using MD5Init ** - ** (2) Call MD5Update on mdContext and M ** - ** (3) Call MD5Final on mdContext ** - ** The message digest is now in the bugffer passed to MD5Final ** - *********************************************************************** - */ - -static unsigned char PADDING[64] = { - 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -}; - -/* F, G, H and I are basic MD5 functions */ -#define F(x, y, z) (((x) & (y)) | ((~x) & (z))) -#define G(x, y, z) (((x) & (z)) | ((y) & (~z))) -#define H(x, y, z) ((x) ^ (y) ^ (z)) -#define I(x, y, z) ((y) ^ ((x) | (~z))) - -/* ROTATE_LEFT rotates x left n bits */ -#define ROTATE_LEFT(x, n) (((x) << (n)) | ((x) >> (32-(n)))) - -/* FF, GG, HH, and II transformations for rounds 1, 2, 3, and 4 */ -/* Rotation is separate from addition to prevent recomputation */ -#define FF(a, b, c, d, x, s, ac) \ - {(a) += F ((b), (c), (d)) + (x) + (UINT4)(ac); \ - (a) = ROTATE_LEFT ((a), (s)); \ - (a) += (b); \ - } -#define GG(a, b, c, d, x, s, ac) \ - {(a) += G ((b), (c), (d)) + (x) + (UINT4)(ac); \ - (a) = ROTATE_LEFT ((a), (s)); \ - (a) += (b); \ - } -#define HH(a, b, c, d, x, s, ac) \ - {(a) += H ((b), (c), (d)) + (x) + (UINT4)(ac); \ - (a) = ROTATE_LEFT ((a), (s)); \ - (a) += (b); \ - } -#define II(a, b, c, d, x, s, ac) \ - {(a) += I ((b), (c), (d)) + (x) + (UINT4)(ac); \ - (a) = ROTATE_LEFT ((a), (s)); \ - (a) += (b); \ - } - -/* The routine MD5Init initializes the message-digest context - mdContext. All fields are set to zero. - */ -void MD5Init (mdContext) -MD5_CTX *mdContext; -{ - mdContext->i[0] = mdContext->i[1] = (UINT4)0; - - /* Load magic initialization constants. - */ - mdContext->buf[0] = (UINT4)0x67452301L; - mdContext->buf[1] = (UINT4)0xefcdab89L; - mdContext->buf[2] = (UINT4)0x98badcfeL; - mdContext->buf[3] = (UINT4)0x10325476L; -} - -/* The routine MD5Update updates the message-digest context to - account for the presence of each of the characters inBuf[0..inLen-1] - in the message whose digest is being computed. - */ -void MD5Update (mdContext, inBuf, inLen) -register MD5_CTX *mdContext; unsigned char *inBuf; - unsigned int inLen; -{ - register int i, ii; - int mdi; - UINT4 in[16]; - - /* compute number of bytes mod 64 */ - mdi = (int)((mdContext->i[0] >> 3) & 0x3F); - - /* update number of bits */ - if ((mdContext->i[0] + ((UINT4)inLen << 3)) < mdContext->i[0]) - mdContext->i[1]++; - mdContext->i[0] += ((UINT4)inLen << 3); - mdContext->i[1] += ((UINT4)inLen >> 29); - - while (inLen--) { - /* add new character to buffer, increment mdi */ - mdContext->in[mdi++] = *inBuf++; - - /* transform if necessary */ - if (mdi == 0x40) { - for (i = 0, ii = 0; i < 16; i++, ii += 4) - in[i] = (((UINT4)mdContext->in[ii+3]) << 24) | - (((UINT4)mdContext->in[ii+2]) << 16) | - (((UINT4)mdContext->in[ii+1]) << 8) | - ((UINT4)mdContext->in[ii]); - Transform (mdContext->buf, in); - mdi = 0; - } - } -} - -/* The routine MD5Final terminates the message-digest computation and - ends with the desired message digest in mdContext->digest[0...15]. - */ -void MD5Final (digest, mdContext) -unsigned char digest[16]; MD5_CTX *mdContext; -{ - UINT4 in[16]; - int mdi; - unsigned int i, ii; - unsigned int padLen; - - /* save number of bits */ - in[14] = mdContext->i[0]; - in[15] = mdContext->i[1]; - - /* compute number of bytes mod 64 */ - mdi = (int)((mdContext->i[0] >> 3) & 0x3F); - - /* pad out to 56 mod 64 */ - padLen = (mdi < 56) ? (56 - mdi) : (120 - mdi); - MD5Update (mdContext, PADDING, padLen); - - /* append length in bits and transform */ - for (i = 0, ii = 0; i < 14; i++, ii += 4) - in[i] = (((UINT4)mdContext->in[ii+3]) << 24) | - (((UINT4)mdContext->in[ii+2]) << 16) | - (((UINT4)mdContext->in[ii+1]) << 8) | - ((UINT4)mdContext->in[ii]); - Transform (mdContext->buf, in); - - /* store buffer in digest */ - for (i = 0, ii = 0; i < 4; i++, ii += 4) { - digest[ii] = (unsigned char) (mdContext->buf[i] & 0xFF); - digest[ii+1] = (unsigned char)((mdContext->buf[i] >> 8) & 0xFF); - digest[ii+2] = (unsigned char)((mdContext->buf[i] >> 16) & 0xFF); - digest[ii+3] = (unsigned char)((mdContext->buf[i] >> 24) & 0xFF); - } -} - -/* Basic MD5 step. Transforms buf based on in. Note that if the Mysterious - Constants are arranged backwards in little-endian order and decrypted with - the DES they produce OCCULT MESSAGES! - */ -void Transform(buf, in) -register UINT4 *buf; -register UINT4 *in; -{ - register UINT4 a = buf[0], b = buf[1], c = buf[2], d = buf[3]; - - /* Round 1 */ -#define S11 7 -#define S12 12 -#define S13 17 -#define S14 22 - FF ( a, b, c, d, in[ 0], S11, 0xD76AA478L); /* 1 */ - FF ( d, a, b, c, in[ 1], S12, 0xE8C7B756L); /* 2 */ - FF ( c, d, a, b, in[ 2], S13, 0x242070DBL); /* 3 */ - FF ( b, c, d, a, in[ 3], S14, 0xC1BDCEEEL); /* 4 */ - FF ( a, b, c, d, in[ 4], S11, 0xF57C0FAFL); /* 5 */ - FF ( d, a, b, c, in[ 5], S12, 0x4787C62AL); /* 6 */ - FF ( c, d, a, b, in[ 6], S13, 0xA8304613L); /* 7 */ - FF ( b, c, d, a, in[ 7], S14, 0xFD469501L); /* 8 */ - FF ( a, b, c, d, in[ 8], S11, 0x698098D8L); /* 9 */ - FF ( d, a, b, c, in[ 9], S12, 0x8B44F7AFL); /* 10 */ - FF ( c, d, a, b, in[10], S13, 0xFFFF5BB1L); /* 11 */ - FF ( b, c, d, a, in[11], S14, 0x895CD7BEL); /* 12 */ - FF ( a, b, c, d, in[12], S11, 0x6B901122L); /* 13 */ - FF ( d, a, b, c, in[13], S12, 0xFD987193L); /* 14 */ - FF ( c, d, a, b, in[14], S13, 0xA679438EL); /* 15 */ - FF ( b, c, d, a, in[15], S14, 0x49B40821L); /* 16 */ - - /* Round 2 */ -#define S21 5 -#define S22 9 -#define S23 14 -#define S24 20 - GG ( a, b, c, d, in[ 1], S21, 0xF61E2562L); /* 17 */ - GG ( d, a, b, c, in[ 6], S22, 0xC040B340L); /* 18 */ - GG ( c, d, a, b, in[11], S23, 0x265E5A51L); /* 19 */ - GG ( b, c, d, a, in[ 0], S24, 0xE9B6C7AAL); /* 20 */ - GG ( a, b, c, d, in[ 5], S21, 0xD62F105DL); /* 21 */ - GG ( d, a, b, c, in[10], S22, 0x02441453L); /* 22 */ - GG ( c, d, a, b, in[15], S23, 0xD8A1E681L); /* 23 */ - GG ( b, c, d, a, in[ 4], S24, 0xE7D3FBC8L); /* 24 */ - GG ( a, b, c, d, in[ 9], S21, 0x21E1CDE6L); /* 25 */ - GG ( d, a, b, c, in[14], S22, 0xC33707D6L); /* 26 */ - GG ( c, d, a, b, in[ 3], S23, 0xF4D50D87L); /* 27 */ - GG ( b, c, d, a, in[ 8], S24, 0x455A14EDL); /* 28 */ - GG ( a, b, c, d, in[13], S21, 0xA9E3E905L); /* 29 */ - GG ( d, a, b, c, in[ 2], S22, 0xFCEFA3F8L); /* 30 */ - GG ( c, d, a, b, in[ 7], S23, 0x676F02D9L); /* 31 */ - GG ( b, c, d, a, in[12], S24, 0x8D2A4C8AL); /* 32 */ - - /* Round 3 */ -#define S31 4 -#define S32 11 -#define S33 16 -#define S34 23 - HH ( a, b, c, d, in[ 5], S31, 0xFFFA3942L); /* 33 */ - HH ( d, a, b, c, in[ 8], S32, 0x8771F681L); /* 34 */ - HH ( c, d, a, b, in[11], S33, 0x6D9D6122L); /* 35 */ - HH ( b, c, d, a, in[14], S34, 0xFDE5380CL); /* 36 */ - HH ( a, b, c, d, in[ 1], S31, 0xA4BEEA44L); /* 37 */ - HH ( d, a, b, c, in[ 4], S32, 0x4BDECFA9L); /* 38 */ - HH ( c, d, a, b, in[ 7], S33, 0xF6BB4B60L); /* 39 */ - HH ( b, c, d, a, in[10], S34, 0xBEBFBC70L); /* 40 */ - HH ( a, b, c, d, in[13], S31, 0x289B7EC6L); /* 41 */ - HH ( d, a, b, c, in[ 0], S32, 0xEAA127FAL); /* 42 */ - HH ( c, d, a, b, in[ 3], S33, 0xD4EF3085L); /* 43 */ - HH ( b, c, d, a, in[ 6], S34, 0x04881D05L); /* 44 */ - HH ( a, b, c, d, in[ 9], S31, 0xD9D4D039L); /* 45 */ - HH ( d, a, b, c, in[12], S32, 0xE6DB99E5L); /* 46 */ - HH ( c, d, a, b, in[15], S33, 0x1FA27CF8L); /* 47 */ - HH ( b, c, d, a, in[ 2], S34, 0xC4AC5665L); /* 48 */ - - /* Round 4 */ -#define S41 6 -#define S42 10 -#define S43 15 -#define S44 21 - II ( a, b, c, d, in[ 0], S41, 0xF4292244L); /* 49 */ - II ( d, a, b, c, in[ 7], S42, 0x432AFF97L); /* 50 */ - II ( c, d, a, b, in[14], S43, 0xAB9423A7L); /* 51 */ - II ( b, c, d, a, in[ 5], S44, 0xFC93A039L); /* 52 */ - II ( a, b, c, d, in[12], S41, 0x655B59C3L); /* 53 */ - II ( d, a, b, c, in[ 3], S42, 0x8F0CCC92L); /* 54 */ - II ( c, d, a, b, in[10], S43, 0xFFEFF47DL); /* 55 */ - II ( b, c, d, a, in[ 1], S44, 0x85845DD1L); /* 56 */ - II ( a, b, c, d, in[ 8], S41, 0x6FA87E4FL); /* 57 */ - II ( d, a, b, c, in[15], S42, 0xFE2CE6E0L); /* 58 */ - II ( c, d, a, b, in[ 6], S43, 0xA3014314L); /* 59 */ - II ( b, c, d, a, in[13], S44, 0x4E0811A1L); /* 60 */ - II ( a, b, c, d, in[ 4], S41, 0xF7537E82L); /* 61 */ - II ( d, a, b, c, in[11], S42, 0xBD3AF235L); /* 62 */ - II ( c, d, a, b, in[ 2], S43, 0x2AD7D2BBL); /* 63 */ - II ( b, c, d, a, in[ 9], S44, 0xEB86D391L); /* 64 */ - - buf[0] += a; - buf[1] += b; - buf[2] += c; - buf[3] += d; -} - diff -Nru critcl-3.1.9/lib/md5c/md5c_c/md5.h critcl-3.1.17+dfsg/lib/md5c/md5c_c/md5.h --- critcl-3.1.9/lib/md5c/md5c_c/md5.h 2013-05-10 05:57:04.000000000 +0000 +++ critcl-3.1.17+dfsg/lib/md5c/md5c_c/md5.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,70 +0,0 @@ -#ifndef MD5_H -#define MD5_H - -/* - *********************************************************************** - ** md5.h -- header file for implementation of MD5 ** - ** RSA Data Security, Inc. MD5 Message-Digest Algorithm ** - ** Created: 2/17/90 RLR ** - ** Revised: 12/27/90 SRD,AJ,BSK,JT Reference C version ** - ** Revised (for MD5): RLR 4/27/91 ** - ** -- G modified to have y&~z instead of y&z ** - ** -- FF, GG, HH modified to add in last register done ** - ** -- Access pattern: round 2 works mod 5, round 3 works mod 3 ** - ** -- distinct additive constant for each step ** - ** -- round 4 added, working mod 7 ** - *********************************************************************** - */ - -/* - * Edited 7 May 93 by CP to change the interface to match that - * of the MD5 routines in RSAREF. Due to this alteration, this - * code is "derived from the RSA Data Security, Inc. MD5 Message- - * Digest Algorithm". (See below.) Also added argument names - * to the prototypes. - */ - -/* - *********************************************************************** - ** Copyright (C) 1990, RSA Data Security, Inc. All rights reserved. ** - ** ** - ** License to copy and use this software is granted provided that ** - ** it is identified as the "RSA Data Security, Inc. MD5 Message- ** - ** Digest Algorithm" in all material mentioning or referencing this ** - ** software or this function. ** - ** ** - ** License is also granted to make and use derivative works ** - ** provided that such works are identified as "derived from the RSA ** - ** Data Security, Inc. MD5 Message-Digest Algorithm" in all ** - ** material mentioning or referencing the derived work. ** - ** ** - ** RSA Data Security, Inc. makes no representations concerning ** - ** either the merchantability of this software or the suitability ** - ** of this software for any particular purpose. It is provided "as ** - ** is" without express or implied warranty of any kind. ** - ** ** - ** These notices must be retained in any copies of any part of this ** - ** documentation and/or software. ** - *********************************************************************** - */ - -/* typedef a 32-bit type */ -#ifdef __alpha -typedef unsigned int UINT4; -#else -typedef unsigned long int UINT4; -#endif - -/* Data structure for MD5 (Message-Digest) computation */ -typedef struct { - UINT4 buf[4]; /* scratch buffer */ - UINT4 i[2]; /* number of _bits_ handled mod 2^64 */ - unsigned char in[64]; /* input buffer */ -} MD5_CTX; - -void MD5Init (MD5_CTX *mdContext); -void MD5Update (MD5_CTX *mdContext, unsigned char *buf, unsigned int len); -void MD5Final (unsigned char digest[16], MD5_CTX *mdContext); -void Transform (UINT4 *buf, UINT4 *in); - -#endif diff -Nru critcl-3.1.9/lib/md5c/md5c.tcl critcl-3.1.17+dfsg/lib/md5c/md5c.tcl --- critcl-3.1.9/lib/md5c/md5c.tcl 2013-05-10 05:57:04.000000000 +0000 +++ critcl-3.1.17+dfsg/lib/md5c/md5c.tcl 1970-01-01 00:00:00.000000000 +0000 @@ -1,146 +0,0 @@ -# Wrapper for RSA's Message Digest in C - -package provide md5c 0.11 -package require critcl - -critcl::cheaders md5c_c/md5.h -critcl::csources md5c_c/md5.c - -critcl::ccode { - #include "md5.h" - #include - #include - #include - - static - Tcl_ObjType md5_type; /* fast internal access representation */ - - static void - md5_free_rep(Tcl_Obj* obj) - { - MD5_CTX* mp = (MD5_CTX*) obj->internalRep.otherValuePtr; - free(mp); - } - - static void - md5_dup_rep(Tcl_Obj* obj, Tcl_Obj* dup) - { - MD5_CTX* mp = (MD5_CTX*) obj->internalRep.otherValuePtr; - dup->internalRep.otherValuePtr = malloc(sizeof *mp); - memcpy(dup->internalRep.otherValuePtr, mp, sizeof *mp); - dup->typePtr = &md5_type; - } - - static void - md5_string_rep(Tcl_Obj* obj) - { - unsigned char buf[16]; - Tcl_Obj* temp; - char* str; - MD5_CTX dup = *(MD5_CTX*) obj->internalRep.otherValuePtr; - - MD5Final(buf, &dup); - - /* convert via a byte array to properly handle null bytes */ - temp = Tcl_NewByteArrayObj(buf, sizeof buf); - Tcl_IncrRefCount(temp); - - str = Tcl_GetStringFromObj(temp, &obj->length); - obj->bytes = Tcl_Alloc(obj->length + 1); - memcpy(obj->bytes, str, obj->length + 1); - - Tcl_DecrRefCount(temp); - } - - static int - md5_from_any(Tcl_Interp* ip, Tcl_Obj* obj) - { - assert(0); - return TCL_ERROR; - } - - static - Tcl_ObjType md5_type = { - "md5c", md5_free_rep, md5_dup_rep, md5_string_rep, md5_from_any - }; -} - -critcl::ccommand md5c {dummy ip objc objv} { - MD5_CTX* mp; - unsigned char* data; - int size; - Tcl_Obj* obj; - - //Tcl_RegisterObjType(&md5_type); - - if (objc < 2 || objc > 3) { - Tcl_WrongNumArgs(ip, 1, objv, "data ?context?"); - return TCL_ERROR; - } - - if (objc == 3) { - if (objv[2]->typePtr != &md5_type && md5_from_any(ip, objv[2]) != TCL_OK) - return TCL_ERROR; - obj = objv[2]; - if (Tcl_IsShared(obj)) - obj = Tcl_DuplicateObj(obj); - } else { - obj = Tcl_NewObj(); - mp = (MD5_CTX*) malloc(sizeof *mp); - MD5Init(mp); - - if (obj->typePtr != NULL && obj->typePtr->freeIntRepProc != NULL) - obj->typePtr->freeIntRepProc(obj); - - obj->internalRep.otherValuePtr = mp; - obj->typePtr = &md5_type; - } - - Tcl_SetObjResult(ip, obj); - Tcl_IncrRefCount(obj); //!! huh? - - Tcl_InvalidateStringRep(obj); - mp = (MD5_CTX*) obj->internalRep.otherValuePtr; - - data = Tcl_GetByteArrayFromObj(objv[1], &size); - MD5Update(mp, data, size); - - return TCL_OK; -} - -if {[info exists pkgtest] && $pkgtest} { - - proc md5c_try {} { - foreach {msg expected} { - "" - "d41d8cd98f00b204e9800998ecf8427e" - "a" - "0cc175b9c0f1b6a831c399e269772661" - "abc" - "900150983cd24fb0d6963f7d28e17f72" - "message digest" - "f96b697d7cb7938d525a2f31aaf161d0" - "abcdefghijklmnopqrstuvwxyz" - "c3fcd3d76192e4007dfb496cca67e13b" - "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789" - "d174ab98d277d9f5a5611c2c9f419d9f" - "12345678901234567890123456789012345678901234567890123456789012345678901234567890" - "57edf4a22be3c955ac49da2e2107b67a" - } { - puts "testing: md5 \"$msg\"" - binary scan [md5c $msg] H* computed - puts "computed: $computed" - if {0 != [string compare $computed $expected]} { - puts "expected: $expected" - puts "FAILED" - } - } - - foreach len {10 50 100 500 1000 5000 10000} { - set blanks [format %$len.0s ""] - puts "input length $len: [time {md5c $blanks} 1000]" - } - } - - md5c_try -} diff -Nru critcl-3.1.9/lib/stubs/container.tcl critcl-3.1.17+dfsg/lib/stubs/container.tcl --- critcl-3.1.9/lib/stubs/container.tcl 2013-05-10 05:57:04.000000000 +0000 +++ critcl-3.1.17+dfsg/lib/stubs/container.tcl 1970-01-01 00:00:00.000000000 +0000 @@ -1,386 +0,0 @@ -# -*- tcl -*- -# STUBS handling -- Container. -# -# (c) 2011 Andreas Kupries http://wiki.tcl.tk/andreas%20kupries - -# A stubs table is represented by a dictionary value. -# A container is a variable holding a stubs table value. - -# stubs table dictionary keys -# -# library -- -# -# The name of the entire library. This value is used to compute -# the USE_*_STUB_PROCS macro and the name of the init file. -# -# interfaces -- -# -# A dictionary indexed by interface name that is used to maintain -# the set of valid interfaces. The value is empty. -# -# scspec -- -# -# Storage class specifier for external function declarations. -# Normally "EXTERN", may be set to something like XYZAPI -# -# epoch, revision -- -# -# The epoch and revision numbers of the interface currently being defined. -# (@@@TODO: should be an array mapping interface names -> numbers) -# -# hooks -- -# -# A dictionary indexed by interface name that contains the set of -# subinterfaces that should be defined for a given interface. -# -# stubs -- -# -# This three dimensional dictionary is indexed first by interface -# name, second by platform name, and third by a numeric -# offset. Each numeric offset contains the C function -# specification that should be used for the given entry in the -# table. The specification consists of a list in the form returned -# by ParseDecl in the stubs reader package, i.e. -# -# decl = list (return-type fun-name arguments) -# arguments = void | list (arg-info ...) -# arg-info = list (type name ?array?) -# array = '[]' -# -# last -- -# -# This two dimensional dictionary is indexed first by interface name, -# and second by platform name. The associated entry contains the -# largest numeric offset used for a given interface/platform -# combo. - -# # ## ### ##### ######## ############# -## Requisites - -package require Tcl 8.4 -package require dict84 ; # Ensure presence of a dict command. - -namespace eval ::stubs::container {} - -# # ## ### ##### ######## ############# -## Implementation. - -proc ::stubs::container::new {} { - return { - library "UNKNOWN" - interfaces {} - hooks {} - stubs {} - last {} - scspec "EXTERN" - epoch {} - revision 0 - } -} - -# Methods to incrementally fill the container with data. Strongly -# related to the API commands of the stubs reader package. - -proc ::stubs::container::library {tablevar name} { - upvar 1 $tablevar t - dict set t library $name - return -} - -proc ::stubs::container::interface {tablevar name} { - upvar 1 $tablevar t - if {[dict exists $t interfaces $name]} { - return -code error "Duplicate declaration of interface \"$name\"" - } - dict set t interfaces $name {} - return -} - -proc ::stubs::container::scspec {tablevar value} { - upvar 1 $tablevar t - dict set t scspec $value - return -} - -proc ::stubs::container::epoch {tablevar value} { - upvar 1 $tablevar t - - if {![string is integer -strict $value]} { - return -code error "Expected integer for epoch, but got \"$value\"" - } - - dict set t epoch $value - return -} - -proc ::stubs::container::hooks {tablevar interface names} { - upvar 1 $tablevar t - dict set t hooks $interface $names - return -} - -proc ::stubs::container::declare {tablevar interface index platforms decl} { - variable legalplatforms - upvar 1 $tablevar t - - #puts "DECLARE ($interface $index) \[$platforms\] =\n\t'[join $decl "'\n\t'"]'" - - if {![dict exists $t interfaces $interface]} { - return -code error "Unknown interface \"$interface\"" - } - if {![string is integer -strict $index]} { - return -code error "Bad index \"$index\", expected integer" - } - - # legal platform codes - # - unix, win, macosx, x11, aqua - - # Check for duplicate declarations, then add the declaration and - # bump the lastNum counter if necessary. - - foreach platform $platforms { - if {![dict exists $legalplatforms $platform]} { - set expected [linsert [join [lsort -dict [dict keys $legalplatforms]] {, }] end-1 or] - return -code error "Bad platform \"$platform\", expected one of $expected" - } - - set key $interface,$platform,$index - if {[dict exists $t stubs $key]} { - return -code error \ - "Duplicate entry: declare $interface $index $platforms $decl" - } - } - - if {![llength $decl]} return - - dict incr t revision - - foreach platform $platforms { - set group $interface,$platform - set key $interface,$platform,$index - - dict set t stubs $key $decl - if {![dict exists $t last $group] || - ($index > [dict get $t last $group])} { - dict set t last $group $index - } - } - return -} - -# # ## ### ##### ######## ############# -# Testing methods. - -proc ::stubs::container::library? {table} { - return [dict get $table library] -} - -proc ::stubs::container::hooks? {table interface} { - if {![dict exists $table interfaces $interface]} { - return -code error "Unknown interface \"$interface\"" - } - return [dict exists $table hooks $interface] -} - -proc ::stubs::container::slot? {table interface platform at} { - if {![dict exists $table interfaces $interface]} { - return -code error "Unknown interface \"$interface\"" - } - return [dict exists $table stubs $interface,$platform,$at] -} - -proc ::stubs::container::scspec? {table} { - return [dict get $table scspec] -} - -proc ::stubs::container::revision? {table} { - return [dict get $table revision] -} - -proc ::stubs::container::epoch? {table} { - return [dict get $table epoch] -} - -# # ## ### ##### ######## ############# -# Accessor methods. - -proc ::stubs::container::interfaces {table} { - return [dict keys [dict get $table interfaces]] -} - -proc ::stubs::container::hooksof {table interface} { - if {![dict exists $table interfaces $interface]} { - return -code error "Unknown interface \"$interface\"" - } - if {![dict exists $table hooks $interface]} { - return {} - } - return [dict get $table hooks $interface] -} - -proc ::stubs::container::platforms {table interface} { - if {![dict exists $table interfaces $interface]} { - return -code error "Unknown interface \"$interface\"" - } - set res {} - #checker exclude warnArgWrite - dict with table { - #checker -scope block exclude warnUndefinedVar - # 'last' is dict element. - foreach k [dict keys $last $interface,*] { - lappend res [lindex [split $k ,] end] - } - } - return $res -} - -proc ::stubs::container::lastof {table interface {platform {}}} { - if {![dict exists $table interfaces $interface]} { - return -code error "Unknown interface \"$interface\"" - } - if {[llength [info level 0]] == 4} { - set key $interface,$platform - if {![dict exists $table last $key]} { - return -1 - } - return [dict get $table last $key] - } - - set res {} - #checker exclude warnArgWrite - dict with table { - #checker -scope block exclude warnUndefinedVar - # 'last' is dict element. - foreach k [dict keys $last $interface,*] { - lappend res [dict get $last $k] - } - } - return $res -} - -proc ::stubs::container::slotplatforms {table interface at} { - if {![dict exists $table interfaces $interface]} { - return -code error "Unknown interface \"$interface\"" - } - set res {} - #checker exclude warnArgWrite - dict with table { - #checker -scope block exclude warnUndefinedVar - # 'stubs' is dict element. - foreach k [dict keys $stubs $interface,*,$at] { - lappend res [lindex [split $k ,] 1] - } - } - return $res -} - -proc ::stubs::container::slot {table interface platform at} { - if {![dict exists $table interfaces $interface]} { - return -code error "Unknown interface \"$interface\"" - } - if {![dict exists $table stubs $interface,$platform,$at]} { - return -code error "Unknown slot \"$platform,$at\"" - } - return [dict get $table stubs $interface,$platform,$at] -} - -# # ## ### ##### ######## ############# -## Serialize, also nicely formatted for readability. - -proc ::stubs::container::print {table} { - - lappend lines "stubs [list [library? $table]] \{" - lappend lines " scspec [list [scspec? $table]]" - lappend lines " epoch [list [epoch? $table]]" - lappend lines " revision [list [revision? $table]]" - - foreach if [interfaces $table] { - lappend lines " interface [list $if] \{" - lappend lines " hooks [list [hooksof $table $if]]" - - set n -1 - foreach l [lastof $table $if] { - if {$l > $n} { set n $l } - } - # n = max lastof for the interface. - - for {set at 0} {$at <= $n} {incr at} { - - set pl [slotplatforms $table $if $at] - if {![llength $pl]} continue - - foreach p $pl { - lappend d $p [slot $table $if $p $at] - #puts |[lindex $d end-1]|[lindex $d end]| - } - # d = list of decls for the slot, per platform. - # invert and collapse... - - foreach {d plist} [Invert $d] { - #puts |$d| - #puts <$plist> - - # d = list (rtype fname arguments) - # arguments = list (argdef) - # argdef = list (atype aname arrayflag) - # | list (atype aname) - # | list (atype) - - lassign $d rtype fname fargs - - lappend lines " declare $at [list $plist] \{" - lappend lines " function [list $fname]" - lappend lines " return [list $rtype]" - foreach a $fargs { - lappend lines " argument [list $a]" - } - lappend lines " \}" - } - } - - lappend lines " \}" - } - - lappend lines "\}" - - return [join $lines \n] -} - -proc ::stubs::container::Invert {dict} { - # input dict : key -> list(value) - # result is a dict : value -> list(key) - - array set res {} - foreach {k v} $dict { - lappend res($v) $k - } - #parray res - set final {} - foreach k [lsort -dict [array names res]] { - lappend final $k [lsort -dict $res($k)] - } - return $final -} - -# # ## ### ##### ######## ############# -## API - -namespace eval ::stubs::container { - variable legalplatforms { - generic . - unix . - win . - macosx . - x11 . - aqua . - } - - namespace export \ - new library interface scspec epoch hooks declare \ - library? hooks? slot? scspec? revision? epoch? \ - interfaces hooksof platforms lastof slotplatforms slot -} - -# # ## ### ##### -package provide stubs::container 1 -return diff -Nru critcl-3.1.9/lib/stubs/gen_decl.tcl critcl-3.1.17+dfsg/lib/stubs/gen_decl.tcl --- critcl-3.1.9/lib/stubs/gen_decl.tcl 2013-05-10 05:57:04.000000000 +0000 +++ critcl-3.1.17+dfsg/lib/stubs/gen_decl.tcl 1970-01-01 00:00:00.000000000 +0000 @@ -1,119 +0,0 @@ -# -*- tcl -*- -# STUBS handling -- Code generation: Writing declarations. -# -# (c) 2011 Andreas Kupries http://wiki.tcl.tk/andreas%20kupries - -# A stubs table is represented by a dictionary value. -# A gen is a variable holding a stubs table value. - -# # ## ### ##### ######## ############# -## Requisites - -package require Tcl 8.4 -package require stubs::gen -package require stubs::container -package require lassign84 - -namespace eval ::stubs::gen::decl::g { - namespace import ::stubs::gen::* -} - -namespace eval ::stubs::gen::decl::c { - namespace import ::stubs::container::* -} - -# # ## ### ##### ######## ############# -## Implementation. - -proc ::stubs::gen::decl::gen {table name} { - set text "\n/*\n * Exported function declarations:\n */\n\n" - append text [g::forall $table $name [list [namespace current]::Make $table] 0] - return $text -} - -# # ## ### ##### -## Internal helpers. - -proc ::stubs::gen::decl::Make {table name decl index} { - #puts "DECL($name $index) = |$decl|" - - lassign $decl rtype fname args - - append text "/* $index */\n" - - set line "[c::scspec? $table] $rtype" - set count [expr {2 - ([string length $line] / 8)}] - append line [string range "\t\t\t" 0 $count] - - set pad [expr {24 - [string length $line]}] - if {$pad <= 0} { - append line " " - set pad 0 - } - - if {![llength $args]} { - append text $line $fname ";\n" - return $text - } - - set arg1 [lindex $args 0] - switch -exact -- $arg1 { - void { - append text $line $fname "(void)" - } - TCL_VARARGS { - append line $fname - append text [MakeArgs $line $pad [lrange $args 1 end] ", ..."] - } - default { - append line $fname - append text [MakeArgs $line $pad $args] - } - } - append text ";\n" - return $text -} - -proc ::stubs::gen::decl::MakeArgs {line pad arguments {suffix {}}} { - #checker -scope local exclude warnArgWrite - set text "" - set sep "(" - foreach arg $arguments { - append line $sep - set next {} - - lassign $arg atype aname aind - - append next $atype - if {[string index $next end] ne "*"} { - append next " " - } - append next $aname $aind - - if {([string length $line] + [string length $next] + $pad) > 76} { - append text [string trimright $line] \n - set line "\t\t\t\t" - set pad 28 - } - append line $next - set sep ", " - } - append line "$suffix)" - - if {[lindex $arguments end] eq "{const char *} format"} { - # TCL_VARARGS case... arguments list already shrunken. - set n [llength $arguments] - append line " TCL_FORMAT_PRINTF(" $n ", " [expr {$n + 1}] ")" - } - - return $text$line -} - -# # ## ### ##### -namespace eval ::stubs::gen::decl { - namespace export gen -} - -# # ## ### ##### -package provide stubs::gen::decl 1 -return diff -Nru critcl-3.1.9/lib/stubs/genframe.tcl critcl-3.1.17+dfsg/lib/stubs/genframe.tcl --- critcl-3.1.9/lib/stubs/genframe.tcl 2013-05-10 05:57:04.000000000 +0000 +++ critcl-3.1.17+dfsg/lib/stubs/genframe.tcl 1970-01-01 00:00:00.000000000 +0000 @@ -1,418 +0,0 @@ -# -*- tcl -*- -# STUBS handling -- Code generation framework. -# -# (c) 2011 Andreas Kupries http://wiki.tcl.tk/andreas%20kupries - -# A stubs table is represented by a dictionary value. -# A gen is a variable holding a stubs table value. - -# # ## ### ##### ######## ############# -## Requisites - -package require Tcl 8.4 -package require stubs::container - -namespace eval ::stubs::gen::c { - namespace import ::stubs::container::* -} - -# # ## ### ##### ######## ############# -## Implementation. - -proc ::stubs::gen::warn {cmdprefix} { - variable warnCmd $cmdprefix - return -} - -proc ::stubs::gen::uncap {text} { - return [string tolower [string index $text 0]][string range $text 1 end] -} - -proc ::stubs::gen::cap {text} { - return [string toupper [string index $text 0]][string range $text 1 end] -} - -proc ::stubs::gen::forall {table name emitCmd onAll {skipString {}}} { - if {$skipString eq {}} { - #checker exclude warnArgWrite - set skipString "/* Slot @@ is reserved */\n" - } - - set platforms [c::platforms $table $name] - - if {[lsearch -exact $platforms "generic"] >= 0} { - # Emit integrated stubs block - set lastNum [MAX [c::lastof $table $name]] - - for {set i 0} {$i <= $lastNum} {incr i} { - - set slots [c::slotplatforms $table $name $i] - set emit 0 - if {[lsearch -exact $slots "generic"] >= 0} { - if {[llength $slots] > 1} { - WARN {conflicting generic and platform entries: $name $i} - } - - append text [CALL generic $i] - set emit 1 - - } elseif {[llength $slots] > 0} { - - array set slot {unix 0 x11 0 win 0 macosx 0 aqua 0} - foreach s $slots { set slot($s) 1 } - # "aqua", "macosx" and "x11" are special cases: - # "macosx" implies "unix", "aqua" implies "macosx" and "x11" - # implies "unix", so we need to be careful not to emit - # duplicate stubs entries: - if {($slot(unix) && $slot(macosx)) || - (($slot(unix) || $slot(macosx)) && - ($slot(x11) || $slot(aqua)))} { - WARN {conflicting platform entries: $name $i} - } - ## unix ## - set temp {} - set plat unix - if {!$slot(aqua) && !$slot(x11)} { - if {$slot($plat)} { - append temp [CALL $plat $i] - } elseif {$onAll} { - append temp [SKIP] - } - } - if {$temp ne ""} { - append text [AddPlatformGuard $plat $temp] - set emit 1 - } - ## x11 ## - set temp {} - set plat x11 - if {!$slot(unix) && !$slot(macosx)} { - if {$slot($plat)} { - append temp [CALL $plat $i] - } elseif {$onAll} { - append temp [SKIP] - } - } - if {$temp ne ""} { - append text [AddPlatformGuard $plat $temp] - set emit 1 - } - ## win ## - set temp {} - set plat win - if {$slot($plat)} { - append temp [CALL $plat $i] - } elseif {$onAll} { - append temp [SKIP] - } - if {$temp ne ""} { - append text [AddPlatformGuard $plat $temp] - set emit 1 - } - ## macosx ## - set temp {} - set plat macosx - if {!$slot(aqua) && !$slot(x11)} { - if {$slot($plat)} { - append temp [CALL $plat $i] - } elseif {$slot(unix)} { - append temp [CALL unix $i] - } elseif {$onAll} { - append temp [SKIP] - } - } - if {$temp ne ""} { - append text [AddPlatformGuard $plat $temp] - set emit 1 - } - ## aqua ## - set temp {} - set plat aqua - if {!$slot(unix) && !$slot(macosx)} { - if {[string range $skipString 0 1] ne "/*"} { - # The code previously had a bug here causing - # it to erroneously generate both a unix entry - # and an aqua entry for a given stubs table - # slot. To preserve backwards compatibility, - # generate a dummy stubs entry before every - # aqua entry (note that this breaks the - # correspondence between emitted entry number - # and actual position of the entry in the - # stubs table, e.g. TkIntStubs entry 113 for - # aqua is in fact at position 114 in the - # table, entry 114 at position 116 etc). - append temp [SKIP] - CHOP temp - append temp " /*\ - Dummy entry for stubs table backwards\ - compatibility */\n" - } - if {$slot($plat)} { - append temp [CALL $plat $i] - } elseif {$onAll} { - append temp [SKIP] - } - } - if {$temp ne ""} { - append text [AddPlatformGuard $plat $temp] - set emit 1 - } - } - if {!$emit} { - append text [SKIP] - } - } - } else { - # Emit separate stubs blocks per platform - array set block {unix 0 x11 0 win 0 macosx 0 aqua 0} - foreach s $platforms { set block($s) 1 } - - ## unix ## - if {$block(unix) && !$block(x11)} { - set temp {} - set plat unix - - # (1) put into helper method - set lastNum [c::lastof $table $name $plat] - for {set i 0} {$i <= $lastNum} {incr i} { - if {[c::slot? $table $name $plat $i]} { - append temp [CALL $plat $i] - } else { - append temp [SKIP] - } - } - append text [AddPlatformGuard $plat $temp] - } - ## win ## - if {$block(win)} { - set temp {} - set plat win - - # (1) put into helper method - set lastNum [c::lastof $table $name $plat] - for {set i 0} {$i <= $lastNum} {incr i} { - if {[c::slot? $table $name $plat $i]} { - append temp [CALL $plat $i] - } else { - append temp [SKIP] - } - } - append text [AddPlatformGuard $plat $temp] - } - ## macosx ## - if {$block(macosx) && !$block(aqua) && !$block(x11)} { - set temp {} - set lastNum [MAX [list \ - [c::lastof $table $name unix] \ - [c::lastof $table $name macosx]]] - - for {set i 0} {$i <= $lastNum} {incr i} { - set emit 0 - foreach plat {unix macosx} { - if {[c::slot? $table $name $plat $i]} { - append temp [CALL $plat $i] - set emit 1 - break - } - } - if {!$emit} { - append temp [SKIP] - } - } - append text [AddPlatformGuard macosx $temp] - } - ## aqua ## - if {$block(aqua)} { - set temp {} - set lastNum [MAX [list \ - [c::lastof $table $name unix] \ - [c::lastof $table $name macosx] \ - [c::lastof $table $name aqua]]] - - for {set i 0} {$i <= $lastNum} {incr i} { - set emit 0 - foreach plat {unix macosx aqua} { - if {[c::slot? $table $name $plat $i]} { - append temp [CALL $plat $i] - set emit 1 - break - } - } - if {!$emit} { - append temp [SKIP] - } - } - append text [AddPlatformGuard aqua $temp] - } - ## x11 ## - if {$block(x11)} { - set temp {} - set lastNum [MAX [list \ - [c::lastof $table $name unix] \ - [c::lastof $table $name macosx] \ - [c::lastof $table $name x11]]] - - for {set i 0} {$i <= $lastNum} {incr i} { - set emit 0 - foreach plat {unix macosx x11} { - if {[c::slot? $table $name $plat $i]} { - if {$plat ne "macosx"} { - append temp [CALL $plat $i] - } else { - append temp [AddPlatformGuard $plat \ - [CALL $plat $i] \ - [SKIP]] - } - set emit 1 - break - } - } - if {!$emit} { - append temp [SKIP] - } - } - append text [AddPlatformGuard x11 $temp] - } - } - - return $text -} - -proc ::stubs::gen::rewrite {path newcode} { - if {![file exists $path]} { - return -code error "Cannot find file: $path" - } - - set in [open ${path} r] - set out [open ${path}.new w] - - # Hardwired use of unix line-endings in the output. - fconfigure $out -translation lf - - # Copy the file header before the code section. - while {![eof $in]} { - set line [gets $in] - if {[string match "*!BEGIN!*" $line]} break - puts $out $line - } - - puts $out "/* !BEGIN!: Do not edit below this line. */" - - # Insert the new code. - puts $out $newcode - - # Skip over the input until the end of the code section. - while {![eof $in]} { - set line [gets $in] - if {[string match "*!END!*" $line]} break - } - - # Copy the trailer after the code section. This can be done fast, - # as searching is not required anymore. - puts $out "/* !END!: Do not edit above this line. */" - puts -nonewline $out [read $in] - - # Close and commit to the changes (atomic rename). - close $in - close $out - file rename -force -- ${path}.new ${path} - return -} - -# # ## ### ##### -## Internal helpers. - -proc ::stubs::gen::CALL {platform index} { - upvar 1 table table name name emitCmd emitCmd - set decl [c::slot $table $name $platform $index] - return [uplevel \#0 [linsert $emitCmd end $name $decl $index]] -} - -proc ::stubs::gen::WARN {text} { - variable warnCmd - if {$warnCmd eq {}} return - return [uplevel \#0 [linsert $warnCmd end [uplevel 1 [list ::subst $text]]]] -} - -proc ::stubs::gen::SKIP {} { - upvar 1 skipString skipString i i - #puts stderr SKIP/$i/[string map [list {$i} $i] $skipString] - return [string map [list @@ $i] $skipString] -} - -proc ::stubs::gen::CHOP {textvar} { - upvar 1 $textvar text - set text [string range $text 0 end-1] - return -} - -proc ::stubs::gen::AddPlatformGuard {platform iftext {elsetext {}}} { - variable guard_begin - variable guard_else - variable guard_end - - set prefix [expr {![info exists guard_begin($platform)] ? "" : $guard_begin($platform)}] - set middle [expr {![info exists guard_else($platform)] ? "" : $guard_else($platform)}] - set suffix [expr {![info exists guard_end($platform)] ? "" : $guard_end($platform)}] - - return $prefix$iftext[expr {($elsetext eq "") - ? "" - : "$middle$elsetext"}]$suffix -} - -if {[package vsatisfies [package present Tcl] 8.5]} { - #checker exclude warnRedefine - proc ::stubs::gen::MAX {list} { - return [tcl::mathfunc::max {*}$list] - } -} else { - #checker exclude warnRedefine - proc ::stubs::gen::MAX {list} { - set max {} - foreach a $list { - if {($max ne {}) && ($max >= $a)} continue - set max $a - } - return $a - } -} - -# # ## ### ##### - -namespace eval ::stubs::gen { - #checker -scope block exclude warnShadowVar - variable guard_begin - variable guard_else - variable guard_end - - array set guard_begin { - win "#ifdef __WIN32__ /* WIN */\n" - unix "#if !defined(__WIN32__) && !defined(MAC_OSX_TCL) /* UNIX */\n" - macosx "#ifdef MAC_OSX_TCL /* MACOSX */\n" - aqua "#ifdef MAC_OSX_TK /* AQUA */\n" - x11 "#if !(defined(__WIN32__) || defined(MAC_OSX_TK)) /* X11 */\n" - } - array set guard_else { - win "#else /* WIN */\n" - unix "#else /* UNIX */\n" - macosx "#else /* MACOSX */\n" - aqua "#else /* AQUA */\n" - x11 "#else /* X11 */\n" - } - array set guard_end { - win "#endif /* WIN */\n" - unix "#endif /* UNIX */\n" - macosx "#endif /* MACOSX */\n" - aqua "#endif /* AQUA */\n" - x11 "#endif /* X11 */\n" - } - - # Default command to report conflict and other warnings. - variable warnCmd {puts stderr} - - namespace export forall rewrite warn cap uncap -} - -# # ## ### ##### -package provide stubs::gen 1 -return diff -Nru critcl-3.1.9/lib/stubs/gen_header.tcl critcl-3.1.17+dfsg/lib/stubs/gen_header.tcl --- critcl-3.1.9/lib/stubs/gen_header.tcl 2013-05-10 05:57:04.000000000 +0000 +++ critcl-3.1.17+dfsg/lib/stubs/gen_header.tcl 1970-01-01 00:00:00.000000000 +0000 @@ -1,112 +0,0 @@ -# -*- tcl -*- -# STUBS handling -- Code generation: Writing the stub headers. -# -# (c) 2011 Andreas Kupries http://wiki.tcl.tk/andreas%20kupries - -# A stubs table is represented by a dictionary value. -# A gen is a variable holding a stubs table value. - -# # ## ### ##### ######## ############# -## Requisites - -package require Tcl 8.4 -package require stubs::gen -package require stubs::container -package require stubs::gen::slot -package require stubs::gen::macro -package require stubs::gen::decl -# critcl, only user, ensured presence of a dict command. -# lassign84, ditto - -namespace eval ::stubs::gen::header::g { - namespace import ::stubs::gen::* -} -namespace eval ::stubs::gen::header::c { - namespace import ::stubs::container::* -} -namespace eval ::stubs::gen::header::s { - namespace import ::stubs::gen::slot::* -} -namespace eval ::stubs::gen::header::m { - namespace import ::stubs::gen::macro::* -} -namespace eval ::stubs::gen::header::d { - namespace import ::stubs::gen::decl::* -} - -# # ## ### ##### ######## ############# -## Implementation. - -proc ::stubs::gen::header::multiline {{flag 1}} { - return [m::multiline $flag] -} - -proc ::stubs::gen::header::gen {table name} { - set capName [g::cap $name] - - set epoch [c::epoch? $table] - if {$epoch ne ""} { - set CAPName [string toupper $name] - append text "\n" - append text "#define ${CAPName}_STUBS_EPOCH $epoch\n" - append text "#define ${CAPName}_STUBS_REVISION [c::revision? $table]\n" - } - - # declarations... - append text [d::gen $table $name] - - if {[c::hooks? $table $name]} { - append text "\ntypedef struct ${capName}StubHooks {\n" - foreach hook [c::hooksof $table $name] { - set capHook [g::cap $hook] - append text " const struct ${capHook}Stubs *${hook}Stubs;\n" - } - append text "} ${capName}StubHooks;\n" - } - - # stub table type definition, including field definitions aka slots... - append text "\ntypedef struct ${capName}Stubs {\n" - append text " int magic;\n" - if {$epoch ne ""} { - append text " int epoch;\n" - append text " int revision;\n" - } - append text " const struct ${capName}StubHooks *hooks;\n\n" - append text [s::gen $table $name] - append text "} ${capName}Stubs;\n" - - # stub table global variable - append text "\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n" - append text "extern const ${capName}Stubs *${name}StubsPtr;\n" - append text "#ifdef __cplusplus\n}\n#endif\n" - - # last, the series of macros for stub users which will route - # function calls through the table. - append text [m::gen $table $name] - - return $text -} - -proc ::stubs::gen::header::rewrite@ {basedir table name} { - rewrite [path $basedir $name] $table $name -} - -proc ::stubs::gen::header::rewrite {path table name} { - g::rewrite $path [gen $table $name] -} - -proc ::stubs::gen::header::path {basedir name} { - return [file join $basedir ${name}Decls.h] -} - -# # ## ### ##### -## Internal helpers. - -# # ## ### ##### -namespace eval ::stubs::gen::header { - namespace export gen multiline rewrite@ rewrite path -} - -# # ## ### ##### ######## ############# -package provide stubs::gen::header 1 -return diff -Nru critcl-3.1.9/lib/stubs/gen_init.tcl critcl-3.1.17+dfsg/lib/stubs/gen_init.tcl --- critcl-3.1.9/lib/stubs/gen_init.tcl 2013-05-10 05:57:04.000000000 +0000 +++ critcl-3.1.17+dfsg/lib/stubs/gen_init.tcl 1970-01-01 00:00:00.000000000 +0000 @@ -1,189 +0,0 @@ -# -*- tcl -*- -# STUBS handling -- Code generation: Writing the initialization code for EXPORTers. -# -# (c) 2011 Andreas Kupries http://wiki.tcl.tk/andreas%20kupries - -# A stubs table is represented by a dictionary value. -# A gen is a variable holding a stubs table value. - -# # ## ### ##### ######## ############# -## Requisites - -package require Tcl 8.4 -package require stubs::gen -package require stubs::container -package require lassign84 - -namespace eval ::stubs::gen::init::g { - namespace import ::stubs::gen::* -} - -namespace eval ::stubs::gen::init::c { - namespace import ::stubs::container::* -} - -# # ## ### ##### ######## ############# -## Implementation. - -proc ::stubs::gen::init::gen {table} { - # Assuming that dependencies only go one level deep, we need to - # emit all of the leaves first to avoid needing forward - # declarations. - - set leaves {} - set roots {} - - foreach name [lsort [c::interfaces $table]] { - if {[c::hooks? $table $name]} { - lappend roots $name - } else { - lappend leaves $name - } - } - - set text {} - foreach name $leaves { - append text [Emit $table $name] - } - foreach name $roots { - append text [Emit $table $name] - } - - return $text -} - -proc ::stubs::gen::init::make@ {basedir table} { - make [path $basedir $table] $table -} - -proc ::stubs::gen::init::make {path table} { - variable template - - set c [open $path w] - puts -nonewline $c \ - [string map \ - [list @@ [string map {:: _} [c::library? $table]]] \ - $template] - close $c - - rewrite $path $table - return -} - -proc ::stubs::gen::init::rewrite@ {basedir table} { - rewrite [path $basedir $table] $table - return -} - -proc ::stubs::gen::init::rewrite {path table} { - g::rewrite $path [gen $table] - return -} - -proc ::stubs::gen::init::path {basedir table} { - return [file join $basedir [c::library? $table]StubInit.c] -} - -# # ## ### ##### -## Internal helpers. - -proc ::stubs::gen::init::Emit {table name} { - # See tcllib/textutil as well. - set capName [g::cap $name] - - if {[c::hooks? $table $name]} { - append text "\nstatic const ${capName}StubHooks ${name}StubHooks = \{\n" - set sep " " - foreach sub [c::hooksof $table $name] { - append text $sep "&${sub}Stubs" - set sep ",\n " - } - append text "\n\};\n" - } - - # Check if this interface is a hook for some other interface. - # TODO: Make this a container API command. - set root 1 - foreach intf [c::interfaces $table] { - if {[c::hooks? $table $intf] && - ([lsearch -exact [c::hooksof $table $intf] $name] >= 0)} { - set root 0 - break - } - } - - # Hooks are local to the file. - append text "\n" - if {!$root} { - append text "static " - } - append text "const ${capName}Stubs ${name}Stubs = \{\n" - append text " TCL_STUB_MAGIC,\n" - - if {[c::epoch? $table] ne ""} { - set CAPName [string toupper $name] - append text " ${CAPName}_STUBS_EPOCH,\n" - append text " ${CAPName}_STUBS_REVISION,\n" - } - - if {[c::hooks? $table $name]} { - append text " &${name}StubHooks,\n" - } else { - append text " 0,\n" - } - - append text [g::forall $table $name [namespace current]::Make 1 \ - " 0, /* @@ */\n"] - - append text "\};\n" - return $text -} - -# Make -- -# -# Generate the prototype for a function. -# -# Arguments: -# name The interface name. -# decl The function declaration. -# index The slot index for this function. -# -# Results: -# Returns the formatted declaration string. - -proc ::stubs::gen::init::Make {name decl index} { - #puts "INIT($name $index) = |$decl|" - - lassign $decl rtype fname args - - if {![llength $args]} { - append text " &$fname, /* $index */\n" - } else { - append text " $fname, /* $index */\n" - } - return $text -} - -# # ## ### ##### -namespace eval ::stubs::gen::init { - #checker exclude warnShadowVar - variable template [string map {{ } {}} { - /* @@StubsInit.c - * - * The contents of this file are automatically generated - * from the @@.decls file. - * - */ - - #include "@@.h" - - /* !BEGIN!: Do not edit below this line. */ - /* !END!: Do not edit above this line. */ - }] - - namespace export gen make@ make rewrite@ rewrite path -} - -# # ## ### ##### ######## ############# -package provide stubs::gen::init 1 -return diff -Nru critcl-3.1.9/lib/stubs/gen_lib.tcl critcl-3.1.17+dfsg/lib/stubs/gen_lib.tcl --- critcl-3.1.9/lib/stubs/gen_lib.tcl 2013-05-10 05:57:04.000000000 +0000 +++ critcl-3.1.17+dfsg/lib/stubs/gen_lib.tcl 1970-01-01 00:00:00.000000000 +0000 @@ -1,215 +0,0 @@ -# -*- tcl -*- -# STUBS handling -- Code generation: Writing the initialization code for IMPORTers. -# -# (c) 2011 Andreas Kupries http://wiki.tcl.tk/andreas%20kupries - -# A stubs table is represented by a dictionary value. -# A gen is a variable holding a stubs table value. - -# # ## ### ##### ######## ############# -## Requisites - -package require Tcl 8.4 -package require stubs::gen -package require stubs::container -package require lassign84 - -namespace eval ::stubs::gen::lib::g { - namespace import ::stubs::gen::* -} - -namespace eval ::stubs::gen::lib::c { - namespace import ::stubs::container::* -} - -# # ## ### ##### ######## ############# -## Implementation. - -proc ::stubs::gen::lib::gen {table} { - # Assuming that dependencies only go one level deep, we need to - # emit all of the leaves first to avoid needing forward - # declarations. - - variable template - - # Assuming that dependencies only go one level deep, we emit all - # of the leaves first to avoid needing forward declarations. - - set leaves {} - set roots {} - - foreach name [lsort [c::interfaces $table]] { - if {[c::hooks? $table $name]} { - lappend roots $name - } else { - lappend leaves $name - } - } - - set headers {} - set variables {} - set hooks {} - - foreach name [concat $leaves $roots] { - set capName [g::cap $name] - - # POLISH - format the variables code block aligned using - # maxlength of interface names. - lappend headers "\#include \"${name}Decls.h\"" - lappend variables "const ${capName}Stubs* ${name}StubsPtr;" - - # Check if this is a hook. If yes it needs additional setup. - set parent [Parent $table $name] - if {$parent eq ""} continue - lappend hooks " ${name}StubsPtr = ${parent}StubsPtr->hooks->${name}Stubs;" - } - - set pname [c::library? $table] ; # FUTURE: May be separate from the library - # namespaces! - set name [string map {:: _} [c::library? $table]] - set capName [g::cap $name] - set upName [string toupper $name] - - set headers [Block $headers] - set variables [Block $variables] - set hooks [Block $hooks] - - return [string map \ - [list \ - @PKG@ $pname \ - @@ $name \ - @UP@ $upName \ - @CAP@ $capName \ - @HEADERS@ $headers \ - @VARS@ $variables \ - @HOOKS@ $hooks \ - ] $template] - return $text -} - -proc ::stubs::gen::lib::Block {list} { - if {![llength $list]} { return "" } - return \n[join $list \n]\n -} - -proc ::stubs::gen::lib::make@ {basedir table} { - make [path $basedir [c::library? $table]] $table -} - -proc ::stubs::gen::lib::make {path table} { - set c [open $path w] - puts -nonewline $c [gen $table] - close $c - return -} - -proc ::stubs::gen::lib::path {basedir name} { - return [file join $basedir ${name}StubLib.c] -} - -# # ## ### ##### -## Internal helpers. - -proc ::stubs::gen::lib::Parent {table name} { - # Check if this interface is a hook for some other interface. - # TODO: Make this a container API command. - foreach intf [c::interfaces $table] { - if {[c::hooks? $table $intf] && - ([lsearch -exact [c::hooksof $table $intf] $name] >= 0)} { - return $intf - } - } - return "" -} - -# # ## ### ##### -namespace eval ::stubs::gen::lib { - #checker exclude warnShadowVar - variable template [string map {{ - } { -}} { - /* - * @@StubLib.c -- - * - * Stub object that will be statically linked into extensions that wish - * to access @@. - */ - - /* - * We need to ensure that we use the stub macros so that this file contains - * no references to any of the stub functions. This will make it possible - * to build an extension that references @CAP@_InitStubs but doesn't end up - * including the rest of the stub functions. - */ - - #ifndef USE_TCL_STUBS - #define USE_TCL_STUBS - #endif - #undef USE_TCL_STUB_PROCS - - #include - - #ifndef USE_@UP@_STUBS - #define USE_@UP@_STUBS - #endif - #undef USE_@UP@_STUB_PROCS - @HEADERS@ - /* - * Ensure that @CAP@_InitStubs is built as an exported symbol. The other stub - * functions should be built as non-exported symbols. - */ - - #undef TCL_STORAGE_CLASS - #define TCL_STORAGE_CLASS DLLEXPORT - @VARS@ - - /* - *---------------------------------------------------------------------- - * - * @CAP@_InitStubs -- - * - * Checks that the correct version of @CAP@ is loaded and that it - * supports stubs. It then initialises the stub table pointers. - * - * Results: - * The actual version of @CAP@ that satisfies the request, or - * NULL to indicate that an error occurred. - * - * Side effects: - * Sets the stub table pointers. - * - *---------------------------------------------------------------------- - */ - - #ifdef @CAP@_InitStubs - #undef @CAP@_InitStubs - #endif - - char * - @CAP@_InitStubs(Tcl_Interp *interp, CONST char *version, int exact) - { - CONST char *actualVersion; - - actualVersion = Tcl_PkgRequireEx(interp, "@PKG@", version, - exact, (ClientData *) &@@StubsPtr); - if (!actualVersion) { - return NULL; - } - - if (!@@StubsPtr) { - Tcl_SetResult(interp, - "This implementation of @CAP@ does not support stubs", - TCL_STATIC); - return NULL; - } - @HOOKS@ - return (char*) actualVersion; - } - }] - - namespace export gen make@ make rewrite@ rewrite path -} - -# # ## ### ##### ######## ############# -package provide stubs::gen::lib 1 -return diff -Nru critcl-3.1.9/lib/stubs/gen_macro.tcl critcl-3.1.17+dfsg/lib/stubs/gen_macro.tcl --- critcl-3.1.9/lib/stubs/gen_macro.tcl 2013-05-10 05:57:04.000000000 +0000 +++ critcl-3.1.17+dfsg/lib/stubs/gen_macro.tcl 1970-01-01 00:00:00.000000000 +0000 @@ -1,74 +0,0 @@ -# -*- tcl -*- -# STUBS handling -- Code generation: Writing the stub macros. -# -# (c) 2011 Andreas Kupries http://wiki.tcl.tk/andreas%20kupries - -# A stubs table is represented by a dictionary value. -# A gen is a variable holding a stubs table value. - -# # ## ### ##### ######## ############# -## Requisites - -package require Tcl 8.4 -package require stubs::gen -package require stubs::container -package require lassign84 - -namespace eval ::stubs::gen::macro::g { - namespace import ::stubs::gen::* -} - -namespace eval ::stubs::gen::macro::c { - namespace import ::stubs::container::* -} - -# # ## ### ##### ######## ############# -## Implementation. - -proc ::stubs::gen::macro::multiline {{flag 1}} { - variable multiline $flag - return $flag -} - -proc ::stubs::gen::macro::gen {table name} { - set upName [string toupper [string map {:: _} [c::library? $table]]] - set sguard "defined(USE_${upName}_STUBS)" - - append text "\n#if $sguard\n" - append text "\n/*\n * Inline function declarations:\n */\n\n" - append text [g::forall $table $name [namespace current]::Make 0] - append text "\n#endif /* $sguard */\n" - return $text -} - -# # ## ### ##### -## Internal helpers. - -proc ::stubs::gen::macro::Make {name decl index} { - variable multiline - #puts "MACRO($name $index) = |$decl|" - - lassign $decl rtype fname args - - set capName [g::uncap $fname] - - append text "#define $fname " - if {$multiline} { append text "\\\n\t" } - append text "(" - if {![llength $args]} { append text "*" } - append text "${name}StubsPtr->$capName)" - append text " /* $index */\n" - return $text -} - -# # ## ### ##### -namespace eval ::stubs::gen::macro { - #checker exclude warnShadowVar - variable multiline 1 - - namespace export gen multiline -} - -# # ## ### ##### ######## ############# -package provide stubs::gen::macro 1 -return diff -Nru critcl-3.1.9/lib/stubs/gen_slot.tcl critcl-3.1.17+dfsg/lib/stubs/gen_slot.tcl --- critcl-3.1.9/lib/stubs/gen_slot.tcl 2013-05-10 05:57:04.000000000 +0000 +++ critcl-3.1.17+dfsg/lib/stubs/gen_slot.tcl 1970-01-01 00:00:00.000000000 +0000 @@ -1,98 +0,0 @@ -# -*- tcl -*- -# STUBS handling -- Code generation: Writing SLOT code. -# -# (c) 2011 Andreas Kupries http://wiki.tcl.tk/andreas%20kupries - -# # ## ### ##### ######## ############# -## Requisites - -package require Tcl 8.4 -package require stubs::gen -package require lassign84 - -# lassign84, ditto - -namespace eval ::stubs::gen::slot::g { - namespace import ::stubs::gen::* -} - -# # ## ### ##### ######## ############# -## Implementation. - -proc ::stubs::gen::slot::gen {table name} { - return [g::forall $table $name [namespace current]::Make 1 \ - " void (*reserved@@)(void);\n"] -} - -# # ## ### ##### -## Internal helpers. - -proc ::stubs::gen::slot::Make {name decl index} { - #puts "SLOT($name $index) = |$decl|" - - lassign $decl rtype fname args - - set capName [g::uncap $fname] - - set text " " - if {![llength $args]} { - append text $rtype " *" $capName "; /* $index */\n" - return $text - } - - if {[string range $rtype end-7 end] eq "CALLBACK"} { - append text \ - [string trim [string range $rtype 0 end-8]] \ - " (CALLBACK *" $capName ") " - } else { - append text $rtype " (*" $capName ") " - } - - set arg1 [lindex $args 0] - switch -exact -- $arg1 { - void { - append text "(void)" - } - TCL_VARARGS { - append text [MakeArgs [lrange $args 1 end] ", ..."] - } - default { - append text [MakeArgs $args] - } - } - - append text "; /* $index */\n" - return $text -} - -proc ::stubs::gen::slot::MakeArgs {arguments {suffix {}}} { - set text "" - set sep "(" - foreach arg $arguments { - lassign $arg atype aname aind - append text $sep $atype - if {[string index $text end] ne "*"} { - append text " " - } - append text $aname $aind - set sep ", " - } - append text "$suffix)" - - if {[lindex $arguments end] eq "\{const char *\} format"} { - # TCL_VARARGS case... arguments list already shrunken. - set n [llength $arguments] - append text " TCL_FORMAT_PRINTF(" $n ", " [expr {$n + 1}] ")" - } - - return $text -} - -# # ## ### ##### -namespace eval ::stubs::gen::slot { - namespace export gen -} - -# # ## ### ##### -package provide stubs::gen::slot 1 -return diff -Nru critcl-3.1.9/lib/stubs/pkgIndex.tcl critcl-3.1.17+dfsg/lib/stubs/pkgIndex.tcl --- critcl-3.1.9/lib/stubs/pkgIndex.tcl 2013-05-10 05:57:04.000000000 +0000 +++ critcl-3.1.17+dfsg/lib/stubs/pkgIndex.tcl 1970-01-01 00:00:00.000000000 +0000 @@ -1,19 +0,0 @@ -if {![package vsatisfies [package provide Tcl] 8.4]} {return} -#checker -scope global exclude warnUndefinedVar - -package ifneeded stubs::container 1 [list source [file join $dir container.tcl]] -package ifneeded stubs::reader 1 [list source [file join $dir reader.tcl]] -package ifneeded stubs::writer 1 [list source [file join $dir writer.tcl]] -package ifneeded stubs::gen 1 [list source [file join $dir genframe.tcl]] -package ifneeded stubs::gen::init 1 [list source [file join $dir gen_init.tcl]] -package ifneeded stubs::gen::header 1 [list source [file join $dir gen_header.tcl]] -package ifneeded stubs::gen::decl 1 [list source [file join $dir gen_decl.tcl]] -package ifneeded stubs::gen::macro 1 [list source [file join $dir gen_macro.tcl]] -package ifneeded stubs::gen::slot 1 [list source [file join $dir gen_slot.tcl]] -package ifneeded stubs::gen::lib 1 [list source [file join $dir gen_lib.tcl]] - -# init :: stub table initializers - C code (xxxStubLib.c, EXPORT) -# header :: stub header (xxxDecls.h) -# \ decl : stub function declarations - header (xxxDecls.h). -# \ macro : stub function macros - header (IMPORT) -# \ slot : stub table field declarations - header (IMPORT) diff -Nru critcl-3.1.9/lib/stubs/reader.tcl critcl-3.1.17+dfsg/lib/stubs/reader.tcl --- critcl-3.1.9/lib/stubs/reader.tcl 2013-05-10 05:57:04.000000000 +0000 +++ critcl-3.1.17+dfsg/lib/stubs/reader.tcl 1970-01-01 00:00:00.000000000 +0000 @@ -1,246 +0,0 @@ -# -*- tcl -*- -# STUBS handling -- Reader. -# -# (c) 2011 Andreas Kupries http://wiki.tcl.tk/andreas%20kupries - -# # ## ### ##### ######## ############# -## Requisites - -package require Tcl 8.4 -package require stubs::container -package require lassign84 - -# A stubs table is represented by a dictionary value. -# A container is a variable holding a stubs table value. - -namespace eval ::stubs::reader::c { - namespace import ::stubs::container::* -} - -# # ## ### ##### ######## ############# -## Implementation. - -proc ::stubs::reader::file {tablevar path} { - upvar 1 $tablevar table - - set chan [open $path r] - set text [read $chan] - close $chan - - text table $text - return -} - -proc ::stubs::reader::text {tablevar text} { - variable current - variable table - - upvar 1 $tablevar t - - set sandbox [interp create -safe] - - interp alias $sandbox library {} ::stubs::reader::P_library - interp alias $sandbox interface {} ::stubs::reader::P_interface - interp alias $sandbox scspec {} ::stubs::reader::P_scspec - interp alias $sandbox epoch {} ::stubs::reader::P_epoch - interp alias $sandbox hooks {} ::stubs::reader::P_hooks - interp alias $sandbox declare {} ::stubs::reader::P_declare - interp alias $sandbox export {} ::stubs::reader::P_export - - set current UNKNOWN - set table $t - - set ::errorCode {} - set ::errorInfo {} - - if {![set code [catch { - $sandbox eval $text - } res]]} { - set t $table - } - - interp delete $sandbox - unset table - - return -code $code -errorcode $::errorCode -errorinfo $::errorInfo \ - $res -} - -# READER API methods. These are called when sourcing a .decls -# file, or evaluating a .decls string. They forward to the -# attached container after pre-processing arguments and merging in -# state information (current interface). - -proc ::stubs::reader::P_library {name} { - variable table - c::library table $name - return -} - -proc ::stubs::reader::P_interface {name} { - variable table - variable current - - set current $name - c::interface table $name - return -} - -proc ::stubs::reader::P_scspec {value} { - variable table - c::scspec table $value - return -} - -proc ::stubs::reader::P_epoch {value} { - variable table - c::epoch table $value - return -} - -proc ::stubs::reader::P_hooks {names} { - variable table - variable current - - c::hooks table $current $names - return -} - -proc ::stubs::reader::P_declare {index args} { - variable table - variable current - - switch -exact [llength $args] { - 1 { - # syntax: declare AT DECL - set platforms [list generic] - set decl [lindex $args 0] - } - 2 { - # syntax: declare AT PLATFORMS DECL - lassign $args platforms decl - } - default { - return -code error \ - "wrong \# args: expected 'index ?platforms? decl" - } - } - - c::declare table $current $index $platforms [ParseDecl $decl] - return -} - -proc ::stubs::reader::P_export {decl} { - variable table - variable current - - # Ignore. - return -} - -# Support methods for parsing a C declaration into its constituent -# pieces. - -# ParseDecl -- -# -# Parse a C function declaration into its component parts. -# -# Arguments: -# decl The function declaration. -# -# Results: -# Returns a list of the form {returnType name arguments}. The arguments -# element consists of a list of type/name pairs, or a single -# element "void". If the function declaration is malformed -# then an error is displayed and the return value is {}. - -proc ::stubs::reader::ParseDecl {decl} { - #checker exclude warnArgWrite - regsub -all "\[ \t\n\]+" [string trim $decl] " " decl - #puts "PARSE ($decl)" - - if {![regexp {^(.*)\((.*)\)$} $decl --> prefix arguments]} { - set prefix $decl - set arguments {} - } - - set prefix [string trim $prefix] - if {![regexp {^(.+[ ][*]*)([^ *]+)$} $prefix --> rtype fname]} { - return -code error "Bad return type: $decl" - } - - set rtype [string trim $rtype] - if {$arguments eq ""} { - return [list $rtype $fname {void}] - } - - foreach arg [split $arguments ,] { - lappend argumentList [string trim $arg] - } - - if {[lindex $argumentList end] eq "..."} { - set arguments TCL_VARARGS - foreach arg [lrange $argumentList 0 end-1] { - set argInfo [ParseArg $arg] - set arity [llength $argInfo] - if {(2 <= $arity) && ($arity <= 3)} { - lappend arguments $argInfo - } else { - return -code error "Bad argument: '$arg' in '$decl'" - } - } - } else { - set arguments {} - foreach arg $argumentList { - set argInfo [ParseArg $arg] - if {$argInfo eq "void"} { - lappend arguments "void" - break - } - set arity [llength $argInfo] - if {(2 <= $arity) && ($arity <= 3)} { - lappend arguments $argInfo - } else { - return -code error "Bad argument: '$arg' in '$decl'" - } - } - } - return [list $rtype $fname $arguments] -} - -# ParseArg -- -# -# This function parses a function argument into a type and name. -# -# Arguments: -# arg The argument to parse. -# -# Results: -# Returns a list of type and name with an optional third array -# indicator. If the argument is malformed, returns "". - -proc ::stubs::reader::ParseArg {arg} { - if {![regexp {^(.+[ ][*]*)([^][ *]+)(\[\])?$} $arg all type name array]} { - if {$arg eq "void"} { - return $arg - } else { - return - } - } - set result [list [string trim $type] $name] - if {$array ne ""} { - lappend result $array - } - return $result -} - -# # ## ### ##### ######## ############# -## API - -namespace eval ::stubs::reader { - namespace export file text -} - -# # ## ### ##### -package provide stubs::reader 1 -return diff -Nru critcl-3.1.9/lib/stubs/writer.tcl critcl-3.1.17+dfsg/lib/stubs/writer.tcl --- critcl-3.1.9/lib/stubs/writer.tcl 2013-05-10 05:57:04.000000000 +0000 +++ critcl-3.1.17+dfsg/lib/stubs/writer.tcl 1970-01-01 00:00:00.000000000 +0000 @@ -1,121 +0,0 @@ -# -*- tcl -*- -# STUBS handling -- Write stubs table as .decls file -# -# (c) 2011 Andreas Kupries http://wiki.tcl.tk/andreas%20kupries - -# A stubs table is represented by a dictionary value. -# A container is a variable holding a stubs table value. - -# # ## ### ##### ######## ############# -## Requisites - -package require Tcl 8.4 -package require stubs::gen -package require stubs::container -package require lassign84 - -namespace eval ::stubs::writer::g { - namespace import ::stubs::gen::* -} - -namespace eval ::stubs::writer::c { - namespace import ::stubs::container::* -} - -# # ## ### ##### ######## ############# -## Implementation. - -proc ::stubs::writer::gen {table} { - - set defaults [c::new] - set dscspec [c::scspec? $defaults] - set depoch [c::epoch? $defaults] - - set name [c::library? $table] - set scspec [c::scspec? $table] - set epoch [c::epoch? $table] - set rev [c::revision? $table] - - lappend lines "\# ${name}.decls -- -*- tcl -*-" - lappend lines "\#" - lappend lines "\#\tThis file contains the declarations for all public functions" - lappend lines "\#\tthat are exported by the \"${name}\" library via its stubs table." - lappend lines "\#" - - lappend lines "" - lappend lines "library [list $name]" - - if {($scspec ne $dscspec) || - ($epoch ne $depoch )} { - if {$scspec ne $dscspec} { - lappend lines "scspec [list $scspec]" - } - if {$epoch ne $depoch } { - lappend lines "epoch [list $epoch]" - lappend lines "revision [list $rev]" - } - } - - foreach if [c::interfaces $table] { - lappend lines "" - lappend lines "interface [list $if]" - - if {[c::hooks? $table $if]} { - lappend lines "hooks [list [c::hooksof $table $if]]" - } - lappend lines \ - [g::forall $table $if \ - [list [namespace current]::Make $table] \ - 0] - } - - lappend lines "\# END $name" - - return [join $lines \n] -} - -# # ## ### ##### -## Internal helpers. - -proc ::stubs::writer::Make {table if decl index} { - #puts |--------------------------------------- - #puts |$if|$index|$decl| - - lassign $decl rtype fname arguments - if {[llength $arguments]} { - # what about the third piece of info, array flag?! ... - - set suffix {} - foreach a $arguments { - if {$a eq "void"} { - lappend ax $a - } elseif {$a eq "TCL_VARARGS"} { - set suffix ", ..." - } else { - lassign $a atype aname aflag - # aflag either "", or "[]". - lappend ax "$atype $aname$aflag" - #puts \t|$atype|$aname|$aflag| - } - } - set ax [join $ax {, }]$suffix - } else { - set ax void - } - set cdecl "\n $rtype $fname ($ax)\n" - set platforms [c::slotplatforms $table $if $index] - - lappend lines "" - lappend lines "declare $index [list $platforms] \{$cdecl\}" - - return [join $lines \n]\n -} - -# # ## ### ##### -namespace eval ::stubs::writer { - namespace export gen -} - -# # ## ### ##### -package provide stubs::writer 1 -return diff -Nru critcl-3.1.9/lib/stubs_container/container.tcl critcl-3.1.17+dfsg/lib/stubs_container/container.tcl --- critcl-3.1.9/lib/stubs_container/container.tcl 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/lib/stubs_container/container.tcl 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,386 @@ +# -*- tcl -*- +# STUBS handling -- Container. +# +# (c) 2011 Andreas Kupries http://wiki.tcl.tk/andreas%20kupries + +# A stubs table is represented by a dictionary value. +# A container is a variable holding a stubs table value. + +# stubs table dictionary keys +# +# library -- +# +# The name of the entire library. This value is used to compute +# the USE_*_STUB_PROCS macro and the name of the init file. +# +# interfaces -- +# +# A dictionary indexed by interface name that is used to maintain +# the set of valid interfaces. The value is empty. +# +# scspec -- +# +# Storage class specifier for external function declarations. +# Normally "EXTERN", may be set to something like XYZAPI +# +# epoch, revision -- +# +# The epoch and revision numbers of the interface currently being defined. +# (@@@TODO: should be an array mapping interface names -> numbers) +# +# hooks -- +# +# A dictionary indexed by interface name that contains the set of +# subinterfaces that should be defined for a given interface. +# +# stubs -- +# +# This three dimensional dictionary is indexed first by interface +# name, second by platform name, and third by a numeric +# offset. Each numeric offset contains the C function +# specification that should be used for the given entry in the +# table. The specification consists of a list in the form returned +# by ParseDecl in the stubs reader package, i.e. +# +# decl = list (return-type fun-name arguments) +# arguments = void | list (arg-info ...) +# arg-info = list (type name ?array?) +# array = '[]' +# +# last -- +# +# This two dimensional dictionary is indexed first by interface name, +# and second by platform name. The associated entry contains the +# largest numeric offset used for a given interface/platform +# combo. + +# # ## ### ##### ######## ############# +## Requisites + +package require Tcl 8.4 +package require dict84 ; # Ensure presence of a dict command. + +namespace eval ::stubs::container {} + +# # ## ### ##### ######## ############# +## Implementation. + +proc ::stubs::container::new {} { + return { + library "UNKNOWN" + interfaces {} + hooks {} + stubs {} + last {} + scspec "EXTERN" + epoch {} + revision 0 + } +} + +# Methods to incrementally fill the container with data. Strongly +# related to the API commands of the stubs reader package. + +proc ::stubs::container::library {tablevar name} { + upvar 1 $tablevar t + dict set t library $name + return +} + +proc ::stubs::container::interface {tablevar name} { + upvar 1 $tablevar t + if {[dict exists $t interfaces $name]} { + return -code error "Duplicate declaration of interface \"$name\"" + } + dict set t interfaces $name {} + return +} + +proc ::stubs::container::scspec {tablevar value} { + upvar 1 $tablevar t + dict set t scspec $value + return +} + +proc ::stubs::container::epoch {tablevar value} { + upvar 1 $tablevar t + + if {![string is integer -strict $value]} { + return -code error "Expected integer for epoch, but got \"$value\"" + } + + dict set t epoch $value + return +} + +proc ::stubs::container::hooks {tablevar interface names} { + upvar 1 $tablevar t + dict set t hooks $interface $names + return +} + +proc ::stubs::container::declare {tablevar interface index platforms decl} { + variable legalplatforms + upvar 1 $tablevar t + + #puts "DECLARE ($interface $index) \[$platforms\] =\n\t'[join $decl "'\n\t'"]'" + + if {![dict exists $t interfaces $interface]} { + return -code error "Unknown interface \"$interface\"" + } + if {![string is integer -strict $index]} { + return -code error "Bad index \"$index\", expected integer" + } + + # legal platform codes + # - unix, win, macosx, x11, aqua + + # Check for duplicate declarations, then add the declaration and + # bump the lastNum counter if necessary. + + foreach platform $platforms { + if {![dict exists $legalplatforms $platform]} { + set expected [linsert [join [lsort -dict [dict keys $legalplatforms]] {, }] end-1 or] + return -code error "Bad platform \"$platform\", expected one of $expected" + } + + set key $interface,$platform,$index + if {[dict exists $t stubs $key]} { + return -code error \ + "Duplicate entry: declare $interface $index $platforms $decl" + } + } + + if {![llength $decl]} return + + dict incr t revision + + foreach platform $platforms { + set group $interface,$platform + set key $interface,$platform,$index + + dict set t stubs $key $decl + if {![dict exists $t last $group] || + ($index > [dict get $t last $group])} { + dict set t last $group $index + } + } + return +} + +# # ## ### ##### ######## ############# +# Testing methods. + +proc ::stubs::container::library? {table} { + return [dict get $table library] +} + +proc ::stubs::container::hooks? {table interface} { + if {![dict exists $table interfaces $interface]} { + return -code error "Unknown interface \"$interface\"" + } + return [dict exists $table hooks $interface] +} + +proc ::stubs::container::slot? {table interface platform at} { + if {![dict exists $table interfaces $interface]} { + return -code error "Unknown interface \"$interface\"" + } + return [dict exists $table stubs $interface,$platform,$at] +} + +proc ::stubs::container::scspec? {table} { + return [dict get $table scspec] +} + +proc ::stubs::container::revision? {table} { + return [dict get $table revision] +} + +proc ::stubs::container::epoch? {table} { + return [dict get $table epoch] +} + +# # ## ### ##### ######## ############# +# Accessor methods. + +proc ::stubs::container::interfaces {table} { + return [dict keys [dict get $table interfaces]] +} + +proc ::stubs::container::hooksof {table interface} { + if {![dict exists $table interfaces $interface]} { + return -code error "Unknown interface \"$interface\"" + } + if {![dict exists $table hooks $interface]} { + return {} + } + return [dict get $table hooks $interface] +} + +proc ::stubs::container::platforms {table interface} { + if {![dict exists $table interfaces $interface]} { + return -code error "Unknown interface \"$interface\"" + } + set res {} + #checker exclude warnArgWrite + dict with table { + #checker -scope block exclude warnUndefinedVar + # 'last' is dict element. + foreach k [dict keys $last $interface,*] { + lappend res [lindex [split $k ,] end] + } + } + return $res +} + +proc ::stubs::container::lastof {table interface {platform {}}} { + if {![dict exists $table interfaces $interface]} { + return -code error "Unknown interface \"$interface\"" + } + if {[llength [info level 0]] == 4} { + set key $interface,$platform + if {![dict exists $table last $key]} { + return -1 + } + return [dict get $table last $key] + } + + set res {} + #checker exclude warnArgWrite + dict with table { + #checker -scope block exclude warnUndefinedVar + # 'last' is dict element. + foreach k [dict keys $last $interface,*] { + lappend res [dict get $last $k] + } + } + return $res +} + +proc ::stubs::container::slotplatforms {table interface at} { + if {![dict exists $table interfaces $interface]} { + return -code error "Unknown interface \"$interface\"" + } + set res {} + #checker exclude warnArgWrite + dict with table { + #checker -scope block exclude warnUndefinedVar + # 'stubs' is dict element. + foreach k [dict keys $stubs $interface,*,$at] { + lappend res [lindex [split $k ,] 1] + } + } + return $res +} + +proc ::stubs::container::slot {table interface platform at} { + if {![dict exists $table interfaces $interface]} { + return -code error "Unknown interface \"$interface\"" + } + if {![dict exists $table stubs $interface,$platform,$at]} { + return -code error "Unknown slot \"$platform,$at\"" + } + return [dict get $table stubs $interface,$platform,$at] +} + +# # ## ### ##### ######## ############# +## Serialize, also nicely formatted for readability. + +proc ::stubs::container::print {table} { + + lappend lines "stubs [list [library? $table]] \{" + lappend lines " scspec [list [scspec? $table]]" + lappend lines " epoch [list [epoch? $table]]" + lappend lines " revision [list [revision? $table]]" + + foreach if [interfaces $table] { + lappend lines " interface [list $if] \{" + lappend lines " hooks [list [hooksof $table $if]]" + + set n -1 + foreach l [lastof $table $if] { + if {$l > $n} { set n $l } + } + # n = max lastof for the interface. + + for {set at 0} {$at <= $n} {incr at} { + + set pl [slotplatforms $table $if $at] + if {![llength $pl]} continue + + foreach p $pl { + lappend d $p [slot $table $if $p $at] + #puts |[lindex $d end-1]|[lindex $d end]| + } + # d = list of decls for the slot, per platform. + # invert and collapse... + + foreach {d plist} [Invert $d] { + #puts |$d| + #puts <$plist> + + # d = list (rtype fname arguments) + # arguments = list (argdef) + # argdef = list (atype aname arrayflag) + # | list (atype aname) + # | list (atype) + + lassign $d rtype fname fargs + + lappend lines " declare $at [list $plist] \{" + lappend lines " function [list $fname]" + lappend lines " return [list $rtype]" + foreach a $fargs { + lappend lines " argument [list $a]" + } + lappend lines " \}" + } + } + + lappend lines " \}" + } + + lappend lines "\}" + + return [join $lines \n] +} + +proc ::stubs::container::Invert {dict} { + # input dict : key -> list(value) + # result is a dict : value -> list(key) + + array set res {} + foreach {k v} $dict { + lappend res($v) $k + } + #parray res + set final {} + foreach k [lsort -dict [array names res]] { + lappend final $k [lsort -dict $res($k)] + } + return $final +} + +# # ## ### ##### ######## ############# +## API + +namespace eval ::stubs::container { + variable legalplatforms { + generic . + unix . + win . + macosx . + x11 . + aqua . + } + + namespace export \ + new library interface scspec epoch hooks declare \ + library? hooks? slot? scspec? revision? epoch? \ + interfaces hooksof platforms lastof slotplatforms slot +} + +# # ## ### ##### +package provide stubs::container 1 +return diff -Nru critcl-3.1.9/lib/stubs_container/pkgIndex.tcl critcl-3.1.17+dfsg/lib/stubs_container/pkgIndex.tcl --- critcl-3.1.9/lib/stubs_container/pkgIndex.tcl 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/lib/stubs_container/pkgIndex.tcl 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,3 @@ +if {![package vsatisfies [package provide Tcl] 8.4]} {return} +#checker -scope global exclude warnUndefinedVar +package ifneeded stubs::container 1 [list source [file join $dir container.tcl]] diff -Nru critcl-3.1.9/lib/stubs_gen_decl/gen_decl.tcl critcl-3.1.17+dfsg/lib/stubs_gen_decl/gen_decl.tcl --- critcl-3.1.9/lib/stubs_gen_decl/gen_decl.tcl 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/lib/stubs_gen_decl/gen_decl.tcl 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,119 @@ +# -*- tcl -*- +# STUBS handling -- Code generation: Writing declarations. +# +# (c) 2011 Andreas Kupries http://wiki.tcl.tk/andreas%20kupries + +# A stubs table is represented by a dictionary value. +# A gen is a variable holding a stubs table value. + +# # ## ### ##### ######## ############# +## Requisites + +package require Tcl 8.4 +package require stubs::gen +package require stubs::container +package require lassign84 + +namespace eval ::stubs::gen::decl::g { + namespace import ::stubs::gen::* +} + +namespace eval ::stubs::gen::decl::c { + namespace import ::stubs::container::* +} + +# # ## ### ##### ######## ############# +## Implementation. + +proc ::stubs::gen::decl::gen {table name} { + set text "\n/*\n * Exported function declarations:\n */\n\n" + append text [g::forall $table $name [list [namespace current]::Make $table] 0] + return $text +} + +# # ## ### ##### +## Internal helpers. + +proc ::stubs::gen::decl::Make {table name decl index} { + #puts "DECL($name $index) = |$decl|" + + lassign $decl rtype fname args + + append text "/* $index */\n" + + set line "[c::scspec? $table] $rtype" + set count [expr {2 - ([string length $line] / 8)}] + append line [string range "\t\t\t" 0 $count] + + set pad [expr {24 - [string length $line]}] + if {$pad <= 0} { + append line " " + set pad 0 + } + + if {![llength $args]} { + append text $line $fname ";\n" + return $text + } + + set arg1 [lindex $args 0] + switch -exact -- $arg1 { + void { + append text $line $fname "(void)" + } + TCL_VARARGS { + append line $fname + append text [MakeArgs $line $pad [lrange $args 1 end] ", ..."] + } + default { + append line $fname + append text [MakeArgs $line $pad $args] + } + } + append text ";\n" + return $text +} + +proc ::stubs::gen::decl::MakeArgs {line pad arguments {suffix {}}} { + #checker -scope local exclude warnArgWrite + set text "" + set sep "(" + foreach arg $arguments { + append line $sep + set next {} + + lassign $arg atype aname aind + + append next $atype + if {[string index $next end] ne "*"} { + append next " " + } + append next $aname $aind + + if {([string length $line] + [string length $next] + $pad) > 76} { + append text [string trimright $line] \n + set line "\t\t\t\t" + set pad 28 + } + append line $next + set sep ", " + } + append line "$suffix)" + + if {[lindex $arguments end] eq "{const char *} format"} { + # TCL_VARARGS case... arguments list already shrunken. + set n [llength $arguments] + append line " TCL_FORMAT_PRINTF(" $n ", " [expr {$n + 1}] ")" + } + + return $text$line +} + +# # ## ### ##### +namespace eval ::stubs::gen::decl { + namespace export gen +} + +# # ## ### ##### +package provide stubs::gen::decl 1 +return diff -Nru critcl-3.1.9/lib/stubs_gen_decl/pkgIndex.tcl critcl-3.1.17+dfsg/lib/stubs_gen_decl/pkgIndex.tcl --- critcl-3.1.9/lib/stubs_gen_decl/pkgIndex.tcl 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/lib/stubs_gen_decl/pkgIndex.tcl 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,3 @@ +if {![package vsatisfies [package provide Tcl] 8.4]} {return} +#checker -scope global exclude warnUndefinedVar +package ifneeded stubs::gen::decl 1 [list source [file join $dir gen_decl.tcl]] diff -Nru critcl-3.1.9/lib/stubs_genframe/genframe.tcl critcl-3.1.17+dfsg/lib/stubs_genframe/genframe.tcl --- critcl-3.1.9/lib/stubs_genframe/genframe.tcl 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/lib/stubs_genframe/genframe.tcl 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,418 @@ +# -*- tcl -*- +# STUBS handling -- Code generation framework. +# +# (c) 2011 Andreas Kupries http://wiki.tcl.tk/andreas%20kupries + +# A stubs table is represented by a dictionary value. +# A gen is a variable holding a stubs table value. + +# # ## ### ##### ######## ############# +## Requisites + +package require Tcl 8.4 +package require stubs::container + +namespace eval ::stubs::gen::c { + namespace import ::stubs::container::* +} + +# # ## ### ##### ######## ############# +## Implementation. + +proc ::stubs::gen::warn {cmdprefix} { + variable warnCmd $cmdprefix + return +} + +proc ::stubs::gen::uncap {text} { + return [string tolower [string index $text 0]][string range $text 1 end] +} + +proc ::stubs::gen::cap {text} { + return [string toupper [string index $text 0]][string range $text 1 end] +} + +proc ::stubs::gen::forall {table name emitCmd onAll {skipString {}}} { + if {$skipString eq {}} { + #checker exclude warnArgWrite + set skipString "/* Slot @@ is reserved */\n" + } + + set platforms [c::platforms $table $name] + + if {[lsearch -exact $platforms "generic"] >= 0} { + # Emit integrated stubs block + set lastNum [MAX [c::lastof $table $name]] + + for {set i 0} {$i <= $lastNum} {incr i} { + + set slots [c::slotplatforms $table $name $i] + set emit 0 + if {[lsearch -exact $slots "generic"] >= 0} { + if {[llength $slots] > 1} { + WARN {conflicting generic and platform entries: $name $i} + } + + append text [CALL generic $i] + set emit 1 + + } elseif {[llength $slots] > 0} { + + array set slot {unix 0 x11 0 win 0 macosx 0 aqua 0} + foreach s $slots { set slot($s) 1 } + # "aqua", "macosx" and "x11" are special cases: + # "macosx" implies "unix", "aqua" implies "macosx" and "x11" + # implies "unix", so we need to be careful not to emit + # duplicate stubs entries: + if {($slot(unix) && $slot(macosx)) || + (($slot(unix) || $slot(macosx)) && + ($slot(x11) || $slot(aqua)))} { + WARN {conflicting platform entries: $name $i} + } + ## unix ## + set temp {} + set plat unix + if {!$slot(aqua) && !$slot(x11)} { + if {$slot($plat)} { + append temp [CALL $plat $i] + } elseif {$onAll} { + append temp [SKIP] + } + } + if {$temp ne ""} { + append text [AddPlatformGuard $plat $temp] + set emit 1 + } + ## x11 ## + set temp {} + set plat x11 + if {!$slot(unix) && !$slot(macosx)} { + if {$slot($plat)} { + append temp [CALL $plat $i] + } elseif {$onAll} { + append temp [SKIP] + } + } + if {$temp ne ""} { + append text [AddPlatformGuard $plat $temp] + set emit 1 + } + ## win ## + set temp {} + set plat win + if {$slot($plat)} { + append temp [CALL $plat $i] + } elseif {$onAll} { + append temp [SKIP] + } + if {$temp ne ""} { + append text [AddPlatformGuard $plat $temp] + set emit 1 + } + ## macosx ## + set temp {} + set plat macosx + if {!$slot(aqua) && !$slot(x11)} { + if {$slot($plat)} { + append temp [CALL $plat $i] + } elseif {$slot(unix)} { + append temp [CALL unix $i] + } elseif {$onAll} { + append temp [SKIP] + } + } + if {$temp ne ""} { + append text [AddPlatformGuard $plat $temp] + set emit 1 + } + ## aqua ## + set temp {} + set plat aqua + if {!$slot(unix) && !$slot(macosx)} { + if {[string range $skipString 0 1] ne "/*"} { + # The code previously had a bug here causing + # it to erroneously generate both a unix entry + # and an aqua entry for a given stubs table + # slot. To preserve backwards compatibility, + # generate a dummy stubs entry before every + # aqua entry (note that this breaks the + # correspondence between emitted entry number + # and actual position of the entry in the + # stubs table, e.g. TkIntStubs entry 113 for + # aqua is in fact at position 114 in the + # table, entry 114 at position 116 etc). + append temp [SKIP] + CHOP temp + append temp " /*\ + Dummy entry for stubs table backwards\ + compatibility */\n" + } + if {$slot($plat)} { + append temp [CALL $plat $i] + } elseif {$onAll} { + append temp [SKIP] + } + } + if {$temp ne ""} { + append text [AddPlatformGuard $plat $temp] + set emit 1 + } + } + if {!$emit} { + append text [SKIP] + } + } + } else { + # Emit separate stubs blocks per platform + array set block {unix 0 x11 0 win 0 macosx 0 aqua 0} + foreach s $platforms { set block($s) 1 } + + ## unix ## + if {$block(unix) && !$block(x11)} { + set temp {} + set plat unix + + # (1) put into helper method + set lastNum [c::lastof $table $name $plat] + for {set i 0} {$i <= $lastNum} {incr i} { + if {[c::slot? $table $name $plat $i]} { + append temp [CALL $plat $i] + } else { + append temp [SKIP] + } + } + append text [AddPlatformGuard $plat $temp] + } + ## win ## + if {$block(win)} { + set temp {} + set plat win + + # (1) put into helper method + set lastNum [c::lastof $table $name $plat] + for {set i 0} {$i <= $lastNum} {incr i} { + if {[c::slot? $table $name $plat $i]} { + append temp [CALL $plat $i] + } else { + append temp [SKIP] + } + } + append text [AddPlatformGuard $plat $temp] + } + ## macosx ## + if {$block(macosx) && !$block(aqua) && !$block(x11)} { + set temp {} + set lastNum [MAX [list \ + [c::lastof $table $name unix] \ + [c::lastof $table $name macosx]]] + + for {set i 0} {$i <= $lastNum} {incr i} { + set emit 0 + foreach plat {unix macosx} { + if {[c::slot? $table $name $plat $i]} { + append temp [CALL $plat $i] + set emit 1 + break + } + } + if {!$emit} { + append temp [SKIP] + } + } + append text [AddPlatformGuard macosx $temp] + } + ## aqua ## + if {$block(aqua)} { + set temp {} + set lastNum [MAX [list \ + [c::lastof $table $name unix] \ + [c::lastof $table $name macosx] \ + [c::lastof $table $name aqua]]] + + for {set i 0} {$i <= $lastNum} {incr i} { + set emit 0 + foreach plat {unix macosx aqua} { + if {[c::slot? $table $name $plat $i]} { + append temp [CALL $plat $i] + set emit 1 + break + } + } + if {!$emit} { + append temp [SKIP] + } + } + append text [AddPlatformGuard aqua $temp] + } + ## x11 ## + if {$block(x11)} { + set temp {} + set lastNum [MAX [list \ + [c::lastof $table $name unix] \ + [c::lastof $table $name macosx] \ + [c::lastof $table $name x11]]] + + for {set i 0} {$i <= $lastNum} {incr i} { + set emit 0 + foreach plat {unix macosx x11} { + if {[c::slot? $table $name $plat $i]} { + if {$plat ne "macosx"} { + append temp [CALL $plat $i] + } else { + append temp [AddPlatformGuard $plat \ + [CALL $plat $i] \ + [SKIP]] + } + set emit 1 + break + } + } + if {!$emit} { + append temp [SKIP] + } + } + append text [AddPlatformGuard x11 $temp] + } + } + + return $text +} + +proc ::stubs::gen::rewrite {path newcode} { + if {![file exists $path]} { + return -code error "Cannot find file: $path" + } + + set in [open ${path} r] + set out [open ${path}.new w] + + # Hardwired use of unix line-endings in the output. + fconfigure $out -translation lf + + # Copy the file header before the code section. + while {![eof $in]} { + set line [gets $in] + if {[string match "*!BEGIN!*" $line]} break + puts $out $line + } + + puts $out "/* !BEGIN!: Do not edit below this line. */" + + # Insert the new code. + puts $out $newcode + + # Skip over the input until the end of the code section. + while {![eof $in]} { + set line [gets $in] + if {[string match "*!END!*" $line]} break + } + + # Copy the trailer after the code section. This can be done fast, + # as searching is not required anymore. + puts $out "/* !END!: Do not edit above this line. */" + puts -nonewline $out [read $in] + + # Close and commit to the changes (atomic rename). + close $in + close $out + file rename -force -- ${path}.new ${path} + return +} + +# # ## ### ##### +## Internal helpers. + +proc ::stubs::gen::CALL {platform index} { + upvar 1 table table name name emitCmd emitCmd + set decl [c::slot $table $name $platform $index] + return [uplevel \#0 [linsert $emitCmd end $name $decl $index]] +} + +proc ::stubs::gen::WARN {text} { + variable warnCmd + if {$warnCmd eq {}} return + return [uplevel \#0 [linsert $warnCmd end [uplevel 1 [list ::subst $text]]]] +} + +proc ::stubs::gen::SKIP {} { + upvar 1 skipString skipString i i + #puts stderr SKIP/$i/[string map [list {$i} $i] $skipString] + return [string map [list @@ $i] $skipString] +} + +proc ::stubs::gen::CHOP {textvar} { + upvar 1 $textvar text + set text [string range $text 0 end-1] + return +} + +proc ::stubs::gen::AddPlatformGuard {platform iftext {elsetext {}}} { + variable guard_begin + variable guard_else + variable guard_end + + set prefix [expr {![info exists guard_begin($platform)] ? "" : $guard_begin($platform)}] + set middle [expr {![info exists guard_else($platform)] ? "" : $guard_else($platform)}] + set suffix [expr {![info exists guard_end($platform)] ? "" : $guard_end($platform)}] + + return $prefix$iftext[expr {($elsetext eq "") + ? "" + : "$middle$elsetext"}]$suffix +} + +if {[package vsatisfies [package present Tcl] 8.5]} { + #checker exclude warnRedefine + proc ::stubs::gen::MAX {list} { + return [tcl::mathfunc::max {*}$list] + } +} else { + #checker exclude warnRedefine + proc ::stubs::gen::MAX {list} { + set max {} + foreach a $list { + if {($max ne {}) && ($max >= $a)} continue + set max $a + } + return $a + } +} + +# # ## ### ##### + +namespace eval ::stubs::gen { + #checker -scope block exclude warnShadowVar + variable guard_begin + variable guard_else + variable guard_end + + array set guard_begin { + win "#ifdef __WIN32__ /* WIN */\n" + unix "#if !defined(__WIN32__) && !defined(MAC_OSX_TCL) /* UNIX */\n" + macosx "#ifdef MAC_OSX_TCL /* MACOSX */\n" + aqua "#ifdef MAC_OSX_TK /* AQUA */\n" + x11 "#if !(defined(__WIN32__) || defined(MAC_OSX_TK)) /* X11 */\n" + } + array set guard_else { + win "#else /* WIN */\n" + unix "#else /* UNIX */\n" + macosx "#else /* MACOSX */\n" + aqua "#else /* AQUA */\n" + x11 "#else /* X11 */\n" + } + array set guard_end { + win "#endif /* WIN */\n" + unix "#endif /* UNIX */\n" + macosx "#endif /* MACOSX */\n" + aqua "#endif /* AQUA */\n" + x11 "#endif /* X11 */\n" + } + + # Default command to report conflict and other warnings. + variable warnCmd {puts stderr} + + namespace export forall rewrite warn cap uncap +} + +# # ## ### ##### +package provide stubs::gen 1 +return diff -Nru critcl-3.1.9/lib/stubs_genframe/pkgIndex.tcl critcl-3.1.17+dfsg/lib/stubs_genframe/pkgIndex.tcl --- critcl-3.1.9/lib/stubs_genframe/pkgIndex.tcl 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/lib/stubs_genframe/pkgIndex.tcl 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,3 @@ +if {![package vsatisfies [package provide Tcl] 8.4]} {return} +#checker -scope global exclude warnUndefinedVar +package ifneeded stubs::gen 1 [list source [file join $dir genframe.tcl]] diff -Nru critcl-3.1.9/lib/stubs_gen_header/gen_header.tcl critcl-3.1.17+dfsg/lib/stubs_gen_header/gen_header.tcl --- critcl-3.1.9/lib/stubs_gen_header/gen_header.tcl 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/lib/stubs_gen_header/gen_header.tcl 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,112 @@ +# -*- tcl -*- +# STUBS handling -- Code generation: Writing the stub headers. +# +# (c) 2011 Andreas Kupries http://wiki.tcl.tk/andreas%20kupries + +# A stubs table is represented by a dictionary value. +# A gen is a variable holding a stubs table value. + +# # ## ### ##### ######## ############# +## Requisites + +package require Tcl 8.4 +package require stubs::gen +package require stubs::container +package require stubs::gen::slot +package require stubs::gen::macro +package require stubs::gen::decl +# critcl, only user, ensured presence of a dict command. +# lassign84, ditto + +namespace eval ::stubs::gen::header::g { + namespace import ::stubs::gen::* +} +namespace eval ::stubs::gen::header::c { + namespace import ::stubs::container::* +} +namespace eval ::stubs::gen::header::s { + namespace import ::stubs::gen::slot::* +} +namespace eval ::stubs::gen::header::m { + namespace import ::stubs::gen::macro::* +} +namespace eval ::stubs::gen::header::d { + namespace import ::stubs::gen::decl::* +} + +# # ## ### ##### ######## ############# +## Implementation. + +proc ::stubs::gen::header::multiline {{flag 1}} { + return [m::multiline $flag] +} + +proc ::stubs::gen::header::gen {table name} { + set capName [g::cap $name] + + set epoch [c::epoch? $table] + if {$epoch ne ""} { + set CAPName [string toupper $name] + append text "\n" + append text "#define ${CAPName}_STUBS_EPOCH $epoch\n" + append text "#define ${CAPName}_STUBS_REVISION [c::revision? $table]\n" + } + + # declarations... + append text [d::gen $table $name] + + if {[c::hooks? $table $name]} { + append text "\ntypedef struct ${capName}StubHooks {\n" + foreach hook [c::hooksof $table $name] { + set capHook [g::cap $hook] + append text " const struct ${capHook}Stubs *${hook}Stubs;\n" + } + append text "} ${capName}StubHooks;\n" + } + + # stub table type definition, including field definitions aka slots... + append text "\ntypedef struct ${capName}Stubs {\n" + append text " int magic;\n" + if {$epoch ne ""} { + append text " int epoch;\n" + append text " int revision;\n" + } + append text " const struct ${capName}StubHooks *hooks;\n\n" + append text [s::gen $table $name] + append text "} ${capName}Stubs;\n" + + # stub table global variable + append text "\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n" + append text "extern const ${capName}Stubs *${name}StubsPtr;\n" + append text "#ifdef __cplusplus\n}\n#endif\n" + + # last, the series of macros for stub users which will route + # function calls through the table. + append text [m::gen $table $name] + + return $text +} + +proc ::stubs::gen::header::rewrite@ {basedir table name} { + rewrite [path $basedir $name] $table $name +} + +proc ::stubs::gen::header::rewrite {path table name} { + g::rewrite $path [gen $table $name] +} + +proc ::stubs::gen::header::path {basedir name} { + return [file join $basedir ${name}Decls.h] +} + +# # ## ### ##### +## Internal helpers. + +# # ## ### ##### +namespace eval ::stubs::gen::header { + namespace export gen multiline rewrite@ rewrite path +} + +# # ## ### ##### ######## ############# +package provide stubs::gen::header 1 +return diff -Nru critcl-3.1.9/lib/stubs_gen_header/pkgIndex.tcl critcl-3.1.17+dfsg/lib/stubs_gen_header/pkgIndex.tcl --- critcl-3.1.9/lib/stubs_gen_header/pkgIndex.tcl 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/lib/stubs_gen_header/pkgIndex.tcl 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,3 @@ +if {![package vsatisfies [package provide Tcl] 8.4]} {return} +#checker -scope global exclude warnUndefinedVar +package ifneeded stubs::gen::header 1 [list source [file join $dir gen_header.tcl]] diff -Nru critcl-3.1.9/lib/stubs_gen_init/gen_init.tcl critcl-3.1.17+dfsg/lib/stubs_gen_init/gen_init.tcl --- critcl-3.1.9/lib/stubs_gen_init/gen_init.tcl 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/lib/stubs_gen_init/gen_init.tcl 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,189 @@ +# -*- tcl -*- +# STUBS handling -- Code generation: Writing the initialization code for EXPORTers. +# +# (c) 2011 Andreas Kupries http://wiki.tcl.tk/andreas%20kupries + +# A stubs table is represented by a dictionary value. +# A gen is a variable holding a stubs table value. + +# # ## ### ##### ######## ############# +## Requisites + +package require Tcl 8.4 +package require stubs::gen +package require stubs::container +package require lassign84 + +namespace eval ::stubs::gen::init::g { + namespace import ::stubs::gen::* +} + +namespace eval ::stubs::gen::init::c { + namespace import ::stubs::container::* +} + +# # ## ### ##### ######## ############# +## Implementation. + +proc ::stubs::gen::init::gen {table} { + # Assuming that dependencies only go one level deep, we need to + # emit all of the leaves first to avoid needing forward + # declarations. + + set leaves {} + set roots {} + + foreach name [lsort [c::interfaces $table]] { + if {[c::hooks? $table $name]} { + lappend roots $name + } else { + lappend leaves $name + } + } + + set text {} + foreach name $leaves { + append text [Emit $table $name] + } + foreach name $roots { + append text [Emit $table $name] + } + + return $text +} + +proc ::stubs::gen::init::make@ {basedir table} { + make [path $basedir $table] $table +} + +proc ::stubs::gen::init::make {path table} { + variable template + + set c [open $path w] + puts -nonewline $c \ + [string map \ + [list @@ [string map {:: _} [c::library? $table]]] \ + $template] + close $c + + rewrite $path $table + return +} + +proc ::stubs::gen::init::rewrite@ {basedir table} { + rewrite [path $basedir $table] $table + return +} + +proc ::stubs::gen::init::rewrite {path table} { + g::rewrite $path [gen $table] + return +} + +proc ::stubs::gen::init::path {basedir table} { + return [file join $basedir [c::library? $table]StubInit.c] +} + +# # ## ### ##### +## Internal helpers. + +proc ::stubs::gen::init::Emit {table name} { + # See tcllib/textutil as well. + set capName [g::cap $name] + + if {[c::hooks? $table $name]} { + append text "\nstatic const ${capName}StubHooks ${name}StubHooks = \{\n" + set sep " " + foreach sub [c::hooksof $table $name] { + append text $sep "&${sub}Stubs" + set sep ",\n " + } + append text "\n\};\n" + } + + # Check if this interface is a hook for some other interface. + # TODO: Make this a container API command. + set root 1 + foreach intf [c::interfaces $table] { + if {[c::hooks? $table $intf] && + ([lsearch -exact [c::hooksof $table $intf] $name] >= 0)} { + set root 0 + break + } + } + + # Hooks are local to the file. + append text "\n" + if {!$root} { + append text "static " + } + append text "const ${capName}Stubs ${name}Stubs = \{\n" + append text " TCL_STUB_MAGIC,\n" + + if {[c::epoch? $table] ne ""} { + set CAPName [string toupper $name] + append text " ${CAPName}_STUBS_EPOCH,\n" + append text " ${CAPName}_STUBS_REVISION,\n" + } + + if {[c::hooks? $table $name]} { + append text " &${name}StubHooks,\n" + } else { + append text " 0,\n" + } + + append text [g::forall $table $name [namespace current]::Make 1 \ + " 0, /* @@ */\n"] + + append text "\};\n" + return $text +} + +# Make -- +# +# Generate the prototype for a function. +# +# Arguments: +# name The interface name. +# decl The function declaration. +# index The slot index for this function. +# +# Results: +# Returns the formatted declaration string. + +proc ::stubs::gen::init::Make {name decl index} { + #puts "INIT($name $index) = |$decl|" + + lassign $decl rtype fname args + + if {![llength $args]} { + append text " &$fname, /* $index */\n" + } else { + append text " $fname, /* $index */\n" + } + return $text +} + +# # ## ### ##### +namespace eval ::stubs::gen::init { + #checker exclude warnShadowVar + variable template [string map {{ } {}} { + /* @@StubsInit.c + * + * The contents of this file are automatically generated + * from the @@.decls file. + * + */ + + #include "@@.h" + + /* !BEGIN!: Do not edit below this line. */ + /* !END!: Do not edit above this line. */ + }] + + namespace export gen make@ make rewrite@ rewrite path +} + +# # ## ### ##### ######## ############# +package provide stubs::gen::init 1 +return diff -Nru critcl-3.1.9/lib/stubs_gen_init/pkgIndex.tcl critcl-3.1.17+dfsg/lib/stubs_gen_init/pkgIndex.tcl --- critcl-3.1.9/lib/stubs_gen_init/pkgIndex.tcl 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/lib/stubs_gen_init/pkgIndex.tcl 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,3 @@ +if {![package vsatisfies [package provide Tcl] 8.4]} {return} +#checker -scope global exclude warnUndefinedVar +package ifneeded stubs::gen::init 1 [list source [file join $dir gen_init.tcl]] diff -Nru critcl-3.1.9/lib/stubs_gen_lib/gen_lib.tcl critcl-3.1.17+dfsg/lib/stubs_gen_lib/gen_lib.tcl --- critcl-3.1.9/lib/stubs_gen_lib/gen_lib.tcl 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/lib/stubs_gen_lib/gen_lib.tcl 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,215 @@ +# -*- tcl -*- +# STUBS handling -- Code generation: Writing the initialization code for IMPORTers. +# +# (c) 2011 Andreas Kupries http://wiki.tcl.tk/andreas%20kupries + +# A stubs table is represented by a dictionary value. +# A gen is a variable holding a stubs table value. + +# # ## ### ##### ######## ############# +## Requisites + +package require Tcl 8.4 +package require stubs::gen +package require stubs::container +package require lassign84 + +namespace eval ::stubs::gen::lib::g { + namespace import ::stubs::gen::* +} + +namespace eval ::stubs::gen::lib::c { + namespace import ::stubs::container::* +} + +# # ## ### ##### ######## ############# +## Implementation. + +proc ::stubs::gen::lib::gen {table} { + # Assuming that dependencies only go one level deep, we need to + # emit all of the leaves first to avoid needing forward + # declarations. + + variable template + + # Assuming that dependencies only go one level deep, we emit all + # of the leaves first to avoid needing forward declarations. + + set leaves {} + set roots {} + + foreach name [lsort [c::interfaces $table]] { + if {[c::hooks? $table $name]} { + lappend roots $name + } else { + lappend leaves $name + } + } + + set headers {} + set variables {} + set hooks {} + + foreach name [concat $leaves $roots] { + set capName [g::cap $name] + + # POLISH - format the variables code block aligned using + # maxlength of interface names. + lappend headers "\#include \"${name}Decls.h\"" + lappend variables "const ${capName}Stubs* ${name}StubsPtr;" + + # Check if this is a hook. If yes it needs additional setup. + set parent [Parent $table $name] + if {$parent eq ""} continue + lappend hooks " ${name}StubsPtr = ${parent}StubsPtr->hooks->${name}Stubs;" + } + + set pname [c::library? $table] ; # FUTURE: May be separate from the library + # namespaces! + set name [string map {:: _} [c::library? $table]] + set capName [g::cap $name] + set upName [string toupper $name] + + set headers [Block $headers] + set variables [Block $variables] + set hooks [Block $hooks] + + return [string map \ + [list \ + @PKG@ $pname \ + @@ $name \ + @UP@ $upName \ + @CAP@ $capName \ + @HEADERS@ $headers \ + @VARS@ $variables \ + @HOOKS@ $hooks \ + ] $template] + return $text +} + +proc ::stubs::gen::lib::Block {list} { + if {![llength $list]} { return "" } + return \n[join $list \n]\n +} + +proc ::stubs::gen::lib::make@ {basedir table} { + make [path $basedir [c::library? $table]] $table +} + +proc ::stubs::gen::lib::make {path table} { + set c [open $path w] + puts -nonewline $c [gen $table] + close $c + return +} + +proc ::stubs::gen::lib::path {basedir name} { + return [file join $basedir ${name}StubLib.c] +} + +# # ## ### ##### +## Internal helpers. + +proc ::stubs::gen::lib::Parent {table name} { + # Check if this interface is a hook for some other interface. + # TODO: Make this a container API command. + foreach intf [c::interfaces $table] { + if {[c::hooks? $table $intf] && + ([lsearch -exact [c::hooksof $table $intf] $name] >= 0)} { + return $intf + } + } + return "" +} + +# # ## ### ##### +namespace eval ::stubs::gen::lib { + #checker exclude warnShadowVar + variable template [string map {{ + } { +}} { + /* + * @@StubLib.c -- + * + * Stub object that will be statically linked into extensions that wish + * to access @@. + */ + + /* + * We need to ensure that we use the stub macros so that this file contains + * no references to any of the stub functions. This will make it possible + * to build an extension that references @CAP@_InitStubs but doesn't end up + * including the rest of the stub functions. + */ + + #ifndef USE_TCL_STUBS + #define USE_TCL_STUBS + #endif + #undef USE_TCL_STUB_PROCS + + #include + + #ifndef USE_@UP@_STUBS + #define USE_@UP@_STUBS + #endif + #undef USE_@UP@_STUB_PROCS + @HEADERS@ + /* + * Ensure that @CAP@_InitStubs is built as an exported symbol. The other stub + * functions should be built as non-exported symbols. + */ + + #undef TCL_STORAGE_CLASS + #define TCL_STORAGE_CLASS DLLEXPORT + @VARS@ + + /* + *---------------------------------------------------------------------- + * + * @CAP@_InitStubs -- + * + * Checks that the correct version of @CAP@ is loaded and that it + * supports stubs. It then initialises the stub table pointers. + * + * Results: + * The actual version of @CAP@ that satisfies the request, or + * NULL to indicate that an error occurred. + * + * Side effects: + * Sets the stub table pointers. + * + *---------------------------------------------------------------------- + */ + + #ifdef @CAP@_InitStubs + #undef @CAP@_InitStubs + #endif + + char * + @CAP@_InitStubs(Tcl_Interp *interp, CONST char *version, int exact) + { + CONST char *actualVersion; + + actualVersion = Tcl_PkgRequireEx(interp, "@PKG@", version, + exact, (ClientData *) &@@StubsPtr); + if (!actualVersion) { + return NULL; + } + + if (!@@StubsPtr) { + Tcl_SetResult(interp, + "This implementation of @CAP@ does not support stubs", + TCL_STATIC); + return NULL; + } + @HOOKS@ + return (char*) actualVersion; + } + }] + + namespace export gen make@ make rewrite@ rewrite path +} + +# # ## ### ##### ######## ############# +package provide stubs::gen::lib 1 +return diff -Nru critcl-3.1.9/lib/stubs_gen_lib/pkgIndex.tcl critcl-3.1.17+dfsg/lib/stubs_gen_lib/pkgIndex.tcl --- critcl-3.1.9/lib/stubs_gen_lib/pkgIndex.tcl 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/lib/stubs_gen_lib/pkgIndex.tcl 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,3 @@ +if {![package vsatisfies [package provide Tcl] 8.4]} {return} +#checker -scope global exclude warnUndefinedVar +package ifneeded stubs::gen::lib 1 [list source [file join $dir gen_lib.tcl]] diff -Nru critcl-3.1.9/lib/stubs_gen_macro/gen_macro.tcl critcl-3.1.17+dfsg/lib/stubs_gen_macro/gen_macro.tcl --- critcl-3.1.9/lib/stubs_gen_macro/gen_macro.tcl 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/lib/stubs_gen_macro/gen_macro.tcl 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,74 @@ +# -*- tcl -*- +# STUBS handling -- Code generation: Writing the stub macros. +# +# (c) 2011 Andreas Kupries http://wiki.tcl.tk/andreas%20kupries + +# A stubs table is represented by a dictionary value. +# A gen is a variable holding a stubs table value. + +# # ## ### ##### ######## ############# +## Requisites + +package require Tcl 8.4 +package require stubs::gen +package require stubs::container +package require lassign84 + +namespace eval ::stubs::gen::macro::g { + namespace import ::stubs::gen::* +} + +namespace eval ::stubs::gen::macro::c { + namespace import ::stubs::container::* +} + +# # ## ### ##### ######## ############# +## Implementation. + +proc ::stubs::gen::macro::multiline {{flag 1}} { + variable multiline $flag + return $flag +} + +proc ::stubs::gen::macro::gen {table name} { + set upName [string toupper [string map {:: _} [c::library? $table]]] + set sguard "defined(USE_${upName}_STUBS)" + + append text "\n#if $sguard\n" + append text "\n/*\n * Inline function declarations:\n */\n\n" + append text [g::forall $table $name [namespace current]::Make 0] + append text "\n#endif /* $sguard */\n" + return $text +} + +# # ## ### ##### +## Internal helpers. + +proc ::stubs::gen::macro::Make {name decl index} { + variable multiline + #puts "MACRO($name $index) = |$decl|" + + lassign $decl rtype fname args + + set capName [g::uncap $fname] + + append text "#define $fname " + if {$multiline} { append text "\\\n\t" } + append text "(" + if {![llength $args]} { append text "*" } + append text "${name}StubsPtr->$capName)" + append text " /* $index */\n" + return $text +} + +# # ## ### ##### +namespace eval ::stubs::gen::macro { + #checker exclude warnShadowVar + variable multiline 1 + + namespace export gen multiline +} + +# # ## ### ##### ######## ############# +package provide stubs::gen::macro 1 +return diff -Nru critcl-3.1.9/lib/stubs_gen_macro/pkgIndex.tcl critcl-3.1.17+dfsg/lib/stubs_gen_macro/pkgIndex.tcl --- critcl-3.1.9/lib/stubs_gen_macro/pkgIndex.tcl 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/lib/stubs_gen_macro/pkgIndex.tcl 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,3 @@ +if {![package vsatisfies [package provide Tcl] 8.4]} {return} +#checker -scope global exclude warnUndefinedVar +package ifneeded stubs::gen::macro 1 [list source [file join $dir gen_macro.tcl]] diff -Nru critcl-3.1.9/lib/stubs_gen_slot/gen_slot.tcl critcl-3.1.17+dfsg/lib/stubs_gen_slot/gen_slot.tcl --- critcl-3.1.9/lib/stubs_gen_slot/gen_slot.tcl 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/lib/stubs_gen_slot/gen_slot.tcl 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,98 @@ +# -*- tcl -*- +# STUBS handling -- Code generation: Writing SLOT code. +# +# (c) 2011 Andreas Kupries http://wiki.tcl.tk/andreas%20kupries + +# # ## ### ##### ######## ############# +## Requisites + +package require Tcl 8.4 +package require stubs::gen +package require lassign84 + +# lassign84, ditto + +namespace eval ::stubs::gen::slot::g { + namespace import ::stubs::gen::* +} + +# # ## ### ##### ######## ############# +## Implementation. + +proc ::stubs::gen::slot::gen {table name} { + return [g::forall $table $name [namespace current]::Make 1 \ + " void (*reserved@@)(void);\n"] +} + +# # ## ### ##### +## Internal helpers. + +proc ::stubs::gen::slot::Make {name decl index} { + #puts "SLOT($name $index) = |$decl|" + + lassign $decl rtype fname args + + set capName [g::uncap $fname] + + set text " " + if {![llength $args]} { + append text $rtype " *" $capName "; /* $index */\n" + return $text + } + + if {[string range $rtype end-7 end] eq "CALLBACK"} { + append text \ + [string trim [string range $rtype 0 end-8]] \ + " (CALLBACK *" $capName ") " + } else { + append text $rtype " (*" $capName ") " + } + + set arg1 [lindex $args 0] + switch -exact -- $arg1 { + void { + append text "(void)" + } + TCL_VARARGS { + append text [MakeArgs [lrange $args 1 end] ", ..."] + } + default { + append text [MakeArgs $args] + } + } + + append text "; /* $index */\n" + return $text +} + +proc ::stubs::gen::slot::MakeArgs {arguments {suffix {}}} { + set text "" + set sep "(" + foreach arg $arguments { + lassign $arg atype aname aind + append text $sep $atype + if {[string index $text end] ne "*"} { + append text " " + } + append text $aname $aind + set sep ", " + } + append text "$suffix)" + + if {[lindex $arguments end] eq "\{const char *\} format"} { + # TCL_VARARGS case... arguments list already shrunken. + set n [llength $arguments] + append text " TCL_FORMAT_PRINTF(" $n ", " [expr {$n + 1}] ")" + } + + return $text +} + +# # ## ### ##### +namespace eval ::stubs::gen::slot { + namespace export gen +} + +# # ## ### ##### +package provide stubs::gen::slot 1 +return diff -Nru critcl-3.1.9/lib/stubs_gen_slot/pkgIndex.tcl critcl-3.1.17+dfsg/lib/stubs_gen_slot/pkgIndex.tcl --- critcl-3.1.9/lib/stubs_gen_slot/pkgIndex.tcl 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/lib/stubs_gen_slot/pkgIndex.tcl 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,3 @@ +if {![package vsatisfies [package provide Tcl] 8.4]} {return} +#checker -scope global exclude warnUndefinedVar +package ifneeded stubs::gen::slot 1 [list source [file join $dir gen_slot.tcl]] diff -Nru critcl-3.1.9/lib/stubs_reader/pkgIndex.tcl critcl-3.1.17+dfsg/lib/stubs_reader/pkgIndex.tcl --- critcl-3.1.9/lib/stubs_reader/pkgIndex.tcl 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/lib/stubs_reader/pkgIndex.tcl 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,3 @@ +if {![package vsatisfies [package provide Tcl] 8.4]} {return} +#checker -scope global exclude warnUndefinedVar +package ifneeded stubs::reader 1 [list source [file join $dir reader.tcl]] diff -Nru critcl-3.1.9/lib/stubs_reader/reader.tcl critcl-3.1.17+dfsg/lib/stubs_reader/reader.tcl --- critcl-3.1.9/lib/stubs_reader/reader.tcl 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/lib/stubs_reader/reader.tcl 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,246 @@ +# -*- tcl -*- +# STUBS handling -- Reader. +# +# (c) 2011 Andreas Kupries http://wiki.tcl.tk/andreas%20kupries + +# # ## ### ##### ######## ############# +## Requisites + +package require Tcl 8.4 +package require stubs::container +package require lassign84 + +# A stubs table is represented by a dictionary value. +# A container is a variable holding a stubs table value. + +namespace eval ::stubs::reader::c { + namespace import ::stubs::container::* +} + +# # ## ### ##### ######## ############# +## Implementation. + +proc ::stubs::reader::file {tablevar path} { + upvar 1 $tablevar table + + set chan [open $path r] + set text [read $chan] + close $chan + + text table $text + return +} + +proc ::stubs::reader::text {tablevar text} { + variable current + variable table + + upvar 1 $tablevar t + + set sandbox [interp create -safe] + + interp alias $sandbox library {} ::stubs::reader::P_library + interp alias $sandbox interface {} ::stubs::reader::P_interface + interp alias $sandbox scspec {} ::stubs::reader::P_scspec + interp alias $sandbox epoch {} ::stubs::reader::P_epoch + interp alias $sandbox hooks {} ::stubs::reader::P_hooks + interp alias $sandbox declare {} ::stubs::reader::P_declare + interp alias $sandbox export {} ::stubs::reader::P_export + + set current UNKNOWN + set table $t + + set ::errorCode {} + set ::errorInfo {} + + if {![set code [catch { + $sandbox eval $text + } res]]} { + set t $table + } + + interp delete $sandbox + unset table + + return -code $code -errorcode $::errorCode -errorinfo $::errorInfo \ + $res +} + +# READER API methods. These are called when sourcing a .decls +# file, or evaluating a .decls string. They forward to the +# attached container after pre-processing arguments and merging in +# state information (current interface). + +proc ::stubs::reader::P_library {name} { + variable table + c::library table $name + return +} + +proc ::stubs::reader::P_interface {name} { + variable table + variable current + + set current $name + c::interface table $name + return +} + +proc ::stubs::reader::P_scspec {value} { + variable table + c::scspec table $value + return +} + +proc ::stubs::reader::P_epoch {value} { + variable table + c::epoch table $value + return +} + +proc ::stubs::reader::P_hooks {names} { + variable table + variable current + + c::hooks table $current $names + return +} + +proc ::stubs::reader::P_declare {index args} { + variable table + variable current + + switch -exact [llength $args] { + 1 { + # syntax: declare AT DECL + set platforms [list generic] + set decl [lindex $args 0] + } + 2 { + # syntax: declare AT PLATFORMS DECL + lassign $args platforms decl + } + default { + return -code error \ + "wrong \# args: expected 'index ?platforms? decl" + } + } + + c::declare table $current $index $platforms [ParseDecl $decl] + return +} + +proc ::stubs::reader::P_export {decl} { + variable table + variable current + + # Ignore. + return +} + +# Support methods for parsing a C declaration into its constituent +# pieces. + +# ParseDecl -- +# +# Parse a C function declaration into its component parts. +# +# Arguments: +# decl The function declaration. +# +# Results: +# Returns a list of the form {returnType name arguments}. The arguments +# element consists of a list of type/name pairs, or a single +# element "void". If the function declaration is malformed +# then an error is displayed and the return value is {}. + +proc ::stubs::reader::ParseDecl {decl} { + #checker exclude warnArgWrite + regsub -all "\[ \t\n\]+" [string trim $decl] " " decl + #puts "PARSE ($decl)" + + if {![regexp {^(.*)\((.*)\)$} $decl --> prefix arguments]} { + set prefix $decl + set arguments {} + } + + set prefix [string trim $prefix] + if {![regexp {^(.+[ ][*]*)([^ *]+)$} $prefix --> rtype fname]} { + return -code error "Bad return type: $decl" + } + + set rtype [string trim $rtype] + if {$arguments eq ""} { + return [list $rtype $fname {void}] + } + + foreach arg [split $arguments ,] { + lappend argumentList [string trim $arg] + } + + if {[lindex $argumentList end] eq "..."} { + set arguments TCL_VARARGS + foreach arg [lrange $argumentList 0 end-1] { + set argInfo [ParseArg $arg] + set arity [llength $argInfo] + if {(2 <= $arity) && ($arity <= 3)} { + lappend arguments $argInfo + } else { + return -code error "Bad argument: '$arg' in '$decl'" + } + } + } else { + set arguments {} + foreach arg $argumentList { + set argInfo [ParseArg $arg] + if {$argInfo eq "void"} { + lappend arguments "void" + break + } + set arity [llength $argInfo] + if {(2 <= $arity) && ($arity <= 3)} { + lappend arguments $argInfo + } else { + return -code error "Bad argument: '$arg' in '$decl'" + } + } + } + return [list $rtype $fname $arguments] +} + +# ParseArg -- +# +# This function parses a function argument into a type and name. +# +# Arguments: +# arg The argument to parse. +# +# Results: +# Returns a list of type and name with an optional third array +# indicator. If the argument is malformed, returns "". + +proc ::stubs::reader::ParseArg {arg} { + if {![regexp {^(.+[ ][*]*)([^][ *]+)(\[\])?$} $arg all type name array]} { + if {$arg eq "void"} { + return $arg + } else { + return + } + } + set result [list [string trim $type] $name] + if {$array ne ""} { + lappend result $array + } + return $result +} + +# # ## ### ##### ######## ############# +## API + +namespace eval ::stubs::reader { + namespace export file text +} + +# # ## ### ##### +package provide stubs::reader 1 +return diff -Nru critcl-3.1.9/lib/stubs_writer/pkgIndex.tcl critcl-3.1.17+dfsg/lib/stubs_writer/pkgIndex.tcl --- critcl-3.1.9/lib/stubs_writer/pkgIndex.tcl 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/lib/stubs_writer/pkgIndex.tcl 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,3 @@ +if {![package vsatisfies [package provide Tcl] 8.4]} {return} +#checker -scope global exclude warnUndefinedVar +package ifneeded stubs::writer 1 [list source [file join $dir writer.tcl]] diff -Nru critcl-3.1.9/lib/stubs_writer/writer.tcl critcl-3.1.17+dfsg/lib/stubs_writer/writer.tcl --- critcl-3.1.9/lib/stubs_writer/writer.tcl 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/lib/stubs_writer/writer.tcl 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,121 @@ +# -*- tcl -*- +# STUBS handling -- Write stubs table as .decls file +# +# (c) 2011 Andreas Kupries http://wiki.tcl.tk/andreas%20kupries + +# A stubs table is represented by a dictionary value. +# A container is a variable holding a stubs table value. + +# # ## ### ##### ######## ############# +## Requisites + +package require Tcl 8.4 +package require stubs::gen +package require stubs::container +package require lassign84 + +namespace eval ::stubs::writer::g { + namespace import ::stubs::gen::* +} + +namespace eval ::stubs::writer::c { + namespace import ::stubs::container::* +} + +# # ## ### ##### ######## ############# +## Implementation. + +proc ::stubs::writer::gen {table} { + + set defaults [c::new] + set dscspec [c::scspec? $defaults] + set depoch [c::epoch? $defaults] + + set name [c::library? $table] + set scspec [c::scspec? $table] + set epoch [c::epoch? $table] + set rev [c::revision? $table] + + lappend lines "\# ${name}.decls -- -*- tcl -*-" + lappend lines "\#" + lappend lines "\#\tThis file contains the declarations for all public functions" + lappend lines "\#\tthat are exported by the \"${name}\" library via its stubs table." + lappend lines "\#" + + lappend lines "" + lappend lines "library [list $name]" + + if {($scspec ne $dscspec) || + ($epoch ne $depoch )} { + if {$scspec ne $dscspec} { + lappend lines "scspec [list $scspec]" + } + if {$epoch ne $depoch } { + lappend lines "epoch [list $epoch]" + lappend lines "revision [list $rev]" + } + } + + foreach if [c::interfaces $table] { + lappend lines "" + lappend lines "interface [list $if]" + + if {[c::hooks? $table $if]} { + lappend lines "hooks [list [c::hooksof $table $if]]" + } + lappend lines \ + [g::forall $table $if \ + [list [namespace current]::Make $table] \ + 0] + } + + lappend lines "\# END $name" + + return [join $lines \n] +} + +# # ## ### ##### +## Internal helpers. + +proc ::stubs::writer::Make {table if decl index} { + #puts |--------------------------------------- + #puts |$if|$index|$decl| + + lassign $decl rtype fname arguments + if {[llength $arguments]} { + # what about the third piece of info, array flag?! ... + + set suffix {} + foreach a $arguments { + if {$a eq "void"} { + lappend ax $a + } elseif {$a eq "TCL_VARARGS"} { + set suffix ", ..." + } else { + lassign $a atype aname aflag + # aflag either "", or "[]". + lappend ax "$atype $aname$aflag" + #puts \t|$atype|$aname|$aflag| + } + } + set ax [join $ax {, }]$suffix + } else { + set ax void + } + set cdecl "\n $rtype $fname ($ax)\n" + set platforms [c::slotplatforms $table $if $index] + + lappend lines "" + lappend lines "declare $index [list $platforms] \{$cdecl\}" + + return [join $lines \n]\n +} + +# # ## ### ##### +namespace eval ::stubs::writer { + namespace export gen +} + +# # ## ### ##### +package provide stubs::writer 1 +return diff -Nru critcl-3.1.9/lib/util84/dict.tcl critcl-3.1.17+dfsg/lib/util84/dict.tcl --- critcl-3.1.9/lib/util84/dict.tcl 2013-05-10 05:57:04.000000000 +0000 +++ critcl-3.1.17+dfsg/lib/util84/dict.tcl 1970-01-01 00:00:00.000000000 +0000 @@ -1,210 +0,0 @@ -## -*- tcl -*- -# # ## ### ##### ######## ############# ##################### - -# Forward compatibility support for 'dict'. - -# # ## ### ##### ######## ############# ##################### -## Requirements. - -package require Tcl 8.4 ; # Minimum supported version. -package provide dict84 1 ; # What we export. - -# # ## ### ##### ######## ############# ##################### -## II. Make sure that the Tcl interpreter has a 'dict' command. - -# Bail out if we are in an environment which already provides the -# command. -if {[llength [info commands ::dict]]} return - -# First try to get the separate 'dict' package first. It is C-based, -# i.e. faster, and ActiveTcl 8.4, for example, has it. Bail out if we -# had success, for we now have the necessary commands. - -if {![catch { - package require dict -}]} return - -# Lastly use the poor man's dict -- a pure tcl [dict] emulation -# Very slow, but complete. -# Taken From http://wiki.tcl.tk/10609. -# -# Not all error checks are implemented! -# e.g. [dict create odd arguments here] will work -# -# Implementation is based on lists, [array set/get] -# and recursion - -proc dict {cmd args} { - uplevel 1 [linsert $args 0 _dict_$cmd] -} -proc _dict_get {dv args} { - if {![llength $args]} {return $dv} else { - array set dvx $dv - set key [lindex $args 0] - set dv $dvx($key) - set args [lrange $args 1 end] - return [eval [linsert $args 0 _dict_get $dv]] - } -} -proc _dict_exists {dv key args} { - array set dvx $dv - set r [info exists dvx($key)] - if {!$r} {return 0} - if {[llength $args]} { - return [eval [linsert $args 0 _dict_exists $dvx($key) ]] - } else {return 1} -} -proc _dict_set {dvar key value args } { - upvar 1 $dvar dv - if {![info exists dv]} {set dv [list]} - array set dvx $dv - if {![llength $args]} { - set dvx($key) $value - } else { - eval [linsert $args 0 _dict_set dvx($key) $value] - } - set dv [array get dvx] -} -proc _dict_unset {dvar key args} { - upvar 1 $dvar mydvar - if {![info exists mydvar]} {return} - array set dv $mydvar - if {![llength $args]} { - if {[info exists dv($key)]} { - unset dv($key) - } - } else { - eval [linsert $args 0 _dict_unset dv($key) ] - } - set mydvar [array get dv] - return {} -} -proc _dict_keys {dv {pat *}} { - array set dvx $dv - return [array names dvx $pat] -} -proc _dict_append {dvar key args} { - upvar 1 $dvar dv - if {![info exists dv]} {set dv [list]} - array set dvx $dv - eval [linsert $args 0 append dvx($key) ] - set dv [array get dvx] -} -proc _dict_create {args} { - return $args -} -proc _dict_filter {dv ftype args} { - set r [list] - foreach {globpattern} $args {break} - foreach {varlist script} $args {break} - - switch $ftype { - key { - foreach {key value} $dv { - if {[string match $globpattern $key]} { - lappend r $key $value - } - } - } - value { - foreach {key value} $dv { - if {[string match $globpattern $value]} { - lappend r $key $value - } - } - } - script { - foreach {Pkey Pval} $varlist {break} - upvar 1 $Pkey key $Pval value - foreach {key value} $dv { - if {[uplevel 1 $script]} { - lappend r $key $value - } - } - } - default { - error "Wrong filter type" - } - } - return $r -} -proc _dict_for {kv dict body} { - uplevel 1 [list foreach $kv $dict $body] -} -proc _dict_incr {dvar key {incr 1}} { - upvar 1 $dvar dv - if {![info exists dv]} {set dv [list]} - array set dvx $dv - if {![info exists dvx($key)]} {set dvx($key) 0} - incr dvx($key) $incr - set dv [array get dvx] -} -proc _dict_info {dv} { - return "Dictionary is represented as plain list" -} -proc _dict_lappend {dvar key args} { - upvar 1 $dvar dv - if {![info exists dv]} {set dv [list]} - array set dvx $dv - eval [linsert $args 0 lappend dvx($key)] - set dv [array get dvx] -} -proc _dict_merge {args} { - foreach dv $args { - array set dvx $dv - } - array get dvx -} -proc _dict_replace {dv args} { - foreach {k v} $args { - _dict_set dv $k $v - } - return $dv -} -proc _dict_remove {dv args} { - foreach k $args { - _dict_unset dv $k - } - return $dv -} -proc _dict_size {dv} { - return [expr {[llength $dv]/2}] -} -proc _dict_values {dv {gp *}} { - set r [list] - foreach {k v} $dv { - if {[string match $gp $v]} { - lappend r $v - } - } - return $r -} -proc _dict_update {dvar args} { - set name [string map {: {} ( {} ) {}} $dvar] - upvar 1 $dvar dv - upvar 1 _my_dict_array$name local - - array set local $dv - foreach {k v} [lrange $args 0 end-1] { - if {[info exists local($k)]} { - if {![uplevel 1 [list info exists $v]]} { - uplevel 1 [list upvar 0 _my_dict_array${name}($k) $v] - } else { - uplevel 1 [list set $v $local($k)] - } - } - } - set code [catch {uplevel 1 [lindex $args end]} res] - - foreach {k v} [lrange $args 0 end-1] { - if {[uplevel 1 [list info exists $v]]} { - set local($k) [uplevel 1 [list set $v]] - } else { - unset -nocomplain local($k) - } - } - set dv [array get local] - unset local - - return -code $code $res -} diff -Nru critcl-3.1.9/lib/util84/lassign.tcl critcl-3.1.17+dfsg/lib/util84/lassign.tcl --- critcl-3.1.9/lib/util84/lassign.tcl 2013-05-10 05:57:04.000000000 +0000 +++ critcl-3.1.17+dfsg/lib/util84/lassign.tcl 1970-01-01 00:00:00.000000000 +0000 @@ -1,35 +0,0 @@ -## -*- tcl -*- -# # ## ### ##### ######## ############# ##################### - -# Lassign. Forward compatibility support. - -# I.e. code implementing a number of commands for 8.4 which are -# otherwise only defined in 8.5+ - -# # ## ### ##### ######## ############# ##################### -## Requirements. - -package require Tcl 8.4 ; # Minimum supported version. -package provide lassign84 1.0.1 ; # What we export. - -# # ## ### ##### ######## ############# ##################### -## I. Make sure that the Tcl interpreter has a 'lassign' command. - -# Bail out if we are in an environment which already provides the -# command. -if {[llength [info commands ::lassign]]} return - -# Command is missing, provide our emulation. -proc lassign {valueList args} { - if {[llength $args] == 0} { - return -code error "wrong # args: lassign list varname ?varname..?" - } - foreach v $args { uplevel 1 [list set $v {}] } - uplevel 1 [list foreach $args $valueList {break}] - return [lrange $valueList [llength $args] end] -} - -## -# # ## ### ##### ######## ############# ##################### -## Ready -return diff -Nru critcl-3.1.9/lib/util84/pkgIndex.tcl critcl-3.1.17+dfsg/lib/util84/pkgIndex.tcl --- critcl-3.1.9/lib/util84/pkgIndex.tcl 2013-05-10 05:57:04.000000000 +0000 +++ critcl-3.1.17+dfsg/lib/util84/pkgIndex.tcl 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -package ifneeded dict84 1 [list source [file join $dir dict.tcl]] -package ifneeded lassign84 1.0.1 [list source [file join $dir lassign.tcl]] diff -Nru critcl-3.1.9/lib/wikit/format.tcl critcl-3.1.17+dfsg/lib/wikit/format.tcl --- critcl-3.1.9/lib/wikit/format.tcl 2013-05-10 05:57:04.000000000 +0000 +++ critcl-3.1.17+dfsg/lib/wikit/format.tcl 2017-10-14 02:48:11.000000000 +0000 @@ -289,7 +289,7 @@ } EVAL { if {![interp exists eval_interp]} { - # create an intepreter to run eval commands + # create an interpreter to run eval commands # when running via web/ GGI this should be a safe interp interp create eval_interp # create the wikidir variable as a convenience diff -Nru critcl-3.1.9/README.md critcl-3.1.17+dfsg/README.md --- critcl-3.1.9/README.md 2013-05-10 05:57:04.000000000 +0000 +++ critcl-3.1.17+dfsg/README.md 2017-10-14 02:48:11.000000000 +0000 @@ -67,7 +67,7 @@ ```> package require stackc``` - ```> stackc S``` + ```> stackc create S``` ```> S push FOO``` diff -Nru critcl-3.1.9/test/all.tcl critcl-3.1.17+dfsg/test/all.tcl --- critcl-3.1.9/test/all.tcl 2013-05-10 05:57:04.000000000 +0000 +++ critcl-3.1.17+dfsg/test/all.tcl 1970-01-01 00:00:00.000000000 +0000 @@ -1,8 +0,0 @@ -# -*- tcl -*- -# Run all .test files in this file's directory, i.e. -# the .test siblings of this file. - -foreach t [glob -directory [file dirname [file normalize [info script]]] \ - *.test] { - source $t -} diff -Nru critcl-3.1.9/test/assets/ccommand/2.0 critcl-3.1.17+dfsg/test/assets/ccommand/2.0 --- critcl-3.1.9/test/assets/ccommand/2.0 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/test/assets/ccommand/2.0 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,8 @@ +/* ---------------------------------------------------------------------- */ + +#define ns__command0 "::command" +static int +tcl__command0(ClientData clientdata, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) +{ +return TCL_OK; +} diff -Nru critcl-3.1.9/test/assets/ccommand/2.1 critcl-3.1.17+dfsg/test/assets/ccommand/2.1 --- critcl-3.1.9/test/assets/ccommand/2.1 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/test/assets/ccommand/2.1 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,8 @@ +/* ---------------------------------------------------------------------- */ + +#define ns__command0 "::command" +static int +tcl__command0(ClientData CD, Tcl_Interp *IP, int OC, Tcl_Obj *CONST OV[]) +{ +return TCL_OK; +} diff -Nru critcl-3.1.9/test/assets/ccommand/2.2 critcl-3.1.17+dfsg/test/assets/ccommand/2.2 --- critcl-3.1.9/test/assets/ccommand/2.2 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/test/assets/ccommand/2.2 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,7 @@ +/* ---------------------------------------------------------------------- */ + +static int +snafu(ClientData clientdata, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) +{ +return TCL_OK; +} diff -Nru critcl-3.1.9/test/assets/ccommand/2.3 critcl-3.1.17+dfsg/test/assets/ccommand/2.3 --- critcl-3.1.9/test/assets/ccommand/2.3 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/test/assets/ccommand/2.3 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,8 @@ +/* ---------------------------------------------------------------------- */ + +#define ns__the_command_max0 "::the::command+max" +static int +tcl__the_command_max0(ClientData clientdata, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) +{ +return TCL_OK; +} diff -Nru critcl-3.1.9/test/assets/ccommand/3.0 critcl-3.1.17+dfsg/test/assets/ccommand/3.0 --- critcl-3.1.9/test/assets/ccommand/3.0 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/test/assets/ccommand/3.0 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,10 @@ +*#define ns__command0 "::command" +static int +tcl__command0(ClientData clientdata, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv\[\]) +{ +return TCL_OK; +} +* +Fake_Init* +*Tcl_CreateObjCommand(interp, ns__command0, tcl__command0, NULL, NULL); +* diff -Nru critcl-3.1.9/test/assets/ccommand/3.4 critcl-3.1.17+dfsg/test/assets/ccommand/3.4 --- critcl-3.1.9/test/assets/ccommand/3.4 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/test/assets/ccommand/3.4 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,10 @@ +*#define ns__command0 "::command" +static int +tcl__command0(ClientData clientdata, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv\[\]) +{ +return TCL_OK; +} +* +Fake_Init* +*Tcl_CreateObjCommand(interp, ns__command0, tcl__command0, NULL, DELE); +* diff -Nru critcl-3.1.9/test/assets/ccommand/3.5 critcl-3.1.17+dfsg/test/assets/ccommand/3.5 --- critcl-3.1.9/test/assets/ccommand/3.5 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/test/assets/ccommand/3.5 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,10 @@ +*#define ns__command0 "::command" +static int +tcl__command0(ClientData clientdata, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv\[\]) +{ +return TCL_OK; +} +* +Fake_Init* +*Tcl_CreateObjCommand(interp, ns__command0, tcl__command0, ABC, NULL); +* diff -Nru critcl-3.1.9/test/assets/ccommand-trace/2.0 critcl-3.1.17+dfsg/test/assets/ccommand-trace/2.0 --- critcl-3.1.9/test/assets/ccommand-trace/2.0 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/test/assets/ccommand-trace/2.0 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,17 @@ +/* ---------------------------------------------------------------------- */ + +#define ns__command0 "::command" +static int +tcl__command0_actual(ClientData clientdata, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) +{ +return TCL_OK; +} + +static int +tcl__command0(ClientData clientdata, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) +{ + int _rv; + critcl_trace_cmd_args (ns__command0, objc, objv); + _rv = tcl__command0_actual (clientdata, interp, objc, objv); + return critcl_trace_cmd_result (_rv, interp); +} diff -Nru critcl-3.1.9/test/assets/ccommand-trace/2.1 critcl-3.1.17+dfsg/test/assets/ccommand-trace/2.1 --- critcl-3.1.9/test/assets/ccommand-trace/2.1 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/test/assets/ccommand-trace/2.1 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,17 @@ +/* ---------------------------------------------------------------------- */ + +#define ns__command0 "::command" +static int +tcl__command0_actual(ClientData CD, Tcl_Interp *IP, int OC, Tcl_Obj *CONST OV[]) +{ +return TCL_OK; +} + +static int +tcl__command0(ClientData CD, Tcl_Interp *IP, int OC, Tcl_Obj *CONST OV[]) +{ + int _rv; + critcl_trace_cmd_args (ns__command0, OC, OV); + _rv = tcl__command0_actual (CD, IP, OC, OV); + return critcl_trace_cmd_result (_rv, IP); +} diff -Nru critcl-3.1.9/test/assets/ccommand-trace/2.2 critcl-3.1.17+dfsg/test/assets/ccommand-trace/2.2 --- critcl-3.1.9/test/assets/ccommand-trace/2.2 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/test/assets/ccommand-trace/2.2 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,16 @@ +/* ---------------------------------------------------------------------- */ + +static int +snafu_actual(ClientData clientdata, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) +{ +return TCL_OK; +} + +static int +snafu(ClientData clientdata, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) +{ + int _rv; + critcl_trace_cmd_args ("snafu", objc, objv); + _rv = snafu_actual (clientdata, interp, objc, objv); + return critcl_trace_cmd_result (_rv, interp); +} diff -Nru critcl-3.1.9/test/assets/ccommand-trace/2.3 critcl-3.1.17+dfsg/test/assets/ccommand-trace/2.3 --- critcl-3.1.9/test/assets/ccommand-trace/2.3 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/test/assets/ccommand-trace/2.3 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,17 @@ +/* ---------------------------------------------------------------------- */ + +#define ns__the_command_max0 "::the::command+max" +static int +tcl__the_command_max0_actual(ClientData clientdata, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) +{ +return TCL_OK; +} + +static int +tcl__the_command_max0(ClientData clientdata, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) +{ + int _rv; + critcl_trace_cmd_args (ns__the_command_max0, objc, objv); + _rv = tcl__the_command_max0_actual (clientdata, interp, objc, objv); + return critcl_trace_cmd_result (_rv, interp); +} diff -Nru critcl-3.1.9/test/assets/ccommand-trace/2.4 critcl-3.1.17+dfsg/test/assets/ccommand-trace/2.4 --- critcl-3.1.9/test/assets/ccommand-trace/2.4 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/test/assets/ccommand-trace/2.4 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,17 @@ +/* ---------------------------------------------------------------------- */ + +#define ns__command0 "::command" +static int +tcl__command0_actual(ClientData clientdata, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) +{ +return TCL_OK; +} + +static int +tcl__command0(ClientData clientdata, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) +{ + int _rv; + critcl_trace_cmd_args (ns__command0, objc, objv); + _rv = tcl__command0_actual (clientdata, interp, objc, objv); + return critcl_trace_cmd_result (_rv, interp); +} diff -Nru critcl-3.1.9/test/assets/ccommand-trace/2.5 critcl-3.1.17+dfsg/test/assets/ccommand-trace/2.5 --- critcl-3.1.9/test/assets/ccommand-trace/2.5 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/test/assets/ccommand-trace/2.5 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,17 @@ +/* ---------------------------------------------------------------------- */ + +#define ns__command0 "::command" +static int +tcl__command0_actual(ClientData clientdata, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) +{ +return TCL_OK; +} + +static int +tcl__command0(ClientData clientdata, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) +{ + int _rv; + critcl_trace_cmd_args (ns__command0, objc, objv); + _rv = tcl__command0_actual (clientdata, interp, objc, objv); + return critcl_trace_cmd_result (_rv, interp); +} diff -Nru critcl-3.1.9/test/assets/ccommand-trace/3.0 critcl-3.1.17+dfsg/test/assets/ccommand-trace/3.0 --- critcl-3.1.9/test/assets/ccommand-trace/3.0 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/test/assets/ccommand-trace/3.0 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,19 @@ +*#define ns__command0 "::command" +static int +tcl__command0_actual(ClientData clientdata, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv\[\]) +{ +return TCL_OK; +} + +static int +tcl__command0(ClientData clientdata, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv\[\]) +{ + int _rv; + critcl_trace_cmd_args (ns__command0, objc, objv); + _rv = tcl__command0_actual (clientdata, interp, objc, objv); + return critcl_trace_cmd_result (_rv, interp); +} +* +Fake_Init* +*Tcl_CreateObjCommand(interp, ns__command0, tcl__command0, NULL, NULL); +* diff -Nru critcl-3.1.9/test/assets/ccommand-trace/3.4 critcl-3.1.17+dfsg/test/assets/ccommand-trace/3.4 --- critcl-3.1.9/test/assets/ccommand-trace/3.4 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/test/assets/ccommand-trace/3.4 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,19 @@ +*#define ns__command0 "::command" +static int +tcl__command0_actual(ClientData clientdata, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv\[\]) +{ +return TCL_OK; +} + +static int +tcl__command0(ClientData clientdata, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv\[\]) +{ + int _rv; + critcl_trace_cmd_args (ns__command0, objc, objv); + _rv = tcl__command0_actual (clientdata, interp, objc, objv); + return critcl_trace_cmd_result (_rv, interp); +} +* +Fake_Init* +*Tcl_CreateObjCommand(interp, ns__command0, tcl__command0, NULL, DELE); +* diff -Nru critcl-3.1.9/test/assets/ccommand-trace/3.5 critcl-3.1.17+dfsg/test/assets/ccommand-trace/3.5 --- critcl-3.1.9/test/assets/ccommand-trace/3.5 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/test/assets/ccommand-trace/3.5 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,19 @@ +*#define ns__command0 "::command" +static int +tcl__command0_actual(ClientData clientdata, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv\[\]) +{ +return TCL_OK; +} + +static int +tcl__command0(ClientData clientdata, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv\[\]) +{ + int _rv; + critcl_trace_cmd_args (ns__command0, objc, objv); + _rv = tcl__command0_actual (clientdata, interp, objc, objv); + return critcl_trace_cmd_result (_rv, interp); +} +* +Fake_Init* +*Tcl_CreateObjCommand(interp, ns__command0, tcl__command0, ABC, NULL); +* diff -Nru critcl-3.1.9/test/assets/cconst/2.0 critcl-3.1.17+dfsg/test/assets/cconst/2.0 --- critcl-3.1.9/test/assets/cconst/2.0 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/test/assets/cconst/2.0 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,20 @@ +/* ---------------------------------------------------------------------- */ + +#define ns__alpha0 "::alpha" + +static int +tcl__alpha0(ClientData cd, Tcl_Interp *interp, int oc, Tcl_Obj *CONST ov[]) +{ + int rv; + if (oc != 1) { + Tcl_WrongNumArgs(interp, 1, ov, NULL); + return TCL_ERROR; + } + + /* Const - - -- --- ----- -------- */ + rv = 1; + + /* (bool return) - - -- --- ----- -------- */ + Tcl_SetObjResult(interp, Tcl_NewIntObj(rv)); + return TCL_OK; +} diff -Nru critcl-3.1.9/test/assets/cconst/2.1 critcl-3.1.17+dfsg/test/assets/cconst/2.1 --- critcl-3.1.9/test/assets/cconst/2.1 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/test/assets/cconst/2.1 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,20 @@ +/* ---------------------------------------------------------------------- */ + +#define ns__alpha0 "::alpha" + +static int +tcl__alpha0(ClientData cd, Tcl_Interp *interp, int oc, Tcl_Obj *CONST ov[]) +{ + int rv; + if (oc != 1) { + Tcl_WrongNumArgs(interp, 1, ov, NULL); + return TCL_ERROR; + } + + /* Const - - -- --- ----- -------- */ + rv = FOO; + + /* (bool return) - - -- --- ----- -------- */ + Tcl_SetObjResult(interp, Tcl_NewIntObj(rv)); + return TCL_OK; +} diff -Nru critcl-3.1.9/test/assets/cconst/2.2 critcl-3.1.17+dfsg/test/assets/cconst/2.2 --- critcl-3.1.9/test/assets/cconst/2.2 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/test/assets/cconst/2.2 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,20 @@ +/* ---------------------------------------------------------------------- */ + +#define ns__alpha0 "::alpha" + +static int +tcl__alpha0(ClientData cd, Tcl_Interp *interp, int oc, Tcl_Obj *CONST ov[]) +{ + int rv; + if (oc != 1) { + Tcl_WrongNumArgs(interp, 1, ov, NULL); + return TCL_ERROR; + } + + /* Const - - -- --- ----- -------- */ + rv = foo(); + + /* (bool return) - - -- --- ----- -------- */ + Tcl_SetObjResult(interp, Tcl_NewIntObj(rv)); + return TCL_OK; +} diff -Nru critcl-3.1.9/test/assets/cconst/2.3 critcl-3.1.17+dfsg/test/assets/cconst/2.3 --- critcl-3.1.9/test/assets/cconst/2.3 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/test/assets/cconst/2.3 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,20 @@ +/* ---------------------------------------------------------------------- */ + +#define ns__the_alpha0 "::the::alpha" + +static int +tcl__the_alpha0(ClientData cd, Tcl_Interp *interp, int oc, Tcl_Obj *CONST ov[]) +{ + int rv; + if (oc != 1) { + Tcl_WrongNumArgs(interp, 1, ov, NULL); + return TCL_ERROR; + } + + /* Const - - -- --- ----- -------- */ + rv = 0; + + /* (bool return) - - -- --- ----- -------- */ + Tcl_SetObjResult(interp, Tcl_NewIntObj(rv)); + return TCL_OK; +} diff -Nru critcl-3.1.9/test/assets/cconst-trace/2.0 critcl-3.1.17+dfsg/test/assets/cconst-trace/2.0 --- critcl-3.1.9/test/assets/cconst-trace/2.0 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/test/assets/cconst-trace/2.0 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,22 @@ +/* ---------------------------------------------------------------------- */ + +#define ns__alpha0 "::alpha" + +static int +tcl__alpha0(ClientData cd, Tcl_Interp *interp, int oc, Tcl_Obj *CONST ov[]) +{ + int rv; + critcl_trace_cmd_args (ns__alpha0, oc, ov); + + if (oc != 1) { + Tcl_WrongNumArgs(interp, 1, ov, NULL); + return critcl_trace_cmd_result (TCL_ERROR, interp); + } + + /* Const - - -- --- ----- -------- */ + rv = 1; + + /* (bool return) - - -- --- ----- -------- */ + Tcl_SetObjResult(interp, Tcl_NewIntObj(rv)); + return critcl_trace_cmd_result (TCL_OK, interp); +} diff -Nru critcl-3.1.9/test/assets/cconst-trace/2.1 critcl-3.1.17+dfsg/test/assets/cconst-trace/2.1 --- critcl-3.1.9/test/assets/cconst-trace/2.1 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/test/assets/cconst-trace/2.1 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,22 @@ +/* ---------------------------------------------------------------------- */ + +#define ns__alpha0 "::alpha" + +static int +tcl__alpha0(ClientData cd, Tcl_Interp *interp, int oc, Tcl_Obj *CONST ov[]) +{ + int rv; + critcl_trace_cmd_args (ns__alpha0, oc, ov); + + if (oc != 1) { + Tcl_WrongNumArgs(interp, 1, ov, NULL); + return critcl_trace_cmd_result (TCL_ERROR, interp); + } + + /* Const - - -- --- ----- -------- */ + rv = FOO; + + /* (bool return) - - -- --- ----- -------- */ + Tcl_SetObjResult(interp, Tcl_NewIntObj(rv)); + return critcl_trace_cmd_result (TCL_OK, interp); +} diff -Nru critcl-3.1.9/test/assets/cconst-trace/2.2 critcl-3.1.17+dfsg/test/assets/cconst-trace/2.2 --- critcl-3.1.9/test/assets/cconst-trace/2.2 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/test/assets/cconst-trace/2.2 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,22 @@ +/* ---------------------------------------------------------------------- */ + +#define ns__alpha0 "::alpha" + +static int +tcl__alpha0(ClientData cd, Tcl_Interp *interp, int oc, Tcl_Obj *CONST ov[]) +{ + int rv; + critcl_trace_cmd_args (ns__alpha0, oc, ov); + + if (oc != 1) { + Tcl_WrongNumArgs(interp, 1, ov, NULL); + return critcl_trace_cmd_result (TCL_ERROR, interp); + } + + /* Const - - -- --- ----- -------- */ + rv = foo(); + + /* (bool return) - - -- --- ----- -------- */ + Tcl_SetObjResult(interp, Tcl_NewIntObj(rv)); + return critcl_trace_cmd_result (TCL_OK, interp); +} diff -Nru critcl-3.1.9/test/assets/cconst-trace/2.3 critcl-3.1.17+dfsg/test/assets/cconst-trace/2.3 --- critcl-3.1.9/test/assets/cconst-trace/2.3 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/test/assets/cconst-trace/2.3 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,22 @@ +/* ---------------------------------------------------------------------- */ + +#define ns__the_alpha0 "::the::alpha" + +static int +tcl__the_alpha0(ClientData cd, Tcl_Interp *interp, int oc, Tcl_Obj *CONST ov[]) +{ + int rv; + critcl_trace_cmd_args (ns__the_alpha0, oc, ov); + + if (oc != 1) { + Tcl_WrongNumArgs(interp, 1, ov, NULL); + return critcl_trace_cmd_result (TCL_ERROR, interp); + } + + /* Const - - -- --- ----- -------- */ + rv = 0; + + /* (bool return) - - -- --- ----- -------- */ + Tcl_SetObjResult(interp, Tcl_NewIntObj(rv)); + return critcl_trace_cmd_result (TCL_OK, interp); +} diff -Nru critcl-3.1.9/test/assets/cdata/2.0 critcl-3.1.17+dfsg/test/assets/cdata/2.0 --- critcl-3.1.9/test/assets/cdata/2.0 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/test/assets/cdata/2.0 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,12 @@ +/* ---------------------------------------------------------------------- */ + +#define ns__alpha0 "::alpha" +static int +tcl__alpha0(ClientData dummy, Tcl_Interp *ip, int objc, Tcl_Obj *CONST objv[]) +{ +static char script[4] = { + 98,101,116,97, + }; + Tcl_SetByteArrayObj(Tcl_GetObjResult(ip), (unsigned char*) script, 4); + return TCL_OK; +} diff -Nru critcl-3.1.9/test/assets/cdata/2.1 critcl-3.1.17+dfsg/test/assets/cdata/2.1 --- critcl-3.1.9/test/assets/cdata/2.1 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/test/assets/cdata/2.1 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,12 @@ +/* ---------------------------------------------------------------------- */ + +#define ns__alpha_x0 "::alpha-x" +static int +tcl__alpha_x0(ClientData dummy, Tcl_Interp *ip, int objc, Tcl_Obj *CONST objv[]) +{ +static char script[4] = { + 98,101,116,97, + }; + Tcl_SetByteArrayObj(Tcl_GetObjResult(ip), (unsigned char*) script, 4); + return TCL_OK; +} diff -Nru critcl-3.1.9/test/assets/cdata/2.2 critcl-3.1.17+dfsg/test/assets/cdata/2.2 --- critcl-3.1.9/test/assets/cdata/2.2 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/test/assets/cdata/2.2 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,12 @@ +/* ---------------------------------------------------------------------- */ + +#define ns__the_alpha0 "::the::alpha" +static int +tcl__the_alpha0(ClientData dummy, Tcl_Interp *ip, int objc, Tcl_Obj *CONST objv[]) +{ +static char script[4] = { + 98,101,116,97, + }; + Tcl_SetByteArrayObj(Tcl_GetObjResult(ip), (unsigned char*) script, 4); + return TCL_OK; +} diff -Nru critcl-3.1.9/test/assets/cdata-trace/2.0 critcl-3.1.17+dfsg/test/assets/cdata-trace/2.0 --- critcl-3.1.9/test/assets/cdata-trace/2.0 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/test/assets/cdata-trace/2.0 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,21 @@ +/* ---------------------------------------------------------------------- */ + +#define ns__alpha0 "::alpha" +static int +tcl__alpha0_actual(ClientData dummy, Tcl_Interp *ip, int objc, Tcl_Obj *CONST objv[]) +{ +static char script[4] = { + 98,101,116,97, + }; + Tcl_SetByteArrayObj(Tcl_GetObjResult(ip), (unsigned char*) script, 4); + return TCL_OK; +} + +static int +tcl__alpha0(ClientData dummy, Tcl_Interp *ip, int objc, Tcl_Obj *CONST objv[]) +{ + int _rv; + critcl_trace_cmd_args (ns__alpha0, objc, objv); + _rv = tcl__alpha0_actual (dummy, ip, objc, objv); + return critcl_trace_cmd_result (_rv, ip); +} diff -Nru critcl-3.1.9/test/assets/cdata-trace/2.1 critcl-3.1.17+dfsg/test/assets/cdata-trace/2.1 --- critcl-3.1.9/test/assets/cdata-trace/2.1 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/test/assets/cdata-trace/2.1 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,21 @@ +/* ---------------------------------------------------------------------- */ + +#define ns__alpha_x0 "::alpha-x" +static int +tcl__alpha_x0_actual(ClientData dummy, Tcl_Interp *ip, int objc, Tcl_Obj *CONST objv[]) +{ +static char script[4] = { + 98,101,116,97, + }; + Tcl_SetByteArrayObj(Tcl_GetObjResult(ip), (unsigned char*) script, 4); + return TCL_OK; +} + +static int +tcl__alpha_x0(ClientData dummy, Tcl_Interp *ip, int objc, Tcl_Obj *CONST objv[]) +{ + int _rv; + critcl_trace_cmd_args (ns__alpha_x0, objc, objv); + _rv = tcl__alpha_x0_actual (dummy, ip, objc, objv); + return critcl_trace_cmd_result (_rv, ip); +} diff -Nru critcl-3.1.9/test/assets/cdata-trace/2.2 critcl-3.1.17+dfsg/test/assets/cdata-trace/2.2 --- critcl-3.1.9/test/assets/cdata-trace/2.2 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/test/assets/cdata-trace/2.2 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,21 @@ +/* ---------------------------------------------------------------------- */ + +#define ns__the_alpha0 "::the::alpha" +static int +tcl__the_alpha0_actual(ClientData dummy, Tcl_Interp *ip, int objc, Tcl_Obj *CONST objv[]) +{ +static char script[4] = { + 98,101,116,97, + }; + Tcl_SetByteArrayObj(Tcl_GetObjResult(ip), (unsigned char*) script, 4); + return TCL_OK; +} + +static int +tcl__the_alpha0(ClientData dummy, Tcl_Interp *ip, int objc, Tcl_Obj *CONST objv[]) +{ + int _rv; + critcl_trace_cmd_args (ns__the_alpha0, objc, objv); + _rv = tcl__the_alpha0_actual (dummy, ip, objc, objv); + return critcl_trace_cmd_result (_rv, ip); +} diff -Nru critcl-3.1.9/test/assets/cproc/2.0 critcl-3.1.17+dfsg/test/assets/cproc/2.0 --- critcl-3.1.9/test/assets/cproc/2.0 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/test/assets/cproc/2.0 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,23 @@ +/* ---------------------------------------------------------------------- */ + +#define ns__aproc0 "::aproc" +static void c__aproc0() +{ + +} + +static int +tcl__aproc0(ClientData cd, Tcl_Interp *interp, int oc, Tcl_Obj *CONST ov[]) +{ + + if (oc != 1) { + Tcl_WrongNumArgs(interp, 1, ov, NULL); + return TCL_ERROR; + } + + /* Call - - -- --- ----- -------- */ + c__aproc0(); + + /* (void return) - - -- --- ----- -------- */ + return TCL_OK; +} diff -Nru critcl-3.1.9/test/assets/cproc/2.1 critcl-3.1.17+dfsg/test/assets/cproc/2.1 --- critcl-3.1.9/test/assets/cproc/2.1 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/test/assets/cproc/2.1 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,23 @@ +/* ---------------------------------------------------------------------- */ + +#define ns__the_aproc0 "::the::aproc" +static void c__the_aproc0() +{ + +} + +static int +tcl__the_aproc0(ClientData cd, Tcl_Interp *interp, int oc, Tcl_Obj *CONST ov[]) +{ + + if (oc != 1) { + Tcl_WrongNumArgs(interp, 1, ov, NULL); + return TCL_ERROR; + } + + /* Call - - -- --- ----- -------- */ + c__the_aproc0(); + + /* (void return) - - -- --- ----- -------- */ + return TCL_OK; +} diff -Nru critcl-3.1.9/test/assets/cproc/2.10 critcl-3.1.17+dfsg/test/assets/cproc/2.10 --- critcl-3.1.9/test/assets/cproc/2.10 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/test/assets/cproc/2.10 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,57 @@ +/* ---------------------------------------------------------------------- */ + +#define ns__aproc0 "::aproc" +static void c__aproc0(int has_x, int x, int y, int z) +{ + +} + +static int +tcl__aproc0(ClientData cd, Tcl_Interp *interp, int oc, Tcl_Obj *CONST ov[]) +{ + int _has_x = 0; + int _x; + int _y; + int _z; + int idx_; + int argc_; + + if ((oc < 3) || (4 < oc)) { + Tcl_WrongNumArgs(interp, 1, ov, "?x? y z"); + return TCL_ERROR; + } + + idx_ = 1; + argc_ = oc - 1; + + /* (int x, optional, default -1) - - -- --- ----- -------- */ + if (argc_ > 2) { + { + if (Tcl_GetIntFromObj(interp, ov[idx_], &_x) != TCL_OK) return TCL_ERROR; } + idx_++; + argc_--; + _has_x = 1; + } else { + _x = -1; + } + + + /* (int y) - - -- --- ----- -------- */ + { + if (Tcl_GetIntFromObj(interp, ov[idx_], &_y) != TCL_OK) return TCL_ERROR; } + + idx_++; + argc_--; + + + /* (int z) - - -- --- ----- -------- */ + { + if (Tcl_GetIntFromObj(interp, ov[idx_], &_z) != TCL_OK) return TCL_ERROR; } + + + /* Call - - -- --- ----- -------- */ + c__aproc0(_has_x, _x, _y, _z); + + /* (void return) - - -- --- ----- -------- */ + return TCL_OK; +} diff -Nru critcl-3.1.9/test/assets/cproc/2.11 critcl-3.1.17+dfsg/test/assets/cproc/2.11 --- critcl-3.1.9/test/assets/cproc/2.11 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/test/assets/cproc/2.11 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,51 @@ +/* ---------------------------------------------------------------------- */ + +#define ns__aproc0 "::aproc" +static void c__aproc0(int x, int y, int has_z, int z) +{ + +} + +static int +tcl__aproc0(ClientData cd, Tcl_Interp *interp, int oc, Tcl_Obj *CONST ov[]) +{ + int _x; + int _y; + int _has_z = 0; + int _z; + int idx_; + int argc_; + + if ((oc < 3) || (4 < oc)) { + Tcl_WrongNumArgs(interp, 1, ov, "x y ?z?"); + return TCL_ERROR; + } + + /* (int x) - - -- --- ----- -------- */ + { + if (Tcl_GetIntFromObj(interp, ov[1], &_x) != TCL_OK) return TCL_ERROR; } + + + /* (int y) - - -- --- ----- -------- */ + { + if (Tcl_GetIntFromObj(interp, ov[2], &_y) != TCL_OK) return TCL_ERROR; } + + + idx_ = 3; + argc_ = oc - 3; + + /* (int z, optional, default -1) - - -- --- ----- -------- */ + if (argc_ > 0) { + { + if (Tcl_GetIntFromObj(interp, ov[idx_], &_z) != TCL_OK) return TCL_ERROR; } + _has_z = 1; + } else { + _z = -1; + } + + /* Call - - -- --- ----- -------- */ + c__aproc0(_x, _y, _has_z, _z); + + /* (void return) - - -- --- ----- -------- */ + return TCL_OK; +} diff -Nru critcl-3.1.9/test/assets/cproc/2.12 critcl-3.1.17+dfsg/test/assets/cproc/2.12 --- critcl-3.1.9/test/assets/cproc/2.12 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/test/assets/cproc/2.12 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,54 @@ +/* ---------------------------------------------------------------------- */ + +#define ns__aproc0 "::aproc" +static void c__aproc0(int x, int has_y, int y, int z) +{ + +} + +static int +tcl__aproc0(ClientData cd, Tcl_Interp *interp, int oc, Tcl_Obj *CONST ov[]) +{ + int _x; + int _has_y = 0; + int _y; + int _z; + int idx_; + int argc_; + + if ((oc < 3) || (4 < oc)) { + Tcl_WrongNumArgs(interp, 1, ov, "x ?y? z"); + return TCL_ERROR; + } + + /* (int x) - - -- --- ----- -------- */ + { + if (Tcl_GetIntFromObj(interp, ov[1], &_x) != TCL_OK) return TCL_ERROR; } + + + idx_ = 2; + argc_ = oc - 2; + + /* (int y, optional, default -1) - - -- --- ----- -------- */ + if (argc_ > 1) { + { + if (Tcl_GetIntFromObj(interp, ov[idx_], &_y) != TCL_OK) return TCL_ERROR; } + idx_++; + argc_--; + _has_y = 1; + } else { + _y = -1; + } + + + /* (int z) - - -- --- ----- -------- */ + { + if (Tcl_GetIntFromObj(interp, ov[idx_], &_z) != TCL_OK) return TCL_ERROR; } + + + /* Call - - -- --- ----- -------- */ + c__aproc0(_x, _has_y, _y, _z); + + /* (void return) - - -- --- ----- -------- */ + return TCL_OK; +} diff -Nru critcl-3.1.9/test/assets/cproc/2.13 critcl-3.1.17+dfsg/test/assets/cproc/2.13 --- critcl-3.1.9/test/assets/cproc/2.13 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/test/assets/cproc/2.13 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,57 @@ +/* ---------------------------------------------------------------------- */ + +#define ns__aproc0 "::aproc" + +#ifndef CRITCL_variadic_int +#define CRITCL_variadic_int + + /* NOTE: Array 'v' is allocated on the heap. The argument + // release code is used to free it after the worker + // function returned. Depending on type and what is done + // by the worker it may have to make copies of the data. + */ + + typedef struct critcl_variadic_int { + int c; /* Element count */ + int* v; /* Allocated array of the elements */ + } critcl_variadic_int; + + static int + _critcl_variadic_int_item (Tcl_Interp* interp, Tcl_Obj* src, int* dst) { + { + if (Tcl_GetIntFromObj(interp, src, dst) != TCL_OK) return TCL_ERROR; } + return TCL_OK; + } + +#endif /* CRITCL_variadic_int _________ */ + +static void c__aproc0(critcl_variadic_int args) +{ + +} + +static int +tcl__aproc0(ClientData cd, Tcl_Interp *interp, int oc, Tcl_Obj *CONST ov[]) +{ + critcl_variadic_int _args; + /* (int args, ...) - - -- --- ----- -------- */ + { + int src, dst, leftovers = (oc-1); + _args.c = leftovers; + _args.v = (int*) ((!leftovers) ? 0 : ckalloc (leftovers * sizeof (int))); + for (src = 1, dst = 0; leftovers > 0; dst++, src++, leftovers--) { + if (_critcl_variadic_int_item (interp, ov[src], &(_args.v[dst])) != TCL_OK) { + ckfree ((char*) _args.v); /* Cleanup partial work */ + return TCL_ERROR; + } + } } + + /* Call - - -- --- ----- -------- */ + c__aproc0(_args); + + /* (Release: int args, ...) - - -- --- ----- -------- */ + if (_args.c) { ckfree ((char*) _args.v); } + + /* (void return) - - -- --- ----- -------- */ + return TCL_OK; +} diff -Nru critcl-3.1.9/test/assets/cproc/2.14 critcl-3.1.17+dfsg/test/assets/cproc/2.14 --- critcl-3.1.9/test/assets/cproc/2.14 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/test/assets/cproc/2.14 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,34 @@ +/* ---------------------------------------------------------------------- */ + +#define ns__aproc0 "::aproc" + +#ifndef CRITCL_variadic_object +#define CRITCL_variadic_object + + typedef struct critcl_variadic_object { + int c; + Tcl_Obj* const* v; + } critcl_variadic_object; + +#endif /* CRITCL_variadic_object _________ */ + +static void c__aproc0(critcl_variadic_object args) +{ + +} + +static int +tcl__aproc0(ClientData cd, Tcl_Interp *interp, int oc, Tcl_Obj *CONST ov[]) +{ + critcl_variadic_object _args; + /* (object args, ...) - - -- --- ----- -------- */ + { + _args.c = (oc-1); + _args.v = &ov[1]; } + + /* Call - - -- --- ----- -------- */ + c__aproc0(_args); + + /* (void return) - - -- --- ----- -------- */ + return TCL_OK; +} diff -Nru critcl-3.1.9/test/assets/cproc/2.15 critcl-3.1.17+dfsg/test/assets/cproc/2.15 --- critcl-3.1.9/test/assets/cproc/2.15 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/test/assets/cproc/2.15 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,75 @@ +/* ---------------------------------------------------------------------- */ + +#define ns__aproc0 "::aproc" + +#ifndef CRITCL_variadic_int +#define CRITCL_variadic_int + + /* NOTE: Array 'v' is allocated on the heap. The argument + // release code is used to free it after the worker + // function returned. Depending on type and what is done + // by the worker it may have to make copies of the data. + */ + + typedef struct critcl_variadic_int { + int c; /* Element count */ + int* v; /* Allocated array of the elements */ + } critcl_variadic_int; + + static int + _critcl_variadic_int_item (Tcl_Interp* interp, Tcl_Obj* src, int* dst) { + { + if (Tcl_GetIntFromObj(interp, src, dst) != TCL_OK) return TCL_ERROR; } + return TCL_OK; + } + +#endif /* CRITCL_variadic_int _________ */ + +static void c__aproc0(int x, int y, critcl_variadic_int args) +{ + +} + +static int +tcl__aproc0(ClientData cd, Tcl_Interp *interp, int oc, Tcl_Obj *CONST ov[]) +{ + int _x; + int _y; + critcl_variadic_int _args; + + if (oc < 3) { + Tcl_WrongNumArgs(interp, 1, ov, "x y ?args...?"); + return TCL_ERROR; + } + + /* (int x) - - -- --- ----- -------- */ + { + if (Tcl_GetIntFromObj(interp, ov[1], &_x) != TCL_OK) return TCL_ERROR; } + + + /* (int y) - - -- --- ----- -------- */ + { + if (Tcl_GetIntFromObj(interp, ov[2], &_y) != TCL_OK) return TCL_ERROR; } + + + /* (int args, ...) - - -- --- ----- -------- */ + { + int src, dst, leftovers = (oc-3); + _args.c = leftovers; + _args.v = (int*) ((!leftovers) ? 0 : ckalloc (leftovers * sizeof (int))); + for (src = 3, dst = 0; leftovers > 0; dst++, src++, leftovers--) { + if (_critcl_variadic_int_item (interp, ov[src], &(_args.v[dst])) != TCL_OK) { + ckfree ((char*) _args.v); /* Cleanup partial work */ + return TCL_ERROR; + } + } } + + /* Call - - -- --- ----- -------- */ + c__aproc0(_x, _y, _args); + + /* (Release: int args, ...) - - -- --- ----- -------- */ + if (_args.c) { ckfree ((char*) _args.v); } + + /* (void return) - - -- --- ----- -------- */ + return TCL_OK; +} diff -Nru critcl-3.1.9/test/assets/cproc/2.16 critcl-3.1.17+dfsg/test/assets/cproc/2.16 --- critcl-3.1.9/test/assets/cproc/2.16 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/test/assets/cproc/2.16 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,90 @@ +/* ---------------------------------------------------------------------- */ + +#define ns__aproc0 "::aproc" + +#ifndef CRITCL_variadic_int +#define CRITCL_variadic_int + + /* NOTE: Array 'v' is allocated on the heap. The argument + // release code is used to free it after the worker + // function returned. Depending on type and what is done + // by the worker it may have to make copies of the data. + */ + + typedef struct critcl_variadic_int { + int c; /* Element count */ + int* v; /* Allocated array of the elements */ + } critcl_variadic_int; + + static int + _critcl_variadic_int_item (Tcl_Interp* interp, Tcl_Obj* src, int* dst) { + { + if (Tcl_GetIntFromObj(interp, src, dst) != TCL_OK) return TCL_ERROR; } + return TCL_OK; + } + +#endif /* CRITCL_variadic_int _________ */ + +static void c__aproc0(int has_x, int x, int has_y, int y, critcl_variadic_int args) +{ + +} + +static int +tcl__aproc0(ClientData cd, Tcl_Interp *interp, int oc, Tcl_Obj *CONST ov[]) +{ + int _has_x = 0; + int _x; + int _has_y = 0; + int _y; + critcl_variadic_int _args; + int idx_; + int argc_; + idx_ = 1; + argc_ = oc - 1; + + /* (int x, optional, default -1) - - -- --- ----- -------- */ + if (argc_ > 1) { + { + if (Tcl_GetIntFromObj(interp, ov[idx_], &_x) != TCL_OK) return TCL_ERROR; } + idx_++; + argc_--; + _has_x = 1; + } else { + _x = -1; + } + + + /* (int y, optional, default -1) - - -- --- ----- -------- */ + if (argc_ > 1) { + { + if (Tcl_GetIntFromObj(interp, ov[idx_], &_y) != TCL_OK) return TCL_ERROR; } + idx_++; + argc_--; + _has_y = 1; + } else { + _y = -1; + } + + + /* (int args, ...) - - -- --- ----- -------- */ + { + int src, dst, leftovers = argc_; + _args.c = leftovers; + _args.v = (int*) ((!leftovers) ? 0 : ckalloc (leftovers * sizeof (int))); + for (src = idx_, dst = 0; leftovers > 0; dst++, src++, leftovers--) { + if (_critcl_variadic_int_item (interp, ov[src], &(_args.v[dst])) != TCL_OK) { + ckfree ((char*) _args.v); /* Cleanup partial work */ + return TCL_ERROR; + } + } } + + /* Call - - -- --- ----- -------- */ + c__aproc0(_has_x, _x, _has_y, _y, _args); + + /* (Release: int args, ...) - - -- --- ----- -------- */ + if (_args.c) { ckfree ((char*) _args.v); } + + /* (void return) - - -- --- ----- -------- */ + return TCL_OK; +} diff -Nru critcl-3.1.9/test/assets/cproc/2.17 critcl-3.1.17+dfsg/test/assets/cproc/2.17 --- critcl-3.1.9/test/assets/cproc/2.17 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/test/assets/cproc/2.17 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,88 @@ +/* ---------------------------------------------------------------------- */ + +#define ns__aproc0 "::aproc" + +#ifndef CRITCL_variadic_int +#define CRITCL_variadic_int + + /* NOTE: Array 'v' is allocated on the heap. The argument + // release code is used to free it after the worker + // function returned. Depending on type and what is done + // by the worker it may have to make copies of the data. + */ + + typedef struct critcl_variadic_int { + int c; /* Element count */ + int* v; /* Allocated array of the elements */ + } critcl_variadic_int; + + static int + _critcl_variadic_int_item (Tcl_Interp* interp, Tcl_Obj* src, int* dst) { + { + if (Tcl_GetIntFromObj(interp, src, dst) != TCL_OK) return TCL_ERROR; } + return TCL_OK; + } + +#endif /* CRITCL_variadic_int _________ */ + +static void c__aproc0(int x, int has_y, int y, critcl_variadic_int args) +{ + +} + +static int +tcl__aproc0(ClientData cd, Tcl_Interp *interp, int oc, Tcl_Obj *CONST ov[]) +{ + int _x; + int _has_y = 0; + int _y; + critcl_variadic_int _args; + int idx_; + int argc_; + + if (oc < 2) { + Tcl_WrongNumArgs(interp, 1, ov, "x ?y? ?args...?"); + return TCL_ERROR; + } + + /* (int x) - - -- --- ----- -------- */ + { + if (Tcl_GetIntFromObj(interp, ov[1], &_x) != TCL_OK) return TCL_ERROR; } + + + idx_ = 2; + argc_ = oc - 2; + + /* (int y, optional, default -1) - - -- --- ----- -------- */ + if (argc_ > 1) { + { + if (Tcl_GetIntFromObj(interp, ov[idx_], &_y) != TCL_OK) return TCL_ERROR; } + idx_++; + argc_--; + _has_y = 1; + } else { + _y = -1; + } + + + /* (int args, ...) - - -- --- ----- -------- */ + { + int src, dst, leftovers = argc_; + _args.c = leftovers; + _args.v = (int*) ((!leftovers) ? 0 : ckalloc (leftovers * sizeof (int))); + for (src = idx_, dst = 0; leftovers > 0; dst++, src++, leftovers--) { + if (_critcl_variadic_int_item (interp, ov[src], &(_args.v[dst])) != TCL_OK) { + ckfree ((char*) _args.v); /* Cleanup partial work */ + return TCL_ERROR; + } + } } + + /* Call - - -- --- ----- -------- */ + c__aproc0(_x, _has_y, _y, _args); + + /* (Release: int args, ...) - - -- --- ----- -------- */ + if (_args.c) { ckfree ((char*) _args.v); } + + /* (void return) - - -- --- ----- -------- */ + return TCL_OK; +} diff -Nru critcl-3.1.9/test/assets/cproc/2.18 critcl-3.1.17+dfsg/test/assets/cproc/2.18 --- critcl-3.1.9/test/assets/cproc/2.18 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/test/assets/cproc/2.18 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,91 @@ +/* ---------------------------------------------------------------------- */ + +#define ns__aproc0 "::aproc" + +#ifndef CRITCL_variadic_int +#define CRITCL_variadic_int + + /* NOTE: Array 'v' is allocated on the heap. The argument + // release code is used to free it after the worker + // function returned. Depending on type and what is done + // by the worker it may have to make copies of the data. + */ + + typedef struct critcl_variadic_int { + int c; /* Element count */ + int* v; /* Allocated array of the elements */ + } critcl_variadic_int; + + static int + _critcl_variadic_int_item (Tcl_Interp* interp, Tcl_Obj* src, int* dst) { + { + if (Tcl_GetIntFromObj(interp, src, dst) != TCL_OK) return TCL_ERROR; } + return TCL_OK; + } + +#endif /* CRITCL_variadic_int _________ */ + +static void c__aproc0(int has_x, int x, int y, critcl_variadic_int args) +{ + +} + +static int +tcl__aproc0(ClientData cd, Tcl_Interp *interp, int oc, Tcl_Obj *CONST ov[]) +{ + int _has_x = 0; + int _x; + int _y; + critcl_variadic_int _args; + int idx_; + int argc_; + + if (oc < 2) { + Tcl_WrongNumArgs(interp, 1, ov, "?x? y ?args...?"); + return TCL_ERROR; + } + + idx_ = 1; + argc_ = oc - 1; + + /* (int x, optional, default -1) - - -- --- ----- -------- */ + if (argc_ > 2) { + { + if (Tcl_GetIntFromObj(interp, ov[idx_], &_x) != TCL_OK) return TCL_ERROR; } + idx_++; + argc_--; + _has_x = 1; + } else { + _x = -1; + } + + + /* (int y) - - -- --- ----- -------- */ + { + if (Tcl_GetIntFromObj(interp, ov[idx_], &_y) != TCL_OK) return TCL_ERROR; } + + idx_++; + argc_--; + + + /* (int args, ...) - - -- --- ----- -------- */ + { + int src, dst, leftovers = argc_; + _args.c = leftovers; + _args.v = (int*) ((!leftovers) ? 0 : ckalloc (leftovers * sizeof (int))); + for (src = idx_, dst = 0; leftovers > 0; dst++, src++, leftovers--) { + if (_critcl_variadic_int_item (interp, ov[src], &(_args.v[dst])) != TCL_OK) { + ckfree ((char*) _args.v); /* Cleanup partial work */ + return TCL_ERROR; + } + } } + + /* Call - - -- --- ----- -------- */ + c__aproc0(_has_x, _x, _y, _args); + + /* (Release: int args, ...) - - -- --- ----- -------- */ + if (_args.c) { ckfree ((char*) _args.v); } + + /* (void return) - - -- --- ----- -------- */ + return TCL_OK; +} diff -Nru critcl-3.1.9/test/assets/cproc/2.2 critcl-3.1.17+dfsg/test/assets/cproc/2.2 --- critcl-3.1.9/test/assets/cproc/2.2 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/test/assets/cproc/2.2 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,23 @@ +/* ---------------------------------------------------------------------- */ + +#define ns__aproc_beta0 "::aproc+beta" +static void c__aproc_beta0() +{ + +} + +static int +tcl__aproc_beta0(ClientData cd, Tcl_Interp *interp, int oc, Tcl_Obj *CONST ov[]) +{ + + if (oc != 1) { + Tcl_WrongNumArgs(interp, 1, ov, NULL); + return TCL_ERROR; + } + + /* Call - - -- --- ----- -------- */ + c__aproc_beta0(); + + /* (void return) - - -- --- ----- -------- */ + return TCL_OK; +} diff -Nru critcl-3.1.9/test/assets/cproc/2.3 critcl-3.1.17+dfsg/test/assets/cproc/2.3 --- critcl-3.1.9/test/assets/cproc/2.3 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/test/assets/cproc/2.3 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,22 @@ +/* ---------------------------------------------------------------------- */ + +static void c_snafu() +{ + +} + +static int +snafu(ClientData cd, Tcl_Interp *interp, int oc, Tcl_Obj *CONST ov[]) +{ + + if (oc != 1) { + Tcl_WrongNumArgs(interp, 1, ov, NULL); + return TCL_ERROR; + } + + /* Call - - -- --- ----- -------- */ + c_snafu(); + + /* (void return) - - -- --- ----- -------- */ + return TCL_OK; +} diff -Nru critcl-3.1.9/test/assets/cproc/2.4 critcl-3.1.17+dfsg/test/assets/cproc/2.4 --- critcl-3.1.9/test/assets/cproc/2.4 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/test/assets/cproc/2.4 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,23 @@ +/* ---------------------------------------------------------------------- */ + +#define ns__aproc0 "::aproc" +static void c__aproc0(ClientData clientdata) +{ + +} + +static int +tcl__aproc0(ClientData cd, Tcl_Interp *interp, int oc, Tcl_Obj *CONST ov[]) +{ + + if (oc != 1) { + Tcl_WrongNumArgs(interp, 1, ov, NULL); + return TCL_ERROR; + } + + /* Call - - -- --- ----- -------- */ + c__aproc0(cd); + + /* (void return) - - -- --- ----- -------- */ + return TCL_OK; +} diff -Nru critcl-3.1.9/test/assets/cproc/2.5 critcl-3.1.17+dfsg/test/assets/cproc/2.5 --- critcl-3.1.9/test/assets/cproc/2.5 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/test/assets/cproc/2.5 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,23 @@ +/* ---------------------------------------------------------------------- */ + +#define ns__aproc0 "::aproc" +static void c__aproc0() +{ + +} + +static int +tcl__aproc0(ClientData cd, Tcl_Interp *interp, int oc, Tcl_Obj *CONST ov[]) +{ + + if (oc != 4) { + Tcl_WrongNumArgs(interp, 4, ov, NULL); + return TCL_ERROR; + } + + /* Call - - -- --- ----- -------- */ + c__aproc0(); + + /* (void return) - - -- --- ----- -------- */ + return TCL_OK; +} diff -Nru critcl-3.1.9/test/assets/cproc/2.6 critcl-3.1.17+dfsg/test/assets/cproc/2.6 --- critcl-3.1.9/test/assets/cproc/2.6 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/test/assets/cproc/2.6 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,28 @@ +/* ---------------------------------------------------------------------- */ + +#define ns__aproc0 "::aproc" +static void c__aproc0(int anargument) +{ + +} + +static int +tcl__aproc0(ClientData cd, Tcl_Interp *interp, int oc, Tcl_Obj *CONST ov[]) +{ + int _anargument; + + if (oc != 2) { + Tcl_WrongNumArgs(interp, 1, ov, "anargument"); + return TCL_ERROR; + } + + /* (int anargument) - - -- --- ----- -------- */ + { + if (Tcl_GetIntFromObj(interp, ov[1], &_anargument) != TCL_OK) return TCL_ERROR; } + + /* Call - - -- --- ----- -------- */ + c__aproc0(_anargument); + + /* (void return) - - -- --- ----- -------- */ + return TCL_OK; +} diff -Nru critcl-3.1.9/test/assets/cproc/2.7 critcl-3.1.17+dfsg/test/assets/cproc/2.7 --- critcl-3.1.9/test/assets/cproc/2.7 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/test/assets/cproc/2.7 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,39 @@ +/* ---------------------------------------------------------------------- */ + +#define ns__aproc0 "::aproc" +static void c__aproc0(int has_anargument, int anargument) +{ + +} + +static int +tcl__aproc0(ClientData cd, Tcl_Interp *interp, int oc, Tcl_Obj *CONST ov[]) +{ + int _has_anargument = 0; + int _anargument; + int idx_; + int argc_; + + if ((oc < 1) || (2 < oc)) { + Tcl_WrongNumArgs(interp, 1, ov, "?anargument?"); + return TCL_ERROR; + } + + idx_ = 1; + argc_ = oc - 1; + + /* (int anargument, optional, default -1) - - -- --- ----- -------- */ + if (argc_ > 0) { + { + if (Tcl_GetIntFromObj(interp, ov[idx_], &_anargument) != TCL_OK) return TCL_ERROR; } + _has_anargument = 1; + } else { + _anargument = -1; + } + + /* Call - - -- --- ----- -------- */ + c__aproc0(_has_anargument, _anargument); + + /* (void return) - - -- --- ----- -------- */ + return TCL_OK; +} diff -Nru critcl-3.1.9/test/assets/cproc/2.8 critcl-3.1.17+dfsg/test/assets/cproc/2.8 --- critcl-3.1.9/test/assets/cproc/2.8 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/test/assets/cproc/2.8 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,62 @@ +/* ---------------------------------------------------------------------- */ + +#define ns__aproc0 "::aproc" +static void c__aproc0(int has_x, int x, int y, int has_z, int z) +{ + +} + +static int +tcl__aproc0(ClientData cd, Tcl_Interp *interp, int oc, Tcl_Obj *CONST ov[]) +{ + int _has_x = 0; + int _x; + int _y; + int _has_z = 0; + int _z; + int idx_; + int argc_; + + if ((oc < 2) || (4 < oc)) { + Tcl_WrongNumArgs(interp, 1, ov, "?x? y ?z?"); + return TCL_ERROR; + } + + idx_ = 1; + argc_ = oc - 1; + + /* (int x, optional, default -1) - - -- --- ----- -------- */ + if (argc_ > 1) { + { + if (Tcl_GetIntFromObj(interp, ov[idx_], &_x) != TCL_OK) return TCL_ERROR; } + idx_++; + argc_--; + _has_x = 1; + } else { + _x = -1; + } + + + /* (int y) - - -- --- ----- -------- */ + { + if (Tcl_GetIntFromObj(interp, ov[idx_], &_y) != TCL_OK) return TCL_ERROR; } + + idx_++; + argc_--; + + + /* (int z, optional, default -1) - - -- --- ----- -------- */ + if (argc_ > 0) { + { + if (Tcl_GetIntFromObj(interp, ov[idx_], &_z) != TCL_OK) return TCL_ERROR; } + _has_z = 1; + } else { + _z = -1; + } + + /* Call - - -- --- ----- -------- */ + c__aproc0(_has_x, _x, _y, _has_z, _z); + + /* (void return) - - -- --- ----- -------- */ + return TCL_OK; +} diff -Nru critcl-3.1.9/test/assets/cproc/2.9 critcl-3.1.17+dfsg/test/assets/cproc/2.9 --- critcl-3.1.9/test/assets/cproc/2.9 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/test/assets/cproc/2.9 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,24 @@ +/* ---------------------------------------------------------------------- */ + +#define ns__aproc0 "::aproc" +static int c__aproc0() +{ + +} + +static int +tcl__aproc0(ClientData cd, Tcl_Interp *interp, int oc, Tcl_Obj *CONST ov[]) +{ + int rv; + if (oc != 1) { + Tcl_WrongNumArgs(interp, 1, ov, NULL); + return TCL_ERROR; + } + + /* Call - - -- --- ----- -------- */ + rv = c__aproc0(); + + /* (int return) - - -- --- ----- -------- */ + Tcl_SetObjResult(interp, Tcl_NewIntObj(rv)); + return TCL_OK; +} diff -Nru critcl-3.1.9/test/assets/cproc/3.0 critcl-3.1.17+dfsg/test/assets/cproc/3.0 --- critcl-3.1.9/test/assets/cproc/3.0 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/test/assets/cproc/3.0 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,23 @@ +/* ---------------------------------------------------------------------- */ + +#define ns__aproc0 "::aproc" +static void c__aproc0() +{ + +} + +static int +tcl__aproc0(ClientData cd, Tcl_Interp *interp, int oc, Tcl_Obj *CONST ov[]) +{ + + if (oc != 1) { + Tcl_WrongNumArgs(interp, 1, ov, NULL); + return TCL_ERROR; + } + + /* Call - - -- --- ----- -------- */ + c__aproc0(); + + /* (void return) - - -- --- ----- -------- */ + return TCL_OK; +} diff -Nru critcl-3.1.9/test/assets/cproc/3.1 critcl-3.1.17+dfsg/test/assets/cproc/3.1 --- critcl-3.1.9/test/assets/cproc/3.1 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/test/assets/cproc/3.1 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,23 @@ +/* ---------------------------------------------------------------------- */ + +#define ns__aproc0 "::aproc" +static int c__aproc0() +{ +return TCL_OK; +} + +static int +tcl__aproc0(ClientData cd, Tcl_Interp *interp, int oc, Tcl_Obj *CONST ov[]) +{ + int rv; + if (oc != 1) { + Tcl_WrongNumArgs(interp, 1, ov, NULL); + return TCL_ERROR; + } + + /* Call - - -- --- ----- -------- */ + rv = c__aproc0(); + + /* (ok return) - - -- --- ----- -------- */ + return rv; +} diff -Nru critcl-3.1.9/test/assets/cproc/3.10 critcl-3.1.17+dfsg/test/assets/cproc/3.10 --- critcl-3.1.9/test/assets/cproc/3.10 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/test/assets/cproc/3.10 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,24 @@ +/* ---------------------------------------------------------------------- */ + +#define ns__aproc0 "::aproc" +static char* c__aproc0() +{ +return alloc_string("bar"); +} + +static int +tcl__aproc0(ClientData cd, Tcl_Interp *interp, int oc, Tcl_Obj *CONST ov[]) +{ + char* rv; + if (oc != 1) { + Tcl_WrongNumArgs(interp, 1, ov, NULL); + return TCL_ERROR; + } + + /* Call - - -- --- ----- -------- */ + rv = c__aproc0(); + + /* (dstring return) - - -- --- ----- -------- */ + Tcl_SetResult (interp, rv, TCL_DYNAMIC); + return TCL_OK; +} diff -Nru critcl-3.1.9/test/assets/cproc/3.11 critcl-3.1.17+dfsg/test/assets/cproc/3.11 --- critcl-3.1.9/test/assets/cproc/3.11 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/test/assets/cproc/3.11 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,26 @@ +/* ---------------------------------------------------------------------- */ + +#define ns__aproc0 "::aproc" +static Tcl_Obj* c__aproc0() +{ +return Tcl_NewIntObj(0); +} + +static int +tcl__aproc0(ClientData cd, Tcl_Interp *interp, int oc, Tcl_Obj *CONST ov[]) +{ + Tcl_Obj* rv; + if (oc != 1) { + Tcl_WrongNumArgs(interp, 1, ov, NULL); + return TCL_ERROR; + } + + /* Call - - -- --- ----- -------- */ + rv = c__aproc0(); + + /* (object return) - - -- --- ----- -------- */ + if (rv == NULL) { return TCL_ERROR; } + Tcl_SetObjResult(interp, rv); + Tcl_DecrRefCount(rv); + return TCL_OK; +} diff -Nru critcl-3.1.9/test/assets/cproc/3.2 critcl-3.1.17+dfsg/test/assets/cproc/3.2 --- critcl-3.1.9/test/assets/cproc/3.2 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/test/assets/cproc/3.2 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,24 @@ +/* ---------------------------------------------------------------------- */ + +#define ns__aproc0 "::aproc" +static int c__aproc0() +{ +return 0; +} + +static int +tcl__aproc0(ClientData cd, Tcl_Interp *interp, int oc, Tcl_Obj *CONST ov[]) +{ + int rv; + if (oc != 1) { + Tcl_WrongNumArgs(interp, 1, ov, NULL); + return TCL_ERROR; + } + + /* Call - - -- --- ----- -------- */ + rv = c__aproc0(); + + /* (int return) - - -- --- ----- -------- */ + Tcl_SetObjResult(interp, Tcl_NewIntObj(rv)); + return TCL_OK; +} diff -Nru critcl-3.1.9/test/assets/cproc/3.3 critcl-3.1.17+dfsg/test/assets/cproc/3.3 --- critcl-3.1.9/test/assets/cproc/3.3 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/test/assets/cproc/3.3 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,24 @@ +/* ---------------------------------------------------------------------- */ + +#define ns__aproc0 "::aproc" +static int c__aproc0() +{ +return 1; +} + +static int +tcl__aproc0(ClientData cd, Tcl_Interp *interp, int oc, Tcl_Obj *CONST ov[]) +{ + int rv; + if (oc != 1) { + Tcl_WrongNumArgs(interp, 1, ov, NULL); + return TCL_ERROR; + } + + /* Call - - -- --- ----- -------- */ + rv = c__aproc0(); + + /* (bool return) - - -- --- ----- -------- */ + Tcl_SetObjResult(interp, Tcl_NewIntObj(rv)); + return TCL_OK; +} diff -Nru critcl-3.1.9/test/assets/cproc/3.4 critcl-3.1.17+dfsg/test/assets/cproc/3.4 --- critcl-3.1.9/test/assets/cproc/3.4 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/test/assets/cproc/3.4 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,24 @@ +/* ---------------------------------------------------------------------- */ + +#define ns__aproc0 "::aproc" +static int c__aproc0() +{ +return 1; +} + +static int +tcl__aproc0(ClientData cd, Tcl_Interp *interp, int oc, Tcl_Obj *CONST ov[]) +{ + int rv; + if (oc != 1) { + Tcl_WrongNumArgs(interp, 1, ov, NULL); + return TCL_ERROR; + } + + /* Call - - -- --- ----- -------- */ + rv = c__aproc0(); + + /* (boolean return) - - -- --- ----- -------- */ + Tcl_SetObjResult(interp, Tcl_NewIntObj(rv)); + return TCL_OK; +} diff -Nru critcl-3.1.9/test/assets/cproc/3.5 critcl-3.1.17+dfsg/test/assets/cproc/3.5 --- critcl-3.1.9/test/assets/cproc/3.5 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/test/assets/cproc/3.5 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,24 @@ +/* ---------------------------------------------------------------------- */ + +#define ns__aproc0 "::aproc" +static long c__aproc0() +{ +return 1; +} + +static int +tcl__aproc0(ClientData cd, Tcl_Interp *interp, int oc, Tcl_Obj *CONST ov[]) +{ + long rv; + if (oc != 1) { + Tcl_WrongNumArgs(interp, 1, ov, NULL); + return TCL_ERROR; + } + + /* Call - - -- --- ----- -------- */ + rv = c__aproc0(); + + /* (long return) - - -- --- ----- -------- */ + Tcl_SetObjResult(interp, Tcl_NewLongObj(rv)); + return TCL_OK; +} diff -Nru critcl-3.1.9/test/assets/cproc/3.6 critcl-3.1.17+dfsg/test/assets/cproc/3.6 --- critcl-3.1.9/test/assets/cproc/3.6 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/test/assets/cproc/3.6 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,24 @@ +/* ---------------------------------------------------------------------- */ + +#define ns__aproc0 "::aproc" +static Tcl_WideInt c__aproc0() +{ +return 1; +} + +static int +tcl__aproc0(ClientData cd, Tcl_Interp *interp, int oc, Tcl_Obj *CONST ov[]) +{ + Tcl_WideInt rv; + if (oc != 1) { + Tcl_WrongNumArgs(interp, 1, ov, NULL); + return TCL_ERROR; + } + + /* Call - - -- --- ----- -------- */ + rv = c__aproc0(); + + /* (wideint return) - - -- --- ----- -------- */ + Tcl_SetObjResult(interp, Tcl_NewWideIntObj(rv)); + return TCL_OK; +} diff -Nru critcl-3.1.9/test/assets/cproc/3.7 critcl-3.1.17+dfsg/test/assets/cproc/3.7 --- critcl-3.1.9/test/assets/cproc/3.7 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/test/assets/cproc/3.7 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,24 @@ +/* ---------------------------------------------------------------------- */ + +#define ns__aproc0 "::aproc" +static double c__aproc0() +{ +return 0.; +} + +static int +tcl__aproc0(ClientData cd, Tcl_Interp *interp, int oc, Tcl_Obj *CONST ov[]) +{ + double rv; + if (oc != 1) { + Tcl_WrongNumArgs(interp, 1, ov, NULL); + return TCL_ERROR; + } + + /* Call - - -- --- ----- -------- */ + rv = c__aproc0(); + + /* (double return) - - -- --- ----- -------- */ + Tcl_SetObjResult(interp, Tcl_NewDoubleObj(rv)); + return TCL_OK; +} diff -Nru critcl-3.1.9/test/assets/cproc/3.8 critcl-3.1.17+dfsg/test/assets/cproc/3.8 --- critcl-3.1.9/test/assets/cproc/3.8 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/test/assets/cproc/3.8 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,24 @@ +/* ---------------------------------------------------------------------- */ + +#define ns__aproc0 "::aproc" +static float c__aproc0() +{ +return 0.; +} + +static int +tcl__aproc0(ClientData cd, Tcl_Interp *interp, int oc, Tcl_Obj *CONST ov[]) +{ + float rv; + if (oc != 1) { + Tcl_WrongNumArgs(interp, 1, ov, NULL); + return TCL_ERROR; + } + + /* Call - - -- --- ----- -------- */ + rv = c__aproc0(); + + /* (float return) - - -- --- ----- -------- */ + Tcl_SetObjResult(interp, Tcl_NewDoubleObj(rv)); + return TCL_OK; +} diff -Nru critcl-3.1.9/test/assets/cproc/3.9 critcl-3.1.17+dfsg/test/assets/cproc/3.9 --- critcl-3.1.9/test/assets/cproc/3.9 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/test/assets/cproc/3.9 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,24 @@ +/* ---------------------------------------------------------------------- */ + +#define ns__aproc0 "::aproc" +static char* c__aproc0() +{ +return "foo"; +} + +static int +tcl__aproc0(ClientData cd, Tcl_Interp *interp, int oc, Tcl_Obj *CONST ov[]) +{ + char* rv; + if (oc != 1) { + Tcl_WrongNumArgs(interp, 1, ov, NULL); + return TCL_ERROR; + } + + /* Call - - -- --- ----- -------- */ + rv = c__aproc0(); + + /* (vstring return) - - -- --- ----- -------- */ + Tcl_SetObjResult(interp, Tcl_NewStringObj(rv,-1)); + return TCL_OK; +} diff -Nru critcl-3.1.9/test/assets/cproc-trace/2.0 critcl-3.1.17+dfsg/test/assets/cproc-trace/2.0 --- critcl-3.1.9/test/assets/cproc-trace/2.0 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/test/assets/cproc-trace/2.0 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,25 @@ +/* ---------------------------------------------------------------------- */ + +#define ns__aproc0 "::aproc" +static void c__aproc0() +{ + +} + +static int +tcl__aproc0(ClientData cd, Tcl_Interp *interp, int oc, Tcl_Obj *CONST ov[]) +{ + + critcl_trace_cmd_args (ns__aproc0, oc, ov); + + if (oc != 1) { + Tcl_WrongNumArgs(interp, 1, ov, NULL); + return critcl_trace_cmd_result (TCL_ERROR, interp); + } + + /* Call - - -- --- ----- -------- */ + c__aproc0(); + + /* (void return) - - -- --- ----- -------- */ + return critcl_trace_cmd_result (TCL_OK, interp); +} diff -Nru critcl-3.1.9/test/assets/cproc-trace/2.1 critcl-3.1.17+dfsg/test/assets/cproc-trace/2.1 --- critcl-3.1.9/test/assets/cproc-trace/2.1 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/test/assets/cproc-trace/2.1 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,25 @@ +/* ---------------------------------------------------------------------- */ + +#define ns__the_aproc0 "::the::aproc" +static void c__the_aproc0() +{ + +} + +static int +tcl__the_aproc0(ClientData cd, Tcl_Interp *interp, int oc, Tcl_Obj *CONST ov[]) +{ + + critcl_trace_cmd_args (ns__the_aproc0, oc, ov); + + if (oc != 1) { + Tcl_WrongNumArgs(interp, 1, ov, NULL); + return critcl_trace_cmd_result (TCL_ERROR, interp); + } + + /* Call - - -- --- ----- -------- */ + c__the_aproc0(); + + /* (void return) - - -- --- ----- -------- */ + return critcl_trace_cmd_result (TCL_OK, interp); +} diff -Nru critcl-3.1.9/test/assets/cproc-trace/2.10 critcl-3.1.17+dfsg/test/assets/cproc-trace/2.10 --- critcl-3.1.9/test/assets/cproc-trace/2.10 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/test/assets/cproc-trace/2.10 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,59 @@ +/* ---------------------------------------------------------------------- */ + +#define ns__aproc0 "::aproc" +static void c__aproc0(int has_x, int x, int y, int z) +{ + +} + +static int +tcl__aproc0(ClientData cd, Tcl_Interp *interp, int oc, Tcl_Obj *CONST ov[]) +{ + int _has_x = 0; + int _x; + int _y; + int _z; + int idx_; + int argc_; + + critcl_trace_cmd_args (ns__aproc0, oc, ov); + + if ((oc < 3) || (4 < oc)) { + Tcl_WrongNumArgs(interp, 1, ov, "?x? y z"); + return critcl_trace_cmd_result (TCL_ERROR, interp); + } + + idx_ = 1; + argc_ = oc - 1; + + /* (int x, optional, default -1) - - -- --- ----- -------- */ + if (argc_ > 2) { + { + if (Tcl_GetIntFromObj(interp, ov[idx_], &_x) != TCL_OK) return critcl_trace_cmd_result (TCL_ERROR, interp); } + idx_++; + argc_--; + _has_x = 1; + } else { + _x = -1; + } + + + /* (int y) - - -- --- ----- -------- */ + { + if (Tcl_GetIntFromObj(interp, ov[idx_], &_y) != TCL_OK) return critcl_trace_cmd_result (TCL_ERROR, interp); } + + idx_++; + argc_--; + + + /* (int z) - - -- --- ----- -------- */ + { + if (Tcl_GetIntFromObj(interp, ov[idx_], &_z) != TCL_OK) return critcl_trace_cmd_result (TCL_ERROR, interp); } + + + /* Call - - -- --- ----- -------- */ + c__aproc0(_has_x, _x, _y, _z); + + /* (void return) - - -- --- ----- -------- */ + return critcl_trace_cmd_result (TCL_OK, interp); +} diff -Nru critcl-3.1.9/test/assets/cproc-trace/2.11 critcl-3.1.17+dfsg/test/assets/cproc-trace/2.11 --- critcl-3.1.9/test/assets/cproc-trace/2.11 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/test/assets/cproc-trace/2.11 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,53 @@ +/* ---------------------------------------------------------------------- */ + +#define ns__aproc0 "::aproc" +static void c__aproc0(int x, int y, int has_z, int z) +{ + +} + +static int +tcl__aproc0(ClientData cd, Tcl_Interp *interp, int oc, Tcl_Obj *CONST ov[]) +{ + int _x; + int _y; + int _has_z = 0; + int _z; + int idx_; + int argc_; + + critcl_trace_cmd_args (ns__aproc0, oc, ov); + + if ((oc < 3) || (4 < oc)) { + Tcl_WrongNumArgs(interp, 1, ov, "x y ?z?"); + return critcl_trace_cmd_result (TCL_ERROR, interp); + } + + /* (int x) - - -- --- ----- -------- */ + { + if (Tcl_GetIntFromObj(interp, ov[1], &_x) != TCL_OK) return critcl_trace_cmd_result (TCL_ERROR, interp); } + + + /* (int y) - - -- --- ----- -------- */ + { + if (Tcl_GetIntFromObj(interp, ov[2], &_y) != TCL_OK) return critcl_trace_cmd_result (TCL_ERROR, interp); } + + + idx_ = 3; + argc_ = oc - 3; + + /* (int z, optional, default -1) - - -- --- ----- -------- */ + if (argc_ > 0) { + { + if (Tcl_GetIntFromObj(interp, ov[idx_], &_z) != TCL_OK) return critcl_trace_cmd_result (TCL_ERROR, interp); } + _has_z = 1; + } else { + _z = -1; + } + + /* Call - - -- --- ----- -------- */ + c__aproc0(_x, _y, _has_z, _z); + + /* (void return) - - -- --- ----- -------- */ + return critcl_trace_cmd_result (TCL_OK, interp); +} diff -Nru critcl-3.1.9/test/assets/cproc-trace/2.12 critcl-3.1.17+dfsg/test/assets/cproc-trace/2.12 --- critcl-3.1.9/test/assets/cproc-trace/2.12 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/test/assets/cproc-trace/2.12 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,56 @@ +/* ---------------------------------------------------------------------- */ + +#define ns__aproc0 "::aproc" +static void c__aproc0(int x, int has_y, int y, int z) +{ + +} + +static int +tcl__aproc0(ClientData cd, Tcl_Interp *interp, int oc, Tcl_Obj *CONST ov[]) +{ + int _x; + int _has_y = 0; + int _y; + int _z; + int idx_; + int argc_; + + critcl_trace_cmd_args (ns__aproc0, oc, ov); + + if ((oc < 3) || (4 < oc)) { + Tcl_WrongNumArgs(interp, 1, ov, "x ?y? z"); + return critcl_trace_cmd_result (TCL_ERROR, interp); + } + + /* (int x) - - -- --- ----- -------- */ + { + if (Tcl_GetIntFromObj(interp, ov[1], &_x) != TCL_OK) return critcl_trace_cmd_result (TCL_ERROR, interp); } + + + idx_ = 2; + argc_ = oc - 2; + + /* (int y, optional, default -1) - - -- --- ----- -------- */ + if (argc_ > 1) { + { + if (Tcl_GetIntFromObj(interp, ov[idx_], &_y) != TCL_OK) return critcl_trace_cmd_result (TCL_ERROR, interp); } + idx_++; + argc_--; + _has_y = 1; + } else { + _y = -1; + } + + + /* (int z) - - -- --- ----- -------- */ + { + if (Tcl_GetIntFromObj(interp, ov[idx_], &_z) != TCL_OK) return critcl_trace_cmd_result (TCL_ERROR, interp); } + + + /* Call - - -- --- ----- -------- */ + c__aproc0(_x, _has_y, _y, _z); + + /* (void return) - - -- --- ----- -------- */ + return critcl_trace_cmd_result (TCL_OK, interp); +} diff -Nru critcl-3.1.9/test/assets/cproc-trace/2.13 critcl-3.1.17+dfsg/test/assets/cproc-trace/2.13 --- critcl-3.1.9/test/assets/cproc-trace/2.13 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/test/assets/cproc-trace/2.13 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,59 @@ +/* ---------------------------------------------------------------------- */ + +#define ns__aproc0 "::aproc" + +#ifndef CRITCL_variadic_int +#define CRITCL_variadic_int + + /* NOTE: Array 'v' is allocated on the heap. The argument + // release code is used to free it after the worker + // function returned. Depending on type and what is done + // by the worker it may have to make copies of the data. + */ + + typedef struct critcl_variadic_int { + int c; /* Element count */ + int* v; /* Allocated array of the elements */ + } critcl_variadic_int; + + static int + _critcl_variadic_int_item (Tcl_Interp* interp, Tcl_Obj* src, int* dst) { + { + if (Tcl_GetIntFromObj(interp, src, dst) != TCL_OK) return TCL_ERROR; } + return TCL_OK; + } + +#endif /* CRITCL_variadic_int _________ */ + +static void c__aproc0(critcl_variadic_int args) +{ + +} + +static int +tcl__aproc0(ClientData cd, Tcl_Interp *interp, int oc, Tcl_Obj *CONST ov[]) +{ + critcl_variadic_int _args; + + critcl_trace_cmd_args (ns__aproc0, oc, ov); + /* (int args, ...) - - -- --- ----- -------- */ + { + int src, dst, leftovers = (oc-1); + _args.c = leftovers; + _args.v = (int*) ((!leftovers) ? 0 : ckalloc (leftovers * sizeof (int))); + for (src = 1, dst = 0; leftovers > 0; dst++, src++, leftovers--) { + if (_critcl_variadic_int_item (interp, ov[src], &(_args.v[dst])) != TCL_OK) { + ckfree ((char*) _args.v); /* Cleanup partial work */ + return critcl_trace_cmd_result (TCL_ERROR, interp); + } + } } + + /* Call - - -- --- ----- -------- */ + c__aproc0(_args); + + /* (Release: int args, ...) - - -- --- ----- -------- */ + if (_args.c) { ckfree ((char*) _args.v); } + + /* (void return) - - -- --- ----- -------- */ + return critcl_trace_cmd_result (TCL_OK, interp); +} diff -Nru critcl-3.1.9/test/assets/cproc-trace/2.14 critcl-3.1.17+dfsg/test/assets/cproc-trace/2.14 --- critcl-3.1.9/test/assets/cproc-trace/2.14 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/test/assets/cproc-trace/2.14 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,36 @@ +/* ---------------------------------------------------------------------- */ + +#define ns__aproc0 "::aproc" + +#ifndef CRITCL_variadic_object +#define CRITCL_variadic_object + + typedef struct critcl_variadic_object { + int c; + Tcl_Obj* const* v; + } critcl_variadic_object; + +#endif /* CRITCL_variadic_object _________ */ + +static void c__aproc0(critcl_variadic_object args) +{ + +} + +static int +tcl__aproc0(ClientData cd, Tcl_Interp *interp, int oc, Tcl_Obj *CONST ov[]) +{ + critcl_variadic_object _args; + + critcl_trace_cmd_args (ns__aproc0, oc, ov); + /* (object args, ...) - - -- --- ----- -------- */ + { + _args.c = (oc-1); + _args.v = &ov[1]; } + + /* Call - - -- --- ----- -------- */ + c__aproc0(_args); + + /* (void return) - - -- --- ----- -------- */ + return critcl_trace_cmd_result (TCL_OK, interp); +} diff -Nru critcl-3.1.9/test/assets/cproc-trace/2.15 critcl-3.1.17+dfsg/test/assets/cproc-trace/2.15 --- critcl-3.1.9/test/assets/cproc-trace/2.15 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/test/assets/cproc-trace/2.15 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,77 @@ +/* ---------------------------------------------------------------------- */ + +#define ns__aproc0 "::aproc" + +#ifndef CRITCL_variadic_int +#define CRITCL_variadic_int + + /* NOTE: Array 'v' is allocated on the heap. The argument + // release code is used to free it after the worker + // function returned. Depending on type and what is done + // by the worker it may have to make copies of the data. + */ + + typedef struct critcl_variadic_int { + int c; /* Element count */ + int* v; /* Allocated array of the elements */ + } critcl_variadic_int; + + static int + _critcl_variadic_int_item (Tcl_Interp* interp, Tcl_Obj* src, int* dst) { + { + if (Tcl_GetIntFromObj(interp, src, dst) != TCL_OK) return TCL_ERROR; } + return TCL_OK; + } + +#endif /* CRITCL_variadic_int _________ */ + +static void c__aproc0(int x, int y, critcl_variadic_int args) +{ + +} + +static int +tcl__aproc0(ClientData cd, Tcl_Interp *interp, int oc, Tcl_Obj *CONST ov[]) +{ + int _x; + int _y; + critcl_variadic_int _args; + + critcl_trace_cmd_args (ns__aproc0, oc, ov); + + if (oc < 3) { + Tcl_WrongNumArgs(interp, 1, ov, "x y ?args...?"); + return critcl_trace_cmd_result (TCL_ERROR, interp); + } + + /* (int x) - - -- --- ----- -------- */ + { + if (Tcl_GetIntFromObj(interp, ov[1], &_x) != TCL_OK) return critcl_trace_cmd_result (TCL_ERROR, interp); } + + + /* (int y) - - -- --- ----- -------- */ + { + if (Tcl_GetIntFromObj(interp, ov[2], &_y) != TCL_OK) return critcl_trace_cmd_result (TCL_ERROR, interp); } + + + /* (int args, ...) - - -- --- ----- -------- */ + { + int src, dst, leftovers = (oc-3); + _args.c = leftovers; + _args.v = (int*) ((!leftovers) ? 0 : ckalloc (leftovers * sizeof (int))); + for (src = 3, dst = 0; leftovers > 0; dst++, src++, leftovers--) { + if (_critcl_variadic_int_item (interp, ov[src], &(_args.v[dst])) != TCL_OK) { + ckfree ((char*) _args.v); /* Cleanup partial work */ + return critcl_trace_cmd_result (TCL_ERROR, interp); + } + } } + + /* Call - - -- --- ----- -------- */ + c__aproc0(_x, _y, _args); + + /* (Release: int args, ...) - - -- --- ----- -------- */ + if (_args.c) { ckfree ((char*) _args.v); } + + /* (void return) - - -- --- ----- -------- */ + return critcl_trace_cmd_result (TCL_OK, interp); +} diff -Nru critcl-3.1.9/test/assets/cproc-trace/2.16 critcl-3.1.17+dfsg/test/assets/cproc-trace/2.16 --- critcl-3.1.9/test/assets/cproc-trace/2.16 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/test/assets/cproc-trace/2.16 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,92 @@ +/* ---------------------------------------------------------------------- */ + +#define ns__aproc0 "::aproc" + +#ifndef CRITCL_variadic_int +#define CRITCL_variadic_int + + /* NOTE: Array 'v' is allocated on the heap. The argument + // release code is used to free it after the worker + // function returned. Depending on type and what is done + // by the worker it may have to make copies of the data. + */ + + typedef struct critcl_variadic_int { + int c; /* Element count */ + int* v; /* Allocated array of the elements */ + } critcl_variadic_int; + + static int + _critcl_variadic_int_item (Tcl_Interp* interp, Tcl_Obj* src, int* dst) { + { + if (Tcl_GetIntFromObj(interp, src, dst) != TCL_OK) return TCL_ERROR; } + return TCL_OK; + } + +#endif /* CRITCL_variadic_int _________ */ + +static void c__aproc0(int has_x, int x, int has_y, int y, critcl_variadic_int args) +{ + +} + +static int +tcl__aproc0(ClientData cd, Tcl_Interp *interp, int oc, Tcl_Obj *CONST ov[]) +{ + int _has_x = 0; + int _x; + int _has_y = 0; + int _y; + critcl_variadic_int _args; + int idx_; + int argc_; + + critcl_trace_cmd_args (ns__aproc0, oc, ov); + idx_ = 1; + argc_ = oc - 1; + + /* (int x, optional, default -1) - - -- --- ----- -------- */ + if (argc_ > 1) { + { + if (Tcl_GetIntFromObj(interp, ov[idx_], &_x) != TCL_OK) return critcl_trace_cmd_result (TCL_ERROR, interp); } + idx_++; + argc_--; + _has_x = 1; + } else { + _x = -1; + } + + + /* (int y, optional, default -1) - - -- --- ----- -------- */ + if (argc_ > 1) { + { + if (Tcl_GetIntFromObj(interp, ov[idx_], &_y) != TCL_OK) return critcl_trace_cmd_result (TCL_ERROR, interp); } + idx_++; + argc_--; + _has_y = 1; + } else { + _y = -1; + } + + + /* (int args, ...) - - -- --- ----- -------- */ + { + int src, dst, leftovers = argc_; + _args.c = leftovers; + _args.v = (int*) ((!leftovers) ? 0 : ckalloc (leftovers * sizeof (int))); + for (src = idx_, dst = 0; leftovers > 0; dst++, src++, leftovers--) { + if (_critcl_variadic_int_item (interp, ov[src], &(_args.v[dst])) != TCL_OK) { + ckfree ((char*) _args.v); /* Cleanup partial work */ + return critcl_trace_cmd_result (TCL_ERROR, interp); + } + } } + + /* Call - - -- --- ----- -------- */ + c__aproc0(_has_x, _x, _has_y, _y, _args); + + /* (Release: int args, ...) - - -- --- ----- -------- */ + if (_args.c) { ckfree ((char*) _args.v); } + + /* (void return) - - -- --- ----- -------- */ + return critcl_trace_cmd_result (TCL_OK, interp); +} diff -Nru critcl-3.1.9/test/assets/cproc-trace/2.17 critcl-3.1.17+dfsg/test/assets/cproc-trace/2.17 --- critcl-3.1.9/test/assets/cproc-trace/2.17 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/test/assets/cproc-trace/2.17 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,90 @@ +/* ---------------------------------------------------------------------- */ + +#define ns__aproc0 "::aproc" + +#ifndef CRITCL_variadic_int +#define CRITCL_variadic_int + + /* NOTE: Array 'v' is allocated on the heap. The argument + // release code is used to free it after the worker + // function returned. Depending on type and what is done + // by the worker it may have to make copies of the data. + */ + + typedef struct critcl_variadic_int { + int c; /* Element count */ + int* v; /* Allocated array of the elements */ + } critcl_variadic_int; + + static int + _critcl_variadic_int_item (Tcl_Interp* interp, Tcl_Obj* src, int* dst) { + { + if (Tcl_GetIntFromObj(interp, src, dst) != TCL_OK) return TCL_ERROR; } + return TCL_OK; + } + +#endif /* CRITCL_variadic_int _________ */ + +static void c__aproc0(int x, int has_y, int y, critcl_variadic_int args) +{ + +} + +static int +tcl__aproc0(ClientData cd, Tcl_Interp *interp, int oc, Tcl_Obj *CONST ov[]) +{ + int _x; + int _has_y = 0; + int _y; + critcl_variadic_int _args; + int idx_; + int argc_; + + critcl_trace_cmd_args (ns__aproc0, oc, ov); + + if (oc < 2) { + Tcl_WrongNumArgs(interp, 1, ov, "x ?y? ?args...?"); + return critcl_trace_cmd_result (TCL_ERROR, interp); + } + + /* (int x) - - -- --- ----- -------- */ + { + if (Tcl_GetIntFromObj(interp, ov[1], &_x) != TCL_OK) return critcl_trace_cmd_result (TCL_ERROR, interp); } + + + idx_ = 2; + argc_ = oc - 2; + + /* (int y, optional, default -1) - - -- --- ----- -------- */ + if (argc_ > 1) { + { + if (Tcl_GetIntFromObj(interp, ov[idx_], &_y) != TCL_OK) return critcl_trace_cmd_result (TCL_ERROR, interp); } + idx_++; + argc_--; + _has_y = 1; + } else { + _y = -1; + } + + + /* (int args, ...) - - -- --- ----- -------- */ + { + int src, dst, leftovers = argc_; + _args.c = leftovers; + _args.v = (int*) ((!leftovers) ? 0 : ckalloc (leftovers * sizeof (int))); + for (src = idx_, dst = 0; leftovers > 0; dst++, src++, leftovers--) { + if (_critcl_variadic_int_item (interp, ov[src], &(_args.v[dst])) != TCL_OK) { + ckfree ((char*) _args.v); /* Cleanup partial work */ + return critcl_trace_cmd_result (TCL_ERROR, interp); + } + } } + + /* Call - - -- --- ----- -------- */ + c__aproc0(_x, _has_y, _y, _args); + + /* (Release: int args, ...) - - -- --- ----- -------- */ + if (_args.c) { ckfree ((char*) _args.v); } + + /* (void return) - - -- --- ----- -------- */ + return critcl_trace_cmd_result (TCL_OK, interp); +} diff -Nru critcl-3.1.9/test/assets/cproc-trace/2.18 critcl-3.1.17+dfsg/test/assets/cproc-trace/2.18 --- critcl-3.1.9/test/assets/cproc-trace/2.18 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/test/assets/cproc-trace/2.18 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,93 @@ +/* ---------------------------------------------------------------------- */ + +#define ns__aproc0 "::aproc" + +#ifndef CRITCL_variadic_int +#define CRITCL_variadic_int + + /* NOTE: Array 'v' is allocated on the heap. The argument + // release code is used to free it after the worker + // function returned. Depending on type and what is done + // by the worker it may have to make copies of the data. + */ + + typedef struct critcl_variadic_int { + int c; /* Element count */ + int* v; /* Allocated array of the elements */ + } critcl_variadic_int; + + static int + _critcl_variadic_int_item (Tcl_Interp* interp, Tcl_Obj* src, int* dst) { + { + if (Tcl_GetIntFromObj(interp, src, dst) != TCL_OK) return TCL_ERROR; } + return TCL_OK; + } + +#endif /* CRITCL_variadic_int _________ */ + +static void c__aproc0(int has_x, int x, int y, critcl_variadic_int args) +{ + +} + +static int +tcl__aproc0(ClientData cd, Tcl_Interp *interp, int oc, Tcl_Obj *CONST ov[]) +{ + int _has_x = 0; + int _x; + int _y; + critcl_variadic_int _args; + int idx_; + int argc_; + + critcl_trace_cmd_args (ns__aproc0, oc, ov); + + if (oc < 2) { + Tcl_WrongNumArgs(interp, 1, ov, "?x? y ?args...?"); + return critcl_trace_cmd_result (TCL_ERROR, interp); + } + + idx_ = 1; + argc_ = oc - 1; + + /* (int x, optional, default -1) - - -- --- ----- -------- */ + if (argc_ > 2) { + { + if (Tcl_GetIntFromObj(interp, ov[idx_], &_x) != TCL_OK) return critcl_trace_cmd_result (TCL_ERROR, interp); } + idx_++; + argc_--; + _has_x = 1; + } else { + _x = -1; + } + + + /* (int y) - - -- --- ----- -------- */ + { + if (Tcl_GetIntFromObj(interp, ov[idx_], &_y) != TCL_OK) return critcl_trace_cmd_result (TCL_ERROR, interp); } + + idx_++; + argc_--; + + + /* (int args, ...) - - -- --- ----- -------- */ + { + int src, dst, leftovers = argc_; + _args.c = leftovers; + _args.v = (int*) ((!leftovers) ? 0 : ckalloc (leftovers * sizeof (int))); + for (src = idx_, dst = 0; leftovers > 0; dst++, src++, leftovers--) { + if (_critcl_variadic_int_item (interp, ov[src], &(_args.v[dst])) != TCL_OK) { + ckfree ((char*) _args.v); /* Cleanup partial work */ + return critcl_trace_cmd_result (TCL_ERROR, interp); + } + } } + + /* Call - - -- --- ----- -------- */ + c__aproc0(_has_x, _x, _y, _args); + + /* (Release: int args, ...) - - -- --- ----- -------- */ + if (_args.c) { ckfree ((char*) _args.v); } + + /* (void return) - - -- --- ----- -------- */ + return critcl_trace_cmd_result (TCL_OK, interp); +} diff -Nru critcl-3.1.9/test/assets/cproc-trace/2.2 critcl-3.1.17+dfsg/test/assets/cproc-trace/2.2 --- critcl-3.1.9/test/assets/cproc-trace/2.2 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/test/assets/cproc-trace/2.2 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,25 @@ +/* ---------------------------------------------------------------------- */ + +#define ns__aproc_beta0 "::aproc+beta" +static void c__aproc_beta0() +{ + +} + +static int +tcl__aproc_beta0(ClientData cd, Tcl_Interp *interp, int oc, Tcl_Obj *CONST ov[]) +{ + + critcl_trace_cmd_args (ns__aproc_beta0, oc, ov); + + if (oc != 1) { + Tcl_WrongNumArgs(interp, 1, ov, NULL); + return critcl_trace_cmd_result (TCL_ERROR, interp); + } + + /* Call - - -- --- ----- -------- */ + c__aproc_beta0(); + + /* (void return) - - -- --- ----- -------- */ + return critcl_trace_cmd_result (TCL_OK, interp); +} diff -Nru critcl-3.1.9/test/assets/cproc-trace/2.3 critcl-3.1.17+dfsg/test/assets/cproc-trace/2.3 --- critcl-3.1.9/test/assets/cproc-trace/2.3 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/test/assets/cproc-trace/2.3 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,24 @@ +/* ---------------------------------------------------------------------- */ + +static void c_snafu() +{ + +} + +static int +snafu(ClientData cd, Tcl_Interp *interp, int oc, Tcl_Obj *CONST ov[]) +{ + + critcl_trace_cmd_args ("snafu", oc, ov); + + if (oc != 1) { + Tcl_WrongNumArgs(interp, 1, ov, NULL); + return critcl_trace_cmd_result (TCL_ERROR, interp); + } + + /* Call - - -- --- ----- -------- */ + c_snafu(); + + /* (void return) - - -- --- ----- -------- */ + return critcl_trace_cmd_result (TCL_OK, interp); +} diff -Nru critcl-3.1.9/test/assets/cproc-trace/2.4 critcl-3.1.17+dfsg/test/assets/cproc-trace/2.4 --- critcl-3.1.9/test/assets/cproc-trace/2.4 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/test/assets/cproc-trace/2.4 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,25 @@ +/* ---------------------------------------------------------------------- */ + +#define ns__aproc0 "::aproc" +static void c__aproc0(ClientData clientdata) +{ + +} + +static int +tcl__aproc0(ClientData cd, Tcl_Interp *interp, int oc, Tcl_Obj *CONST ov[]) +{ + + critcl_trace_cmd_args (ns__aproc0, oc, ov); + + if (oc != 1) { + Tcl_WrongNumArgs(interp, 1, ov, NULL); + return critcl_trace_cmd_result (TCL_ERROR, interp); + } + + /* Call - - -- --- ----- -------- */ + c__aproc0(cd); + + /* (void return) - - -- --- ----- -------- */ + return critcl_trace_cmd_result (TCL_OK, interp); +} diff -Nru critcl-3.1.9/test/assets/cproc-trace/2.5 critcl-3.1.17+dfsg/test/assets/cproc-trace/2.5 --- critcl-3.1.9/test/assets/cproc-trace/2.5 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/test/assets/cproc-trace/2.5 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,25 @@ +/* ---------------------------------------------------------------------- */ + +#define ns__aproc0 "::aproc" +static void c__aproc0() +{ + +} + +static int +tcl__aproc0(ClientData cd, Tcl_Interp *interp, int oc, Tcl_Obj *CONST ov[]) +{ + + critcl_trace_cmd_args (ns__aproc0, oc, ov); + + if (oc != 4) { + Tcl_WrongNumArgs(interp, 4, ov, NULL); + return critcl_trace_cmd_result (TCL_ERROR, interp); + } + + /* Call - - -- --- ----- -------- */ + c__aproc0(); + + /* (void return) - - -- --- ----- -------- */ + return critcl_trace_cmd_result (TCL_OK, interp); +} diff -Nru critcl-3.1.9/test/assets/cproc-trace/2.6 critcl-3.1.17+dfsg/test/assets/cproc-trace/2.6 --- critcl-3.1.9/test/assets/cproc-trace/2.6 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/test/assets/cproc-trace/2.6 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,30 @@ +/* ---------------------------------------------------------------------- */ + +#define ns__aproc0 "::aproc" +static void c__aproc0(int anargument) +{ + +} + +static int +tcl__aproc0(ClientData cd, Tcl_Interp *interp, int oc, Tcl_Obj *CONST ov[]) +{ + int _anargument; + + critcl_trace_cmd_args (ns__aproc0, oc, ov); + + if (oc != 2) { + Tcl_WrongNumArgs(interp, 1, ov, "anargument"); + return critcl_trace_cmd_result (TCL_ERROR, interp); + } + + /* (int anargument) - - -- --- ----- -------- */ + { + if (Tcl_GetIntFromObj(interp, ov[1], &_anargument) != TCL_OK) return critcl_trace_cmd_result (TCL_ERROR, interp); } + + /* Call - - -- --- ----- -------- */ + c__aproc0(_anargument); + + /* (void return) - - -- --- ----- -------- */ + return critcl_trace_cmd_result (TCL_OK, interp); +} diff -Nru critcl-3.1.9/test/assets/cproc-trace/2.7 critcl-3.1.17+dfsg/test/assets/cproc-trace/2.7 --- critcl-3.1.9/test/assets/cproc-trace/2.7 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/test/assets/cproc-trace/2.7 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,41 @@ +/* ---------------------------------------------------------------------- */ + +#define ns__aproc0 "::aproc" +static void c__aproc0(int has_anargument, int anargument) +{ + +} + +static int +tcl__aproc0(ClientData cd, Tcl_Interp *interp, int oc, Tcl_Obj *CONST ov[]) +{ + int _has_anargument = 0; + int _anargument; + int idx_; + int argc_; + + critcl_trace_cmd_args (ns__aproc0, oc, ov); + + if ((oc < 1) || (2 < oc)) { + Tcl_WrongNumArgs(interp, 1, ov, "?anargument?"); + return critcl_trace_cmd_result (TCL_ERROR, interp); + } + + idx_ = 1; + argc_ = oc - 1; + + /* (int anargument, optional, default -1) - - -- --- ----- -------- */ + if (argc_ > 0) { + { + if (Tcl_GetIntFromObj(interp, ov[idx_], &_anargument) != TCL_OK) return critcl_trace_cmd_result (TCL_ERROR, interp); } + _has_anargument = 1; + } else { + _anargument = -1; + } + + /* Call - - -- --- ----- -------- */ + c__aproc0(_has_anargument, _anargument); + + /* (void return) - - -- --- ----- -------- */ + return critcl_trace_cmd_result (TCL_OK, interp); +} diff -Nru critcl-3.1.9/test/assets/cproc-trace/2.8 critcl-3.1.17+dfsg/test/assets/cproc-trace/2.8 --- critcl-3.1.9/test/assets/cproc-trace/2.8 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/test/assets/cproc-trace/2.8 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,64 @@ +/* ---------------------------------------------------------------------- */ + +#define ns__aproc0 "::aproc" +static void c__aproc0(int has_x, int x, int y, int has_z, int z) +{ + +} + +static int +tcl__aproc0(ClientData cd, Tcl_Interp *interp, int oc, Tcl_Obj *CONST ov[]) +{ + int _has_x = 0; + int _x; + int _y; + int _has_z = 0; + int _z; + int idx_; + int argc_; + + critcl_trace_cmd_args (ns__aproc0, oc, ov); + + if ((oc < 2) || (4 < oc)) { + Tcl_WrongNumArgs(interp, 1, ov, "?x? y ?z?"); + return critcl_trace_cmd_result (TCL_ERROR, interp); + } + + idx_ = 1; + argc_ = oc - 1; + + /* (int x, optional, default -1) - - -- --- ----- -------- */ + if (argc_ > 1) { + { + if (Tcl_GetIntFromObj(interp, ov[idx_], &_x) != TCL_OK) return critcl_trace_cmd_result (TCL_ERROR, interp); } + idx_++; + argc_--; + _has_x = 1; + } else { + _x = -1; + } + + + /* (int y) - - -- --- ----- -------- */ + { + if (Tcl_GetIntFromObj(interp, ov[idx_], &_y) != TCL_OK) return critcl_trace_cmd_result (TCL_ERROR, interp); } + + idx_++; + argc_--; + + + /* (int z, optional, default -1) - - -- --- ----- -------- */ + if (argc_ > 0) { + { + if (Tcl_GetIntFromObj(interp, ov[idx_], &_z) != TCL_OK) return critcl_trace_cmd_result (TCL_ERROR, interp); } + _has_z = 1; + } else { + _z = -1; + } + + /* Call - - -- --- ----- -------- */ + c__aproc0(_has_x, _x, _y, _has_z, _z); + + /* (void return) - - -- --- ----- -------- */ + return critcl_trace_cmd_result (TCL_OK, interp); +} diff -Nru critcl-3.1.9/test/assets/cproc-trace/2.9 critcl-3.1.17+dfsg/test/assets/cproc-trace/2.9 --- critcl-3.1.9/test/assets/cproc-trace/2.9 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/test/assets/cproc-trace/2.9 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,26 @@ +/* ---------------------------------------------------------------------- */ + +#define ns__aproc0 "::aproc" +static int c__aproc0() +{ + +} + +static int +tcl__aproc0(ClientData cd, Tcl_Interp *interp, int oc, Tcl_Obj *CONST ov[]) +{ + int rv; + critcl_trace_cmd_args (ns__aproc0, oc, ov); + + if (oc != 1) { + Tcl_WrongNumArgs(interp, 1, ov, NULL); + return critcl_trace_cmd_result (TCL_ERROR, interp); + } + + /* Call - - -- --- ----- -------- */ + rv = c__aproc0(); + + /* (int return) - - -- --- ----- -------- */ + Tcl_SetObjResult(interp, Tcl_NewIntObj(rv)); + return critcl_trace_cmd_result (TCL_OK, interp); +} diff -Nru critcl-3.1.9/test/assets/cproc-trace/3.0 critcl-3.1.17+dfsg/test/assets/cproc-trace/3.0 --- critcl-3.1.9/test/assets/cproc-trace/3.0 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/test/assets/cproc-trace/3.0 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,25 @@ +/* ---------------------------------------------------------------------- */ + +#define ns__aproc0 "::aproc" +static void c__aproc0() +{ + +} + +static int +tcl__aproc0(ClientData cd, Tcl_Interp *interp, int oc, Tcl_Obj *CONST ov[]) +{ + + critcl_trace_cmd_args (ns__aproc0, oc, ov); + + if (oc != 1) { + Tcl_WrongNumArgs(interp, 1, ov, NULL); + return critcl_trace_cmd_result (TCL_ERROR, interp); + } + + /* Call - - -- --- ----- -------- */ + c__aproc0(); + + /* (void return) - - -- --- ----- -------- */ + return critcl_trace_cmd_result (TCL_OK, interp); +} diff -Nru critcl-3.1.9/test/assets/cproc-trace/3.1 critcl-3.1.17+dfsg/test/assets/cproc-trace/3.1 --- critcl-3.1.9/test/assets/cproc-trace/3.1 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/test/assets/cproc-trace/3.1 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,25 @@ +/* ---------------------------------------------------------------------- */ + +#define ns__aproc0 "::aproc" +static int c__aproc0() +{ +return TCL_OK; +} + +static int +tcl__aproc0(ClientData cd, Tcl_Interp *interp, int oc, Tcl_Obj *CONST ov[]) +{ + int rv; + critcl_trace_cmd_args (ns__aproc0, oc, ov); + + if (oc != 1) { + Tcl_WrongNumArgs(interp, 1, ov, NULL); + return critcl_trace_cmd_result (TCL_ERROR, interp); + } + + /* Call - - -- --- ----- -------- */ + rv = c__aproc0(); + + /* (ok return) - - -- --- ----- -------- */ + return critcl_trace_cmd_result (rv, interp); +} diff -Nru critcl-3.1.9/test/assets/cproc-trace/3.10 critcl-3.1.17+dfsg/test/assets/cproc-trace/3.10 --- critcl-3.1.9/test/assets/cproc-trace/3.10 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/test/assets/cproc-trace/3.10 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,26 @@ +/* ---------------------------------------------------------------------- */ + +#define ns__aproc0 "::aproc" +static char* c__aproc0() +{ +return alloc_string("bar"); +} + +static int +tcl__aproc0(ClientData cd, Tcl_Interp *interp, int oc, Tcl_Obj *CONST ov[]) +{ + char* rv; + critcl_trace_cmd_args (ns__aproc0, oc, ov); + + if (oc != 1) { + Tcl_WrongNumArgs(interp, 1, ov, NULL); + return critcl_trace_cmd_result (TCL_ERROR, interp); + } + + /* Call - - -- --- ----- -------- */ + rv = c__aproc0(); + + /* (dstring return) - - -- --- ----- -------- */ + Tcl_SetResult (interp, rv, TCL_DYNAMIC); + return critcl_trace_cmd_result (TCL_OK, interp); +} diff -Nru critcl-3.1.9/test/assets/cproc-trace/3.11 critcl-3.1.17+dfsg/test/assets/cproc-trace/3.11 --- critcl-3.1.9/test/assets/cproc-trace/3.11 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/test/assets/cproc-trace/3.11 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,28 @@ +/* ---------------------------------------------------------------------- */ + +#define ns__aproc0 "::aproc" +static Tcl_Obj* c__aproc0() +{ +return Tcl_NewIntObj(0); +} + +static int +tcl__aproc0(ClientData cd, Tcl_Interp *interp, int oc, Tcl_Obj *CONST ov[]) +{ + Tcl_Obj* rv; + critcl_trace_cmd_args (ns__aproc0, oc, ov); + + if (oc != 1) { + Tcl_WrongNumArgs(interp, 1, ov, NULL); + return critcl_trace_cmd_result (TCL_ERROR, interp); + } + + /* Call - - -- --- ----- -------- */ + rv = c__aproc0(); + + /* (object return) - - -- --- ----- -------- */ + if (rv == NULL) { return critcl_trace_cmd_result (TCL_ERROR, interp); } + Tcl_SetObjResult(interp, rv); + Tcl_DecrRefCount(rv); + return critcl_trace_cmd_result (TCL_OK, interp); +} diff -Nru critcl-3.1.9/test/assets/cproc-trace/3.2 critcl-3.1.17+dfsg/test/assets/cproc-trace/3.2 --- critcl-3.1.9/test/assets/cproc-trace/3.2 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/test/assets/cproc-trace/3.2 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,26 @@ +/* ---------------------------------------------------------------------- */ + +#define ns__aproc0 "::aproc" +static int c__aproc0() +{ +return 0; +} + +static int +tcl__aproc0(ClientData cd, Tcl_Interp *interp, int oc, Tcl_Obj *CONST ov[]) +{ + int rv; + critcl_trace_cmd_args (ns__aproc0, oc, ov); + + if (oc != 1) { + Tcl_WrongNumArgs(interp, 1, ov, NULL); + return critcl_trace_cmd_result (TCL_ERROR, interp); + } + + /* Call - - -- --- ----- -------- */ + rv = c__aproc0(); + + /* (int return) - - -- --- ----- -------- */ + Tcl_SetObjResult(interp, Tcl_NewIntObj(rv)); + return critcl_trace_cmd_result (TCL_OK, interp); +} diff -Nru critcl-3.1.9/test/assets/cproc-trace/3.3 critcl-3.1.17+dfsg/test/assets/cproc-trace/3.3 --- critcl-3.1.9/test/assets/cproc-trace/3.3 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/test/assets/cproc-trace/3.3 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,26 @@ +/* ---------------------------------------------------------------------- */ + +#define ns__aproc0 "::aproc" +static int c__aproc0() +{ +return 1; +} + +static int +tcl__aproc0(ClientData cd, Tcl_Interp *interp, int oc, Tcl_Obj *CONST ov[]) +{ + int rv; + critcl_trace_cmd_args (ns__aproc0, oc, ov); + + if (oc != 1) { + Tcl_WrongNumArgs(interp, 1, ov, NULL); + return critcl_trace_cmd_result (TCL_ERROR, interp); + } + + /* Call - - -- --- ----- -------- */ + rv = c__aproc0(); + + /* (bool return) - - -- --- ----- -------- */ + Tcl_SetObjResult(interp, Tcl_NewIntObj(rv)); + return critcl_trace_cmd_result (TCL_OK, interp); +} diff -Nru critcl-3.1.9/test/assets/cproc-trace/3.4 critcl-3.1.17+dfsg/test/assets/cproc-trace/3.4 --- critcl-3.1.9/test/assets/cproc-trace/3.4 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/test/assets/cproc-trace/3.4 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,26 @@ +/* ---------------------------------------------------------------------- */ + +#define ns__aproc0 "::aproc" +static int c__aproc0() +{ +return 1; +} + +static int +tcl__aproc0(ClientData cd, Tcl_Interp *interp, int oc, Tcl_Obj *CONST ov[]) +{ + int rv; + critcl_trace_cmd_args (ns__aproc0, oc, ov); + + if (oc != 1) { + Tcl_WrongNumArgs(interp, 1, ov, NULL); + return critcl_trace_cmd_result (TCL_ERROR, interp); + } + + /* Call - - -- --- ----- -------- */ + rv = c__aproc0(); + + /* (boolean return) - - -- --- ----- -------- */ + Tcl_SetObjResult(interp, Tcl_NewIntObj(rv)); + return critcl_trace_cmd_result (TCL_OK, interp); +} diff -Nru critcl-3.1.9/test/assets/cproc-trace/3.5 critcl-3.1.17+dfsg/test/assets/cproc-trace/3.5 --- critcl-3.1.9/test/assets/cproc-trace/3.5 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/test/assets/cproc-trace/3.5 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,26 @@ +/* ---------------------------------------------------------------------- */ + +#define ns__aproc0 "::aproc" +static long c__aproc0() +{ +return 1; +} + +static int +tcl__aproc0(ClientData cd, Tcl_Interp *interp, int oc, Tcl_Obj *CONST ov[]) +{ + long rv; + critcl_trace_cmd_args (ns__aproc0, oc, ov); + + if (oc != 1) { + Tcl_WrongNumArgs(interp, 1, ov, NULL); + return critcl_trace_cmd_result (TCL_ERROR, interp); + } + + /* Call - - -- --- ----- -------- */ + rv = c__aproc0(); + + /* (long return) - - -- --- ----- -------- */ + Tcl_SetObjResult(interp, Tcl_NewLongObj(rv)); + return critcl_trace_cmd_result (TCL_OK, interp); +} diff -Nru critcl-3.1.9/test/assets/cproc-trace/3.6 critcl-3.1.17+dfsg/test/assets/cproc-trace/3.6 --- critcl-3.1.9/test/assets/cproc-trace/3.6 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/test/assets/cproc-trace/3.6 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,26 @@ +/* ---------------------------------------------------------------------- */ + +#define ns__aproc0 "::aproc" +static Tcl_WideInt c__aproc0() +{ +return 1; +} + +static int +tcl__aproc0(ClientData cd, Tcl_Interp *interp, int oc, Tcl_Obj *CONST ov[]) +{ + Tcl_WideInt rv; + critcl_trace_cmd_args (ns__aproc0, oc, ov); + + if (oc != 1) { + Tcl_WrongNumArgs(interp, 1, ov, NULL); + return critcl_trace_cmd_result (TCL_ERROR, interp); + } + + /* Call - - -- --- ----- -------- */ + rv = c__aproc0(); + + /* (wideint return) - - -- --- ----- -------- */ + Tcl_SetObjResult(interp, Tcl_NewWideIntObj(rv)); + return critcl_trace_cmd_result (TCL_OK, interp); +} diff -Nru critcl-3.1.9/test/assets/cproc-trace/3.7 critcl-3.1.17+dfsg/test/assets/cproc-trace/3.7 --- critcl-3.1.9/test/assets/cproc-trace/3.7 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/test/assets/cproc-trace/3.7 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,26 @@ +/* ---------------------------------------------------------------------- */ + +#define ns__aproc0 "::aproc" +static double c__aproc0() +{ +return 0.; +} + +static int +tcl__aproc0(ClientData cd, Tcl_Interp *interp, int oc, Tcl_Obj *CONST ov[]) +{ + double rv; + critcl_trace_cmd_args (ns__aproc0, oc, ov); + + if (oc != 1) { + Tcl_WrongNumArgs(interp, 1, ov, NULL); + return critcl_trace_cmd_result (TCL_ERROR, interp); + } + + /* Call - - -- --- ----- -------- */ + rv = c__aproc0(); + + /* (double return) - - -- --- ----- -------- */ + Tcl_SetObjResult(interp, Tcl_NewDoubleObj(rv)); + return critcl_trace_cmd_result (TCL_OK, interp); +} diff -Nru critcl-3.1.9/test/assets/cproc-trace/3.8 critcl-3.1.17+dfsg/test/assets/cproc-trace/3.8 --- critcl-3.1.9/test/assets/cproc-trace/3.8 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/test/assets/cproc-trace/3.8 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,26 @@ +/* ---------------------------------------------------------------------- */ + +#define ns__aproc0 "::aproc" +static float c__aproc0() +{ +return 0.; +} + +static int +tcl__aproc0(ClientData cd, Tcl_Interp *interp, int oc, Tcl_Obj *CONST ov[]) +{ + float rv; + critcl_trace_cmd_args (ns__aproc0, oc, ov); + + if (oc != 1) { + Tcl_WrongNumArgs(interp, 1, ov, NULL); + return critcl_trace_cmd_result (TCL_ERROR, interp); + } + + /* Call - - -- --- ----- -------- */ + rv = c__aproc0(); + + /* (float return) - - -- --- ----- -------- */ + Tcl_SetObjResult(interp, Tcl_NewDoubleObj(rv)); + return critcl_trace_cmd_result (TCL_OK, interp); +} diff -Nru critcl-3.1.9/test/assets/cproc-trace/3.9 critcl-3.1.17+dfsg/test/assets/cproc-trace/3.9 --- critcl-3.1.9/test/assets/cproc-trace/3.9 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/test/assets/cproc-trace/3.9 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,26 @@ +/* ---------------------------------------------------------------------- */ + +#define ns__aproc0 "::aproc" +static char* c__aproc0() +{ +return "foo"; +} + +static int +tcl__aproc0(ClientData cd, Tcl_Interp *interp, int oc, Tcl_Obj *CONST ov[]) +{ + char* rv; + critcl_trace_cmd_args (ns__aproc0, oc, ov); + + if (oc != 1) { + Tcl_WrongNumArgs(interp, 1, ov, NULL); + return critcl_trace_cmd_result (TCL_ERROR, interp); + } + + /* Call - - -- --- ----- -------- */ + rv = c__aproc0(); + + /* (vstring return) - - -- --- ----- -------- */ + Tcl_SetObjResult(interp, Tcl_NewStringObj(rv,-1)); + return critcl_trace_cmd_result (TCL_OK, interp); +} diff -Nru critcl-3.1.9/test/assets/def-2.0 critcl-3.1.17+dfsg/test/assets/def-2.0 --- critcl-3.1.9/test/assets/def-2.0 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/test/assets/def-2.0 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,2 @@ + +#define foo 333 diff -Nru critcl-3.1.9/test/assets/undef-2.0 critcl-3.1.17+dfsg/test/assets/undef-2.0 --- critcl-3.1.9/test/assets/undef-2.0 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/test/assets/undef-2.0 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,2 @@ + +#undef foo diff -Nru critcl-3.1.9/test/attic/basic.tcl critcl-3.1.17+dfsg/test/attic/basic.tcl --- critcl-3.1.9/test/attic/basic.tcl 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/test/attic/basic.tcl 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,12 @@ +package require critcl + +critcl::cproc add {int x int y} int { + return x + y; +} + +critcl::cproc cube {int x} int { + return x * x * x; +} + +puts stderr "add 1 + 2 = [add 1 2]" +puts stderr "cube 2 = [cube 2]" diff -Nru critcl-3.1.9/test/attic/basic.tst critcl-3.1.17+dfsg/test/attic/basic.tst --- critcl-3.1.9/test/attic/basic.tst 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/test/attic/basic.tst 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,7 @@ +package require tcltest +namespace import tcltest::* + +test basic "Basic compile + go" -body { + puts stderr "exec = [info nameofexecutable]" + puts stderr "prog = $starkit::topdir" +} diff -Nru critcl-3.1.9/test/attic/c++direct-1.tcl critcl-3.1.17+dfsg/test/attic/c++direct-1.tcl --- critcl-3.1.9/test/attic/c++direct-1.tcl 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/test/attic/c++direct-1.tcl 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,70 @@ +package require critcl + +critcl::config language c++ +critcl::clibraries -lstdc++ + +namespace eval testing { + critcl::ccode { + class Counter { + public: + Counter(int startValue=0); + Counter operator++(); + void set( int newValue); + void reset(); + int value() const; + private: + int count; + int resetValue; + }; + + Counter::Counter(int startValue) : count(startValue), + resetValue(startValue) {} + Counter Counter::operator++() { + count++; + } + + void Counter::set(int newValue) { + count=newValue; + } + + void Counter::reset() { + count=resetValue; + } + + int Counter::value() const { + return count; + } + } + + critcl::c++command counter Counter { {} {int start_value} } { + void set {int new_value} + void reset {} + void {incr operator++} {} + int value {} + } + +} + +if 1 { + testing::counter p 10 + puts "Initial Counter: [p value]" + p incr + p incr + p incr + puts "Counter after 3 increments: [p value]" + p set 20 + puts "Counter after set to 20: [p value]" + p reset + puts "Counter after reset: [p value]" + + testing::counter d + puts "Initial Counter: [d value]" + d incr + d incr + d incr + puts "Counter after 3 increments: [d value]" + d set 20 + puts "Counter after set to 20: [d value]" + d reset + puts "Counter after reset: [d value]" +} diff -Nru critcl-3.1.9/test/attic/c++direct-2.tcl critcl-3.1.17+dfsg/test/attic/c++direct-2.tcl --- critcl-3.1.9/test/attic/c++direct-2.tcl 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/test/attic/c++direct-2.tcl 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,29 @@ +package require critcl + +critcl::config language c++ +critcl::clibraries -lstdc++ + +critcl::ccode { + class A { + int val; + public: + A() : val (123) {} + int value() const { return val; } + operator int() { return val; } + int operator |(int o) { return val|o; } + int operator &(int o) { return val&o; } + }; +} + +critcl::c++command tst A {} { + int value {} + int {int {operator int}} {} + int {or {operator |}} {int} + int {and {operator &}} {int} +} + +tst A +puts "tst = [A value]" +puts "tst = [A int]" +puts "tst = [A or 0xf]" +puts "tst = [A and 0xf]" diff -Nru critcl-3.1.9/test/attic/c++indirect.tcl critcl-3.1.17+dfsg/test/attic/c++indirect.tcl --- critcl-3.1.9/test/attic/c++indirect.tcl 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/test/attic/c++indirect.tcl 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,20 @@ +package require critcl + +critcl::config language c++ +critcl::clibraries -lstdc++ + +critcl::ccode { + class A { + int value; + public: + A() : value (123) {} + operator int() const { return value; } + }; +} + +critcl::cproc tryplus {} int { + A var; + return var; +} + +puts "tryplus = [tryplus]" diff -Nru critcl-3.1.9/test/attic/fbasic.tcl critcl-3.1.17+dfsg/test/attic/fbasic.tcl --- critcl-3.1.9/test/attic/fbasic.tcl 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/test/attic/fbasic.tcl 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1 @@ +# Basic test for Critclf diff -Nru critcl-3.1.9/test/basic.tcl critcl-3.1.17+dfsg/test/basic.tcl --- critcl-3.1.9/test/basic.tcl 2013-05-10 05:57:04.000000000 +0000 +++ critcl-3.1.17+dfsg/test/basic.tcl 1970-01-01 00:00:00.000000000 +0000 @@ -1,12 +0,0 @@ -package require critcl - -critcl::cproc add {int x int y} int { - return x + y; -} - -critcl::cproc cube {int x} int { - return x * x * x; -} - -puts stderr "add 1 + 2 = [add 1 2]" -puts stderr "cube 2 = [cube 2]" diff -Nru critcl-3.1.9/test/basic.tst critcl-3.1.17+dfsg/test/basic.tst --- critcl-3.1.9/test/basic.tst 2013-05-10 05:57:04.000000000 +0000 +++ critcl-3.1.17+dfsg/test/basic.tst 1970-01-01 00:00:00.000000000 +0000 @@ -1,7 +0,0 @@ -package require tcltest -namespace import tcltest::* - -test basic "Basic compile + go" -body { - puts stderr "exec = [info nameofexecutable]" - puts stderr "prog = $starkit::topdir" -} diff -Nru critcl-3.1.9/test/cache.test critcl-3.1.17+dfsg/test/cache.test --- critcl-3.1.9/test/cache.test 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/test/cache.test 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,65 @@ +# -*- tcl -*- +# ------------------------------------------------------------------------- +# critcl_cache.test +# ------------------------------------------------------------------------- + +source [file join [file dirname [info script]] support testutilities.tcl] + +testsNeedTcl 8.4 +testsNeedTcltest 2 + +support { + useLocal lib/lassign84/lassign.tcl lassign84 + useLocal lib/dict84/dict.tcl dict84 + + useLocal lib/stubs_container/container.tcl stubs::container + useLocal lib/stubs_reader/reader.tcl stubs::reader + useLocal lib/stubs_genframe/genframe.tcl stubs::gen + + # Helper procedures + useLocalFile test/support/crit_utils.tcl +} +testing { + useLocal lib/critcl/critcl.tcl critcl +} + +overrides + +# ------------------------------------------------------------------------- +## cache syntax + +test critcl-cache-1.0.6 {cache, wrong\#args, too many} -constraints tcl8.6plus -body { + critcl::cache C X +} -returnCodes error -result {wrong # args: should be "critcl::cache ?dir?"} + +test critcl-cache-1.0.5 {cache, wrong\#args, too many} -constraints tcl8.5 -body { + critcl::cache C X +} -returnCodes error -result {wrong # args: should be "critcl::cache ?dir?"} + +test critcl-cache-1.0.4 {cache, wrong\#args, too many} -constraints tcl8.4 -body { + critcl::cache C X +} -returnCodes error -result {wrong # args: should be "critcl::cache ?dir?"} + +# ------------------------------------------------------------------------- +## + +test critcl-cache-2.0 {cache, default, home directory} -body { + critcl::cache +} -match glob -result $::env(HOME)/.critcl/* + +test critcl-cache-2.1 {cache, redirecting cache} -setup { + set here [critcl::cache] +} -body { + critcl::cache ~/FOO +} -cleanup { + critcl::cache $here + unset here +} -match glob -result $::env(HOME)/FOO + +# ------------------------------------------------------------------------- +testsuiteCleanup + +# Local variables: +# mode: tcl +# indent-tabs-mode: nil +# End: diff -Nru critcl-3.1.9/test/ccommand.test critcl-3.1.17+dfsg/test/ccommand.test --- critcl-3.1.9/test/ccommand.test 2013-05-10 05:57:04.000000000 +0000 +++ critcl-3.1.17+dfsg/test/ccommand.test 2017-10-14 02:48:11.000000000 +0000 @@ -1,101 +1,17 @@ -# -*- tcl -*- -# ------------------------------------------------------------------------- -# critcl_ccommand.test +# critcl::ccommand -- Regular tests # ------------------------------------------------------------------------- +# Setup -source [file join \ - [file dirname [file join [pwd] [info script]]] \ - testutilities.tcl] +source [file join [file dirname [info script]] support testutilities.tcl] testsNeedTcl 8.4 testsNeedTcltest 2 -support { - useLocal lib/util84/lassign.tcl lassign84 - useLocal lib/util84/dict.tcl dict84 - - useLocal lib/stubs/container.tcl stubs::container - useLocal lib/stubs/reader.tcl stubs::reader - useLocal lib/stubs/genframe.tcl stubs::gen -} -testing { - useLocal lib/critcl/critcl.tcl critcl -} - -# ------------------------------------------------------------------------- -## ccommand syntax - -test critcl-ccommand-1.0 {ccommand, wrong\#args} -setup { -} -body { - critcl::ccommand -} -cleanup { -} -returnCodes error -result {wrong # args: should be "critcl::ccommand name anames ..."} - -# ------------------------------------------------------------------------- -## Go through the various knobs we can use to configure the definition and output - -proc get {args} { - set t [string trim [critcl::collect $args]] - #regsub -all -- {#line \d+ } $t {#line XX } t - return $t -} - -test critcl-ccommand-2.0 {basic ccommand} -body { - get critcl::ccommand command {} { - return TCL_OK; - } -} -result {/* ---------------------------------------------------------------------- */ - -#define ns__command0 "::command" -static int tcl__command0(ClientData clientdata, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) -{ -return TCL_OK; -}} - -# ------------------------------------------------------------------------- - -test critcl-ccommand-2.1 {basic ccommand, custom arguments} -body { - get critcl::ccommand command {CD IP OC OV} { - return TCL_OK; - } -} -result {/* ---------------------------------------------------------------------- */ - -#define ns__command0 "::command" -static int tcl__command0(ClientData CD, Tcl_Interp *IP, int OC, Tcl_Obj *CONST OV[]) -{ -return TCL_OK; -}} - -# ------------------------------------------------------------------------- - -test critcl-ccommand-2.2 {basic ccommand, custom C name} -body { - get critcl::ccommand snafu {} { - return TCL_OK; - } -cname 1 -} -result {/* ---------------------------------------------------------------------- */ - -static int snafu(ClientData clientdata, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) -{ -return TCL_OK; -}} - -# ------------------------------------------------------------------------- - -test critcl-ccommand-2.2 {basic ccommand, namespaced, and Tcl vs C} -body { - get critcl::ccommand the::command+max {} { - return TCL_OK; - } -} -result {/* ---------------------------------------------------------------------- */ - -#define ns__the_command_max0 "::the::command+max" -static int tcl__the_command_max0(ClientData clientdata, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) -{ -return TCL_OK; -}} +useLocalFile test/support/crit_utils.tcl # ------------------------------------------------------------------------- -testsuiteCleanup +do ccommand # Local variables: # mode: tcl diff -Nru critcl-3.1.9/test/ccommand-trace.test critcl-3.1.17+dfsg/test/ccommand-trace.test --- critcl-3.1.9/test/ccommand-trace.test 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/test/ccommand-trace.test 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,19 @@ +# critcl::ccommand -- Testing with trace code. +# ------------------------------------------------------------------------- +# Setup + +source [file join [file dirname [info script]] support testutilities.tcl] + +testsNeedTcl 8.4 +testsNeedTcltest 2 + +useLocalFile test/support/crit_utils.tcl + +# ------------------------------------------------------------------------- + +trace-do ccommand + +# Local variables: +# mode: tcl +# indent-tabs-mode: nil +# End: diff -Nru critcl-3.1.9/test/cconst.test critcl-3.1.17+dfsg/test/cconst.test --- critcl-3.1.9/test/cconst.test 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/test/cconst.test 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,19 @@ +# critcl::cconst -- Regular tests +# ------------------------------------------------------------------------- +# Setup + +source [file join [file dirname [info script]] support testutilities.tcl] + +testsNeedTcl 8.4 +testsNeedTcltest 2 + +useLocalFile test/support/crit_utils.tcl + +# ------------------------------------------------------------------------- + +do cconst + +# Local variables: +# mode: tcl +# indent-tabs-mode: nil +# End: diff -Nru critcl-3.1.9/test/cconst-trace.test critcl-3.1.17+dfsg/test/cconst-trace.test --- critcl-3.1.9/test/cconst-trace.test 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/test/cconst-trace.test 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,19 @@ +# critcl::cconst -- Testing with trace code. +# ------------------------------------------------------------------------- +# Setup + +source [file join [file dirname [info script]] support testutilities.tcl] + +testsNeedTcl 8.4 +testsNeedTcltest 2 + +useLocalFile test/support/crit_utils.tcl + +# ------------------------------------------------------------------------- + +trace-do cconst + +# Local variables: +# mode: tcl +# indent-tabs-mode: nil +# End: diff -Nru critcl-3.1.9/test/cdata.test critcl-3.1.17+dfsg/test/cdata.test --- critcl-3.1.9/test/cdata.test 2013-05-10 05:57:04.000000000 +0000 +++ critcl-3.1.17+dfsg/test/cdata.test 2017-10-14 02:48:11.000000000 +0000 @@ -1,103 +1,17 @@ -# -*- tcl -*- -# ------------------------------------------------------------------------- -# critcl_cdata.test +# critcl::cdata -- Regular tests # ------------------------------------------------------------------------- +# Setup -source [file join \ - [file dirname [file join [pwd] [info script]]] \ - testutilities.tcl] +source [file join [file dirname [info script]] support testutilities.tcl] testsNeedTcl 8.4 testsNeedTcltest 2 -support { - useLocal lib/util84/lassign.tcl lassign84 - useLocal lib/util84/dict.tcl dict84 - - useLocal lib/stubs/container.tcl stubs::container - useLocal lib/stubs/reader.tcl stubs::reader - useLocal lib/stubs/genframe.tcl stubs::gen -} -testing { - useLocal lib/critcl/critcl.tcl critcl -} - -# ------------------------------------------------------------------------- -## cdata syntax - -test critcl-cdata-1.0 {cdata, wrong\#args} -setup { -} -body { - critcl::cdata -} -returnCodes error -result {wrong # args: should be "critcl::cdata name data"} - -test critcl-cdata-1.1 {cdata, wrong\#args} -setup { -} -body { - critcl::cdata N -} -returnCodes error -result {wrong # args: should be "critcl::cdata name data"} - -test critcl-cdata-1.2 {cdata, wrong\#args} -setup { -} -body { - critcl::cdata N D X -} -returnCodes error -result {wrong # args: should be "critcl::cdata name data"} - -# ------------------------------------------------------------------------- -## Go through the various knobs we can use to configure the definition and output - -proc get {args} { - set t [string trim [critcl::collect $args]] - #regsub -all -- {#line \d+ } $t {#line XX } t - return $t -} - -test critcl-cdata-2.0 {basic cdata} -body { - get critcl::cdata alpha beta -} -result {/* ---------------------------------------------------------------------- */ - -#define ns__alpha0 "::alpha" -static int tcl__alpha0(ClientData dummy, Tcl_Interp *ip, int objc, Tcl_Obj *CONST objv[]) -{ -static char script[4] = { - 98,101,116,97, - }; - Tcl_SetByteArrayObj(Tcl_GetObjResult(ip), (unsigned char*) script, 4); - return TCL_OK; -}} - -# ------------------------------------------------------------------------- - -test critcl-cdata-2.1 {basic cdata, Tcl vs C identifiers} -body { - get critcl::cdata alpha-x beta -} -result {/* ---------------------------------------------------------------------- */ - -#define ns__alpha_x0 "::alpha-x" -static int tcl__alpha_x0(ClientData dummy, Tcl_Interp *ip, int objc, Tcl_Obj *CONST objv[]) -{ -static char script[4] = { - 98,101,116,97, - }; - Tcl_SetByteArrayObj(Tcl_GetObjResult(ip), (unsigned char*) script, 4); - return TCL_OK; -}} - -# ------------------------------------------------------------------------- - -test critcl-cdata-2.1 {basic cdata, namespaced} -body { - get critcl::cdata the::alpha beta -} -result {/* ---------------------------------------------------------------------- */ - -#define ns__the_alpha0 "::the::alpha" -static int tcl__the_alpha0(ClientData dummy, Tcl_Interp *ip, int objc, Tcl_Obj *CONST objv[]) -{ -static char script[4] = { - 98,101,116,97, - }; - Tcl_SetByteArrayObj(Tcl_GetObjResult(ip), (unsigned char*) script, 4); - return TCL_OK; -}} +useLocalFile test/support/crit_utils.tcl # ------------------------------------------------------------------------- -testsuiteCleanup +do cdata # Local variables: # mode: tcl diff -Nru critcl-3.1.9/test/cdata-trace.test critcl-3.1.17+dfsg/test/cdata-trace.test --- critcl-3.1.9/test/cdata-trace.test 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/test/cdata-trace.test 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,19 @@ +# critcl::cdata -- Testing with trace code. +# ------------------------------------------------------------------------- +# Setup + +source [file join [file dirname [info script]] support testutilities.tcl] + +testsNeedTcl 8.4 +testsNeedTcltest 2 + +useLocalFile test/support/crit_utils.tcl + +# ------------------------------------------------------------------------- + +trace-do cdata + +# Local variables: +# mode: tcl +# indent-tabs-mode: nil +# End: diff -Nru critcl-3.1.9/test/c++direct-1.tcl critcl-3.1.17+dfsg/test/c++direct-1.tcl --- critcl-3.1.9/test/c++direct-1.tcl 2013-05-10 05:57:04.000000000 +0000 +++ critcl-3.1.17+dfsg/test/c++direct-1.tcl 1970-01-01 00:00:00.000000000 +0000 @@ -1,70 +0,0 @@ -package require critcl - -critcl::config language c++ -critcl::clibraries -lstdc++ - -namespace eval testing { - critcl::ccode { - class Counter { - public: - Counter(int startValue=0); - Counter operator++(); - void set( int newValue); - void reset(); - int value() const; - private: - int count; - int resetValue; - }; - - Counter::Counter(int startValue) : count(startValue), - resetValue(startValue) {} - Counter Counter::operator++() { - count++; - } - - void Counter::set(int newValue) { - count=newValue; - } - - void Counter::reset() { - count=resetValue; - } - - int Counter::value() const { - return count; - } - } - - critcl::c++command counter Counter { {} {int start_value} } { - void set {int new_value} - void reset {} - void {incr operator++} {} - int value {} - } - -} - -if 1 { - testing::counter p 10 - puts "Initial Counter: [p value]" - p incr - p incr - p incr - puts "Counter after 3 increments: [p value]" - p set 20 - puts "Counter after set to 20: [p value]" - p reset - puts "Counter after reset: [p value]" - - testing::counter d - puts "Initial Counter: [d value]" - d incr - d incr - d incr - puts "Counter after 3 increments: [d value]" - d set 20 - puts "Counter after set to 20: [d value]" - d reset - puts "Counter after reset: [d value]" -} diff -Nru critcl-3.1.9/test/c++direct-2.tcl critcl-3.1.17+dfsg/test/c++direct-2.tcl --- critcl-3.1.9/test/c++direct-2.tcl 2013-05-10 05:57:04.000000000 +0000 +++ critcl-3.1.17+dfsg/test/c++direct-2.tcl 1970-01-01 00:00:00.000000000 +0000 @@ -1,29 +0,0 @@ -package require critcl - -critcl::config language c++ -critcl::clibraries -lstdc++ - -critcl::ccode { - class A { - int val; - public: - A() : val (123) {} - int value() const { return val; } - operator int() { return val; } - int operator |(int o) { return val|o; } - int operator &(int o) { return val&o; } - }; -} - -critcl::c++command tst A {} { - int value {} - int {int {operator int}} {} - int {or {operator |}} {int} - int {and {operator &}} {int} -} - -tst A -puts "tst = [A value]" -puts "tst = [A int]" -puts "tst = [A or 0xf]" -puts "tst = [A and 0xf]" diff -Nru critcl-3.1.9/test/c++indirect.tcl critcl-3.1.17+dfsg/test/c++indirect.tcl --- critcl-3.1.9/test/c++indirect.tcl 2013-05-10 05:57:04.000000000 +0000 +++ critcl-3.1.17+dfsg/test/c++indirect.tcl 1970-01-01 00:00:00.000000000 +0000 @@ -1,20 +0,0 @@ -package require critcl - -critcl::config language c++ -critcl::clibraries -lstdc++ - -critcl::ccode { - class A { - int value; - public: - A() : value (123) {} - operator int() const { return value; } - }; -} - -critcl::cproc tryplus {} int { - A var; - return var; -} - -puts "tryplus = [tryplus]" diff -Nru critcl-3.1.9/test/cproc.test critcl-3.1.17+dfsg/test/cproc.test --- critcl-3.1.9/test/cproc.test 2013-05-10 05:57:04.000000000 +0000 +++ critcl-3.1.17+dfsg/test/cproc.test 2017-10-14 02:48:11.000000000 +0000 @@ -1,168 +1,17 @@ -# -*- tcl -*- -# ------------------------------------------------------------------------- -# critcl_cproc.test +# critcl::cproc -- Regular tests # ------------------------------------------------------------------------- +# Setup -source [file join \ - [file dirname [file join [pwd] [info script]]] \ - testutilities.tcl] +source [file join [file dirname [info script]] support testutilities.tcl] testsNeedTcl 8.4 testsNeedTcltest 2 -support { - useLocal lib/util84/lassign.tcl lassign84 - useLocal lib/util84/dict.tcl dict84 - - useLocal lib/stubs/container.tcl stubs::container - useLocal lib/stubs/reader.tcl stubs::reader - useLocal lib/stubs/genframe.tcl stubs::gen -} -testing { - useLocal lib/critcl/critcl.tcl critcl - - # Note: The next command does not influence the standard argument- - # and result-types. - critcl::config lines 0 -} - -# ------------------------------------------------------------------------- -## cproc syntax - -test critcl-cproc-1.0 {cproc, wrong\#args} -setup { -} -body { - critcl::cproc -} -cleanup { -} -returnCodes error -result {wrong # args: should be "critcl::cproc name adefs rtype ?body? ..."} - -# ------------------------------------------------------------------------- -## Go through the various knobs we can use to configure the definition and output - -proc get {args} { - set t [string trim [critcl::collect $args]] - #regsub -all -- {#line \d+ } $t {#line XX } t - return $t -} - -# ------------------------------------------------------------------------- - -test critcl-cproc-2.0 {basic cproc} -body { - get critcl::cproc aproc {} void {} -} -result {/* ---------------------------------------------------------------------- */ - -#define ns__aproc0 "::aproc" -static void c__aproc0() -{ - -} - -static int -tcl__aproc0(ClientData cd, Tcl_Interp *interp, int oc, Tcl_Obj *CONST ov[]) -{ - - if (oc != 1) { - Tcl_WrongNumArgs(interp, 1, ov, NULL); - return TCL_ERROR; - } - - /* Call - - -- --- ----- -------- */ - c__aproc0(); - -#line 4603 "critcl.tcl" - return TCL_OK; -}} - -# ------------------------------------------------------------------------- - -test critcl-cproc-2.1 {basic cproc, namespaced} -body { - get critcl::cproc the::aproc {} void {} -} -result {/* ---------------------------------------------------------------------- */ - -#define ns__the_aproc0 "::the::aproc" -static void c__the_aproc0() -{ - -} - -static int -tcl__the_aproc0(ClientData cd, Tcl_Interp *interp, int oc, Tcl_Obj *CONST ov[]) -{ - - if (oc != 1) { - Tcl_WrongNumArgs(interp, 1, ov, NULL); - return TCL_ERROR; - } - - /* Call - - -- --- ----- -------- */ - c__the_aproc0(); - -#line 4603 "critcl.tcl" - return TCL_OK; -}} - -# ------------------------------------------------------------------------- - -test critcl-cproc-2.2 {basic cproc, Tcl vs C identifiers} -body { - get critcl::cproc aproc+beta {} void {} -} -result {/* ---------------------------------------------------------------------- */ - -#define ns__aproc_beta0 "::aproc+beta" -static void c__aproc_beta0() -{ - -} - -static int -tcl__aproc_beta0(ClientData cd, Tcl_Interp *interp, int oc, Tcl_Obj *CONST ov[]) -{ - - if (oc != 1) { - Tcl_WrongNumArgs(interp, 1, ov, NULL); - return TCL_ERROR; - } - - /* Call - - -- --- ----- -------- */ - c__aproc_beta0(); - -#line 4603 "critcl.tcl" - return TCL_OK; -}} - -# ------------------------------------------------------------------------- - -test critcl-cproc-2.3 {basic cproc, custom C name} -body { - get critcl::cproc snafu {} void {} -cname 1 -} -result {/* ---------------------------------------------------------------------- */ - -static void c_snafu() -{ - -} - -static int -snafu(ClientData cd, Tcl_Interp *interp, int oc, Tcl_Obj *CONST ov[]) -{ - - if (oc != 1) { - Tcl_WrongNumArgs(interp, 1, ov, NULL); - return TCL_ERROR; - } - - /* Call - - -- --- ----- -------- */ - c_snafu(); - -#line 4603 "critcl.tcl" - return TCL_OK; -}} +useLocalFile test/support/crit_utils.tcl # ------------------------------------------------------------------------- -## XXX TODO one to multiple arguments -## XXX TODO optional arguments -## XXX TODO various argument types -## XXX TODO various result types -## XXX TODO ... -testsuiteCleanup +do cproc # Local variables: # mode: tcl diff -Nru critcl-3.1.9/test/cproc-trace.test critcl-3.1.17+dfsg/test/cproc-trace.test --- critcl-3.1.9/test/cproc-trace.test 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/test/cproc-trace.test 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,19 @@ +# critcl::cproc -- Testing with trace code. +# ------------------------------------------------------------------------- +# Setup + +source [file join [file dirname [info script]] support testutilities.tcl] + +testsNeedTcl 8.4 +testsNeedTcltest 2 + +useLocalFile test/support/crit_utils.tcl + +# ------------------------------------------------------------------------- + +trace-do cproc + +# Local variables: +# mode: tcl +# indent-tabs-mode: nil +# End: diff -Nru critcl-3.1.9/test/fbasic.tcl critcl-3.1.17+dfsg/test/fbasic.tcl --- critcl-3.1.9/test/fbasic.tcl 2013-05-10 05:57:04.000000000 +0000 +++ critcl-3.1.17+dfsg/test/fbasic.tcl 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -# Basic test for Critclf diff -Nru critcl-3.1.9/test/md5.test critcl-3.1.17+dfsg/test/md5.test --- critcl-3.1.9/test/md5.test 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/test/md5.test 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,55 @@ +# -*- tcl -*- +# ------------------------------------------------------------------------- +# critcl_md5.test +# ------------------------------------------------------------------------- + +source [file join [file dirname [info script]] support testutilities.tcl] + +testsNeedTcl 8.4 +testsNeedTcltest 2 + +support {} +testing { + # Must be installed + package require critcl_md5c + + puts *\t[join [info loaded] \n*\t] +} + +# ------------------------------------------------------------------------- +## md5c syntax + +test critcl-md5c-1.0.0 {md5c, wrong\#args, not enough} -body { + md5c +} -returnCodes error -result {wrong # args: should be "md5c data ?context?"} + +test critcl-md5c-1.0.1 {md5c, wrong\#args, too many} -body { + md5c STR CTX X +} -returnCodes error -result {wrong # args: should be "md5c data ?context?"} + +# ------------------------------------------------------------------------- +## md5c values + +foreach {n expected msg} { + 0 "d41d8cd98f00b204e9800998ecf8427e" "" + 1 "0cc175b9c0f1b6a831c399e269772661" "a" + 2 "900150983cd24fb0d6963f7d28e17f72" "abc" + 3 "f96b697d7cb7938d525a2f31aaf161d0" "message digest" + 4 "c3fcd3d76192e4007dfb496cca67e13b" "abcdefghijklmnopqrstuvwxyz" + 5 "d174ab98d277d9f5a5611c2c9f419d9f" "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789" + 6 "57edf4a22be3c955ac49da2e2107b67a" "12345678901234567890123456789012345678901234567890123456789012345678901234567890" + 7 "020c3dd6931f7e94ecc99a1f4e4c53e2" "a\$apr1\$a" +} { + test critcl-md5c-2.0.$n "md5c, msg:($msg)" -body { + binary scan [md5c $msg] H* computed + set computed + } -result $expected +} + +# ------------------------------------------------------------------------- +testsuiteCleanup + +# Local variables: +# mode: tcl +# indent-tabs-mode: nil +# End: diff -Nru critcl-3.1.9/test/stubs_container.test critcl-3.1.17+dfsg/test/stubs_container.test --- critcl-3.1.9/test/stubs_container.test 2013-05-10 05:57:04.000000000 +0000 +++ critcl-3.1.17+dfsg/test/stubs_container.test 2017-10-14 02:48:11.000000000 +0000 @@ -4,19 +4,17 @@ # ------------------------------------------------------------------------- -source [file join \ - [file dirname [file join [pwd] [info script]]] \ - testutilities.tcl] +source [file join [file dirname [info script]] support testutilities.tcl] testsNeedTcl 8.4 testsNeedTcltest 2 support { - useLocal lib/util84/lassign.tcl lassign84 - useLocal lib/util84/dict.tcl dict84 + useLocal lib/lassign84/lassign.tcl lassign84 + useLocal lib/dict84/dict.tcl dict84 } testing { - useLocal lib/stubs/container.tcl stubs::container + useLocal lib/stubs_container/container.tcl stubs::container } # ------------------------------------------------------------------------- @@ -221,11 +219,11 @@ stubs::container::interface T TEST lappend R [stubs::container::interfaces $T] stubs::container::interface T FOO - lappend R [stubs::container::interfaces $T] + lappend R [lsort -dict [stubs::container::interfaces $T]] set R } -cleanup { unset T R -} -result {{} TEST {TEST FOO}} +} -result {{} TEST {FOO TEST}} test stubs-container-5.6 {interface, duplicate declaration} -setup { set T [stubs::container::new] diff -Nru critcl-3.1.9/test/stubs_reader.test critcl-3.1.17+dfsg/test/stubs_reader.test --- critcl-3.1.9/test/stubs_reader.test 2013-05-10 05:57:04.000000000 +0000 +++ critcl-3.1.17+dfsg/test/stubs_reader.test 2017-10-14 02:48:11.000000000 +0000 @@ -4,21 +4,19 @@ # ------------------------------------------------------------------------- -source [file join \ - [file dirname [file join [pwd] [info script]]] \ - testutilities.tcl] +source [file join [file dirname [info script]] support testutilities.tcl] testsNeedTcl 8.4 testsNeedTcltest 2 support { - useLocal lib/util84/lassign.tcl lassign84 - useLocal lib/util84/dict.tcl dict84 + useLocal lib/lassign84/lassign.tcl lassign84 + useLocal lib/dict84/dict.tcl dict84 - useLocal lib/stubs/container.tcl stubs::container + useLocal lib/stubs_container/container.tcl stubs::container } testing { - useLocal lib/stubs/reader.tcl stubs::reader + useLocal lib/stubs_reader/reader.tcl stubs::reader } # ------------------------------------------------------------------------- diff -Nru critcl-3.1.9/test/stubs_writer.test critcl-3.1.17+dfsg/test/stubs_writer.test --- critcl-3.1.9/test/stubs_writer.test 2013-05-10 05:57:04.000000000 +0000 +++ critcl-3.1.17+dfsg/test/stubs_writer.test 2017-10-14 02:48:11.000000000 +0000 @@ -4,23 +4,21 @@ # ------------------------------------------------------------------------- -source [file join \ - [file dirname [file join [pwd] [info script]]] \ - testutilities.tcl] +source [file join [file dirname [info script]] support testutilities.tcl] testsNeedTcl 8.4 testsNeedTcltest 2 support { - useLocal lib/util84/lassign.tcl lassign84 - useLocal lib/util84/dict.tcl dict84 + useLocal lib/lassign84/lassign.tcl lassign84 + useLocal lib/dict84/dict.tcl dict84 - useLocal lib/stubs/container.tcl stubs::container - useLocal lib/stubs/reader.tcl stubs::reader - useLocal lib/stubs/genframe.tcl stubs::gen + useLocal lib/stubs_container/container.tcl stubs::container + useLocal lib/stubs_reader/reader.tcl stubs::reader + useLocal lib/stubs_genframe/genframe.tcl stubs::gen } testing { - useLocal lib/stubs/writer.tcl stubs::writer + useLocal lib/stubs_writer/writer.tcl stubs::writer } # ------------------------------------------------------------------------- diff -Nru critcl-3.1.9/test/suites/ccommand.test critcl-3.1.17+dfsg/test/suites/ccommand.test --- critcl-3.1.9/test/suites/ccommand.test 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/test/suites/ccommand.test 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,123 @@ +# -*- tcl -*- +# ------------------------------------------------------------------------- +# critcl::ccommand +# -- Core tests. +# Used via ccommand.test and ccommand-trace.test +# -- Parameters +# (1) suffix ('' | '-trace') +# This parameter affects test naming and directory holding the +# expected results. +# ------------------------------------------------------------------------- +# Parameter validation + +global suffix +if {![info exists suffix]} { + error "Missing parameter 'suffix'. Please define as either empty string, or '-trace'" +} elseif {($suffix ne "") && ($suffix ne "-trace")} { + error "Bad value '$suffix' for parameter 'suffix'. Please define as either empty string, or '-trace'" +} + +# ------------------------------------------------------------------------- +# Setup + +support { + useLocal lib/lassign84/lassign.tcl lassign84 + useLocal lib/dict84/dict.tcl dict84 + + useLocal lib/stubs_container/container.tcl stubs::container + useLocal lib/stubs_reader/reader.tcl stubs::reader + useLocal lib/stubs_genframe/genframe.tcl stubs::gen +} + +testing { + useLocal lib/critcl/critcl.tcl critcl +} + +overrides +on-traced-on + +# ------------------------------------------------------------------------- +## ccommand syntax + +test critcl-ccommand${suffix}-1.0.6 {ccommand, wrong\#args} -constraints tcl8.6plus -body { + critcl::ccommand +} -returnCodes error -result {wrong # args: should be "critcl::ccommand name anames ?arg ...?"} + +test critcl-ccommand${suffix}-1.0.5 {ccommand, wrong\#args} -constraints tcl8.5 -body { + critcl::ccommand +} -returnCodes error -result {wrong # args: should be "critcl::ccommand name anames ..."} + +test critcl-ccommand${suffix}-1.0.4 {ccommand, wrong\#args} -constraints tcl8.4 -body { + critcl::ccommand +} -returnCodes error -result {wrong # args: should be "critcl::ccommand name anames args"} + +# ------------------------------------------------------------------------- +## Go through the various knobs we can use to configure the definition and output + +test critcl-ccommand${suffix}-2.0 {ccommand, defaults} -body { + get critcl::ccommand command {} { + return TCL_OK; + } +} -result [viewFile [localPath test/assets/ccommand${suffix}/2.0]] + +test critcl-ccommand${suffix}-2.1 {ccommand, custom arguments} -body { + get critcl::ccommand command {CD IP OC OV} { + return TCL_OK; + } +} -result [viewFile [localPath test/assets/ccommand${suffix}/2.1]] + +test critcl-ccommand${suffix}-2.2 {ccommand, -cname (custom C name)} -body { + get critcl::ccommand snafu {} { + return TCL_OK; + } -cname 1 +} -result [viewFile [localPath test/assets/ccommand${suffix}/2.2]] + +test critcl-ccommand${suffix}-2.3 {ccommand, namespaced name, and Tcl vs C} -body { + get critcl::ccommand the::command+max {} { + return TCL_OK; + } +} -result [viewFile [localPath test/assets/ccommand${suffix}/2.3]] + +test critcl-ccommand${suffix}-2.4 {ccommand, -delproc} -body { + get critcl::ccommand command {} { + return TCL_OK; + } -delproc DELE +} -result [viewFile [localPath test/assets/ccommand${suffix}/2.0]] + +test critcl-ccommand${suffix}-2.5 {ccommand, -clientdata} -body { + get critcl::ccommand command {} { + return TCL_OK; + } -clientdata ABC +} -result [viewFile [localPath test/assets/ccommand${suffix}/2.0]] + +# ------------------------------------------------------------------------- +## Full builds. + +test critcl-ccommand${suffix}-3.0 {ccommand, defaults} -setup setup -body { + critcl::ccommand command {} { return TCL_OK; } + critcl::cbuild [the-file] + inspect v*.c +} -cleanup cleanup -match glob \ + -result [viewFile [localPath test/assets/ccommand${suffix}/3.0]] + +test critcl-ccommand${suffix}-3.4 {ccommand, -delproc} -setup setup -body { + critcl::ccommand command {} { return TCL_OK; } -delproc DELE + critcl::cbuild [the-file] + inspect v*.c +} -cleanup cleanup -match glob \ + -result [viewFile [localPath test/assets/ccommand${suffix}/3.4]] + +test critcl-ccommand${suffix}-3.5 {ccommand, -clientdata} -setup setup -body { + critcl::ccommand command {} { return TCL_OK; } -clientdata ABC + critcl::cbuild [the-file] + inspect v*.c +} -cleanup cleanup -match glob \ + -result [viewFile [localPath test/assets/ccommand${suffix}/3.5]] + +# ------------------------------------------------------------------------- +testsuiteCleanup + +# Local variables: +# mode: tcl +# indent-tabs-mode: nil +# End: diff -Nru critcl-3.1.9/test/suites/cconst.test critcl-3.1.17+dfsg/test/suites/cconst.test --- critcl-3.1.9/test/suites/cconst.test 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/test/suites/cconst.test 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,94 @@ +# -*- tcl -*- +# ------------------------------------------------------------------------- +# critcl::cconst +# -- Core tests. +# Used via cconst.test and cconst-trace.test +# -- Parameters +# (1) suffix ('' | '-trace') +# This parameter affects test naming and directory holding the +# expected results. +# ------------------------------------------------------------------------- +# Parameter validation + +global suffix +if {![info exists suffix]} { + error "Missing parameter 'suffix'. Please define as either empty string, or '-trace'" +} elseif {($suffix ne "") && ($suffix ne "-trace")} { + error "Bad value '$suffix' for parameter 'suffix'. Please define as either empty string, or '-trace'" +} + +# ------------------------------------------------------------------------- +# Setup + +support { + useLocal lib/lassign84/lassign.tcl lassign84 + useLocal lib/dict84/dict.tcl dict84 + + useLocal lib/stubs_container/container.tcl stubs::container + useLocal lib/stubs_reader/reader.tcl stubs::reader + useLocal lib/stubs_genframe/genframe.tcl stubs::gen +} +testing { + useLocal lib/critcl/critcl.tcl critcl +} + +# Note: The next command does not influence the standard argument- +# and result-types. +#critcl::config lines 0 +overrides +on-traced-on + +# ------------------------------------------------------------------------- +## cconst syntax + +test critcl-cconst${suffix}-1.0 {cconst, wrong args, not enough} -setup { +} -body { + critcl::cconst +} -returnCodes error -result {wrong # args: should be "critcl::cconst name rtype rvalue"} + +test critcl-cconst${suffix}-1.1 {cconst, wrong args, not enough} -setup { +} -body { + critcl::cconst N +} -returnCodes error -result {wrong # args: should be "critcl::cconst name rtype rvalue"} + +test critcl-cconst${suffix}-1.2 {cconst, wrong args, not enough} -setup { +} -body { + critcl::cconst N T +} -returnCodes error -result {wrong # args: should be "critcl::cconst name rtype rvalue"} + +test critcl-cconst${suffix}-1.3 {cconst, wrong args, too many} -setup { +} -body { + critcl::cconst N T R X +} -returnCodes error -result {wrong # args: should be "critcl::cconst name rtype rvalue"} + +test critcl-cconst${suffix}-1.4 {cconst, bad result type (void)} -setup { +} -body { + critcl::cconst N void T +} -returnCodes error -result {Constants cannot be of type "void"} + +# ------------------------------------------------------------------------- +## Go through the various knobs we can use to configure the definition and output + +test critcl-cconst${suffix}-2.0 {cconst, bool, fixed value} -body { + get critcl::cconst alpha bool 1 +} -result [viewFile [localPath test/assets/cconst${suffix}/2.0]] + +test critcl-cconst${suffix}-2.1 {cconst, bool, define} -body { + get critcl::cconst alpha bool FOO +} -result [viewFile [localPath test/assets/cconst${suffix}/2.1]] + +test critcl-cconst${suffix}-2.2 {cconst, bool, function} -body { + get critcl::cconst alpha bool foo() +} -result [viewFile [localPath test/assets/cconst${suffix}/2.2]] + +test critcl-cconst${suffix}-2.3 {cconst, namespaced name} -body { + get critcl::cconst the::alpha bool 0 +} -result [viewFile [localPath test/assets/cconst${suffix}/2.3]] + +# ------------------------------------------------------------------------- +testsuiteCleanup + +# Local variables: +# mode: tcl +# indent-tabs-mode: nil +# End: diff -Nru critcl-3.1.9/test/suites/cdata.test critcl-3.1.17+dfsg/test/suites/cdata.test --- critcl-3.1.9/test/suites/cdata.test 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/test/suites/cdata.test 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,77 @@ +# -*- tcl -*- +# ------------------------------------------------------------------------- +# critcl::cdata +# -- Core tests. +# Used via cdata.test and cdata-trace.test +# -- Parameters +# (1) suffix ('' | '-trace') +# This parameter affects test naming and directory holding the +# expected results. +# ------------------------------------------------------------------------- +# Parameter validation + +global suffix +if {![info exists suffix]} { + error "Missing parameter 'suffix'. Please define as either empty string, or '-trace'" +} elseif {($suffix ne "") && ($suffix ne "-trace")} { + error "Bad value '$suffix' for parameter 'suffix'. Please define as either empty string, or '-trace'" +} + +# ------------------------------------------------------------------------- +# Setup + +support { + useLocal lib/lassign84/lassign.tcl lassign84 + useLocal lib/dict84/dict.tcl dict84 + + useLocal lib/stubs_container/container.tcl stubs::container + useLocal lib/stubs_reader/reader.tcl stubs::reader + useLocal lib/stubs_genframe/genframe.tcl stubs::gen +} +testing { + useLocal lib/critcl/critcl.tcl critcl +} + +overrides +on-traced-on + +# ------------------------------------------------------------------------- +## cdata syntax + +test critcl-cdata${suffix}-1.0 {cdata, wrong args, not enough} -setup { +} -body { + critcl::cdata +} -returnCodes error -result {wrong # args: should be "critcl::cdata name data"} + +test critcl-cdata${suffix}-1.1 {cdata, wrong args, not enough} -setup { +} -body { + critcl::cdata N +} -returnCodes error -result {wrong # args: should be "critcl::cdata name data"} + +test critcl-cdata${suffix}-1.2 {cdata, wrong args, too many} -setup { +} -body { + critcl::cdata N D X +} -returnCodes error -result {wrong # args: should be "critcl::cdata name data"} + +# ------------------------------------------------------------------------- +## Go through the various knobs we can use to configure the definition and output + +test critcl-cdata${suffix}-2.0 {cdata, defaults} -body { + get critcl::cdata alpha beta +} -result [viewFile [localPath test/assets/cdata${suffix}/2.0]] + +test critcl-cdata${suffix}-2.1 {cdata, Tcl vs C identifiers} -body { + get critcl::cdata alpha-x beta +} -result [viewFile [localPath test/assets/cdata${suffix}/2.1]] + +test critcl-cdata${suffix}-2.2 {cdata, namespaced name} -body { + get critcl::cdata the::alpha beta +} -result [viewFile [localPath test/assets/cdata${suffix}/2.2]] + +# ------------------------------------------------------------------------- +testsuiteCleanup + +# Local variables: +# mode: tcl +# indent-tabs-mode: nil +# End: diff -Nru critcl-3.1.9/test/suites/cproc.test critcl-3.1.17+dfsg/test/suites/cproc.test --- critcl-3.1.9/test/suites/cproc.test 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/test/suites/cproc.test 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,238 @@ +# -*- tcl -*- +# ------------------------------------------------------------------------- +# critcl::cproc +# -- Core tests. +# Used via cproc.test and cproc-trace.test +# -- Parameters +# (1) suffix ('' | '-trace') +# This parameter affects test naming and directory holding the +# expected results. +# ------------------------------------------------------------------------- +# Parameter validation + +global suffix +if {![info exists suffix]} { + error "Missing parameter 'suffix'. Please define as either empty string, or '-trace'" +} elseif {($suffix ne "") && ($suffix ne "-trace")} { + error "Bad value '$suffix' for parameter 'suffix'. Please define as either empty string, or '-trace'" +} + +# ------------------------------------------------------------------------- +# Setup + +support { + useLocal lib/lassign84/lassign.tcl lassign84 + useLocal lib/dict84/dict.tcl dict84 + + useLocal lib/stubs_container/container.tcl stubs::container + useLocal lib/stubs_reader/reader.tcl stubs::reader + useLocal lib/stubs_genframe/genframe.tcl stubs::gen +} +testing { + useLocal lib/critcl/critcl.tcl critcl +} + +# Note: The next command does not influence the standard argument- +# and result-types. +overrides +#critcl::config lines 0 +on-traced-on + +# ------------------------------------------------------------------------- +## cproc syntax + +test critcl-cproc${suffix}-1.0.6 {cproc, wrong\#args} -constraints tcl8.6plus -body { + critcl::cproc +} -returnCodes error -result {wrong # args: should be "critcl::cproc name adefs rtype ?body? ?arg ...?"} + +test critcl-cproc${suffix}-1.0.5 {cproc, wrong\#args} -constraints tcl8.5 -body { + critcl::cproc +} -returnCodes error -result {wrong # args: should be "critcl::cproc name adefs rtype ?body? ..."} + +test critcl-cproc${suffix}-1.0.4 {cproc, wrong\#args} -constraints tcl8.4 -body { + critcl::cproc +} -returnCodes error -result {wrong # args: should be "critcl::cproc name adefs rtype ?body? args"} + +# ------------------------------------------------------------------------- +## Go through the various knobs we can use to configure the definition and output + +test critcl-cproc${suffix}-2.0 {cproc, simple name} -body { + get critcl::cproc aproc {} void {} +} -result [viewFile [localPath test/assets/cproc${suffix}/2.0]] + +test critcl-cproc${suffix}-2.1 {cproc, namespaced name} -body { + get critcl::cproc the::aproc {} void {} +} -result [viewFile [localPath test/assets/cproc${suffix}/2.1]] + +test critcl-cproc${suffix}-2.2 {cproc, Tcl vs C identifiers} -body { + get critcl::cproc aproc+beta {} void {} +} -result [viewFile [localPath test/assets/cproc${suffix}/2.2]] + +test critcl-cproc${suffix}-2.3 {cproc, custom C name} -body { + get critcl::cproc snafu {} void {} -cname 1 +} -result [viewFile [localPath test/assets/cproc${suffix}/2.3]] + +test critcl-cproc${suffix}-2.4 {cproc, client data} -body { + get critcl::cproc aproc {} void {} -pass-cdata 1 +} -result [viewFile [localPath test/assets/cproc${suffix}/2.4]] + +test critcl-cproc${suffix}-2.5 {cproc, client data} -body { + get critcl::cproc aproc {} void {} -arg-offset 3 +} -result [viewFile [localPath test/assets/cproc${suffix}/2.5]] + +test critcl-cproc${suffix}-2.6 {cproc, int argument} -body { + get critcl::cproc aproc { + int anargument + } void {} +} -result [viewFile [localPath test/assets/cproc${suffix}/2.6]] + +test critcl-cproc${suffix}-2.7 {cproc, optional int argument} -body { + get critcl::cproc aproc { + int {anargument -1} + } void {} +} -result [viewFile [localPath test/assets/cproc${suffix}/2.7]] + +test critcl-cproc${suffix}-2.8 {cproc, optional args, freely mixed} -body { + get critcl::cproc aproc { + int {x -1} + int y + int {z -1} + } void {} +} -result [viewFile [localPath test/assets/cproc${suffix}/2.8]] + +test critcl-cproc${suffix}-2.9 {cproc, int result} -body { + get critcl::cproc aproc {} int {} +} -result [viewFile [localPath test/assets/cproc${suffix}/2.9]] + +test critcl-cproc${suffix}-2.10 {cproc, optional args} -body { + get critcl::cproc aproc { + int {x -1} + int y + int z + } void {} +} -result [viewFile [localPath test/assets/cproc${suffix}/2.10]] + +test critcl-cproc${suffix}-2.11 {cproc, optional args} -body { + get critcl::cproc aproc { + int x + int y + int {z -1} + } void {} +} -result [viewFile [localPath test/assets/cproc${suffix}/2.11]] + +test critcl-cproc${suffix}-2.12 {cproc, optional args} -body { + get critcl::cproc aproc { + int x + int {y -1} + int z + } void {} +} -result [viewFile [localPath test/assets/cproc${suffix}/2.12]] + +test critcl-cproc${suffix}-2.13 {cproc, variadic int argument} -body { + get critcl::cproc aproc { + int args + } void {} +} -result [viewFile [localPath test/assets/cproc${suffix}/2.13]] + +test critcl-cproc${suffix}-2.14 {cproc, variadic Tcl_Obj* argument} -body { + get critcl::cproc aproc { + object args + } void {} +} -result [viewFile [localPath test/assets/cproc${suffix}/2.14]] + +test critcl-cproc${suffix}-2.15 {cproc, variadic int argument, required in front} -body { + get critcl::cproc aproc { + int x + int y + int args + } void {} +} -result [viewFile [localPath test/assets/cproc${suffix}/2.15]] + +test critcl-cproc${suffix}-2.16 {cproc, variadic int argument, optional in front} -body { + get critcl::cproc aproc { + int {x -1} + int {y -1} + int args + } void {} +} -result [viewFile [localPath test/assets/cproc${suffix}/2.16]] + +test critcl-cproc${suffix}-2.17 {cproc, variadic int argument, mix required/optional in front} -body { + get critcl::cproc aproc { + int x + int {y -1} + int args + } void {} +} -result [viewFile [localPath test/assets/cproc${suffix}/2.17]] + +test critcl-cproc${suffix}-2.18 {cproc, variadic int argument, mix optional/required in front} -body { + get critcl::cproc aproc { + int {x -1} + int y + int args + } void {} +} -result [viewFile [localPath test/assets/cproc${suffix}/2.18]] + +# ------------------------------------------------------------------------- +# Vary the result type of the function. Covers all builtin result types. + +test critcl-cproc${suffix}-3.0 {cproc, void result} -body { + get critcl::cproc aproc {} void { } +} -result [viewFile [localPath test/assets/cproc${suffix}/3.0]] + +test critcl-cproc${suffix}-3.1 {cproc, Tcl-code result} -body { + get critcl::cproc aproc {} ok { return TCL_OK; } +} -result [viewFile [localPath test/assets/cproc${suffix}/3.1]] + +test critcl-cproc${suffix}-3.2 {cproc, int result} -body { + get critcl::cproc aproc {} int { return 0; } +} -result [viewFile [localPath test/assets/cproc${suffix}/3.2]] + +test critcl-cproc${suffix}-3.3 {cproc, bool result} -body { + get critcl::cproc aproc {} bool { return 1; } +} -result [viewFile [localPath test/assets/cproc${suffix}/3.3]] + +test critcl-cproc${suffix}-3.4 {cproc, boolean result} -body { + get critcl::cproc aproc {} boolean { return 1; } +} -result [viewFile [localPath test/assets/cproc${suffix}/3.4]] + +test critcl-cproc${suffix}-3.5 {cproc, long result} -body { + get critcl::cproc aproc {} long { return 1; } +} -result [viewFile [localPath test/assets/cproc${suffix}/3.5]] + +test critcl-cproc${suffix}-3.6 {cproc, wideint result} -body { + get critcl::cproc aproc {} wideint { return 1; } +} -result [viewFile [localPath test/assets/cproc${suffix}/3.6]] + +test critcl-cproc${suffix}-3.7 {cproc, double result} -body { + get critcl::cproc aproc {} double { return 0.; } +} -result [viewFile [localPath test/assets/cproc${suffix}/3.7]] + +test critcl-cproc${suffix}-3.8 {cproc, float result} -body { + get critcl::cproc aproc {} float { return 0.; } +} -result [viewFile [localPath test/assets/cproc${suffix}/3.8]] + +test critcl-cproc${suffix}-3.9 {cproc, vstring result} -body { + get critcl::cproc aproc {} vstring { return "foo"; } +} -result [viewFile [localPath test/assets/cproc${suffix}/3.9]] + +test critcl-cproc${suffix}-3.10 {cproc, dstring result} -body { + get critcl::cproc aproc {} dstring { return alloc_string("bar"); } +} -result [viewFile [localPath test/assets/cproc${suffix}/3.10]] + +test critcl-cproc${suffix}-3.11 {cproc, object result} -body { + get critcl::cproc aproc {} object { return Tcl_NewIntObj(0); } +} -result [viewFile [localPath test/assets/cproc${suffix}/3.11]] + +# ------------------------------------------------------------------------- +## XXX TODO one to multiple arguments +## XXX TODO optional arguments +## XXX TODO various argument types +## XXX TODO various result types +## XXX TODO ... + +testsuiteCleanup + +# Local variables: +# mode: tcl +# indent-tabs-mode: nil +# End: diff -Nru critcl-3.1.9/test/support/crit_utils.tcl critcl-3.1.17+dfsg/test/support/crit_utils.tcl --- critcl-3.1.9/test/support/crit_utils.tcl 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/test/support/crit_utils.tcl 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,98 @@ +## -*- tcl -*- +# ------------------------------------------------------------------------- + +proc do {suite} { + global suffix + set suffix "" + uplevel 1 [list source [file join [file dirname [info script]] suites ${suite}.test]] +} + +proc trace-do {suite} { + global suffix + set suffix "-trace" + uplevel 1 [list source [file join [file dirname [info script]] suites ${suite}.test]] + + # Stop tracing code injection for the files coming after this one, + # and reset the marker. + critcl::config trace 0 + #unset ::critcl::v::__trace__ +} + +proc on-traced-on {} { + global suffix + if {$suffix eq {}} return + # Activate trace injection. Run a dummy cproc, in a collection + # environment, to get the once-only generated code out of the way. + uplevel 1 {useLocal lib/critcl-cutil/cutil.tcl critcl::cutil} + critcl::config trace 1 + uplevel 1 {critcl::collect { critcl::cproc __ {} void {}}} + return +} + +proc get {args} { + set t [string trim [critcl::collect $args]] + #regsub -all -- {#line \d+ } $t {#line XX } t + return $t +} + +proc setup {} { + critcl::fastuuid ;# no md5, counter, reset + set critcl::v::this FAKE ;# fake a file-name + critcl::cache [localPath test/CACHE] ;# choose cache + return +} + +proc the-file {} { + return $critcl::v::this +} + +proc cleanup {} { + unset critcl::v::this + unset critcl::v::code + unset critcl::v::delproc + unset critcl::v::clientdata + file delete -force -- [localPath test/CACHE] + return +} + +proc inspect {pattern} { + viewFile [lindex [glob -directory [critcl::cache] $pattern] 0] +} + +proc overrides {} { + critcl::fastuuid ;# no md5, use counter + critcl::config lines 0 ;# no #line, mostly + critcl::config keepsrc 1 ;# keep sources in cache + + # Disable actual compilation + proc ::critcl::Compile {tclfile origin cfile obj} { + } + + proc ::critcl::Link {file} { + } + + proc ::critcl::ExecWithLogging {cmdline okmsg errmsg} { + } + + proc ::critcl::Exec {cmdline} { + } + + proc ::critcl::Load {file} { + } +} + + +tcltest::customMatch glob-check G +proc G {p s} { + set map [list \n \\n \t \\t { } \\s] + set buf {} + foreach c [split $p {}] { + append buf $c + if {![string match ${buf}* $s]} { + puts FAIL|[string map $map ${buf}*]| + } + } + return 1 +} + +# ------------------------------------------------------------------------- diff -Nru critcl-3.1.9/test/support/testutilities.tcl critcl-3.1.17+dfsg/test/support/testutilities.tcl --- critcl-3.1.9/test/support/testutilities.tcl 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/test/support/testutilities.tcl 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,725 @@ +# -*- tcl -*- +# Testsuite utilities / boilerplate +# Copyright (c) 2006-2016, Andreas Kupries +# +# + +namespace eval ::tcllib::testutils { + variable version 1.2 + variable self [file dirname [file join [pwd] [info script]]] + variable tcllib [file dirname $self] + variable tag "" + variable theEnv ; # Saved environment. +} + +# ### ### ### ######### ######### ######### +## Commands for common functions and boilerplate actions required by +## many testsuites of Tcllib modules and packages in a central place +## for easier maintenance. + +# ### ### ### ######### ######### ######### +## Declare the minimal version of Tcl required to run the package +## tested by this testsuite, and its dependencies. + +proc testsNeedTcl {version} { + # This command ensures that a minimum version of Tcl is used to + # run the tests in the calling testsuite. If the minimum is not + # met by the active interpreter we forcibly bail out of the + # testsuite calling the command. The command has to be called + # immediately after loading the utilities. + + if {[package vsatisfies [package provide Tcl] $version]} return + + puts " Aborting the tests found in \"[file tail [info script]]\"" + puts " Requiring at least Tcl $version, have [package present Tcl]." + + # This causes a 'return' in the calling scope. + return -code return +} + +# ### ### ### ######### ######### ######### +## Declare the minimum version of Tcltest required to run the +## testsuite. + +proc testsNeedTcltest {version} { + # This command ensure that a minimum version of the Tcltest + # support package is used to run the tests in the calling + # testsuite. If the minimum is not met by the loaded package we + # forcibly bail out of the testsuite calling the command. The + # command has to be called after loading the utilities. The only + # command allowed to come before it is 'textNeedTcl' above. + + # Note that this command will try to load a suitable version of + # Tcltest if the package has not been loaded yet. + + if {[lsearch [namespace children] ::tcltest] == -1} { + if {![catch { + package require tcltest $version + }]} { + namespace import -force ::tcltest::* + InitializeTclTest + return + } + } elseif {[package vcompare [package present tcltest] $version] >= 0} { + InitializeTclTest + return + } + + puts " Aborting the tests found in [file tail [info script]]." + puts " Requiring at least tcltest $version, have [package present tcltest]" + + # This causes a 'return' in the calling scope. + return -code return +} + +proc testsNeed {name version} { + # This command ensures that a minimum version of package is + # used to run the tests in the calling testsuite. If the minimum + # is not met by the active interpreter we forcibly bail out of the + # testsuite calling the command. The command has to be called + # immediately after loading the utilities. + + if {[package vsatisfies [package provide $name] $version]} return + + puts " Aborting the tests found in \"[file tail [info script]]\"" + puts " Requiring at least $name $version, have [package present $name]." + + # This causes a 'return' in the calling scope. + return -code return +} + +# ### ### ### ######### ######### ######### + +## Save/restore the environment, for testsuites which have to +## manipulate it to (1) either achieve the effects they test +## for/against, or (2) to shield themselves against manipulation by +## the environment. We have examples for both in 'fileutil' (1), and +## 'doctools' (2). +## +## Saving is done automatically at the beginning of a test file, +## through this module. Restoration is done semi-automatically. We +## __cannot__ hook into the tcltest cleanup hook It is already used by +## all.tcl to transfer the information from the slave doing the actual +## tests to the master. Here the hook is only an alias, and +## unmodifiable. We create a new cleanup command which runs both our +## environment cleanup, and the regular one. All .test files are +## modified to use the new cleanup. + +proc ::tcllib::testutils::SaveEnvironment {} { + global env + variable theEnv [array get env] + return +} + +proc ::tcllib::testutils::RestoreEnvironment {} { + global env + variable theEnv + foreach k [array names env] { + unset env($k) + } + array set env $theEnv + return +} + +proc testsuiteCleanup {} { + ::tcllib::testutils::RestoreEnvironment + ::tcltest::cleanupTests + return +} + +proc array_unset {a {pattern *}} { + upvar 1 $a array + foreach k [array names array $pattern] { + unset array($k) + } + return +} + +# ### ### ### ######### ######### ######### +## Newer versions of the Tcltest support package for testsuite provide +## various features which make the creation and maintenance of +## testsuites much easier. I consider it important to have these +## features even if an older version of Tcltest is loaded. To this end +## we now provide emulations and implementations, conditional on the +## version of Tcltest found to be active. + +# ### ### ### ######### ######### ######### +## Easy definition and initialization of test constraints. + +proc InitializeTclTest {} { + global tcltestinit + if {[info exists tcltestinit] && $tcltestinit} return + set tcltestinit 1 + + if {![package vsatisfies [package provide tcltest] 2.0]} { + # Tcltest 2.0+ provides a documented public API to define and + # initialize a test constraint. For earlier versions of the + # package the user has to directly set a non-public undocumented + # variable in the package's namespace. We create a command doing + # this and emulating the public API. + + proc ::tcltest::testConstraint {c args} { + variable testConstraints + if {[llength $args] < 1} { + if {[info exists testConstraints($c)]} { + return $testConstraints($c) + } else { + return {} + } + } else { + set testConstraints($c) [lindex $args 0] + } + return + } + + namespace eval ::tcltest { + namespace export testConstraint + } + uplevel \#0 {namespace import -force ::tcltest::*} + } + + # ### ### ### ######### ######### ######### + ## Define a set of standard constraints + + ::tcltest::testConstraint tcl8.3only \ + [expr {![package vsatisfies [package provide Tcl] 8.4]}] + + ::tcltest::testConstraint tcl8.3plus \ + [expr {[package vsatisfies [package provide Tcl] 8.3]}] + + ::tcltest::testConstraint tcl8.4plus \ + [expr {[package vsatisfies [package provide Tcl] 8.4]}] + + ::tcltest::testConstraint tcl8.5plus \ + [expr {[package vsatisfies [package provide Tcl] 8.5]}] + + ::tcltest::testConstraint tcl8.6plus \ + [expr {[package vsatisfies [package provide Tcl] 8.6]}] + + ::tcltest::testConstraint tcl8.4minus \ + [expr {![package vsatisfies [package provide Tcl] 8.5]}] + + ::tcltest::testConstraint tcl8.5 \ + [expr { + [ tcltest::testConstraint tcl8.5plus] && + ![tcltest::testConstraint tcl8.6plus] + }] + + ::tcltest::testConstraint tcl8.4 \ + [expr { + [ tcltest::testConstraint tcl8.4plus] && + ![tcltest::testConstraint tcl8.5plus] + }] + + # ### ### ### ######### ######### ######### + ## Cross-version code for the generation of the error messages created + ## by Tcl procedures when called with the wrong number of arguments, + ## either too many, or not enough. + + if {[package vsatisfies [package provide Tcl] 8.6]} { + # 8.6+ + proc ::tcltest::wrongNumArgs {functionName argList missingIndex} { + if {[string match args [lindex $argList end]]} { + set argList [lreplace $argList end end ?arg ...?] + } + if {$argList != {}} {set argList " $argList"} + set msg "wrong # args: should be \"$functionName$argList\"" + return $msg + } + + proc ::tcltest::tooManyArgs {functionName argList} { + # create a different message for functions with no args + if {[llength $argList]} { + if {[string match args [lindex $argList end]]} { + set argList [lreplace $argList end end ?arg ...?] + } + set msg "wrong # args: should be \"$functionName $argList\"" + } else { + set msg "wrong # args: should be \"$functionName\"" + } + return $msg + } + } elseif {[package vsatisfies [package provide Tcl] 8.5]} { + # 8.5 + proc ::tcltest::wrongNumArgs {functionName argList missingIndex} { + if {[string match args [lindex $argList end]]} { + set argList [lreplace $argList end end ...] + } + if {$argList != {}} {set argList " $argList"} + set msg "wrong # args: should be \"$functionName$argList\"" + return $msg + } + + proc ::tcltest::tooManyArgs {functionName argList} { + # create a different message for functions with no args + if {[llength $argList]} { + if {[string match args [lindex $argList end]]} { + set argList [lreplace $argList end end ...] + } + set msg "wrong # args: should be \"$functionName $argList\"" + } else { + set msg "wrong # args: should be \"$functionName\"" + } + return $msg + } + } elseif {[package vsatisfies [package provide Tcl] 8.4]} { + # 8.4+ + proc ::tcltest::wrongNumArgs {functionName argList missingIndex} { + if {$argList != {}} {set argList " $argList"} + set msg "wrong # args: should be \"$functionName$argList\"" + return $msg + } + + proc ::tcltest::tooManyArgs {functionName argList} { + # create a different message for functions with no args + if {[llength $argList]} { + set msg "wrong # args: should be \"$functionName $argList\"" + } else { + set msg "wrong # args: should be \"$functionName\"" + } + return $msg + } + } else { + # 8.2+ + proc ::tcltest::wrongNumArgs {functionName argList missingIndex} { + set msg "no value given for parameter " + append msg "\"[lindex $argList $missingIndex]\" to " + append msg "\"$functionName\"" + return $msg + } + + proc ::tcltest::tooManyArgs {functionName argList} { + set msg "called \"$functionName\" with too many arguments" + return $msg + } + } + + # ### ### ### ######### ######### ######### + ## tclTest::makeFile result API changed for 2.0 + + if {![package vsatisfies [package provide tcltest] 2.0]} { + + # The 'makeFile' in Tcltest 1.0 returns a list of all the + # paths generated so far, whereas the 'makeFile' in 2.0+ + # returns only the path of the newly generated file. We + # standardize on the more useful behaviour of 2.0+. If 1.x is + # present we have to create an emulation layer to get the + # wanted result. + + # 1.0 is not fully correctly described. If the file was + # created before no list is returned at all. We force things + # by adding a line to the old procedure which makes the result + # unconditional (the name of the file/dir created). + + # The same change applies to 'makeDirectory' + + if {![llength [info commands ::tcltest::makeFile_1]]} { + # Marker first. + proc ::tcltest::makeFile_1 {args} {} + + # Extend procedures with command to return the required + # full name. + proc ::tcltest::makeFile {contents name} \ + [info body ::tcltest::makeFile]\n[list set fullName] + + proc ::tcltest::makeDirectory {name} \ + [info body ::tcltest::makeDirectory]\n[list set fullName] + + # Re-export + namespace eval ::tcltest { + namespace export makeFile makeDirectory + } + uplevel \#0 {namespace import -force ::tcltest::*} + } + } + + # ### ### ### ######### ######### ######### + ## Extended functionality, creation of binary temp. files. + ## Also creation of paths for temp. files + + proc ::tcltest::makeBinaryFile {data f} { + set path [makeFile {} $f] + set ch [open $path w] + fconfigure $ch -translation binary + puts -nonewline $ch $data + close $ch + return $path + } + + proc ::tcltest::tempPath {path} { + variable temporaryDirectory + return [file join $temporaryDirectory $path] + } + + namespace eval ::tcltest { + namespace export wrongNumArgs tooManyArgs + namespace export makeBinaryFile tempPath + } + uplevel \#0 {namespace import -force ::tcltest::*} + return +} + +# ### ### ### ######### ######### ######### +## Command to construct wrong/args messages for Snit methods. + +proc snitErrors {} { + if {[package vsatisfies [package provide snit] 2]} { + # Snit 2.0+ + + proc snitWrongNumArgs {obj method arglist missingIndex} { + regsub {^.*Snit_method} $method {} method + tcltest::wrongNumArgs "$obj $method" $arglist $missingIndex + } + + proc snitTooManyArgs {obj method arglist} { + regsub {^.*Snit_method} $method {} method + tcltest::tooManyArgs "$obj $method" $arglist + } + + } else { + proc snitWrongNumArgs {obj method arglist missingIndex} { + incr missingIndex 4 + tcltest::wrongNumArgs "$method" [linsert $arglist 0 \ + type selfns win self] $missingIndex + } + + proc snitTooManyArgs {obj method arglist} { + tcltest::tooManyArgs "$method" [linsert $arglist 0 \ + type selfns win self] + } + } +} + +# ### ### ### ######### ######### ######### +## Commands to load files from various locations within the local +## Tcllib, and the loading of local Tcllib packages. None of them goes +## through the auto-loader, nor the regular package management, to +## avoid contamination of the testsuite by packages and code outside +## of the Tcllib under test. + +proc localPath {fname} { + return [file join $::tcltest::testsDirectory $fname] +} + +proc tcllibPath {fname} { + return [file join $::tcllib::testutils::tcllib $fname] +} + +proc useLocalFile {fname} { + return [uplevel 1 [list source [localPath $fname]]] +} + +proc useTcllibFile {fname} { + return [uplevel 1 [list source [tcllibPath $fname]]] +} + +proc use {fname pname args} { + set nsname ::$pname + if {[llength $args]} {set nsname [lindex $args 0]} + + package forget $pname + catch {namespace delete $nsname} + + if {[catch { + uplevel 1 [list useTcllibFile $fname] + } msg]} { + puts " Aborting the tests found in \"[file tail [info script]]\"" + puts " Error in [file tail $fname]: $msg" + return -code error "" + } + + puts "$::tcllib::testutils::tag [list $pname] [package present $pname]" + return +} + +proc useKeep {fname pname args} { + set nsname ::$pname + if {[llength $args]} {set nsname [lindex $args 0]} + + package forget $pname + + # Keep = Keep the existing namespace of the package. + # = Do not delete it. This is required if the + # namespace contains commands created by a + # binary package, like 'tcllibc'. They cannot + # be re-created. + ## + ## catch {namespace delete $nsname} + + if {[catch { + uplevel 1 [list useTcllibFile $fname] + } msg]} { + puts " Aborting the tests found in \"[file tail [info script]]\"" + puts " Error in [file tail $fname]: $msg" + return -code error "" + } + + puts "$::tcllib::testutils::tag [list $pname] [package present $pname]" + return +} + +proc useLocal {fname pname args} { + set nsname ::$pname + if {[llength $args]} {set nsname [lindex $args 0]} + + package forget $pname + catch {namespace delete $nsname} + + if {[catch { + uplevel 1 [list useLocalFile $fname] + } msg]} { + puts " Aborting the tests found in \"[file tail [info script]]\"" + puts " Error in [file tail $fname]: $msg" + return -code error "" + } + + puts "$::tcllib::testutils::tag [list $pname] [package present $pname]" + return +} + +proc useLocalKeep {fname pname args} { + set nsname ::$pname + if {[llength $args]} {set nsname [lindex $args 0]} + + package forget $pname + + # Keep = Keep the existing namespace of the package. + # = Do not delete it. This is required if the + # namespace contains commands created by a + # binary package, like 'tcllibc'. They cannot + # be re-created. + ## + ## catch {namespace delete $nsname} + + if {[catch { + uplevel 1 [list useLocalFile $fname] + } msg]} { + puts " Aborting the tests found in \"[file tail [info script]]\"" + puts " Error in [file tail $fname]: $msg" + return -code error "" + } + + puts "$::tcllib::testutils::tag [list $pname] [package present $pname]" + return +} + +proc useAccel {acc fname pname args} { + set use [expr {$acc ? "useKeep" : "use"}] + uplevel 1 [linsert $args 0 $use $fname $pname] +} + +proc support {script} { + InitializeTclTest + set ::tcllib::testutils::tag "-" + if {[catch { + uplevel 1 $script + } msg]} { + set prefix "SETUP Error (Support): " + puts $prefix[join [split $::errorInfo \n] "\n$prefix"] + + return -code return + } + return +} + +proc testing {script} { + InitializeTclTest + set ::tcllib::testutils::tag "*" + if {[catch { + uplevel 1 $script + } msg]} { + set prefix "SETUP Error (Testing): " + puts $prefix[join [split $::errorInfo \n] "\n$prefix"] + + return -code return + } + return +} + +proc useTcllibC {} { + set index [tcllibPath tcllibc/pkgIndex.tcl] + if {![file exists $index]} { + # Might have an external tcllibc + if {![catch { + package require tcllibc + }]} { + puts "$::tcllib::testutils::tag tcllibc [package present tcllibc]" + puts "$::tcllib::testutils::tag tcllibc = [package ifneeded tcllibc [package present tcllibc]]" + return 1 + } + + return 0 + } + + set ::dir [file dirname $index] + uplevel #0 [list source $index] + unset ::dir + + package require tcllibc + + puts "$::tcllib::testutils::tag tcllibc [package present tcllibc]" + puts "$::tcllib::testutils::tag tcllibc = [package ifneeded tcllibc [package present tcllibc]]" + return 1 +} + +# ### ### ### ######### ######### ######### +## General utilities + +# - dictsort - +# +# Sort a dictionary by its keys. I.e. reorder the contents of the +# dictionary so that in its list representation the keys are found in +# ascending alphabetical order. In other words, this command creates +# a canonical list representation of the input dictionary, suitable +# for direct comparison. +# +# Arguments: +# dict: The dictionary to sort. +# +# Result: +# The canonical representation of the dictionary. + +proc dictsort {dict} { + array set a $dict + set out [list] + foreach key [lsort [array names a]] { + lappend out $key $a($key) + } + return $out +} + +# ### ### ### ######### ######### ######### +## Putting strings together, if they cannot be expressed easily as one +## string due to quoting problems. + +proc cat {args} { + return [join $args ""] +} + +# ### ### ### ######### ######### ######### +## Mini-logging facility, can also be viewed as an accumulator for +## complex results. +# +# res! : clear accumulator. +# res+ : add arguments to accumulator. +# res? : query contents of accumulator. +# res?lines : query accumulator and format as +# multiple lines, one per list element. + +proc res! {} { + variable result {} + return +} + +proc res+ {args} { + variable result + lappend result $args + return +} + +proc res? {} { + variable result + return $result +} + +proc res?lines {} { + return [join [res?] \n] +} + +# ### ### ### ######### ######### ######### +## Helper commands to deal with packages +## which have multiple implementations, i.e. +## their pure Tcl base line and one or more +## accelerators. We are assuming a specific +## API for accessing the data about available +## accelerators, switching between them, etc. + +# == Assumed API == +# +# KnownImplementations -- +# Returns list of all known implementations. +# +# Implementations -- +# Returns list of activated implementations. +# A subset of 'KnownImplementations' +# +# Names -- +# Returns dict mapping all known implementations +# to human-readable strings for output during a +# test run +# +# LoadAccelerator accel -- +# Tries to make the implementation named +# 'accel' available for use. Result is boolean. +# True indicates a successful activation. +# +# SwitchTo accel -- +# Activate the implementation named 'accel'. +# The empty string disables all implementations. + +proc TestAccelInit {namespace} { + # Disable all implementations ... Base state. + ${namespace}::SwitchTo {} + + # List the implementations. + array set map [${namespace}::Names] + foreach e [${namespace}::KnownImplementations] { + if {[${namespace}::LoadAccelerator $e]} { + puts "> $map($e)" + } + } + return +} + +proc TestAccelDo {namespace var script} { + upvar 1 $var impl + foreach impl [${namespace}::Implementations] { + ${namespace}::SwitchTo $impl + uplevel 1 $script + } + return +} + +proc TestAccelExit {namespace} { + # Reset the system to a fully inactive state. + ${namespace}::SwitchTo {} + return +} + +# ### ### ### ######### ######### ######### +## + +proc TestFiles {pattern} { + if {[package vsatisfies [package provide Tcl] 8.3]} { + # 8.3+ -directory ok + set flist [glob -nocomplain -directory $::tcltest::testsDirectory $pattern] + } else { + # 8.2 or less, no -directory + set flist [glob -nocomplain [file join $::tcltest::testsDirectory $pattern]] + } + foreach f [lsort -dict $flist] { + uplevel 1 [list source $f] + } + return +} + +proc TestFilesGlob {pattern} { + if {[package vsatisfies [package provide Tcl] 8.3]} { + # 8.3+ -directory ok + set flist [glob -nocomplain -directory $::tcltest::testsDirectory $pattern] + } else { + # 8.2 or less, no -directory + set flist [glob -nocomplain [file join $::tcltest::testsDirectory $pattern]] + } + return [lsort -dict $flist] +} + +# ### ### ### ######### ######### ######### +## + +::tcllib::testutils::SaveEnvironment + +# ### ### ### ######### ######### ######### +package provide tcllib::testutils $::tcllib::testutils::version +puts "- tcllib::testutils [package present tcllib::testutils]" +return diff -Nru critcl-3.1.9/test/testutilities.tcl critcl-3.1.17+dfsg/test/testutilities.tcl --- critcl-3.1.9/test/testutilities.tcl 2013-05-10 05:57:04.000000000 +0000 +++ critcl-3.1.17+dfsg/test/testutilities.tcl 1970-01-01 00:00:00.000000000 +0000 @@ -1,711 +0,0 @@ -# -*- tcl -*- -# Testsuite utilities / boilerplate -# Copyright (c) 2006, Andreas Kupries - -namespace eval ::tcllib::testutils { - variable version 1.2 - variable self [file dirname [file join [pwd] [info script]]] - variable tcllib [file dirname $self] - variable tag "" - variable theEnv ; # Saved environment. -} - -# ### ### ### ######### ######### ######### -## Commands for common functions and boilerplate actions required by -## many testsuites of Tcllib modules and packages in a central place -## for easier maintenance. - -# ### ### ### ######### ######### ######### -## Declare the minimal version of Tcl required to run the package -## tested by this testsuite, and its dependencies. - -proc testsNeedTcl {version} { - # This command ensures that a minimum version of Tcl is used to - # run the tests in the calling testsuite. If the minimum is not - # met by the active interpreter we forcibly bail out of the - # testsuite calling the command. The command has to be called - # immediately after loading the utilities. - - if {[package vsatisfies [package provide Tcl] $version]} return - - puts " Aborting the tests found in \"[file tail [info script]]\"" - puts " Requiring at least Tcl $version, have [package present Tcl]." - - # This causes a 'return' in the calling scope. - return -code return -} - -# ### ### ### ######### ######### ######### -## Declare the minimum version of Tcltest required to run the -## testsuite. - -proc testsNeedTcltest {version} { - # This command ensure that a minimum version of the Tcltest - # support package is used to run the tests in the calling - # testsuite. If the minimum is not met by the loaded package we - # forcibly bail out of the testsuite calling the command. The - # command has to be called after loading the utilities. The only - # command allowed to come before it is 'textNeedTcl' above. - - # Note that this command will try to load a suitable version of - # Tcltest if the package has not been loaded yet. - - if {[lsearch [namespace children] ::tcltest] == -1} { - if {![catch { - package require tcltest $version - }]} { - namespace import -force ::tcltest::* - InitializeTclTest - return - } - } elseif {[package vcompare [package present tcltest] $version] >= 0} { - InitializeTclTest - return - } - - puts " Aborting the tests found in [file tail [info script]]." - puts " Requiring at least tcltest $version, have [package present tcltest]" - - # This causes a 'return' in the calling scope. - return -code return -} - -proc testsNeed {name version} { - # This command ensures that a minimum version of package is - # used to run the tests in the calling testsuite. If the minimum - # is not met by the active interpreter we forcibly bail out of the - # testsuite calling the command. The command has to be called - # immediately after loading the utilities. - - if {[package vsatisfies [package provide $name] $version]} return - - puts " Aborting the tests found in \"[file tail [info script]]\"" - puts " Requiring at least $name $version, have [package present $name]." - - # This causes a 'return' in the calling scope. - return -code return -} - -# ### ### ### ######### ######### ######### - -## Save/restore the environment, for testsuites which have to -## manipulate it to (1) either achieve the effects they test -## for/against, or (2) to shield themselves against manipulation by -## the environment. We have examples for both in 'fileutil' (1), and -## 'doctools' (2). -## -## Saving is done automatically at the beginning of a test file, -## through this module. Restoration is done semi-automatically. We -## __cannot__ hook into the tcltest cleanup hook It is already used by -## all.tcl to transfer the information from the slave doing the actual -## tests to the master. Here the hook is only an alias, and -## unmodifiable. We create a new cleanup command which runs both our -## environment cleanup, and the regular one. All .test files are -## modified to use the new cleanup. - -proc ::tcllib::testutils::SaveEnvironment {} { - global env - variable theEnv [array get env] - return -} - -proc ::tcllib::testutils::RestoreEnvironment {} { - global env - variable theEnv - foreach k [array names env] { - unset env($k) - } - array set env $theEnv - return -} - -proc testsuiteCleanup {} { - ::tcllib::testutils::RestoreEnvironment - ::tcltest::cleanupTests - return -} - -proc array_unset {a {pattern *}} { - upvar 1 $a array - foreach k [array names array $pattern] { - unset array($k) - } - return -} - -# ### ### ### ######### ######### ######### -## Newer versions of the Tcltest support package for testsuite provide -## various features which make the creation and maintenance of -## testsuites much easier. I consider it important to have these -## features even if an older version of Tcltest is loaded. To this end -## we now provide emulations and implementations, conditional on the -## version of Tcltest found to be active. - -# ### ### ### ######### ######### ######### -## Easy definition and initialization of test constraints. - -proc InitializeTclTest {} { - global tcltestinit - if {[info exists tcltestinit] && $tcltestinit} return - set tcltestinit 1 - - if {![package vsatisfies [package provide tcltest] 2.0]} { - # Tcltest 2.0+ provides a documented public API to define and - # initialize a test constraint. For earlier versions of the - # package the user has to directly set a non-public undocumented - # variable in the package's namespace. We create a command doing - # this and emulating the public API. - - proc ::tcltest::testConstraint {c args} { - variable testConstraints - if {[llength $args] < 1} { - if {[info exists testConstraints($c)]} { - return $testConstraints($c) - } else { - return {} - } - } else { - set testConstraints($c) [lindex $args 0] - } - return - } - - namespace eval ::tcltest { - namespace export testConstraint - } - uplevel \#0 {namespace import -force ::tcltest::*} - } - - # ### ### ### ######### ######### ######### - ## Define a set of standard constraints - - ::tcltest::testConstraint tcl8.3only \ - [expr {![package vsatisfies [package provide Tcl] 8.4]}] - - ::tcltest::testConstraint tcl8.3plus \ - [expr {[package vsatisfies [package provide Tcl] 8.3]}] - - ::tcltest::testConstraint tcl8.4plus \ - [expr {[package vsatisfies [package provide Tcl] 8.4]}] - - ::tcltest::testConstraint tcl8.5plus \ - [expr {[package vsatisfies [package provide Tcl] 8.5]}] - - ::tcltest::testConstraint tcl8.6plus \ - [expr {[package vsatisfies [package provide Tcl] 8.6]}] - - ::tcltest::testConstraint tcl8.4minus \ - [expr {![package vsatisfies [package provide Tcl] 8.5]}] - - # ### ### ### ######### ######### ######### - ## Cross-version code for the generation of the error messages created - ## by Tcl procedures when called with the wrong number of arguments, - ## either too many, or not enough. - - if {[package vsatisfies [package provide Tcl] 8.6]} { - # 8.6+ - proc ::tcltest::wrongNumArgs {functionName argList missingIndex} { - if {[string match args [lindex $argList end]]} { - set argList [lreplace $argList end end ?arg ...?] - } - if {$argList != {}} {set argList " $argList"} - set msg "wrong # args: should be \"$functionName$argList\"" - return $msg - } - - proc ::tcltest::tooManyArgs {functionName argList} { - # create a different message for functions with no args - if {[llength $argList]} { - if {[string match args [lindex $argList end]]} { - set argList [lreplace $argList end end ?arg ...?] - } - set msg "wrong # args: should be \"$functionName $argList\"" - } else { - set msg "wrong # args: should be \"$functionName\"" - } - return $msg - } - } elseif {[package vsatisfies [package provide Tcl] 8.5]} { - # 8.5 - proc ::tcltest::wrongNumArgs {functionName argList missingIndex} { - if {[string match args [lindex $argList end]]} { - set argList [lreplace $argList end end ...] - } - if {$argList != {}} {set argList " $argList"} - set msg "wrong # args: should be \"$functionName$argList\"" - return $msg - } - - proc ::tcltest::tooManyArgs {functionName argList} { - # create a different message for functions with no args - if {[llength $argList]} { - if {[string match args [lindex $argList end]]} { - set argList [lreplace $argList end end ...] - } - set msg "wrong # args: should be \"$functionName $argList\"" - } else { - set msg "wrong # args: should be \"$functionName\"" - } - return $msg - } - } elseif {[package vsatisfies [package provide Tcl] 8.4]} { - # 8.4+ - proc ::tcltest::wrongNumArgs {functionName argList missingIndex} { - if {$argList != {}} {set argList " $argList"} - set msg "wrong # args: should be \"$functionName$argList\"" - return $msg - } - - proc ::tcltest::tooManyArgs {functionName argList} { - # create a different message for functions with no args - if {[llength $argList]} { - set msg "wrong # args: should be \"$functionName $argList\"" - } else { - set msg "wrong # args: should be \"$functionName\"" - } - return $msg - } - } else { - # 8.2+ - proc ::tcltest::wrongNumArgs {functionName argList missingIndex} { - set msg "no value given for parameter " - append msg "\"[lindex $argList $missingIndex]\" to " - append msg "\"$functionName\"" - return $msg - } - - proc ::tcltest::tooManyArgs {functionName argList} { - set msg "called \"$functionName\" with too many arguments" - return $msg - } - } - - # ### ### ### ######### ######### ######### - ## tclTest::makeFile result API changed for 2.0 - - if {![package vsatisfies [package provide tcltest] 2.0]} { - - # The 'makeFile' in Tcltest 1.0 returns a list of all the - # paths generated so far, whereas the 'makeFile' in 2.0+ - # returns only the path of the newly generated file. We - # standardize on the more useful behaviour of 2.0+. If 1.x is - # present we have to create an emulation layer to get the - # wanted result. - - # 1.0 is not fully correctly described. If the file was - # created before no list is returned at all. We force things - # by adding a line to the old procedure which makes the result - # unconditional (the name of the file/dir created). - - # The same change applies to 'makeDirectory' - - if {![llength [info commands ::tcltest::makeFile_1]]} { - # Marker first. - proc ::tcltest::makeFile_1 {args} {} - - # Extend procedures with command to return the required - # full name. - proc ::tcltest::makeFile {contents name} \ - [info body ::tcltest::makeFile]\n[list set fullName] - - proc ::tcltest::makeDirectory {name} \ - [info body ::tcltest::makeDirectory]\n[list set fullName] - - # Re-export - namespace eval ::tcltest { - namespace export makeFile makeDirectory - } - uplevel \#0 {namespace import -force ::tcltest::*} - } - } - - # ### ### ### ######### ######### ######### - ## Extended functionality, creation of binary temp. files. - ## Also creation of paths for temp. files - - proc ::tcltest::makeBinaryFile {data f} { - set path [makeFile {} $f] - set ch [open $path w] - fconfigure $ch -translation binary - puts -nonewline $ch $data - close $ch - return $path - } - - proc ::tcltest::tempPath {path} { - variable temporaryDirectory - return [file join $temporaryDirectory $path] - } - - namespace eval ::tcltest { - namespace export wrongNumArgs tooManyArgs - namespace export makeBinaryFile tempPath - } - uplevel \#0 {namespace import -force ::tcltest::*} - return -} - -# ### ### ### ######### ######### ######### -## Command to construct wrong/args messages for Snit methods. - -proc snitErrors {} { - if {[package vsatisfies [package provide snit] 2]} { - # Snit 2.0+ - - proc snitWrongNumArgs {obj method arglist missingIndex} { - regsub {^.*Snit_method} $method {} method - tcltest::wrongNumArgs "$obj $method" $arglist $missingIndex - } - - proc snitTooManyArgs {obj method arglist} { - regsub {^.*Snit_method} $method {} method - tcltest::tooManyArgs "$obj $method" $arglist - } - - } else { - proc snitWrongNumArgs {obj method arglist missingIndex} { - incr missingIndex 4 - tcltest::wrongNumArgs "$method" [linsert $arglist 0 \ - type selfns win self] $missingIndex - } - - proc snitTooManyArgs {obj method arglist} { - tcltest::tooManyArgs "$method" [linsert $arglist 0 \ - type selfns win self] - } - } -} - -# ### ### ### ######### ######### ######### -## Commands to load files from various locations within the local -## Tcllib, and the loading of local Tcllib packages. None of them goes -## through the auto-loader, nor the regular package management, to -## avoid contamination of the testsuite by packages and code outside -## of the Tcllib under test. - -proc localPath {fname} { - return [file join $::tcltest::testsDirectory $fname] -} - -proc tcllibPath {fname} { - return [file join $::tcllib::testutils::tcllib $fname] -} - -proc useLocalFile {fname} { - return [uplevel 1 [list source [localPath $fname]]] -} - -proc useTcllibFile {fname} { - return [uplevel 1 [list source [tcllibPath $fname]]] -} - -proc use {fname pname args} { - set nsname ::$pname - if {[llength $args]} {set nsname [lindex $args 0]} - - package forget $pname - catch {namespace delete $nsname} - - if {[catch { - uplevel 1 [list useTcllibFile $fname] - } msg]} { - puts " Aborting the tests found in \"[file tail [info script]]\"" - puts " Error in [file tail $fname]: $msg" - return -code error "" - } - - puts "$::tcllib::testutils::tag [list $pname] [package present $pname]" - return -} - -proc useKeep {fname pname args} { - set nsname ::$pname - if {[llength $args]} {set nsname [lindex $args 0]} - - package forget $pname - - # Keep = Keep the existing namespace of the package. - # = Do not delete it. This is required if the - # namespace contains commands created by a - # binary package, like 'tcllibc'. They cannot - # be re-created. - ## - ## catch {namespace delete $nsname} - - if {[catch { - uplevel 1 [list useTcllibFile $fname] - } msg]} { - puts " Aborting the tests found in \"[file tail [info script]]\"" - puts " Error in [file tail $fname]: $msg" - return -code error "" - } - - puts "$::tcllib::testutils::tag [list $pname] [package present $pname]" - return -} - -proc useLocal {fname pname args} { - set nsname ::$pname - if {[llength $args]} {set nsname [lindex $args 0]} - - package forget $pname - catch {namespace delete $nsname} - - if {[catch { - uplevel 1 [list useLocalFile $fname] - } msg]} { - puts " Aborting the tests found in \"[file tail [info script]]\"" - puts " Error in [file tail $fname]: $msg" - return -code error "" - } - - puts "$::tcllib::testutils::tag [list $pname] [package present $pname]" - return -} - -proc useLocalKeep {fname pname args} { - set nsname ::$pname - if {[llength $args]} {set nsname [lindex $args 0]} - - package forget $pname - - # Keep = Keep the existing namespace of the package. - # = Do not delete it. This is required if the - # namespace contains commands created by a - # binary package, like 'tcllibc'. They cannot - # be re-created. - ## - ## catch {namespace delete $nsname} - - if {[catch { - uplevel 1 [list useLocalFile $fname] - } msg]} { - puts " Aborting the tests found in \"[file tail [info script]]\"" - puts " Error in [file tail $fname]: $msg" - return -code error "" - } - - puts "$::tcllib::testutils::tag [list $pname] [package present $pname]" - return -} - -proc useAccel {acc fname pname args} { - set use [expr {$acc ? "useKeep" : "use"}] - uplevel 1 [linsert $args 0 $use $fname $pname] -} - -proc support {script} { - InitializeTclTest - set ::tcllib::testutils::tag "-" - if {[catch { - uplevel 1 $script - } msg]} { - set prefix "SETUP Error (Support): " - puts $prefix[join [split $::errorInfo \n] "\n$prefix"] - - return -code return - } - return -} - -proc testing {script} { - InitializeTclTest - set ::tcllib::testutils::tag "*" - if {[catch { - uplevel 1 $script - } msg]} { - set prefix "SETUP Error (Testing): " - puts $prefix[join [split $::errorInfo \n] "\n$prefix"] - - return -code return - } - return -} - -proc useTcllibC {} { - set index [tcllibPath tcllibc/pkgIndex.tcl] - if {![file exists $index]} { - # Might have an external tcllibc - if {![catch { - package require tcllibc - }]} { - puts "$::tcllib::testutils::tag tcllibc [package present tcllibc]" - puts "$::tcllib::testutils::tag tcllibc = [package ifneeded tcllibc [package present tcllibc]]" - return 1 - } - - return 0 - } - - set ::dir [file dirname $index] - uplevel #0 [list source $index] - unset ::dir - - package require tcllibc - - puts "$::tcllib::testutils::tag tcllibc [package present tcllibc]" - puts "$::tcllib::testutils::tag tcllibc = [package ifneeded tcllibc [package present tcllibc]]" - return 1 -} - -# ### ### ### ######### ######### ######### -## General utilities - -# - dictsort - -# -# Sort a dictionary by its keys. I.e. reorder the contents of the -# dictionary so that in its list representation the keys are found in -# ascending alphabetical order. In other words, this command creates -# a canonical list representation of the input dictionary, suitable -# for direct comparison. -# -# Arguments: -# dict: The dictionary to sort. -# -# Result: -# The canonical representation of the dictionary. - -proc dictsort {dict} { - array set a $dict - set out [list] - foreach key [lsort [array names a]] { - lappend out $key $a($key) - } - return $out -} - -# ### ### ### ######### ######### ######### -## Putting strings together, if they cannot be expressed easily as one -## string due to quoting problems. - -proc cat {args} { - return [join $args ""] -} - -# ### ### ### ######### ######### ######### -## Mini-logging facility, can also be viewed as an accumulator for -## complex results. -# -# res! : clear accumulator. -# res+ : add arguments to accumulator. -# res? : query contents of accumulator. -# res?lines : query accumulator and format as -# multiple lines, one per list element. - -proc res! {} { - variable result {} - return -} - -proc res+ {args} { - variable result - lappend result $args - return -} - -proc res? {} { - variable result - return $result -} - -proc res?lines {} { - return [join [res?] \n] -} - -# ### ### ### ######### ######### ######### -## Helper commands to deal with packages -## which have multiple implementations, i.e. -## their pure Tcl base line and one or more -## accelerators. We are assuming a specific -## API for accessing the data about available -## accelerators, switching between them, etc. - -# == Assumed API == -# -# KnownImplementations -- -# Returns list of all known implementations. -# -# Implementations -- -# Returns list of activated implementations. -# A subset of 'KnownImplementations' -# -# Names -- -# Returns dict mapping all known implementations -# to human-readable strings for output during a -# test run -# -# LoadAccelerator accel -- -# Tries to make the implementation named -# 'accel' available for use. Result is boolean. -# True indicates a successful activation. -# -# SwitchTo accel -- -# Activate the implementation named 'accel'. -# The empty string disables all implementations. - -proc TestAccelInit {namespace} { - # Disable all implementations ... Base state. - ${namespace}::SwitchTo {} - - # List the implementations. - array set map [${namespace}::Names] - foreach e [${namespace}::KnownImplementations] { - if {[${namespace}::LoadAccelerator $e]} { - puts "> $map($e)" - } - } - return -} - -proc TestAccelDo {namespace var script} { - upvar 1 $var impl - foreach impl [${namespace}::Implementations] { - ${namespace}::SwitchTo $impl - uplevel 1 $script - } - return -} - -proc TestAccelExit {namespace} { - # Reset the system to a fully inactive state. - ${namespace}::SwitchTo {} - return -} - -# ### ### ### ######### ######### ######### -## - -proc TestFiles {pattern} { - if {[package vsatisfies [package provide Tcl] 8.3]} { - # 8.3+ -directory ok - set flist [glob -nocomplain -directory $::tcltest::testsDirectory $pattern] - } else { - # 8.2 or less, no -directory - set flist [glob -nocomplain [file join $::tcltest::testsDirectory $pattern]] - } - foreach f [lsort -dict $flist] { - uplevel 1 [list source $f] - } - return -} - -proc TestFilesGlob {pattern} { - if {[package vsatisfies [package provide Tcl] 8.3]} { - # 8.3+ -directory ok - set flist [glob -nocomplain -directory $::tcltest::testsDirectory $pattern] - } else { - # 8.2 or less, no -directory - set flist [glob -nocomplain [file join $::tcltest::testsDirectory $pattern]] - } - return [lsort -dict $flist] -} - -# ### ### ### ######### ######### ######### -## - -::tcllib::testutils::SaveEnvironment - -# ### ### ### ######### ######### ######### -package provide tcllib::testutils $::tcllib::testutils::version -puts "- tcllib::testutils [package present tcllib::testutils]" -return diff -Nru critcl-3.1.9/test/util_def.test critcl-3.1.17+dfsg/test/util_def.test --- critcl-3.1.9/test/util_def.test 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/test/util_def.test 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,91 @@ +# -*- tcl -*- +# ------------------------------------------------------------------------- +# critcl_util_def.test +# ------------------------------------------------------------------------- + +source [file join [file dirname [info script]] support testutilities.tcl] + +testsNeedTcl 8.4 +testsNeedTcltest 2 + +support { + useLocal lib/lassign84/lassign.tcl lassign84 + useLocal lib/dict84/dict.tcl dict84 + + useLocal lib/stubs_container/container.tcl stubs::container + useLocal lib/stubs_reader/reader.tcl stubs::reader + useLocal lib/stubs_genframe/genframe.tcl stubs::gen + + useLocal lib/critcl/critcl.tcl critcl + + # Helper procedures + useLocalFile test/support/crit_utils.tcl +} +testing { + useLocal lib/critcl-util/util.tcl critcl::util +} + +overrides + +# ------------------------------------------------------------------------- +## util::def syntax + +test critcl-util-def-1.0.6 {util-def, wrong\#args, not enough} -constraints tcl8.6plus -body { + critcl::util::def +} -returnCodes error -result {wrong # args: should be "critcl::util::def configfile define ?value?"} + +test critcl-util-def-1.0.5 {util-def, wrong\#args, not enough} -constraints tcl8.5 -body { + critcl::util::def +} -returnCodes error -result {wrong # args: should be "critcl::util::def configfile define ?value?"} + +test critcl-util-def-1.0.4 {util-def, wrong\#args, not enough} -constraints tcl8.4 -body { + critcl::util::def +} -returnCodes error -result {wrong # args: should be "critcl::util::def configfile define ?value?"} + +test critcl-util-def-1.1.6 {util-def, wrong\#args, not enough} -constraints tcl8.6plus -body { + critcl::util::def C +} -returnCodes error -result {wrong # args: should be "critcl::util::def configfile define ?value?"} + +test critcl-util-def-1.1.5 {util-def, wrong\#args, not enough} -constraints tcl8.5 -body { + critcl::util::def C +} -returnCodes error -result {wrong # args: should be "critcl::util::def configfile define ?value?"} + +test critcl-util-def-1.1.4 {util-def, wrong\#args, not enough} -constraints tcl8.4 -body { + critcl::util::def C +} -returnCodes error -result {wrong # args: should be "critcl::util::def configfile define ?value?"} + +test critcl-util-def-1.2.6 {util-def, wrong\#args, too many} -constraints tcl8.6plus -body { + critcl::util::def C D V X +} -returnCodes error -result {wrong # args: should be "critcl::util::def configfile define ?value?"} + +test critcl-util-def-1.2.5 {util-def, wrong\#args, too many} -constraints tcl8.5 -body { + critcl::util::def C D V X +} -returnCodes error -result {wrong # args: should be "critcl::util::def configfile define ?value?"} + +test critcl-util-def-1.2.4 {util-def, wrong\#args, too many} -constraints tcl8.4 -body { + critcl::util::def C D V X +} -returnCodes error -result {wrong # args: should be "critcl::util::def configfile define ?value?"} + +# ------------------------------------------------------------------------- +## + +test critcl-util-def-2.0 {util-def} -setup { + set here [critcl::cache] + file mkdir ~/.critcl-tests-[pid] + critcl::cache ~/.critcl-tests-[pid] +} -body { + critcl::util::def C foo 333 + inspect C +} -cleanup { + critcl::cache $here + unset here + file delete -force ~/.critcl-tests-[pid] +} -result [viewFile [localPath test/assets/def-2.0]] + +# ------------------------------------------------------------------------- +testsuiteCleanup + +# Local variables: +# mode: tcl +# indent-tabs-mode: nil +# End: diff -Nru critcl-3.1.9/test/util_undef.test critcl-3.1.17+dfsg/test/util_undef.test --- critcl-3.1.9/test/util_undef.test 1970-01-01 00:00:00.000000000 +0000 +++ critcl-3.1.17+dfsg/test/util_undef.test 2017-10-14 02:48:11.000000000 +0000 @@ -0,0 +1,67 @@ +# -*- tcl -*- +# ------------------------------------------------------------------------- +# critcl_util_undef.test +# ------------------------------------------------------------------------- + +source [file join [file dirname [info script]] support testutilities.tcl] + +testsNeedTcl 8.4 +testsNeedTcltest 2 + +support { + useLocal lib/lassign84/lassign.tcl lassign84 + useLocal lib/dict84/dict.tcl dict84 + + useLocal lib/stubs_container/container.tcl stubs::container + useLocal lib/stubs_reader/reader.tcl stubs::reader + useLocal lib/stubs_genframe/genframe.tcl stubs::gen + + useLocal lib/critcl/critcl.tcl critcl + + # Helper procedures + useLocalFile test/support/crit_utils.tcl +} +testing { + useLocal lib/critcl-util/util.tcl critcl::util +} + +overrides + +# ------------------------------------------------------------------------- +## util::undef syntax + +test critcl-util-undef-1.0 {util-undef, wrong\#args, not enough} -body { + critcl::util::undef +} -returnCodes error -result {wrong # args: should be "critcl::util::undef configfile define"} + +test critcl-util-undef-1.1 {util-undef, wrong\#args, not enough} -body { + critcl::util::undef C +} -returnCodes error -result {wrong # args: should be "critcl::util::undef configfile define"} + +test critcl-util-undef-1.2 {util-undef, wrong\#args, too many} -body { + critcl::util::undef C D X +} -returnCodes error -result {wrong # args: should be "critcl::util::undef configfile define"} + +# ------------------------------------------------------------------------- +## + +test critcl-util-undef-2.0 {util-undef} -setup { + set here [critcl::cache] + file mkdir ~/.critcl-tests-[pid] + critcl::cache ~/.critcl-tests-[pid] +} -body { + critcl::util::undef C foo + inspect C +} -cleanup { + critcl::cache $here + unset here + file delete -force ~/.critcl-tests-[pid] +} -result [viewFile [localPath test/assets/undef-2.0]] + +# ------------------------------------------------------------------------- +testsuiteCleanup + +# Local variables: +# mode: tcl +# indent-tabs-mode: nil +# End:
    Critcl - Package Reference
    critcl-cproc-typesCritcl - cproc Type Reference
    critcl::app Critcl - Application Package Reference
    critcl::bitmapCriTcl Utilities: Bitset en- and decoding
    critcl::class CriTcl Utilities: C Classes
    critcl::cutilCriTcl C-level Utilities
    critcl::emapCriTcl Utilities: Enum en- and decoding
    critcl::enumCriTcl Utilities: String/Integer mapping
    critcl::iassoc CriTcl Utilities: Tcl Interp Associations
    critcl::literalsCriTcl Utilities: Constant string pools
    critcl::util CriTcl Utilities