Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5893756a8c |
@@ -1,3 +1,20 @@
|
||||
compat/zlib/win32/zdll.lib
|
||||
compat/zlib/win32/zlib1.dll
|
||||
compat/zlib/win64/zdll.lib
|
||||
compat/zlib/win64/zlib1.dll
|
||||
compat/zlib/win64/libz.dll.a
|
||||
compat/zlib/zlib.3.pdf
|
||||
compat/zlib/win32/zdll.lib
|
||||
compat/zlib/win32/zlib1.dll
|
||||
compat/zlib/win64/zdll.lib
|
||||
compat/zlib/win64/zlib1.dll
|
||||
compat/zlib/win64/libz.dll.a
|
||||
compat/zlib/zlib.3.pdf
|
||||
libtommath/win32/tommath.lib
|
||||
libtommath/win32/libtommath.dll
|
||||
libtommath/win64/tommath.lib
|
||||
libtommath/win64/libtommath.dll
|
||||
libtommath/win64/libtommath.dll.a
|
||||
*.a
|
||||
*.bmp
|
||||
*.dll
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
compat/zlib/contrib/dotzlib/DotZLib/UnitTests.cs
|
||||
compat/zlib/contrib/vstudio/readme.txt
|
||||
compat/zlib/contrib/vstudio/*/zlib.rc
|
||||
compat/zlib/contrib/vstudio/*/*.sln
|
||||
compat/zlib/win32/*.txt
|
||||
compat/zlib/win64/*.txt
|
||||
libtommath/*.dsp
|
||||
@@ -17,4 +16,4 @@ win/rules-ext.vc
|
||||
win/targets.vc
|
||||
win/tcl.dsp
|
||||
win/tcl.dsw
|
||||
win/tcl.hpj.in
|
||||
win/tcl.hpj.in
|
||||
@@ -1,7 +1,6 @@
|
||||
*.a
|
||||
*.dll
|
||||
*.dylib
|
||||
*.dylib.E
|
||||
*.exe
|
||||
*.exp
|
||||
*.la
|
||||
@@ -14,7 +13,6 @@
|
||||
*.sl
|
||||
*.so
|
||||
*/Makefile
|
||||
*/autom4te.cache
|
||||
*/config.cache
|
||||
*/config.log
|
||||
*/config.status
|
||||
@@ -32,7 +30,7 @@ libtommath/pretty.build
|
||||
libtommath/tommath.src
|
||||
libtommath/*.log
|
||||
libtommath/*.pdf
|
||||
libtommath/*.pl
|
||||
libtommath/gen.pl
|
||||
libtommath/*.sh
|
||||
libtommath/doc/*
|
||||
libtommath/tombc/*
|
||||
@@ -44,19 +42,10 @@ libtommath/etc/*
|
||||
libtommath/demo/*
|
||||
libtommath/*.out
|
||||
libtommath/*.tex
|
||||
macosx/configure
|
||||
unix/autoMkindex.tcl
|
||||
unix/dltest.marker
|
||||
unix/dltest/*.bundle
|
||||
unix/dltest/*.dll
|
||||
unix/dltest/*.dylib
|
||||
unix/dltest/*.o
|
||||
unix/dltest/*.sl
|
||||
unix/dltest/*.so
|
||||
unix/tcl.pc
|
||||
unix/tclIndex
|
||||
unix/Tcl-Info.plist
|
||||
unix/Tclsh-Info.plist
|
||||
unix/pkgs/*
|
||||
win/Debug*
|
||||
win/Release*
|
||||
@@ -64,5 +53,4 @@ win/*.manifest
|
||||
win/pkgs/*
|
||||
win/coffbase.txt
|
||||
win/tcl.hpj
|
||||
win/nmakehlp.out
|
||||
win/nmhlp-out.txt
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
u
|
||||
@@ -27,7 +27,6 @@
|
||||
|
||||
# Denote all files that are truly binary and should not be modified.
|
||||
*.a binary
|
||||
*.bmp binary
|
||||
*.dll binary
|
||||
*.exe binary
|
||||
*.gif binary
|
||||
|
||||
@@ -1,37 +0,0 @@
|
||||
name: Linux Build and Test
|
||||
on: [push]
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
- name: Configure
|
||||
working-directory: unix
|
||||
run: |
|
||||
mkdir "${HOME}/install dir"
|
||||
./configure ${CFGOPT} "--prefix=$HOME/install dir" || (cat config.log && exit 1)
|
||||
- name: Build
|
||||
working-directory: unix
|
||||
run: |
|
||||
make all
|
||||
- name: Build Test Harness
|
||||
working-directory: unix
|
||||
run: |
|
||||
make tcltest
|
||||
- name: Run Tests
|
||||
working-directory: unix
|
||||
run: |
|
||||
make test
|
||||
- name: Test-Drive Installation
|
||||
working-directory: unix
|
||||
run: |
|
||||
make install
|
||||
- name: Create Distribution Package
|
||||
working-directory: unix
|
||||
run: |
|
||||
make dist
|
||||
- name: Convert Documentation to HTML
|
||||
working-directory: unix
|
||||
run: |
|
||||
make html-tcl
|
||||
@@ -1,37 +0,0 @@
|
||||
name: Linux Build and Test
|
||||
on: [push]
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
- name: Configure
|
||||
working-directory: unix
|
||||
run: |
|
||||
mkdir "${HOME}/install dir"
|
||||
./configure ${CFGOPT} "--prefix=$HOME/install dir" || (cat config.log && exit 1)
|
||||
- name: Build
|
||||
working-directory: unix
|
||||
run: |
|
||||
make all
|
||||
- name: Build Test Harness
|
||||
working-directory: unix
|
||||
run: |
|
||||
make tcltest
|
||||
- name: Run Tests
|
||||
working-directory: unix
|
||||
run: |
|
||||
make test
|
||||
- name: Test-Drive Installation
|
||||
working-directory: unix
|
||||
run: |
|
||||
make install
|
||||
- name: Create Distribution Package
|
||||
working-directory: unix
|
||||
run: |
|
||||
make dist
|
||||
- name: Convert Documentation to HTML
|
||||
working-directory: unix
|
||||
run: |
|
||||
make html-tcl
|
||||
@@ -1,22 +0,0 @@
|
||||
name: Windows Build and Test
|
||||
on: [push]
|
||||
jobs:
|
||||
build:
|
||||
runs-on: windows-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
- name: Init MSVC
|
||||
uses: ilammy/msvc-dev-cmd@v1
|
||||
- name: Build
|
||||
working-directory: win
|
||||
run: |
|
||||
nmake -f makefile.vc all
|
||||
- name: Build Test Harness
|
||||
working-directory: win
|
||||
run: |
|
||||
nmake -f makefile.vc tcltest
|
||||
- name: Run Tests
|
||||
working-directory: win
|
||||
run: |
|
||||
nmake -f makefile.vc test
|
||||
+5
-16
@@ -1,8 +1,6 @@
|
||||
*.a
|
||||
*.bundle
|
||||
*.dll
|
||||
*.dylib
|
||||
*.dylib.E
|
||||
*.exe
|
||||
*.exp
|
||||
*.lib
|
||||
@@ -12,18 +10,10 @@
|
||||
*.res
|
||||
*.sl
|
||||
*.so
|
||||
.fslckout
|
||||
Makefile
|
||||
Tcl-Info.plist
|
||||
Tclsh-Info.plist
|
||||
autom4te.cache
|
||||
config.cache
|
||||
config.log
|
||||
config.status
|
||||
config.status.lineno
|
||||
html
|
||||
manifest.uuid
|
||||
_FOSSIL_
|
||||
*/Makefile
|
||||
*/config.cache
|
||||
*/config.log
|
||||
*/config.status
|
||||
*/tclConfig.sh
|
||||
*/tclsh*
|
||||
*/tcltest*
|
||||
@@ -31,6 +21,7 @@ _FOSSIL_
|
||||
*/version.vc
|
||||
*/libtcl.vfs
|
||||
*/libtcl_*.zip
|
||||
html
|
||||
libtommath/bn.ilg
|
||||
libtommath/bn.ind
|
||||
libtommath/pretty.build
|
||||
@@ -49,7 +40,6 @@ libtommath/etc/*
|
||||
libtommath/demo/*
|
||||
libtommath/*.out
|
||||
libtommath/*.tex
|
||||
macosx/configure
|
||||
unix/autoMkindex.tcl
|
||||
unix/dltest.marker
|
||||
unix/tcl.pc
|
||||
@@ -61,5 +51,4 @@ win/*.manifest
|
||||
win/pkgs/*
|
||||
win/coffbase.txt
|
||||
win/tcl.hpj
|
||||
win/nmakehlp.out
|
||||
win/nmhlp-out.txt
|
||||
|
||||
@@ -5,22 +5,7 @@
|
||||
<projects>
|
||||
</projects>
|
||||
<buildSpec>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.cdt.managedbuilder.core.genmakebuilder</name>
|
||||
<triggers>clean,full,incremental,</triggers>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder</name>
|
||||
<triggers>full,incremental,</triggers>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
</buildSpec>
|
||||
<natures>
|
||||
<nature>org.eclipse.cdt.core.cnature</nature>
|
||||
<nature>org.eclipse.cdt.managedbuilder.core.managedBuildNature</nature>
|
||||
<nature>org.eclipse.cdt.managedbuilder.core.ScannerConfigNature</nature>
|
||||
</natures>
|
||||
</projectDescription>
|
||||
|
||||
+83
-147
@@ -1,77 +1,74 @@
|
||||
sudo: false
|
||||
language: c
|
||||
addons:
|
||||
apt:
|
||||
sources:
|
||||
- ubuntu-toolchain-r-test
|
||||
packages:
|
||||
- binutils-mingw-w64-i686
|
||||
- binutils-mingw-w64-x86-64
|
||||
- gcc-mingw-w64
|
||||
- gcc-mingw-w64-base
|
||||
- gcc-mingw-w64-i686
|
||||
- gcc-mingw-w64-x86-64
|
||||
- gcc-multilib
|
||||
jobs:
|
||||
|
||||
matrix:
|
||||
include:
|
||||
# Testing on Linux GCC
|
||||
# Testing on Linux with various compilers
|
||||
- name: "Linux/GCC/Shared"
|
||||
os: linux
|
||||
dist: focal
|
||||
dist: bionic
|
||||
compiler: gcc
|
||||
env:
|
||||
- BUILD_DIR=unix
|
||||
- name: "Linux/GCC/Shared: UTF_MAX=4"
|
||||
os: linux
|
||||
dist: focal
|
||||
dist: bionic
|
||||
compiler: gcc
|
||||
env:
|
||||
- BUILD_DIR=unix
|
||||
- CFGOPT=CFLAGS=-DTCL_UTF_MAX=4
|
||||
- name: "Linux/GCC/Shared: NO_DEPRECATED"
|
||||
os: linux
|
||||
dist: focal
|
||||
dist: bionic
|
||||
compiler: gcc
|
||||
env:
|
||||
- BUILD_DIR=unix
|
||||
- CFGOPT="CFLAGS=-DTCL_NO_DEPRECATED=1"
|
||||
- name: "Linux/GCC/Static"
|
||||
os: linux
|
||||
dist: focal
|
||||
dist: bionic
|
||||
compiler: gcc
|
||||
env:
|
||||
- CFGOPT="--disable-shared"
|
||||
- BUILD_DIR=unix
|
||||
- name: "Linux/GCC/Debug"
|
||||
os: linux
|
||||
dist: focal
|
||||
dist: bionic
|
||||
compiler: gcc
|
||||
env:
|
||||
- BUILD_DIR=unix
|
||||
- CFGOPT="--enable-symbols"
|
||||
- name: "Linux/GCC/Mem-Debug"
|
||||
os: linux
|
||||
dist: focal
|
||||
compiler: gcc
|
||||
env:
|
||||
- BUILD_DIR=unix
|
||||
- CFGOPT="--enable-symbols=mem"
|
||||
# C++ build.
|
||||
- name: "Linux/G++/Shared"
|
||||
os: linux
|
||||
dist: focal
|
||||
dist: bionic
|
||||
compiler: g++
|
||||
env:
|
||||
- BUILD_DIR=unix
|
||||
- CFGOPT="CC=g++ CFLAGS=-Dregister=dont+use+register"
|
||||
# Newer/Older versions of GCC
|
||||
- name: "Linux/GCC 10/Shared"
|
||||
# Older versions of GCC...
|
||||
- name: "Linux/GCC 7/Shared"
|
||||
os: linux
|
||||
dist: focal
|
||||
compiler: gcc-10
|
||||
dist: bionic
|
||||
compiler: gcc-7
|
||||
addons:
|
||||
apt:
|
||||
sources:
|
||||
- ubuntu-toolchain-r-test
|
||||
packages:
|
||||
- g++-10
|
||||
- g++-7
|
||||
env:
|
||||
- BUILD_DIR=unix
|
||||
- name: "Linux/GCC 6/Shared"
|
||||
os: linux
|
||||
dist: bionic
|
||||
compiler: gcc-6
|
||||
addons:
|
||||
apt:
|
||||
sources:
|
||||
- ubuntu-toolchain-r-test
|
||||
packages:
|
||||
- g++-6
|
||||
env:
|
||||
- BUILD_DIR=unix
|
||||
- name: "Linux/GCC 5/Shared"
|
||||
@@ -80,14 +77,16 @@ jobs:
|
||||
compiler: gcc-5
|
||||
addons:
|
||||
apt:
|
||||
sources:
|
||||
- ubuntu-toolchain-r-test
|
||||
packages:
|
||||
- g++-5
|
||||
env:
|
||||
- BUILD_DIR=unix
|
||||
# Testing on Linux Clang
|
||||
# Clang
|
||||
- name: "Linux/Clang/Shared"
|
||||
os: linux
|
||||
dist: focal
|
||||
dist: bionic
|
||||
compiler: clang
|
||||
env:
|
||||
- BUILD_DIR=unix
|
||||
@@ -100,29 +99,27 @@ jobs:
|
||||
- CFGOPT="CFLAGS=-DTCL_NO_DEPRECATED=1"
|
||||
- name: "Linux/Clang/Static"
|
||||
os: linux
|
||||
dist: focal
|
||||
dist: bionic
|
||||
compiler: clang
|
||||
env:
|
||||
- CFGOPT="--disable-shared"
|
||||
- BUILD_DIR=unix
|
||||
- name: "Linux/Clang/Debug"
|
||||
os: linux
|
||||
dist: focal
|
||||
dist: bionic
|
||||
compiler: clang
|
||||
env:
|
||||
- BUILD_DIR=unix
|
||||
- CFGOPT="--enable-symbols"
|
||||
- name: "Linux/Clang/Mem-Debug"
|
||||
os: linux
|
||||
dist: focal
|
||||
compiler: clang
|
||||
# Testing on Mac, various styles
|
||||
- name: "macOS/Xcode 11.3/Shared/Unix-like"
|
||||
os: osx
|
||||
osx_image: xcode11.3
|
||||
env:
|
||||
- BUILD_DIR=unix
|
||||
- CFGOPT="--enable-symbols=mem"
|
||||
# Testing on Mac, various styles
|
||||
- name: "macOS/Clang/Xcode 12/Shared"
|
||||
- name: "macOS/Xcode 11.3/Shared"
|
||||
os: osx
|
||||
osx_image: xcode12.2
|
||||
osx_image: xcode11.3
|
||||
env:
|
||||
- BUILD_DIR=macosx
|
||||
install: []
|
||||
@@ -130,15 +127,20 @@ jobs:
|
||||
- make all
|
||||
# The styles=develop avoids some weird problems on OSX
|
||||
- make test styles=develop
|
||||
- name: "macOS/Clang/Xcode 12/Shared/Unix-like"
|
||||
addons:
|
||||
homebrew:
|
||||
packages:
|
||||
- libtommath
|
||||
- name: "macOS/Xcode 11/Shared"
|
||||
os: osx
|
||||
osx_image: xcode12.2
|
||||
osx_image: xcode11
|
||||
env:
|
||||
- BUILD_DIR=unix
|
||||
- CFGOPT="--enable-dtrace"
|
||||
- name: "macOS/Clang/Xcode 12/Shared/libtommath"
|
||||
- BUILD_DIR=macosx
|
||||
install: []
|
||||
script: *mactest
|
||||
- name: "macOS/Xcode 10/Shared"
|
||||
os: osx
|
||||
osx_image: xcode12.2
|
||||
osx_image: xcode10.3
|
||||
env:
|
||||
- BUILD_DIR=macosx
|
||||
install: []
|
||||
@@ -147,57 +149,41 @@ jobs:
|
||||
homebrew:
|
||||
packages:
|
||||
- libtommath
|
||||
- name: "macOS/Clang++/Xcode 12/Shared"
|
||||
- name: "macOS/Xcode 9/Shared"
|
||||
os: osx
|
||||
osx_image: xcode12.2
|
||||
env:
|
||||
- BUILD_DIR=unix
|
||||
- CFGOPT="CC=clang++ --enable-framework --enable-dtrace CFLAGS=-Dregister=dont+use+register CPPFLAGS=-D__private_extern__=extern"
|
||||
script:
|
||||
- make all tcltest
|
||||
# Newer MacOS versions
|
||||
- name: "macOS/Clang/Xcode 12/Universal Apps/Shared"
|
||||
os: osx
|
||||
osx_image: xcode12u
|
||||
osx_image: xcode9
|
||||
env:
|
||||
- BUILD_DIR=macosx
|
||||
install: []
|
||||
script: *mactest
|
||||
# Older MacOS versions
|
||||
- name: "macOS/Clang/Xcode 11/Shared"
|
||||
addons:
|
||||
homebrew:
|
||||
packages:
|
||||
- libtommath
|
||||
- name: "macOS/Xcode 8/Shared"
|
||||
os: osx
|
||||
osx_image: xcode11.7
|
||||
env:
|
||||
- BUILD_DIR=macosx
|
||||
install: []
|
||||
script: *mactest
|
||||
- name: "macOS/Clang/Xcode 10/Shared"
|
||||
os: osx
|
||||
osx_image: xcode10.3
|
||||
env:
|
||||
- BUILD_DIR=macosx
|
||||
install: []
|
||||
script: *mactest
|
||||
- name: "macOS/Clang/Xcode 9/Shared"
|
||||
os: osx
|
||||
osx_image: xcode9.4
|
||||
env:
|
||||
- BUILD_DIR=macosx
|
||||
install: []
|
||||
script: *mactest
|
||||
- name: "macOS/Clang/Xcode 8/Shared"
|
||||
os: osx
|
||||
osx_image: xcode8.3
|
||||
osx_image: xcode8
|
||||
env:
|
||||
- BUILD_DIR=macosx
|
||||
install: []
|
||||
script: *mactest
|
||||
addons:
|
||||
homebrew:
|
||||
packages:
|
||||
- libtommath
|
||||
# Test with mingw-w64 cross-compile
|
||||
# Doesn't run tests because wine is only an imperfect Windows emulation
|
||||
- name: "Linux-cross-Windows/GCC/Shared/no test"
|
||||
os: linux
|
||||
dist: focal
|
||||
dist: bionic
|
||||
compiler: x86_64-w64-mingw32-gcc
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- gcc-mingw-w64-base
|
||||
- binutils-mingw-w64-x86-64
|
||||
- gcc-mingw-w64-x86-64
|
||||
- gcc-mingw-w64
|
||||
env:
|
||||
- BUILD_DIR=win
|
||||
- CFGOPT="--host=x86_64-w64-mingw32 --enable-64bit"
|
||||
@@ -210,8 +196,16 @@ jobs:
|
||||
# Doesn't run tests because wine is only an imperfect Windows emulation
|
||||
- name: "Linux-cross-Windows-32/GCC/Shared/no test"
|
||||
os: linux
|
||||
dist: focal
|
||||
dist: bionic
|
||||
compiler: i686-w64-mingw32-gcc
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- gcc-mingw-w64-base
|
||||
- binutils-mingw-w64-i686
|
||||
- gcc-mingw-w64-i686
|
||||
- gcc-mingw-w64
|
||||
- gcc-multilib
|
||||
env:
|
||||
- BUILD_DIR=win
|
||||
- CFGOPT=--host=i686-w64-mingw32
|
||||
@@ -224,8 +218,6 @@ jobs:
|
||||
- BUILD_DIR=win
|
||||
- VCDIR="/C/Program Files (x86)/Microsoft Visual Studio/2017/BuildTools/VC/Auxiliary/Build"
|
||||
before_install: &vcpreinst
|
||||
- rm -rf tests/safe-stock8*.test
|
||||
- touch generic/tclStubInit.c generic/tclOOStubInit.c generic/tclOOScript.h
|
||||
- PATH="$PATH:$VCDIR"
|
||||
- cd ${BUILD_DIR}
|
||||
install: []
|
||||
@@ -259,15 +251,6 @@ jobs:
|
||||
script:
|
||||
- cmd.exe //C vcvarsall.bat x64 '&&' nmake 'OPTS=static,msvcrt' '-f' makefile.vc all tcltest
|
||||
- cmd.exe //C vcvarsall.bat x64 '&&' nmake 'OPTS=static,msvcrt' '-f' makefile.vc test
|
||||
- name: "Windows/MSVC/StaticPackage"
|
||||
os: windows
|
||||
compiler: cl
|
||||
env: *vcenv
|
||||
before_install: *vcpreinst
|
||||
install: []
|
||||
script:
|
||||
- cmd.exe //C vcvarsall.bat x64 '&&' nmake 'OPTS=static,staticpkg,msvcrt' '-f' makefile.vc all tcltest
|
||||
- cmd.exe //C vcvarsall.bat x64 '&&' nmake 'OPTS=static,staticpkg,msvcrt' '-f' makefile.vc test
|
||||
- name: "Windows/MSVC/Debug"
|
||||
os: windows
|
||||
compiler: cl
|
||||
@@ -277,15 +260,6 @@ jobs:
|
||||
script:
|
||||
- cmd.exe //C vcvarsall.bat x64 '&&' nmake 'OPTS=symbols' '-f' makefile.vc all tcltest
|
||||
- cmd.exe //C vcvarsall.bat x64 '&&' nmake 'OPTS=symbols' '-f' makefile.vc test
|
||||
- name: "Windows/MSVC/Mem-Debug"
|
||||
os: windows
|
||||
compiler: cl
|
||||
env: *vcenv
|
||||
before_install: *vcpreinst
|
||||
install: []
|
||||
script:
|
||||
- cmd.exe //C vcvarsall.bat x64 '&&' nmake 'STATS=memdbg' '-f' makefile.vc all tcltest
|
||||
- cmd.exe //C vcvarsall.bat x64 '&&' nmake 'STATS=memdbg' '-f' makefile.vc test
|
||||
# Test on Windows with MSVC native (32-bit)
|
||||
- name: "Windows/MSVC-x86/Shared"
|
||||
os: windows
|
||||
@@ -332,15 +306,6 @@ jobs:
|
||||
script:
|
||||
- cmd.exe //C vcvarsall.bat x86 '&&' nmake 'OPTS=symbols' '-f' makefile.vc all tcltest
|
||||
- cmd.exe //C vcvarsall.bat x86 '&&' nmake 'OPTS=symbols' '-f' makefile.vc test
|
||||
- name: "Windows/MSVC-x86/Mem-Debug"
|
||||
os: windows
|
||||
compiler: cl
|
||||
env: *vcenv
|
||||
before_install: *vcpreinst
|
||||
install: []
|
||||
script:
|
||||
- cmd.exe //C vcvarsall.bat x86 '&&' nmake 'STATS=memdbg' '-f' makefile.vc all tcltest
|
||||
- cmd.exe //C vcvarsall.bat x86 '&&' nmake 'STATS=memdbg' '-f' makefile.vc test
|
||||
# Test on Windows with GCC native
|
||||
- name: "Windows/GCC/Shared"
|
||||
os: windows
|
||||
@@ -349,8 +314,6 @@ jobs:
|
||||
- BUILD_DIR=win
|
||||
- CFGOPT="--enable-64bit"
|
||||
before_install: &makepreinst
|
||||
- rm -rf tests/safe-stock8*.test
|
||||
- touch generic/tclStubInit.c generic/tclOOStubInit.c generic/tclOOScript.h
|
||||
- choco install -y make zip
|
||||
- cd ${BUILD_DIR}
|
||||
- name: "Windows/GCC/Shared: UTF_MAX=4"
|
||||
@@ -390,13 +353,6 @@ jobs:
|
||||
- BUILD_DIR=win
|
||||
- CFGOPT="--enable-64bit --enable-symbols"
|
||||
before_install: *makepreinst
|
||||
- name: "Windows/GCC/Mem-Debug"
|
||||
os: windows
|
||||
compiler: gcc
|
||||
env:
|
||||
- BUILD_DIR=win
|
||||
- CFGOPT="--enable-64bit --enable-symbols=mem"
|
||||
before_install: *makepreinst
|
||||
# Test on Windows with GCC native (32-bit)
|
||||
- name: "Windows/GCC-x86/Shared"
|
||||
os: windows
|
||||
@@ -441,32 +397,12 @@ jobs:
|
||||
- BUILD_DIR=win
|
||||
- CFGOPT="--enable-symbols"
|
||||
before_install: *makepreinst
|
||||
- name: "Windows/GCC-x86/Mem-Debug"
|
||||
os: windows
|
||||
compiler: gcc
|
||||
env:
|
||||
- BUILD_DIR=win
|
||||
- CFGOPT="--enable-symbols=mem"
|
||||
before_install: *makepreinst
|
||||
# "make dist" only
|
||||
- name: "Linux: make dist"
|
||||
os: linux
|
||||
dist: focal
|
||||
compiler: gcc
|
||||
env:
|
||||
- BUILD_DIR=unix
|
||||
script:
|
||||
- make dist
|
||||
before_install:
|
||||
- rm -rf tests/safe-stock8*.test
|
||||
- touch generic/tclStubInit.c generic/tclOOStubInit.c generic/tclOOScript.h
|
||||
- cd ${BUILD_DIR}
|
||||
install:
|
||||
- mkdir "$HOME/install dir"
|
||||
- ./configure ${CFGOPT} "--prefix=$HOME/install dir" || (cat config.log && exit 1)
|
||||
- ./configure ${CFGOPT} --prefix=$HOME || (cat config.log && exit 1)
|
||||
before_script:
|
||||
- export ERROR_ON_FAILURES=1
|
||||
script:
|
||||
- make all tcltest || echo "Something wrong, maybe a hickup, let's try again"
|
||||
- make all tcltest
|
||||
- make test
|
||||
- make install
|
||||
|
||||
+1
-1
@@ -1779,7 +1779,7 @@
|
||||
* generic/tclCmdMZ.c: Fixed infinite loop bug with [regexp -all]
|
||||
[Bug: 4981].
|
||||
|
||||
* tests/*.test: Changed all occurrences of "namespace import
|
||||
* tests/*.test: Changed all occurances of "namespace import
|
||||
::tcltest" to "namespace import -force ::tcltest" [Bug: 3948].
|
||||
|
||||
2000-04-09 Brent Welch <welch@scriptics.com>
|
||||
|
||||
+2
-2
@@ -351,7 +351,7 @@
|
||||
|
||||
* mac/tclMacFile.c: fixed bug in permission checking code
|
||||
|
||||
* mac/tclMacLoad.c: corrected utf-8 handling, comparison of package
|
||||
* mac/tclMacLoad.c: corrected utf8 handling, comparison of package
|
||||
names to code fragment names changed to only match on the length of
|
||||
package name, this allows for fragment names with version numbers
|
||||
appended.
|
||||
@@ -3525,7 +3525,7 @@
|
||||
* generic/tclVar.c (Tcl_UnsetObjCmd): Rewrote argument parser to avoid
|
||||
a read off the end of the argument array that could occur when
|
||||
executing something like [unset -nocomplain] was executed. Improved
|
||||
the error message given when not enough arguments are given (-nocomplain
|
||||
the error message given when too few arguments are given (-nocomplain
|
||||
should obviously be *before* --, not after it) and also modified the
|
||||
test suite to take account of that and the documentation to use the
|
||||
same improvement. [Bug 405769]
|
||||
|
||||
+1
-1
@@ -1753,7 +1753,7 @@
|
||||
|
||||
2002-07-05 Reinhard Max <max@suse.de>
|
||||
|
||||
* generic/tclClock.c (FormatClock): Convert the format string to utf-8
|
||||
* generic/tclClock.c (FormatClock): Convert the format string to UTF8
|
||||
before calling TclpStrftime, so that non-ASCII characters don't get
|
||||
mangled when the result string is being converted back.
|
||||
* tests/clock.test: Added a test for that.
|
||||
|
||||
+2
-2
@@ -2302,7 +2302,7 @@
|
||||
934511].
|
||||
|
||||
* doc/CrtCommand.3: Added note that the arguments given to the command
|
||||
proc of a Tcl_CreateCommand are in utf-8 since Tcl 8.1. Closing [Patch
|
||||
proc of a Tcl_CreateCommand are in utf8 since Tcl 8.1. Closing [Patch
|
||||
414778].
|
||||
|
||||
* doc/ChnlStack.3: Removed the declaration that the interp argument to
|
||||
@@ -2873,7 +2873,7 @@
|
||||
2004-06-02 Jeff Hobbs <jeffh@ActiveState.com>
|
||||
|
||||
* win/tclWinFile.c (TclpFindExecutable): when using GetModuleFileNameA
|
||||
(Win9x), convert from CP_ACP to WCHAR then convert back to utf-8.
|
||||
(Win9x), convert from CP_ACP to WCHAR then convert back to utf8.
|
||||
Adjunct to 2004-04-07 fix.
|
||||
|
||||
2004-06-02 David Gravereaux <davygrvy@pobox.com>
|
||||
|
||||
@@ -5,17 +5,7 @@ This is the **Tcl 8.7a4** source distribution.
|
||||
You can get any source release of Tcl from [our distribution
|
||||
site](https://sourceforge.net/projects/tcl/files/Tcl/).
|
||||
|
||||
8.6.10
|
||||
[](https://github.com/tcltk/tcl/actions?query=workflow%3A%22Linux+Build+and+Test%22+branch%3Acore-8-6-branch)
|
||||
[](https://github.com/tcltk/tcl/actions?query=workflow%3A%22Windows+Build+and+Test%22+branch%3Acore-8-6-branch)
|
||||
<br>
|
||||
8.7a4
|
||||
[](https://github.com/tcltk/tcl/actions?query=workflow%3A%22Linux+Build+and+Test%22+branch%3Acore-8-branch)
|
||||
[](https://github.com/tcltk/tcl/actions?query=workflow%3A%22Windows+Build+and+Test%22+branch%3Acore-8-branch)
|
||||
<br>
|
||||
9.0a2
|
||||
[](https://github.com/tcltk/tcl/actions?query=workflow%3A%22Linux+Build+and+Test%22+branch%3Amain)
|
||||
[](https://github.com/tcltk/tcl/actions?query=workflow%3A%22Windows+Build+and+Test%22+branch%3Amain)
|
||||
[](https://travis-ci.org/tcltk/tcl)
|
||||
|
||||
## Contents
|
||||
1. [Introduction](#intro)
|
||||
|
||||
+6
-2
@@ -21,15 +21,19 @@
|
||||
|
||||
#include <sys/types.h>
|
||||
|
||||
#ifdef __APPLE__
|
||||
extern void * memchr(const void *s, int c, size_t n);
|
||||
#else
|
||||
extern char * memchr(const void *s, int c, size_t n);
|
||||
#endif
|
||||
extern int memcmp(const void *s1, const void *s2, size_t n);
|
||||
extern void * memcpy(void *t, const void *f, size_t n);
|
||||
extern char * memcpy(void *t, const void *f, size_t n);
|
||||
#ifdef NO_MEMMOVE
|
||||
#define memmove(d,s,n) (bcopy((s), (d), (n)))
|
||||
#else
|
||||
extern char * memmove(void *t, const void *f, size_t n);
|
||||
#endif
|
||||
extern void * memset(void *s, int c, size_t n);
|
||||
extern char * memset(void *s, int c, size_t n);
|
||||
|
||||
extern int strcasecmp(const char *s1, const char *s2);
|
||||
extern char * strcat(char *dst, const char *src);
|
||||
|
||||
+5
-5
@@ -36,10 +36,10 @@
|
||||
|
||||
char *
|
||||
strstr(
|
||||
const char *string, /* String to search. */
|
||||
const char *substring) /* Substring to try to find in string. */
|
||||
char *string, /* String to search. */
|
||||
char *substring) /* Substring to try to find in string. */
|
||||
{
|
||||
const char *a, *b;
|
||||
char *a, *b;
|
||||
|
||||
/*
|
||||
* First scan quickly through the two strings looking for a
|
||||
@@ -49,7 +49,7 @@ strstr(
|
||||
|
||||
b = substring;
|
||||
if (*b == 0) {
|
||||
return (char *)string;
|
||||
return string;
|
||||
}
|
||||
for ( ; *string != 0; string += 1) {
|
||||
if (*string != *b) {
|
||||
@@ -58,7 +58,7 @@ strstr(
|
||||
a = string;
|
||||
while (1) {
|
||||
if (*b == 0) {
|
||||
return (char *)string;
|
||||
return string;
|
||||
}
|
||||
if (*a++ != *b++) {
|
||||
break;
|
||||
|
||||
@@ -29,6 +29,12 @@
|
||||
|
||||
#define CRC32(c, b) ((*(pcrc_32_tab+(((int)(c) ^ (b)) & 0xff))) ^ ((c) >> 8))
|
||||
|
||||
#ifdef Z_U4
|
||||
typedef Z_U4 z_crc_t;
|
||||
#else
|
||||
typedef unsigned long z_crc_t;
|
||||
#endif
|
||||
|
||||
/***********************************************************************
|
||||
* Return the next byte in the pseudo-random sequence
|
||||
*/
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 11.00
|
||||
# Visual Studio 2010
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "zlibvc", "zlibvc.vcxproj", "{8FD826F8-3739-44E6-8CC8-997122E53B8D}"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio 2012
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "zlibvc", "zlibvc.vcxproj", "{8FD826F8-3739-44E6-8CC8-997122E53B8D}"
|
||||
|
||||
@@ -1,119 +1,119 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio 2013
|
||||
VisualStudioVersion = 12.0.40629.0
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "zlibvc", "zlibvc.vcxproj", "{8FD826F8-3739-44E6-8CC8-997122E53B8D}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "zlibstat", "zlibstat.vcxproj", "{745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testzlib", "testzlib.vcxproj", "{AA6666AA-E09F-4135-9C0C-4FE50C3C654B}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testzlibdll", "testzlibdll.vcxproj", "{C52F9E7B-498A-42BE-8DB4-85A15694366A}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "minizip", "minizip.vcxproj", "{48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "miniunz", "miniunz.vcxproj", "{C52F9E7B-498A-42BE-8DB4-85A15694382A}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Itanium = Debug|Itanium
|
||||
Debug|Win32 = Debug|Win32
|
||||
Debug|x64 = Debug|x64
|
||||
Release|Itanium = Release|Itanium
|
||||
Release|Win32 = Release|Win32
|
||||
Release|x64 = Release|x64
|
||||
ReleaseWithoutAsm|Itanium = ReleaseWithoutAsm|Itanium
|
||||
ReleaseWithoutAsm|Win32 = ReleaseWithoutAsm|Win32
|
||||
ReleaseWithoutAsm|x64 = ReleaseWithoutAsm|x64
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{8FD826F8-3739-44E6-8CC8-997122E53B8D}.Debug|Itanium.ActiveCfg = Debug|Win32
|
||||
{8FD826F8-3739-44E6-8CC8-997122E53B8D}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{8FD826F8-3739-44E6-8CC8-997122E53B8D}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{8FD826F8-3739-44E6-8CC8-997122E53B8D}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{8FD826F8-3739-44E6-8CC8-997122E53B8D}.Debug|x64.Build.0 = Debug|x64
|
||||
{8FD826F8-3739-44E6-8CC8-997122E53B8D}.Release|Itanium.ActiveCfg = Release|Win32
|
||||
{8FD826F8-3739-44E6-8CC8-997122E53B8D}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{8FD826F8-3739-44E6-8CC8-997122E53B8D}.Release|Win32.Build.0 = Release|Win32
|
||||
{8FD826F8-3739-44E6-8CC8-997122E53B8D}.Release|x64.ActiveCfg = Release|x64
|
||||
{8FD826F8-3739-44E6-8CC8-997122E53B8D}.Release|x64.Build.0 = Release|x64
|
||||
{8FD826F8-3739-44E6-8CC8-997122E53B8D}.ReleaseWithoutAsm|Itanium.ActiveCfg = ReleaseWithoutAsm|Win32
|
||||
{8FD826F8-3739-44E6-8CC8-997122E53B8D}.ReleaseWithoutAsm|Win32.ActiveCfg = ReleaseWithoutAsm|Win32
|
||||
{8FD826F8-3739-44E6-8CC8-997122E53B8D}.ReleaseWithoutAsm|Win32.Build.0 = ReleaseWithoutAsm|Win32
|
||||
{8FD826F8-3739-44E6-8CC8-997122E53B8D}.ReleaseWithoutAsm|x64.ActiveCfg = ReleaseWithoutAsm|x64
|
||||
{8FD826F8-3739-44E6-8CC8-997122E53B8D}.ReleaseWithoutAsm|x64.Build.0 = ReleaseWithoutAsm|x64
|
||||
{745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.Debug|Itanium.ActiveCfg = Debug|Win32
|
||||
{745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.Debug|x64.Build.0 = Debug|x64
|
||||
{745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.Release|Itanium.ActiveCfg = Release|Win32
|
||||
{745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.Release|Win32.Build.0 = Release|Win32
|
||||
{745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.Release|x64.ActiveCfg = Release|x64
|
||||
{745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.Release|x64.Build.0 = Release|x64
|
||||
{745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.ReleaseWithoutAsm|Itanium.ActiveCfg = ReleaseWithoutAsm|Win32
|
||||
{745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.ReleaseWithoutAsm|Win32.ActiveCfg = ReleaseWithoutAsm|Win32
|
||||
{745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.ReleaseWithoutAsm|Win32.Build.0 = ReleaseWithoutAsm|Win32
|
||||
{745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.ReleaseWithoutAsm|x64.ActiveCfg = ReleaseWithoutAsm|x64
|
||||
{745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.ReleaseWithoutAsm|x64.Build.0 = ReleaseWithoutAsm|x64
|
||||
{AA6666AA-E09F-4135-9C0C-4FE50C3C654B}.Debug|Itanium.ActiveCfg = Debug|Win32
|
||||
{AA6666AA-E09F-4135-9C0C-4FE50C3C654B}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{AA6666AA-E09F-4135-9C0C-4FE50C3C654B}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{AA6666AA-E09F-4135-9C0C-4FE50C3C654B}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{AA6666AA-E09F-4135-9C0C-4FE50C3C654B}.Debug|x64.Build.0 = Debug|x64
|
||||
{AA6666AA-E09F-4135-9C0C-4FE50C3C654B}.Release|Itanium.ActiveCfg = Release|Win32
|
||||
{AA6666AA-E09F-4135-9C0C-4FE50C3C654B}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{AA6666AA-E09F-4135-9C0C-4FE50C3C654B}.Release|Win32.Build.0 = Release|Win32
|
||||
{AA6666AA-E09F-4135-9C0C-4FE50C3C654B}.Release|x64.ActiveCfg = Release|x64
|
||||
{AA6666AA-E09F-4135-9C0C-4FE50C3C654B}.Release|x64.Build.0 = Release|x64
|
||||
{AA6666AA-E09F-4135-9C0C-4FE50C3C654B}.ReleaseWithoutAsm|Itanium.ActiveCfg = ReleaseWithoutAsm|Win32
|
||||
{AA6666AA-E09F-4135-9C0C-4FE50C3C654B}.ReleaseWithoutAsm|Win32.ActiveCfg = ReleaseWithoutAsm|Win32
|
||||
{AA6666AA-E09F-4135-9C0C-4FE50C3C654B}.ReleaseWithoutAsm|Win32.Build.0 = ReleaseWithoutAsm|Win32
|
||||
{AA6666AA-E09F-4135-9C0C-4FE50C3C654B}.ReleaseWithoutAsm|x64.ActiveCfg = ReleaseWithoutAsm|x64
|
||||
{AA6666AA-E09F-4135-9C0C-4FE50C3C654B}.ReleaseWithoutAsm|x64.Build.0 = ReleaseWithoutAsm|x64
|
||||
{C52F9E7B-498A-42BE-8DB4-85A15694366A}.Debug|Itanium.ActiveCfg = Debug|Win32
|
||||
{C52F9E7B-498A-42BE-8DB4-85A15694366A}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{C52F9E7B-498A-42BE-8DB4-85A15694366A}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{C52F9E7B-498A-42BE-8DB4-85A15694366A}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{C52F9E7B-498A-42BE-8DB4-85A15694366A}.Debug|x64.Build.0 = Debug|x64
|
||||
{C52F9E7B-498A-42BE-8DB4-85A15694366A}.Release|Itanium.ActiveCfg = Release|Win32
|
||||
{C52F9E7B-498A-42BE-8DB4-85A15694366A}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{C52F9E7B-498A-42BE-8DB4-85A15694366A}.Release|Win32.Build.0 = Release|Win32
|
||||
{C52F9E7B-498A-42BE-8DB4-85A15694366A}.Release|x64.ActiveCfg = Release|x64
|
||||
{C52F9E7B-498A-42BE-8DB4-85A15694366A}.Release|x64.Build.0 = Release|x64
|
||||
{C52F9E7B-498A-42BE-8DB4-85A15694366A}.ReleaseWithoutAsm|Itanium.ActiveCfg = Release|Win32
|
||||
{C52F9E7B-498A-42BE-8DB4-85A15694366A}.ReleaseWithoutAsm|Win32.ActiveCfg = Release|Win32
|
||||
{C52F9E7B-498A-42BE-8DB4-85A15694366A}.ReleaseWithoutAsm|x64.ActiveCfg = Release|x64
|
||||
{48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}.Debug|Itanium.ActiveCfg = Debug|Win32
|
||||
{48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}.Debug|x64.Build.0 = Debug|x64
|
||||
{48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}.Release|Itanium.ActiveCfg = Release|Win32
|
||||
{48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}.Release|Win32.Build.0 = Release|Win32
|
||||
{48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}.Release|x64.ActiveCfg = Release|x64
|
||||
{48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}.Release|x64.Build.0 = Release|x64
|
||||
{48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}.ReleaseWithoutAsm|Itanium.ActiveCfg = Release|Win32
|
||||
{48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}.ReleaseWithoutAsm|Win32.ActiveCfg = Release|Win32
|
||||
{48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}.ReleaseWithoutAsm|x64.ActiveCfg = Release|x64
|
||||
{C52F9E7B-498A-42BE-8DB4-85A15694382A}.Debug|Itanium.ActiveCfg = Debug|Win32
|
||||
{C52F9E7B-498A-42BE-8DB4-85A15694382A}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{C52F9E7B-498A-42BE-8DB4-85A15694382A}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{C52F9E7B-498A-42BE-8DB4-85A15694382A}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{C52F9E7B-498A-42BE-8DB4-85A15694382A}.Debug|x64.Build.0 = Debug|x64
|
||||
{C52F9E7B-498A-42BE-8DB4-85A15694382A}.Release|Itanium.ActiveCfg = Release|Win32
|
||||
{C52F9E7B-498A-42BE-8DB4-85A15694382A}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{C52F9E7B-498A-42BE-8DB4-85A15694382A}.Release|Win32.Build.0 = Release|Win32
|
||||
{C52F9E7B-498A-42BE-8DB4-85A15694382A}.Release|x64.ActiveCfg = Release|x64
|
||||
{C52F9E7B-498A-42BE-8DB4-85A15694382A}.Release|x64.Build.0 = Release|x64
|
||||
{C52F9E7B-498A-42BE-8DB4-85A15694382A}.ReleaseWithoutAsm|Itanium.ActiveCfg = Release|Win32
|
||||
{C52F9E7B-498A-42BE-8DB4-85A15694382A}.ReleaseWithoutAsm|Win32.ActiveCfg = Release|Win32
|
||||
{C52F9E7B-498A-42BE-8DB4-85A15694382A}.ReleaseWithoutAsm|x64.ActiveCfg = Release|x64
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio 2013
|
||||
VisualStudioVersion = 12.0.40629.0
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "zlibvc", "zlibvc.vcxproj", "{8FD826F8-3739-44E6-8CC8-997122E53B8D}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "zlibstat", "zlibstat.vcxproj", "{745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testzlib", "testzlib.vcxproj", "{AA6666AA-E09F-4135-9C0C-4FE50C3C654B}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testzlibdll", "testzlibdll.vcxproj", "{C52F9E7B-498A-42BE-8DB4-85A15694366A}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "minizip", "minizip.vcxproj", "{48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "miniunz", "miniunz.vcxproj", "{C52F9E7B-498A-42BE-8DB4-85A15694382A}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Itanium = Debug|Itanium
|
||||
Debug|Win32 = Debug|Win32
|
||||
Debug|x64 = Debug|x64
|
||||
Release|Itanium = Release|Itanium
|
||||
Release|Win32 = Release|Win32
|
||||
Release|x64 = Release|x64
|
||||
ReleaseWithoutAsm|Itanium = ReleaseWithoutAsm|Itanium
|
||||
ReleaseWithoutAsm|Win32 = ReleaseWithoutAsm|Win32
|
||||
ReleaseWithoutAsm|x64 = ReleaseWithoutAsm|x64
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{8FD826F8-3739-44E6-8CC8-997122E53B8D}.Debug|Itanium.ActiveCfg = Debug|Win32
|
||||
{8FD826F8-3739-44E6-8CC8-997122E53B8D}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{8FD826F8-3739-44E6-8CC8-997122E53B8D}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{8FD826F8-3739-44E6-8CC8-997122E53B8D}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{8FD826F8-3739-44E6-8CC8-997122E53B8D}.Debug|x64.Build.0 = Debug|x64
|
||||
{8FD826F8-3739-44E6-8CC8-997122E53B8D}.Release|Itanium.ActiveCfg = Release|Win32
|
||||
{8FD826F8-3739-44E6-8CC8-997122E53B8D}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{8FD826F8-3739-44E6-8CC8-997122E53B8D}.Release|Win32.Build.0 = Release|Win32
|
||||
{8FD826F8-3739-44E6-8CC8-997122E53B8D}.Release|x64.ActiveCfg = Release|x64
|
||||
{8FD826F8-3739-44E6-8CC8-997122E53B8D}.Release|x64.Build.0 = Release|x64
|
||||
{8FD826F8-3739-44E6-8CC8-997122E53B8D}.ReleaseWithoutAsm|Itanium.ActiveCfg = ReleaseWithoutAsm|Win32
|
||||
{8FD826F8-3739-44E6-8CC8-997122E53B8D}.ReleaseWithoutAsm|Win32.ActiveCfg = ReleaseWithoutAsm|Win32
|
||||
{8FD826F8-3739-44E6-8CC8-997122E53B8D}.ReleaseWithoutAsm|Win32.Build.0 = ReleaseWithoutAsm|Win32
|
||||
{8FD826F8-3739-44E6-8CC8-997122E53B8D}.ReleaseWithoutAsm|x64.ActiveCfg = ReleaseWithoutAsm|x64
|
||||
{8FD826F8-3739-44E6-8CC8-997122E53B8D}.ReleaseWithoutAsm|x64.Build.0 = ReleaseWithoutAsm|x64
|
||||
{745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.Debug|Itanium.ActiveCfg = Debug|Win32
|
||||
{745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.Debug|x64.Build.0 = Debug|x64
|
||||
{745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.Release|Itanium.ActiveCfg = Release|Win32
|
||||
{745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.Release|Win32.Build.0 = Release|Win32
|
||||
{745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.Release|x64.ActiveCfg = Release|x64
|
||||
{745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.Release|x64.Build.0 = Release|x64
|
||||
{745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.ReleaseWithoutAsm|Itanium.ActiveCfg = ReleaseWithoutAsm|Win32
|
||||
{745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.ReleaseWithoutAsm|Win32.ActiveCfg = ReleaseWithoutAsm|Win32
|
||||
{745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.ReleaseWithoutAsm|Win32.Build.0 = ReleaseWithoutAsm|Win32
|
||||
{745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.ReleaseWithoutAsm|x64.ActiveCfg = ReleaseWithoutAsm|x64
|
||||
{745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.ReleaseWithoutAsm|x64.Build.0 = ReleaseWithoutAsm|x64
|
||||
{AA6666AA-E09F-4135-9C0C-4FE50C3C654B}.Debug|Itanium.ActiveCfg = Debug|Win32
|
||||
{AA6666AA-E09F-4135-9C0C-4FE50C3C654B}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{AA6666AA-E09F-4135-9C0C-4FE50C3C654B}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{AA6666AA-E09F-4135-9C0C-4FE50C3C654B}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{AA6666AA-E09F-4135-9C0C-4FE50C3C654B}.Debug|x64.Build.0 = Debug|x64
|
||||
{AA6666AA-E09F-4135-9C0C-4FE50C3C654B}.Release|Itanium.ActiveCfg = Release|Win32
|
||||
{AA6666AA-E09F-4135-9C0C-4FE50C3C654B}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{AA6666AA-E09F-4135-9C0C-4FE50C3C654B}.Release|Win32.Build.0 = Release|Win32
|
||||
{AA6666AA-E09F-4135-9C0C-4FE50C3C654B}.Release|x64.ActiveCfg = Release|x64
|
||||
{AA6666AA-E09F-4135-9C0C-4FE50C3C654B}.Release|x64.Build.0 = Release|x64
|
||||
{AA6666AA-E09F-4135-9C0C-4FE50C3C654B}.ReleaseWithoutAsm|Itanium.ActiveCfg = ReleaseWithoutAsm|Win32
|
||||
{AA6666AA-E09F-4135-9C0C-4FE50C3C654B}.ReleaseWithoutAsm|Win32.ActiveCfg = ReleaseWithoutAsm|Win32
|
||||
{AA6666AA-E09F-4135-9C0C-4FE50C3C654B}.ReleaseWithoutAsm|Win32.Build.0 = ReleaseWithoutAsm|Win32
|
||||
{AA6666AA-E09F-4135-9C0C-4FE50C3C654B}.ReleaseWithoutAsm|x64.ActiveCfg = ReleaseWithoutAsm|x64
|
||||
{AA6666AA-E09F-4135-9C0C-4FE50C3C654B}.ReleaseWithoutAsm|x64.Build.0 = ReleaseWithoutAsm|x64
|
||||
{C52F9E7B-498A-42BE-8DB4-85A15694366A}.Debug|Itanium.ActiveCfg = Debug|Win32
|
||||
{C52F9E7B-498A-42BE-8DB4-85A15694366A}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{C52F9E7B-498A-42BE-8DB4-85A15694366A}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{C52F9E7B-498A-42BE-8DB4-85A15694366A}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{C52F9E7B-498A-42BE-8DB4-85A15694366A}.Debug|x64.Build.0 = Debug|x64
|
||||
{C52F9E7B-498A-42BE-8DB4-85A15694366A}.Release|Itanium.ActiveCfg = Release|Win32
|
||||
{C52F9E7B-498A-42BE-8DB4-85A15694366A}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{C52F9E7B-498A-42BE-8DB4-85A15694366A}.Release|Win32.Build.0 = Release|Win32
|
||||
{C52F9E7B-498A-42BE-8DB4-85A15694366A}.Release|x64.ActiveCfg = Release|x64
|
||||
{C52F9E7B-498A-42BE-8DB4-85A15694366A}.Release|x64.Build.0 = Release|x64
|
||||
{C52F9E7B-498A-42BE-8DB4-85A15694366A}.ReleaseWithoutAsm|Itanium.ActiveCfg = Release|Win32
|
||||
{C52F9E7B-498A-42BE-8DB4-85A15694366A}.ReleaseWithoutAsm|Win32.ActiveCfg = Release|Win32
|
||||
{C52F9E7B-498A-42BE-8DB4-85A15694366A}.ReleaseWithoutAsm|x64.ActiveCfg = Release|x64
|
||||
{48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}.Debug|Itanium.ActiveCfg = Debug|Win32
|
||||
{48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}.Debug|x64.Build.0 = Debug|x64
|
||||
{48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}.Release|Itanium.ActiveCfg = Release|Win32
|
||||
{48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}.Release|Win32.Build.0 = Release|Win32
|
||||
{48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}.Release|x64.ActiveCfg = Release|x64
|
||||
{48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}.Release|x64.Build.0 = Release|x64
|
||||
{48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}.ReleaseWithoutAsm|Itanium.ActiveCfg = Release|Win32
|
||||
{48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}.ReleaseWithoutAsm|Win32.ActiveCfg = Release|Win32
|
||||
{48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}.ReleaseWithoutAsm|x64.ActiveCfg = Release|x64
|
||||
{C52F9E7B-498A-42BE-8DB4-85A15694382A}.Debug|Itanium.ActiveCfg = Debug|Win32
|
||||
{C52F9E7B-498A-42BE-8DB4-85A15694382A}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{C52F9E7B-498A-42BE-8DB4-85A15694382A}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{C52F9E7B-498A-42BE-8DB4-85A15694382A}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{C52F9E7B-498A-42BE-8DB4-85A15694382A}.Debug|x64.Build.0 = Debug|x64
|
||||
{C52F9E7B-498A-42BE-8DB4-85A15694382A}.Release|Itanium.ActiveCfg = Release|Win32
|
||||
{C52F9E7B-498A-42BE-8DB4-85A15694382A}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{C52F9E7B-498A-42BE-8DB4-85A15694382A}.Release|Win32.Build.0 = Release|Win32
|
||||
{C52F9E7B-498A-42BE-8DB4-85A15694382A}.Release|x64.ActiveCfg = Release|x64
|
||||
{C52F9E7B-498A-42BE-8DB4-85A15694382A}.Release|x64.Build.0 = Release|x64
|
||||
{C52F9E7B-498A-42BE-8DB4-85A15694382A}.ReleaseWithoutAsm|Itanium.ActiveCfg = Release|Win32
|
||||
{C52F9E7B-498A-42BE-8DB4-85A15694382A}.ReleaseWithoutAsm|Win32.ActiveCfg = Release|Win32
|
||||
{C52F9E7B-498A-42BE-8DB4-85A15694382A}.ReleaseWithoutAsm|x64.ActiveCfg = Release|x64
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
|
||||
@@ -1,119 +1,119 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio 14
|
||||
VisualStudioVersion = 14.0.25420.1
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "zlibvc", "zlibvc.vcxproj", "{8FD826F8-3739-44E6-8CC8-997122E53B8D}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "zlibstat", "zlibstat.vcxproj", "{745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testzlib", "testzlib.vcxproj", "{AA6666AA-E09F-4135-9C0C-4FE50C3C654B}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testzlibdll", "testzlibdll.vcxproj", "{C52F9E7B-498A-42BE-8DB4-85A15694366A}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "minizip", "minizip.vcxproj", "{48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "miniunz", "miniunz.vcxproj", "{C52F9E7B-498A-42BE-8DB4-85A15694382A}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Itanium = Debug|Itanium
|
||||
Debug|Win32 = Debug|Win32
|
||||
Debug|x64 = Debug|x64
|
||||
Release|Itanium = Release|Itanium
|
||||
Release|Win32 = Release|Win32
|
||||
Release|x64 = Release|x64
|
||||
ReleaseWithoutAsm|Itanium = ReleaseWithoutAsm|Itanium
|
||||
ReleaseWithoutAsm|Win32 = ReleaseWithoutAsm|Win32
|
||||
ReleaseWithoutAsm|x64 = ReleaseWithoutAsm|x64
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{8FD826F8-3739-44E6-8CC8-997122E53B8D}.Debug|Itanium.ActiveCfg = Debug|Win32
|
||||
{8FD826F8-3739-44E6-8CC8-997122E53B8D}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{8FD826F8-3739-44E6-8CC8-997122E53B8D}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{8FD826F8-3739-44E6-8CC8-997122E53B8D}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{8FD826F8-3739-44E6-8CC8-997122E53B8D}.Debug|x64.Build.0 = Debug|x64
|
||||
{8FD826F8-3739-44E6-8CC8-997122E53B8D}.Release|Itanium.ActiveCfg = Release|Win32
|
||||
{8FD826F8-3739-44E6-8CC8-997122E53B8D}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{8FD826F8-3739-44E6-8CC8-997122E53B8D}.Release|Win32.Build.0 = Release|Win32
|
||||
{8FD826F8-3739-44E6-8CC8-997122E53B8D}.Release|x64.ActiveCfg = Release|x64
|
||||
{8FD826F8-3739-44E6-8CC8-997122E53B8D}.Release|x64.Build.0 = Release|x64
|
||||
{8FD826F8-3739-44E6-8CC8-997122E53B8D}.ReleaseWithoutAsm|Itanium.ActiveCfg = ReleaseWithoutAsm|Win32
|
||||
{8FD826F8-3739-44E6-8CC8-997122E53B8D}.ReleaseWithoutAsm|Win32.ActiveCfg = ReleaseWithoutAsm|Win32
|
||||
{8FD826F8-3739-44E6-8CC8-997122E53B8D}.ReleaseWithoutAsm|Win32.Build.0 = ReleaseWithoutAsm|Win32
|
||||
{8FD826F8-3739-44E6-8CC8-997122E53B8D}.ReleaseWithoutAsm|x64.ActiveCfg = ReleaseWithoutAsm|x64
|
||||
{8FD826F8-3739-44E6-8CC8-997122E53B8D}.ReleaseWithoutAsm|x64.Build.0 = ReleaseWithoutAsm|x64
|
||||
{745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.Debug|Itanium.ActiveCfg = Debug|Win32
|
||||
{745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.Debug|x64.Build.0 = Debug|x64
|
||||
{745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.Release|Itanium.ActiveCfg = Release|Win32
|
||||
{745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.Release|Win32.Build.0 = Release|Win32
|
||||
{745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.Release|x64.ActiveCfg = Release|x64
|
||||
{745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.Release|x64.Build.0 = Release|x64
|
||||
{745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.ReleaseWithoutAsm|Itanium.ActiveCfg = ReleaseWithoutAsm|Win32
|
||||
{745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.ReleaseWithoutAsm|Win32.ActiveCfg = ReleaseWithoutAsm|Win32
|
||||
{745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.ReleaseWithoutAsm|Win32.Build.0 = ReleaseWithoutAsm|Win32
|
||||
{745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.ReleaseWithoutAsm|x64.ActiveCfg = ReleaseWithoutAsm|x64
|
||||
{745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.ReleaseWithoutAsm|x64.Build.0 = ReleaseWithoutAsm|x64
|
||||
{AA6666AA-E09F-4135-9C0C-4FE50C3C654B}.Debug|Itanium.ActiveCfg = Debug|Win32
|
||||
{AA6666AA-E09F-4135-9C0C-4FE50C3C654B}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{AA6666AA-E09F-4135-9C0C-4FE50C3C654B}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{AA6666AA-E09F-4135-9C0C-4FE50C3C654B}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{AA6666AA-E09F-4135-9C0C-4FE50C3C654B}.Debug|x64.Build.0 = Debug|x64
|
||||
{AA6666AA-E09F-4135-9C0C-4FE50C3C654B}.Release|Itanium.ActiveCfg = Release|Win32
|
||||
{AA6666AA-E09F-4135-9C0C-4FE50C3C654B}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{AA6666AA-E09F-4135-9C0C-4FE50C3C654B}.Release|Win32.Build.0 = Release|Win32
|
||||
{AA6666AA-E09F-4135-9C0C-4FE50C3C654B}.Release|x64.ActiveCfg = Release|x64
|
||||
{AA6666AA-E09F-4135-9C0C-4FE50C3C654B}.Release|x64.Build.0 = Release|x64
|
||||
{AA6666AA-E09F-4135-9C0C-4FE50C3C654B}.ReleaseWithoutAsm|Itanium.ActiveCfg = ReleaseWithoutAsm|Win32
|
||||
{AA6666AA-E09F-4135-9C0C-4FE50C3C654B}.ReleaseWithoutAsm|Win32.ActiveCfg = ReleaseWithoutAsm|Win32
|
||||
{AA6666AA-E09F-4135-9C0C-4FE50C3C654B}.ReleaseWithoutAsm|Win32.Build.0 = ReleaseWithoutAsm|Win32
|
||||
{AA6666AA-E09F-4135-9C0C-4FE50C3C654B}.ReleaseWithoutAsm|x64.ActiveCfg = ReleaseWithoutAsm|x64
|
||||
{AA6666AA-E09F-4135-9C0C-4FE50C3C654B}.ReleaseWithoutAsm|x64.Build.0 = ReleaseWithoutAsm|x64
|
||||
{C52F9E7B-498A-42BE-8DB4-85A15694366A}.Debug|Itanium.ActiveCfg = Debug|Win32
|
||||
{C52F9E7B-498A-42BE-8DB4-85A15694366A}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{C52F9E7B-498A-42BE-8DB4-85A15694366A}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{C52F9E7B-498A-42BE-8DB4-85A15694366A}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{C52F9E7B-498A-42BE-8DB4-85A15694366A}.Debug|x64.Build.0 = Debug|x64
|
||||
{C52F9E7B-498A-42BE-8DB4-85A15694366A}.Release|Itanium.ActiveCfg = Release|Win32
|
||||
{C52F9E7B-498A-42BE-8DB4-85A15694366A}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{C52F9E7B-498A-42BE-8DB4-85A15694366A}.Release|Win32.Build.0 = Release|Win32
|
||||
{C52F9E7B-498A-42BE-8DB4-85A15694366A}.Release|x64.ActiveCfg = Release|x64
|
||||
{C52F9E7B-498A-42BE-8DB4-85A15694366A}.Release|x64.Build.0 = Release|x64
|
||||
{C52F9E7B-498A-42BE-8DB4-85A15694366A}.ReleaseWithoutAsm|Itanium.ActiveCfg = Release|Win32
|
||||
{C52F9E7B-498A-42BE-8DB4-85A15694366A}.ReleaseWithoutAsm|Win32.ActiveCfg = Release|Win32
|
||||
{C52F9E7B-498A-42BE-8DB4-85A15694366A}.ReleaseWithoutAsm|x64.ActiveCfg = Release|x64
|
||||
{48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}.Debug|Itanium.ActiveCfg = Debug|Win32
|
||||
{48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}.Debug|x64.Build.0 = Debug|x64
|
||||
{48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}.Release|Itanium.ActiveCfg = Release|Win32
|
||||
{48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}.Release|Win32.Build.0 = Release|Win32
|
||||
{48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}.Release|x64.ActiveCfg = Release|x64
|
||||
{48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}.Release|x64.Build.0 = Release|x64
|
||||
{48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}.ReleaseWithoutAsm|Itanium.ActiveCfg = Release|Win32
|
||||
{48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}.ReleaseWithoutAsm|Win32.ActiveCfg = Release|Win32
|
||||
{48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}.ReleaseWithoutAsm|x64.ActiveCfg = Release|x64
|
||||
{C52F9E7B-498A-42BE-8DB4-85A15694382A}.Debug|Itanium.ActiveCfg = Debug|Win32
|
||||
{C52F9E7B-498A-42BE-8DB4-85A15694382A}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{C52F9E7B-498A-42BE-8DB4-85A15694382A}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{C52F9E7B-498A-42BE-8DB4-85A15694382A}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{C52F9E7B-498A-42BE-8DB4-85A15694382A}.Debug|x64.Build.0 = Debug|x64
|
||||
{C52F9E7B-498A-42BE-8DB4-85A15694382A}.Release|Itanium.ActiveCfg = Release|Win32
|
||||
{C52F9E7B-498A-42BE-8DB4-85A15694382A}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{C52F9E7B-498A-42BE-8DB4-85A15694382A}.Release|Win32.Build.0 = Release|Win32
|
||||
{C52F9E7B-498A-42BE-8DB4-85A15694382A}.Release|x64.ActiveCfg = Release|x64
|
||||
{C52F9E7B-498A-42BE-8DB4-85A15694382A}.Release|x64.Build.0 = Release|x64
|
||||
{C52F9E7B-498A-42BE-8DB4-85A15694382A}.ReleaseWithoutAsm|Itanium.ActiveCfg = Release|Win32
|
||||
{C52F9E7B-498A-42BE-8DB4-85A15694382A}.ReleaseWithoutAsm|Win32.ActiveCfg = Release|Win32
|
||||
{C52F9E7B-498A-42BE-8DB4-85A15694382A}.ReleaseWithoutAsm|x64.ActiveCfg = Release|x64
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio 14
|
||||
VisualStudioVersion = 14.0.25420.1
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "zlibvc", "zlibvc.vcxproj", "{8FD826F8-3739-44E6-8CC8-997122E53B8D}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "zlibstat", "zlibstat.vcxproj", "{745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testzlib", "testzlib.vcxproj", "{AA6666AA-E09F-4135-9C0C-4FE50C3C654B}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testzlibdll", "testzlibdll.vcxproj", "{C52F9E7B-498A-42BE-8DB4-85A15694366A}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "minizip", "minizip.vcxproj", "{48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "miniunz", "miniunz.vcxproj", "{C52F9E7B-498A-42BE-8DB4-85A15694382A}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Itanium = Debug|Itanium
|
||||
Debug|Win32 = Debug|Win32
|
||||
Debug|x64 = Debug|x64
|
||||
Release|Itanium = Release|Itanium
|
||||
Release|Win32 = Release|Win32
|
||||
Release|x64 = Release|x64
|
||||
ReleaseWithoutAsm|Itanium = ReleaseWithoutAsm|Itanium
|
||||
ReleaseWithoutAsm|Win32 = ReleaseWithoutAsm|Win32
|
||||
ReleaseWithoutAsm|x64 = ReleaseWithoutAsm|x64
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{8FD826F8-3739-44E6-8CC8-997122E53B8D}.Debug|Itanium.ActiveCfg = Debug|Win32
|
||||
{8FD826F8-3739-44E6-8CC8-997122E53B8D}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{8FD826F8-3739-44E6-8CC8-997122E53B8D}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{8FD826F8-3739-44E6-8CC8-997122E53B8D}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{8FD826F8-3739-44E6-8CC8-997122E53B8D}.Debug|x64.Build.0 = Debug|x64
|
||||
{8FD826F8-3739-44E6-8CC8-997122E53B8D}.Release|Itanium.ActiveCfg = Release|Win32
|
||||
{8FD826F8-3739-44E6-8CC8-997122E53B8D}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{8FD826F8-3739-44E6-8CC8-997122E53B8D}.Release|Win32.Build.0 = Release|Win32
|
||||
{8FD826F8-3739-44E6-8CC8-997122E53B8D}.Release|x64.ActiveCfg = Release|x64
|
||||
{8FD826F8-3739-44E6-8CC8-997122E53B8D}.Release|x64.Build.0 = Release|x64
|
||||
{8FD826F8-3739-44E6-8CC8-997122E53B8D}.ReleaseWithoutAsm|Itanium.ActiveCfg = ReleaseWithoutAsm|Win32
|
||||
{8FD826F8-3739-44E6-8CC8-997122E53B8D}.ReleaseWithoutAsm|Win32.ActiveCfg = ReleaseWithoutAsm|Win32
|
||||
{8FD826F8-3739-44E6-8CC8-997122E53B8D}.ReleaseWithoutAsm|Win32.Build.0 = ReleaseWithoutAsm|Win32
|
||||
{8FD826F8-3739-44E6-8CC8-997122E53B8D}.ReleaseWithoutAsm|x64.ActiveCfg = ReleaseWithoutAsm|x64
|
||||
{8FD826F8-3739-44E6-8CC8-997122E53B8D}.ReleaseWithoutAsm|x64.Build.0 = ReleaseWithoutAsm|x64
|
||||
{745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.Debug|Itanium.ActiveCfg = Debug|Win32
|
||||
{745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.Debug|x64.Build.0 = Debug|x64
|
||||
{745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.Release|Itanium.ActiveCfg = Release|Win32
|
||||
{745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.Release|Win32.Build.0 = Release|Win32
|
||||
{745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.Release|x64.ActiveCfg = Release|x64
|
||||
{745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.Release|x64.Build.0 = Release|x64
|
||||
{745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.ReleaseWithoutAsm|Itanium.ActiveCfg = ReleaseWithoutAsm|Win32
|
||||
{745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.ReleaseWithoutAsm|Win32.ActiveCfg = ReleaseWithoutAsm|Win32
|
||||
{745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.ReleaseWithoutAsm|Win32.Build.0 = ReleaseWithoutAsm|Win32
|
||||
{745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.ReleaseWithoutAsm|x64.ActiveCfg = ReleaseWithoutAsm|x64
|
||||
{745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.ReleaseWithoutAsm|x64.Build.0 = ReleaseWithoutAsm|x64
|
||||
{AA6666AA-E09F-4135-9C0C-4FE50C3C654B}.Debug|Itanium.ActiveCfg = Debug|Win32
|
||||
{AA6666AA-E09F-4135-9C0C-4FE50C3C654B}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{AA6666AA-E09F-4135-9C0C-4FE50C3C654B}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{AA6666AA-E09F-4135-9C0C-4FE50C3C654B}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{AA6666AA-E09F-4135-9C0C-4FE50C3C654B}.Debug|x64.Build.0 = Debug|x64
|
||||
{AA6666AA-E09F-4135-9C0C-4FE50C3C654B}.Release|Itanium.ActiveCfg = Release|Win32
|
||||
{AA6666AA-E09F-4135-9C0C-4FE50C3C654B}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{AA6666AA-E09F-4135-9C0C-4FE50C3C654B}.Release|Win32.Build.0 = Release|Win32
|
||||
{AA6666AA-E09F-4135-9C0C-4FE50C3C654B}.Release|x64.ActiveCfg = Release|x64
|
||||
{AA6666AA-E09F-4135-9C0C-4FE50C3C654B}.Release|x64.Build.0 = Release|x64
|
||||
{AA6666AA-E09F-4135-9C0C-4FE50C3C654B}.ReleaseWithoutAsm|Itanium.ActiveCfg = ReleaseWithoutAsm|Win32
|
||||
{AA6666AA-E09F-4135-9C0C-4FE50C3C654B}.ReleaseWithoutAsm|Win32.ActiveCfg = ReleaseWithoutAsm|Win32
|
||||
{AA6666AA-E09F-4135-9C0C-4FE50C3C654B}.ReleaseWithoutAsm|Win32.Build.0 = ReleaseWithoutAsm|Win32
|
||||
{AA6666AA-E09F-4135-9C0C-4FE50C3C654B}.ReleaseWithoutAsm|x64.ActiveCfg = ReleaseWithoutAsm|x64
|
||||
{AA6666AA-E09F-4135-9C0C-4FE50C3C654B}.ReleaseWithoutAsm|x64.Build.0 = ReleaseWithoutAsm|x64
|
||||
{C52F9E7B-498A-42BE-8DB4-85A15694366A}.Debug|Itanium.ActiveCfg = Debug|Win32
|
||||
{C52F9E7B-498A-42BE-8DB4-85A15694366A}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{C52F9E7B-498A-42BE-8DB4-85A15694366A}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{C52F9E7B-498A-42BE-8DB4-85A15694366A}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{C52F9E7B-498A-42BE-8DB4-85A15694366A}.Debug|x64.Build.0 = Debug|x64
|
||||
{C52F9E7B-498A-42BE-8DB4-85A15694366A}.Release|Itanium.ActiveCfg = Release|Win32
|
||||
{C52F9E7B-498A-42BE-8DB4-85A15694366A}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{C52F9E7B-498A-42BE-8DB4-85A15694366A}.Release|Win32.Build.0 = Release|Win32
|
||||
{C52F9E7B-498A-42BE-8DB4-85A15694366A}.Release|x64.ActiveCfg = Release|x64
|
||||
{C52F9E7B-498A-42BE-8DB4-85A15694366A}.Release|x64.Build.0 = Release|x64
|
||||
{C52F9E7B-498A-42BE-8DB4-85A15694366A}.ReleaseWithoutAsm|Itanium.ActiveCfg = Release|Win32
|
||||
{C52F9E7B-498A-42BE-8DB4-85A15694366A}.ReleaseWithoutAsm|Win32.ActiveCfg = Release|Win32
|
||||
{C52F9E7B-498A-42BE-8DB4-85A15694366A}.ReleaseWithoutAsm|x64.ActiveCfg = Release|x64
|
||||
{48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}.Debug|Itanium.ActiveCfg = Debug|Win32
|
||||
{48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}.Debug|x64.Build.0 = Debug|x64
|
||||
{48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}.Release|Itanium.ActiveCfg = Release|Win32
|
||||
{48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}.Release|Win32.Build.0 = Release|Win32
|
||||
{48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}.Release|x64.ActiveCfg = Release|x64
|
||||
{48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}.Release|x64.Build.0 = Release|x64
|
||||
{48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}.ReleaseWithoutAsm|Itanium.ActiveCfg = Release|Win32
|
||||
{48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}.ReleaseWithoutAsm|Win32.ActiveCfg = Release|Win32
|
||||
{48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}.ReleaseWithoutAsm|x64.ActiveCfg = Release|x64
|
||||
{C52F9E7B-498A-42BE-8DB4-85A15694382A}.Debug|Itanium.ActiveCfg = Debug|Win32
|
||||
{C52F9E7B-498A-42BE-8DB4-85A15694382A}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{C52F9E7B-498A-42BE-8DB4-85A15694382A}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{C52F9E7B-498A-42BE-8DB4-85A15694382A}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{C52F9E7B-498A-42BE-8DB4-85A15694382A}.Debug|x64.Build.0 = Debug|x64
|
||||
{C52F9E7B-498A-42BE-8DB4-85A15694382A}.Release|Itanium.ActiveCfg = Release|Win32
|
||||
{C52F9E7B-498A-42BE-8DB4-85A15694382A}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{C52F9E7B-498A-42BE-8DB4-85A15694382A}.Release|Win32.Build.0 = Release|Win32
|
||||
{C52F9E7B-498A-42BE-8DB4-85A15694382A}.Release|x64.ActiveCfg = Release|x64
|
||||
{C52F9E7B-498A-42BE-8DB4-85A15694382A}.Release|x64.Build.0 = Release|x64
|
||||
{C52F9E7B-498A-42BE-8DB4-85A15694382A}.ReleaseWithoutAsm|Itanium.ActiveCfg = Release|Win32
|
||||
{C52F9E7B-498A-42BE-8DB4-85A15694382A}.ReleaseWithoutAsm|Win32.ActiveCfg = Release|Win32
|
||||
{C52F9E7B-498A-42BE-8DB4-85A15694382A}.ReleaseWithoutAsm|x64.ActiveCfg = Release|x64
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 10.00
|
||||
# Visual Studio 2008
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "zlibvc", "zlibvc.vcproj", "{8FD826F8-3739-44E6-8CC8-997122E53B8D}"
|
||||
|
||||
@@ -4,11 +4,11 @@
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
.TH Tcl_CreateAlias 3 7.6 Tcl "Tcl Library Procedures"
|
||||
.TH Tcl_CreateSlave 3 7.6 Tcl "Tcl Library Procedures"
|
||||
.so man.macros
|
||||
.BS
|
||||
.SH NAME
|
||||
Tcl_IsSafe, Tcl_MakeSafe, Tcl_CreateChild, Tcl_CreateSlave, Tcl_GetChild, Tcl_GetSlave, Tcl_GetParent, Tcl_GetMaster, Tcl_GetInterpPath, Tcl_CreateAlias, Tcl_CreateAliasObj, Tcl_GetAlias, Tcl_GetAliasObj, Tcl_ExposeCommand, Tcl_HideCommand \- manage multiple Tcl interpreters, aliases and hidden commands
|
||||
Tcl_IsSafe, Tcl_MakeSafe, Tcl_CreateSlave, Tcl_GetSlave, Tcl_GetMaster, Tcl_GetInterpPath, Tcl_CreateAlias, Tcl_CreateAliasObj, Tcl_GetAlias, Tcl_GetAliasObj, Tcl_ExposeCommand, Tcl_HideCommand \- manage multiple Tcl interpreters, aliases and hidden commands
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
\fB#include <tcl.h>\fR
|
||||
@@ -20,40 +20,31 @@ int
|
||||
\fBTcl_MakeSafe\fR(\fIinterp\fR)
|
||||
.sp
|
||||
Tcl_Interp *
|
||||
\fBTcl_CreateChild\fR(\fIinterp, name, isSafe\fR)
|
||||
\fBTcl_CreateSlave\fR(\fIinterp, slaveName, isSafe\fR)
|
||||
.sp
|
||||
Tcl_Interp *
|
||||
\fBTcl_CreateSlave\fR(\fIinterp, name, isSafe\fR)
|
||||
.sp
|
||||
Tcl_Interp *
|
||||
\fBTcl_GetSlave\fR(\fIinterp, name\fR)
|
||||
.sp
|
||||
Tcl_Interp *
|
||||
\fBTcl_GetChild\fR(\fIinterp, name\fR)
|
||||
\fBTcl_GetSlave\fR(\fIinterp, slaveName\fR)
|
||||
.sp
|
||||
Tcl_Interp *
|
||||
\fBTcl_GetMaster\fR(\fIinterp\fR)
|
||||
.sp
|
||||
Tcl_Interp *
|
||||
\fBTcl_GetParent\fR(\fIinterp\fR)
|
||||
int
|
||||
\fBTcl_GetInterpPath\fR(\fIaskingInterp, slaveInterp\fR)
|
||||
.sp
|
||||
int
|
||||
\fBTcl_GetInterpPath\fR(\fIinterp, childInterp\fR)
|
||||
.sp
|
||||
int
|
||||
\fBTcl_CreateAlias\fR(\fIchildInterp, childCmd, targetInterp, targetCmd,
|
||||
\fBTcl_CreateAlias\fR(\fIslaveInterp, slaveCmd, targetInterp, targetCmd,
|
||||
argc, argv\fR)
|
||||
.sp
|
||||
int
|
||||
\fBTcl_CreateAliasObj\fR(\fIchildInterp, childCmd, targetInterp, targetCmd,
|
||||
\fBTcl_CreateAliasObj\fR(\fIslaveInterp, slaveCmd, targetInterp, targetCmd,
|
||||
objc, objv\fR)
|
||||
.sp
|
||||
int
|
||||
\fBTcl_GetAlias\fR(\fIinterp, childCmd, targetInterpPtr, targetCmdPtr,
|
||||
\fBTcl_GetAlias\fR(\fIinterp, slaveCmd, targetInterpPtr, targetCmdPtr,
|
||||
argcPtr, argvPtr\fR)
|
||||
.sp
|
||||
int
|
||||
\fBTcl_GetAliasObj\fR(\fIinterp, childCmd, targetInterpPtr, targetCmdPtr,
|
||||
\fBTcl_GetAliasObj\fR(\fIinterp, slaveCmd, targetInterpPtr, targetCmdPtr,
|
||||
objcPtr, objvPtr\fR)
|
||||
.sp
|
||||
int
|
||||
@@ -65,17 +56,17 @@ int
|
||||
.AS "const char *const" **targetInterpPtr out
|
||||
.AP Tcl_Interp *interp in
|
||||
Interpreter in which to execute the specified command.
|
||||
.AP "const char" *name in
|
||||
Name of child interpreter to create or manipulate.
|
||||
.AP "const char" *slaveName in
|
||||
Name of slave interpreter to create or manipulate.
|
||||
.AP int isSafe in
|
||||
If non-zero, a
|
||||
.QW safe
|
||||
child that is suitable for running untrusted code
|
||||
is created, otherwise a trusted child is created.
|
||||
.AP Tcl_Interp *childInterp in
|
||||
slave that is suitable for running untrusted code
|
||||
is created, otherwise a trusted slave is created.
|
||||
.AP Tcl_Interp *slaveInterp in
|
||||
Interpreter to use for creating the source command for an alias (see
|
||||
below).
|
||||
.AP "const char" *childCmd in
|
||||
.AP "const char" *slaveCmd in
|
||||
Name of source command for alias.
|
||||
.AP Tcl_Interp *targetInterp in
|
||||
Interpreter that contains the target command for an alias.
|
||||
@@ -130,19 +121,17 @@ interpreter. The return value for those procedures that return an \fBint\fR
|
||||
is either \fBTCL_OK\fR or \fBTCL_ERROR\fR. If \fBTCL_ERROR\fR is returned
|
||||
then the interpreter's result contains an error message.
|
||||
.PP
|
||||
\fBTcl_CreateChild\fR creates a new interpreter as a child of \fIinterp\fR.
|
||||
It also creates a child command named \fIname\fR in \fIinterp\fR which
|
||||
allows \fIinterp\fR to manipulate the new child.
|
||||
If \fIisSafe\fR is zero, the command creates a trusted child in which Tcl
|
||||
\fBTcl_CreateSlave\fR creates a new interpreter as a slave of \fIinterp\fR.
|
||||
It also creates a slave command named \fIslaveName\fR in \fIinterp\fR which
|
||||
allows \fIinterp\fR to manipulate the new slave.
|
||||
If \fIisSafe\fR is zero, the command creates a trusted slave in which Tcl
|
||||
code has access to all the Tcl commands.
|
||||
If it is \fB1\fR, the command creates a
|
||||
.QW safe
|
||||
child in which Tcl code has access only to set of Tcl commands defined as
|
||||
slave in which Tcl code has access only to set of Tcl commands defined as
|
||||
.QW "Safe Tcl" ;
|
||||
see the manual entry for the Tcl \fBinterp\fR command for details.
|
||||
If the creation of the new child interpreter failed, \fBNULL\fR is returned.
|
||||
.PP
|
||||
\fBTcl_CreateSlave\fR is a synonym for \fBTcl_CreateChild\fR.
|
||||
If the creation of the new slave interpreter failed, \fBNULL\fR is returned.
|
||||
.PP
|
||||
\fBTcl_IsSafe\fR returns \fB1\fR if \fIinterp\fR is
|
||||
.QW safe
|
||||
@@ -158,38 +147,34 @@ from \fIinterp\fR. However, it cannot know what parts of an extension
|
||||
or application are safe and does not make any attempt to remove those
|
||||
parts, so safety is not guaranteed after calling \fBTcl_MakeSafe\fR.
|
||||
Callers will want to take care with their use of \fBTcl_MakeSafe\fR
|
||||
to avoid false claims of safety. For many situations, \fBTcl_CreateChild\fR
|
||||
to avoid false claims of safety. For many situations, \fBTcl_CreateSlave\fR
|
||||
may be a better choice, since it creates interpreters in a known-safe state.
|
||||
.PP
|
||||
\fBTcl_GetChild\fR returns a pointer to a child interpreter of
|
||||
\fIinterp\fR. The child interpreter is identified by \fIname\fR.
|
||||
If no such child interpreter exists, \fBNULL\fR is returned.
|
||||
\fBTcl_GetSlave\fR returns a pointer to a slave interpreter of
|
||||
\fIinterp\fR. The slave interpreter is identified by \fIslaveName\fR.
|
||||
If no such slave interpreter exists, \fBNULL\fR is returned.
|
||||
.PP
|
||||
\fBTcl_GetSlave\fR is a synonym for \fBTcl_GetChild\fR.
|
||||
.PP
|
||||
\fBTcl_GetParent\fR returns a pointer to the parent interpreter of
|
||||
\fIinterp\fR. If \fIinterp\fR has no parent (it is a
|
||||
\fBTcl_GetMaster\fR returns a pointer to the master interpreter of
|
||||
\fIinterp\fR. If \fIinterp\fR has no master (it is a
|
||||
top-level interpreter) then \fBNULL\fR is returned.
|
||||
.PP
|
||||
\fBTcl_GetMaster\fR is a synonym for \fBTcl_GetParent\fR.
|
||||
.PP
|
||||
\fBTcl_GetInterpPath\fR stores in the result of \fIinterp\fR
|
||||
the relative path between \fIinterp\fR and \fIchildInterp\fR;
|
||||
\fIchildInterp\fR must be a child of \fIinterp\fR. If the computation
|
||||
\fBTcl_GetInterpPath\fR stores in the result of \fIaskingInterp\fR
|
||||
the relative path between \fIaskingInterp\fR and \fIslaveInterp\fR;
|
||||
\fIslaveInterp\fR must be a slave of \fIaskingInterp\fR. If the computation
|
||||
of the relative path succeeds, \fBTCL_OK\fR is returned, else
|
||||
\fBTCL_ERROR\fR is returned and an error message is stored as the
|
||||
result of \fIinterp\fR.
|
||||
result of \fIaskingInterp\fR.
|
||||
.PP
|
||||
\fBTcl_CreateAlias\fR creates a command named \fIchildCmd\fR in
|
||||
\fIchildInterp\fR that when invoked, will cause the command \fItargetCmd\fR
|
||||
\fBTcl_CreateAlias\fR creates a command named \fIslaveCmd\fR in
|
||||
\fIslaveInterp\fR that when invoked, will cause the command \fItargetCmd\fR
|
||||
to be invoked in \fItargetInterp\fR. The arguments specified by the strings
|
||||
contained in \fIargv\fR are always prepended to any arguments supplied in the
|
||||
invocation of \fIchildCmd\fR and passed to \fItargetCmd\fR.
|
||||
invocation of \fIslaveCmd\fR and passed to \fItargetCmd\fR.
|
||||
This operation returns \fBTCL_OK\fR if it succeeds, or \fBTCL_ERROR\fR if
|
||||
it fails; in that case, an error message is left in the value result
|
||||
of \fIchildInterp\fR.
|
||||
of \fIslaveInterp\fR.
|
||||
Note that there are no restrictions on the ancestry relationship (as
|
||||
created by \fBTcl_CreateChild\fR) between \fIchildInterp\fR and
|
||||
created by \fBTcl_CreateSlave\fR) between \fIslaveInterp\fR and
|
||||
\fItargetInterp\fR. Any two interpreters can be used, without any
|
||||
restrictions on how they are related.
|
||||
.PP
|
||||
@@ -248,4 +233,4 @@ interp
|
||||
|
||||
.SH KEYWORDS
|
||||
alias, command, exposed commands, hidden commands, interpreter, invoke,
|
||||
parent, child
|
||||
master, slave
|
||||
+4
-4
@@ -414,7 +414,7 @@ caller (with a reference count of 0).
|
||||
the encoding identified by \fIencodingName\fR and evaluates
|
||||
its contents as a Tcl script. It returns the same information as
|
||||
\fBTcl_EvalObjEx\fR.
|
||||
If \fIencodingName\fR is NULL, the utf-8 encoding is used for
|
||||
If \fIencodingName\fR is NULL, the system encoding is used for
|
||||
reading the file contents.
|
||||
If the file could not be read then a Tcl error is returned to describe
|
||||
why the file could not be read.
|
||||
@@ -430,7 +430,7 @@ or
|
||||
which will be safely substituted by the Tcl interpreter into
|
||||
.QW ^Z .
|
||||
\fBTcl_FSEvalFile\fR is a simpler version of
|
||||
\fBTcl_FSEvalFileEx\fR that always uses the utf-8 encoding
|
||||
\fBTcl_FSEvalFileEx\fR that always uses the system encoding
|
||||
when reading the file.
|
||||
.PP
|
||||
\fBTcl_FSLoadFile\fR dynamically loads a binary code file into memory and
|
||||
@@ -1340,11 +1340,11 @@ is considered to be owned by the filesystem (not by Tcl's core), but
|
||||
should be given a reference count for Tcl. Tcl will use the contents of the
|
||||
list and then decrement that reference count. This allows filesystems to
|
||||
choose whether they actually want to retain a
|
||||
.QW "global list"
|
||||
.QW "master list"
|
||||
of volumes
|
||||
or not (if not, they generate the list on the fly and pass it to Tcl
|
||||
with a reference count of 1 and then forget about the list, if yes, then
|
||||
they simply increment the reference count of their global list and pass it
|
||||
they simply increment the reference count of their master list and pass it
|
||||
to Tcl which will copy the contents and then decrement the count back
|
||||
to where it was).
|
||||
.PP
|
||||
|
||||
+6
-13
@@ -27,22 +27,19 @@ Interpreter to use for error reporting; if NULL, then no message is
|
||||
provided on errors.
|
||||
.AP Tcl_Obj *objPtr in/out
|
||||
The string value of this value is used to search through \fItablePtr\fR.
|
||||
If the \fBTCL_INDEX_TEMP_TABLE\fR flag is not specified,
|
||||
the internal representation is modified to hold the index of the matching
|
||||
The internal representation is modified to hold the index of the matching
|
||||
table entry.
|
||||
.AP "const char *const" *tablePtr in
|
||||
An array of null-terminated strings. The end of the array is marked
|
||||
by a NULL string pointer.
|
||||
Note that, unless the \fBTCL_INDEX_TEMP_TABLE\fR flag is specified,
|
||||
references to the \fItablePtr\fR may be retained in the
|
||||
Note that references to the \fItablePtr\fR may be retained in the
|
||||
internal representation of \fIobjPtr\fR, so this should represent the
|
||||
address of a statically-allocated array.
|
||||
.AP "const void" *structTablePtr in
|
||||
An array of arbitrary type, typically some \fBstruct\fR type.
|
||||
The first member of the structure must be a null-terminated string.
|
||||
The size of the structure is given by \fIoffset\fR.
|
||||
Note that, unless the \fBTCL_INDEX_TEMP_TABLE\fR flag is specified,
|
||||
references to the \fIstructTablePtr\fR may be retained in the
|
||||
Note that references to the \fIstructTablePtr\fR may be retained in the
|
||||
internal representation of \fIobjPtr\fR, so this should represent the
|
||||
address of a statically-allocated array of structures.
|
||||
.AP int offset in
|
||||
@@ -53,8 +50,7 @@ Null-terminated string describing what is being looked up, such as
|
||||
\fBoption\fR. This string is included in error messages.
|
||||
.AP int flags in
|
||||
OR-ed combination of bits providing additional information for
|
||||
operation. The only bits that are currently defined are \fBTCL_EXACT\fR
|
||||
and \fBTCL_INDEX_TEMP_TABLE\fR.
|
||||
operation. The only bit that is currently defined is \fBTCL_EXACT\fR.
|
||||
.AP int *indexPtr out
|
||||
The index of the string in \fItablePtr\fR that matches the value of
|
||||
\fIobjPtr\fR is returned here.
|
||||
@@ -80,8 +76,7 @@ error message to indicate what was being looked up. For example,
|
||||
if \fImsg\fR is \fBoption\fR the error message will have a form like
|
||||
.QW "\fBbad option \N'34'firt\N'34': must be first, second, or third\fR" .
|
||||
.PP
|
||||
If the \fBTCL_INDEX_TEMP_TABLE\fR was not specified, when
|
||||
\fBTcl_GetIndexFromObj\fR completes successfully it modifies the
|
||||
If \fBTcl_GetIndexFromObj\fR completes successfully it modifies the
|
||||
internal representation of \fIobjPtr\fR to hold the address of
|
||||
the table and the index of the matching entry. If \fBTcl_GetIndexFromObj\fR
|
||||
is invoked again with the same \fIobjPtr\fR and \fItablePtr\fR
|
||||
@@ -89,9 +84,7 @@ arguments (e.g. during a reinvocation of a Tcl command), it returns
|
||||
the matching index immediately without having to redo the lookup
|
||||
operation. Note: \fBTcl_GetIndexFromObj\fR assumes that the entries
|
||||
in \fItablePtr\fR are static: they must not change between
|
||||
invocations. This caching mechanism can be disallowed by specifying
|
||||
the \fBTCL_INDEX_TEMP_TABLE\fR flag.
|
||||
If the value of \fIobjPtr\fR is the empty string,
|
||||
invocations. If the value of \fIobjPtr\fR is the empty string,
|
||||
\fBTcl_GetIndexFromObj\fR will treat it as a non-matching value
|
||||
and return \fBTCL_ERROR\fR.
|
||||
.PP
|
||||
|
||||
+1
-1
@@ -116,7 +116,7 @@ execution of the callbacks is unspecified) execution in the limited
|
||||
interpreter is stopped by raising an error and setting a flag that
|
||||
prevents the \fBcatch\fR command in that interpreter from trapping
|
||||
that error. It is up to the context that started execution in that
|
||||
interpreter (typically the main interpreter) to handle the error.
|
||||
interpreter (typically a master interpreter) to handle the error.
|
||||
.SH "LIMIT CHECKING API"
|
||||
.PP
|
||||
To check the resource limits for an interpreter, call
|
||||
|
||||
+1
-3
@@ -138,9 +138,7 @@ create a new value or modify an existing value to hold
|
||||
the \fIobjc\fR elements of the array referenced by \fIobjv\fR
|
||||
where each element is a pointer to a Tcl value.
|
||||
If \fIobjc\fR is less than or equal to zero,
|
||||
they return an empty value. If \fIobjv\fR is NULL, the resulting list
|
||||
contains 0 elements, with reserved space in an internal representation
|
||||
for \fIobjc\fR more elements (to avoid its reallocation later).
|
||||
they return an empty value.
|
||||
The new value's string representation is left invalid.
|
||||
The two procedures increment the reference counts
|
||||
of the elements in \fIobjc\fR since the list value now refers to them.
|
||||
|
||||
@@ -223,10 +223,7 @@ before this range overflows, or when the maximum of eight digits
|
||||
is reached. The upper bits of the Unicode character will be 0.
|
||||
.RS
|
||||
.PP
|
||||
The range U+00D800\(enU+00DFFF is reserved for surrogates, which
|
||||
are illegal on its own. Therefore, such sequences will result in
|
||||
the replacement character U+FFFD. Surrogate pairs should be
|
||||
encoded as single \e\fBU\fIhhhhhhhh\fR character.
|
||||
The range U+010000\(enU+10FFFD is reserved for the future.
|
||||
.RE
|
||||
.PP
|
||||
Backslash substitution is not performed on words enclosed in braces,
|
||||
|
||||
+6
-6
@@ -79,7 +79,7 @@ against the standard Tcl library. Extensions (stub-enabled or
|
||||
not) are not intended to call \fBTcl_Main\fR.
|
||||
.PP
|
||||
\fBTcl_Main\fR is not thread-safe. It should only be called by
|
||||
a single main thread of a multi-threaded application. This
|
||||
a single master thread of a multi-threaded application. This
|
||||
restriction is not a problem with normal use described above.
|
||||
.PP
|
||||
\fBTcl_Main\fR and therefore all applications based upon it, like
|
||||
@@ -112,7 +112,7 @@ The file name and encoding values managed by the routines
|
||||
\fBTcl_SetStartupScript\fR and \fBTcl_GetStartupScript\fR
|
||||
are stored per-thread. Although the storage and retrieval
|
||||
functions of these routines work in any thread, only those
|
||||
calls in the same main thread as \fBTcl_Main\fR can have
|
||||
calls in the same master thread as \fBTcl_Main\fR can have
|
||||
any influence on it.
|
||||
.PP
|
||||
The caller of \fBTcl_Main\fR may call \fBTcl_SetStartupScript\fR
|
||||
@@ -126,7 +126,7 @@ a \fIstartup script\fR, and \fIname\fR is taken to be the name
|
||||
of the encoding of the contents of that file. \fBTcl_Main\fR
|
||||
then calls \fBTcl_SetStartupScript\fR with these values.
|
||||
.PP
|
||||
\fBTcl_Main\fR then defines in its main interpreter
|
||||
\fBTcl_Main\fR then defines in its master interpreter
|
||||
the Tcl variables \fIargc\fR, \fIargv\fR, \fIargv0\fR, and
|
||||
\fItcl_interactive\fR, as described in the documentation for \fBtclsh\fR.
|
||||
.PP
|
||||
@@ -154,9 +154,9 @@ When the \fIappInitProc\fR is finished, \fBTcl_Main\fR calls
|
||||
been requested, if any. If a startup script has been provided,
|
||||
\fBTcl_Main\fR attempts to evaluate it. Otherwise, interactive
|
||||
mode begins with examination of the variable \fItcl_rcFileName\fR
|
||||
in the main interpreter. If that variable exists and holds the
|
||||
in the master interpreter. If that variable exists and holds the
|
||||
name of a readable file, the contents of that file are evaluated
|
||||
in the main interpreter. Then interactive operations begin,
|
||||
in the master interpreter. Then interactive operations begin,
|
||||
with prompts and command evaluation results written to the standard
|
||||
output channel, and commands read from the standard input channel
|
||||
and then evaluated. The prompts written to the standard output
|
||||
@@ -164,7 +164,7 @@ channel may be customized by defining the Tcl variables \fItcl_prompt1\fR
|
||||
and \fItcl_prompt2\fR as described in the documentation for \fBtclsh\fR.
|
||||
The prompts and command evaluation results are written to the standard
|
||||
output channel only if the Tcl variable \fItcl_interactive\fR in the
|
||||
main interpreter holds a non-zero integer value.
|
||||
master interpreter holds a non-zero integer value.
|
||||
.PP
|
||||
\fBTcl_SetMainLoop\fR allows setting an event loop procedure to be run.
|
||||
This allows, for example, Tk to be dynamically loaded and set its event
|
||||
|
||||
@@ -259,43 +259,25 @@ string. The caller must not ask for the next character after the last
|
||||
character in the string if the string is not terminated by a null
|
||||
character.
|
||||
.PP
|
||||
\fBTcl_UtfPrev\fR is used to step backward through but not beyond the
|
||||
UTF-8 string that begins at \fIstart\fR. If the UTF-8 string is made
|
||||
up entirely of complete and well-formed characters, and \fIsrc\fR points
|
||||
to the lead byte of one of those characters (or to the location one byte
|
||||
past the end of the string), then repeated calls of \fBTcl_UtfPrev\fR will
|
||||
return pointers to the lead bytes of each character in the string, one
|
||||
character at a time, terminating when it returns \fIstart\fR.
|
||||
.PP
|
||||
When the conditions of completeness and well-formedness may not be satisfied,
|
||||
a more precise description of the function of \fBTcl_UtfPrev\fR is necessary.
|
||||
It always returns a pointer greater than or equal to \fIstart\fR; that is,
|
||||
always a pointer to a location in the string. It always returns a pointer to
|
||||
a byte that begins a character when scanning for characters beginning
|
||||
from \fIstart\fR. When \fIsrc\fR is greater than \fIstart\fR, it
|
||||
always returns a pointer less than \fIsrc\fR and greater than or
|
||||
equal to (\fIsrc\fR - \fBTCL_UTF_MAX\fR). The character that begins
|
||||
at the returned pointer is the first one that either includes the
|
||||
byte \fIsrc[-1]\fR, or might include it if the right trail bytes are
|
||||
present at \fIsrc\fR and greater. \fBTcl_UtfPrev\fR never reads the
|
||||
byte \fIsrc[0]\fR nor the byte \fIstart[-1]\fR nor the byte
|
||||
\fIsrc[-\fBTCL_UTF_MAX\fI-1]\fR.
|
||||
Given \fIsrc\fR, a pointer to some location in a UTF-8 string (or to a
|
||||
null byte immediately following such a string), \fBTcl_UtfPrev\fR
|
||||
returns a pointer to the closest preceding byte that starts a UTF-8
|
||||
character.
|
||||
This function will not back up to a position before \fIstart\fR,
|
||||
the start of the UTF-8 string. If \fIsrc\fR was already at \fIstart\fR, the
|
||||
return value will be \fIstart\fR.
|
||||
.PP
|
||||
\fBTcl_UniCharAtIndex\fR corresponds to a C string array dereference or the
|
||||
Pascal Ord() function. It returns the Unicode character represented at the
|
||||
Pascal Ord() function. It returns the Tcl_UniChar represented at the
|
||||
specified character (not byte) \fIindex\fR in the UTF-8 string
|
||||
\fIsrc\fR. The source string must contain at least \fIindex\fR
|
||||
characters. If a negative \fIindex\fR is given or \fIindex\fR points
|
||||
to the second half of a surrogate pair, it returns -1.
|
||||
characters. Behavior is undefined if a negative \fIindex\fR is given.
|
||||
.PP
|
||||
\fBTcl_UtfAtIndex\fR returns a pointer to the specified character (not
|
||||
byte) \fIindex\fR in the UTF-8 string \fIsrc\fR. The source string must
|
||||
contain at least \fIindex\fR characters. This is equivalent to calling
|
||||
\fBTcl_UtfToUniChar\fR \fIindex\fR times, except if that would return
|
||||
a pointer to the second byte of a valid 4-byte UTF-8 sequence, in which
|
||||
case, \fBTcl_UtfToUniChar\fR will be called once more to find the end
|
||||
of the sequence. If a negative \fIindex\fR is given, the returned pointer
|
||||
points to the first character in the source string.
|
||||
\fBTcl_UtfNext\fR \fIindex\fR times. If a negative \fIindex\fR is given,
|
||||
the return pointer points to the first character in the source string.
|
||||
.PP
|
||||
\fBTcl_UtfBackslash\fR is a utility procedure used by several of the Tcl
|
||||
commands. It parses a backslash sequence and stores the properly formed
|
||||
|
||||
+9
-13
@@ -105,27 +105,23 @@ produce files that other implementations of decoders cannot process):
|
||||
.TP
|
||||
\fB\-maxlen \fIlength\fR
|
||||
.
|
||||
Indicates the maximum number of characters to produce for each encoded line.
|
||||
The valid range is 5 to 85. Line lengths outside that range cannot be
|
||||
accommodated by the encoding format. The default value is 61.
|
||||
Indicates that the output should be split into lines of no more than
|
||||
\fIlength\fR characters. By default, lines are split every 61 characters, and
|
||||
this must be in the range 3 to 85 due to limitations in the encoding.
|
||||
.TP
|
||||
\fB\-wrapchar \fIcharacter\fR
|
||||
.
|
||||
Indicates the character(s) to use to mark the end of each encoded line.
|
||||
Acceptable values are a sequence of zero or more characters from the
|
||||
set { \\x09 (TAB), \\x0B (VT), \\x0C (FF), \\x0D (CR) } followed
|
||||
by zero or one newline \\x0A (LF). Any other values are rejected because
|
||||
they would generate encoded text that could not be decoded. The default value
|
||||
is a single newline.
|
||||
Indicates that, when lines are split because of the \fB\-maxlen\fR option,
|
||||
\fIcharacter\fR should be used to separate lines. By default, this is a
|
||||
newline character,
|
||||
.QW \en .
|
||||
.PP
|
||||
During decoding, the following options are supported:
|
||||
.TP
|
||||
\fB\-strict\fR
|
||||
.
|
||||
Instructs the decoder to throw an error if it encounters anything
|
||||
outside of the standard encoding format. Without this option, the
|
||||
decoder tolerates some deviations, mostly to forgive reflows of lines
|
||||
between the encoder and decoder.
|
||||
Instructs the decoder to throw an error if it encounters unexpected
|
||||
whitespace characters. Otherwise it ignores them.
|
||||
.PP
|
||||
Note that neither the encoder nor the decoder handle the header and footer of
|
||||
the uuencode format.
|
||||
|
||||
+1
-1
@@ -772,7 +772,7 @@ set offset 0
|
||||
\fI# Search for string "FOOBAR" in the file\fR
|
||||
while {[\fBchan gets\fR $f line] >= 0} {
|
||||
set idx [string first FOOBAR $line]
|
||||
if {$idx >= 0} {
|
||||
if {$idx > -1} {
|
||||
\fI# Found it; rewrite line\fR
|
||||
|
||||
\fBchan seek\fR $f [expr {$offset + $idx}]
|
||||
|
||||
+9
-10
@@ -471,36 +471,36 @@ The following format groups are recognized by the \fBclock scan\fR and
|
||||
\fBclock format\fR commands.
|
||||
.TP
|
||||
\fB%a\fR
|
||||
On output, produces an abbreviation (\fIe.g.,\fR \fBMon\fR) for the day
|
||||
On output, receives an abbreviation (\fIe.g.,\fR \fBMon\fR) for the day
|
||||
of the week in the given locale. On input, matches the name of the day
|
||||
of the week in the given locale (in either abbreviated or full form, or
|
||||
any unique prefix of either form).
|
||||
.TP
|
||||
\fB%A\fR
|
||||
On output, produces the full name (\fIe.g.,\fR \fBMonday\fR) of the day
|
||||
On output, receives the full name (\fIe.g.,\fR \fBMonday\fR) of the day
|
||||
of the week in the given locale. On input, matches the name of the day
|
||||
of the week in the given locale (in either abbreviated or full form, or
|
||||
any unique prefix of either form).
|
||||
.TP
|
||||
\fB%b\fR
|
||||
On output, produces an abbreviation (\fIe.g.,\fR \fBJan\fR) for the name
|
||||
On output, receives an abbreviation (\fIe.g.,\fR \fBJan\fR) for the name
|
||||
of the month in the given locale. On input, matches the name of the month
|
||||
in the given locale (in either abbreviated or full form, or
|
||||
any unique prefix of either form).
|
||||
.TP
|
||||
\fB%B\fR
|
||||
On output, produces the full name (\fIe.g.,\fR \fBJanuary\fR)
|
||||
On output, receives the full name (\fIe.g.,\fR \fBJanuary\fR)
|
||||
of the month in the given locale. On input, matches the name of the month
|
||||
in the given locale (in either abbreviated or full form, or
|
||||
any unique prefix of either form).
|
||||
.TP
|
||||
\fB%c\fR
|
||||
On output, produces a localized representation of date and time of day;
|
||||
On output, receives a localized representation of date and time of day;
|
||||
the localized representation is expected to use the Gregorian calendar.
|
||||
On input, matches whatever \fB%c\fR produces.
|
||||
.TP
|
||||
\fB%C\fR
|
||||
On output, produces the number of the century in Indo-Arabic numerals.
|
||||
On output, receives the number of the century in Indo-Arabic numerals.
|
||||
On input, matches one or two digits, possibly with leading whitespace,
|
||||
that are expected to be the number of the century.
|
||||
.TP
|
||||
@@ -913,14 +913,13 @@ an error may result if these years are used.
|
||||
\fIISO 8601 point-in-time\fR
|
||||
.
|
||||
An ISO 8601 point-in-time specification, such as
|
||||
.QW "\fICCyymmdd\fBT\fIhhmmss\fR",
|
||||
.QW \fICCyymmdd\fBT\fIhhmmss\fR,
|
||||
where \fBT\fR is the literal
|
||||
.QW T ,
|
||||
.QW "\fICCyymmdd hhmmss\fR" ,
|
||||
.QW "\fICCyymmdd\fBT\fIhh:mm:ss\fR" ,
|
||||
or
|
||||
.QW "\fICCyy-mm-dd\fBT\fIhh\fB:\fImm\fB:\fIss\fR".
|
||||
Note that only these four formats are accepted.
|
||||
.QW \fICCyymmdd\fBT\fIhh\fB:\fImm\fB:\fIss\fR .
|
||||
Note that only these three formats are accepted.
|
||||
The command does \fInot\fR accept the full range of point-in-time
|
||||
specifications specified in ISO8601. Other formats can be recognized by
|
||||
giving an explicit \fB\-format\fR option to the \fBclock scan\fR command.
|
||||
|
||||
+7
-7
@@ -28,7 +28,7 @@ writing the resulting dictionary value back to that variable.
|
||||
Non-existent keys are treated as if they map to an empty string. The
|
||||
updated dictionary value is returned.
|
||||
.VS TIP508
|
||||
If \fIdictionaryVariable\fR indicates an element that does not exist of an
|
||||
If \fIdictionaryVarable\fR indicates an element that does not exist of an
|
||||
array that has a default value set, the default value and will be used as the
|
||||
value of the dictionary prior to the appending operation.
|
||||
.VE TIP508
|
||||
@@ -142,7 +142,7 @@ are treated as if they map to 0. It is an error to increment a value
|
||||
for an existing key if that value is not an integer. The updated
|
||||
dictionary value is returned.
|
||||
.VS TIP508
|
||||
If \fIdictionaryVariable\fR indicates an element that does not exist of an
|
||||
If \fIdictionaryVarable\fR indicates an element that does not exist of an
|
||||
array that has a default value set, the default value and will be used as the
|
||||
value of the dictionary prior to the incrementing operation.
|
||||
.VE TIP508
|
||||
@@ -172,7 +172,7 @@ there to be no items to append to the list. It is an error for the
|
||||
value that the key maps to to not be representable as a list. The
|
||||
updated dictionary value is returned.
|
||||
.VS TIP508
|
||||
If \fIdictionaryVariable\fR indicates an element that does not exist of an
|
||||
If \fIdictionaryVarable\fR indicates an element that does not exist of an
|
||||
array that has a default value set, the default value and will be used as the
|
||||
value of the dictionary prior to the list-appending operation.
|
||||
.VE TIP508
|
||||
@@ -234,7 +234,7 @@ containing a mapping from the given key to the given value. When
|
||||
multiple keys are present, this operation creates or updates a chain
|
||||
of nested dictionaries. The updated dictionary value is returned.
|
||||
.VS TIP508
|
||||
If \fIdictionaryVariable\fR indicates an element that does not exist of an
|
||||
If \fIdictionaryVarable\fR indicates an element that does not exist of an
|
||||
array that has a default value set, the default value and will be used as the
|
||||
value of the dictionary prior to the value insert/update operation.
|
||||
.VE TIP508
|
||||
@@ -254,7 +254,7 @@ must be specified, but the last key on the key-path need not exist.
|
||||
All other components on the path must exist. The updated dictionary
|
||||
value is returned.
|
||||
.VS TIP508
|
||||
If \fIdictionaryVariable\fR indicates an element that does not exist of an
|
||||
If \fIdictionaryVarable\fR indicates an element that does not exist of an
|
||||
array that has a default value set, the default value and will be used as the
|
||||
value of the dictionary prior to the value remove operation.
|
||||
.VE TIP508
|
||||
@@ -274,7 +274,7 @@ or some other kind of exceptional exit. The result of \fBdict
|
||||
update\fR is (unless some kind of error occurs) the result of the
|
||||
evaluation of \fIbody\fR.
|
||||
.VS TIP508
|
||||
If \fIdictionaryVariable\fR indicates an element that does not exist of an
|
||||
If \fIdictionaryVarable\fR indicates an element that does not exist of an
|
||||
array that has a default value set, the default value and will be used as the
|
||||
value of the dictionary prior to the update operation.
|
||||
.VE TIP508
|
||||
@@ -313,7 +313,7 @@ dictionaries no longer exists. The result of \fBdict with\fR is
|
||||
(unless some kind of error occurs) the result of the evaluation of
|
||||
\fIbody\fR.
|
||||
.VS TIP508
|
||||
If \fIdictionaryVariable\fR indicates an element that does not exist of an
|
||||
If \fIdictionaryVarable\fR indicates an element that does not exist of an
|
||||
array that has a default value set, the default value and will be used as the
|
||||
value of the dictionary prior to the updating operation.
|
||||
.VE TIP508
|
||||
|
||||
+22
-58
@@ -17,7 +17,7 @@ expr \- Evaluate an expression
|
||||
.BE
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
The \fIexpr\fR command concatenates \fIarg\fRs, separated by a space, into an expression, and evaluates
|
||||
Concatenates \fIarg\fRs, separated by a space, into an expression, and evaluates
|
||||
that expression, returning its value.
|
||||
The operators permitted in an expression include a subset of
|
||||
the operators permitted in C expressions. For those operators
|
||||
@@ -41,17 +41,27 @@ When an expression evaluates to an integer, the value is the decimal form of
|
||||
the integer, and when an expression evaluates to a floating-point number, the
|
||||
value is the form produced by the \fB%g\fR format specifier of Tcl's
|
||||
\fBformat\fR command.
|
||||
.PP
|
||||
.VS "TIP 582"
|
||||
You can use \fB#\fR at any point in the expression (except inside double
|
||||
quotes or braces) to start a comment. Comments last to the end of the line or
|
||||
the end of the expression, whichever comes first.
|
||||
.VE "TIP 582"
|
||||
.SS OPERANDS
|
||||
.PP
|
||||
An expression consists of a combination of operands, operators, parentheses and
|
||||
commas, possibly with whitespace between any of these elements, which is
|
||||
ignored.
|
||||
An integer operand may be specified in decimal (the normal case, the optional
|
||||
first two characters are \fB0d\fR), binary
|
||||
(the first two characters are \fB0b\fR), octal
|
||||
(the first two characters are \fB0o\fR), or hexadecimal
|
||||
(the first two characters are \fB0x\fR) form. For
|
||||
compatibility with older Tcl releases, an operand that begins with \fB0\fR is
|
||||
interpreted as an octal integer even if the second character is not \fBo\fR.
|
||||
A floating-point number may be specified in any of several
|
||||
common decimal formats, and may use the decimal point \fB.\fR,
|
||||
\fBe\fR or \fBE\fR for scientific notation, and
|
||||
the sign characters \fB+\fR and \fB\-\fR. The
|
||||
following are all valid floating-point numbers: 2.1, 3., 6e4, 7.91e+16.
|
||||
The strings \fBInf\fR
|
||||
and \fBNaN\fR, in any combination of case, are also recognized as floating point
|
||||
values. An operand that doesn't have a numeric interpretation must be quoted
|
||||
with either braces or with double quotes.
|
||||
.PP
|
||||
An operand may be specified in any of the following ways:
|
||||
.IP [1]
|
||||
@@ -88,54 +98,11 @@ produces the value on the right side.
|
||||
.PP
|
||||
.CS
|
||||
.ta 9c
|
||||
\fBexpr\fR {3.1 + $a} \fI6.1\fR
|
||||
\fBexpr\fR {2 + "$a.$b"} \fI5.6\fR
|
||||
\fBexpr\fR {4*[llength "6 2"]} \fI8\fR
|
||||
\fBexpr\fR 3.1 + $a \fI6.1\fR
|
||||
\fBexpr\fR 2 + "$a.$b" \fI5.6\fR
|
||||
\fBexpr\fR 4*[llength "6 2"] \fI8\fR
|
||||
\fBexpr\fR {{word one} < "word $a"} \fI0\fR
|
||||
.CE
|
||||
.PP
|
||||
\fBInteger value\fR
|
||||
.PP
|
||||
An integer operand may be specified in decimal (the normal case, the optional
|
||||
first two characters are \fB0d\fR), binary
|
||||
(the first two characters are \fB0b\fR), octal
|
||||
(the first two characters are \fB0o\fR), or hexadecimal
|
||||
(the first two characters are \fB0x\fR) form. For
|
||||
compatibility with older Tcl releases, an operand that begins with \fB0\fR is
|
||||
interpreted as an octal integer even if the second character is not \fBo\fR.
|
||||
.PP
|
||||
\fBFloating-point value\fR
|
||||
.PP
|
||||
A floating-point number may be specified in any of several
|
||||
common decimal formats, and may use the decimal point \fB.\fR,
|
||||
\fBe\fR or \fBE\fR for scientific notation, and
|
||||
the sign characters \fB+\fR and \fB\-\fR. The
|
||||
following are all valid floating-point numbers: 2.1, 3., 6e4, 7.91e+16.
|
||||
The strings \fBInf\fR
|
||||
and \fBNaN\fR, in any combination of case, are also recognized as floating point
|
||||
values. An operand that doesn't have a numeric interpretation must be quoted
|
||||
with either braces or with double quotes.
|
||||
.PP
|
||||
\fBBoolean value\fR
|
||||
.PP
|
||||
A boolean value may be represented by any of the values \fB0\fR, \fBfalse\fR, \fBno\fR,
|
||||
or \fBoff\fR and any of the values \fB1\fR, \fBtrue\fR, \fByes\fR, or \fBon\fR.
|
||||
.PP
|
||||
\fBDigit Separator\fR
|
||||
.PP
|
||||
Digits in any numeric value may be separated with one or more underscore
|
||||
characters, "\fB_\fR", to improve readability. These separators may only
|
||||
appear between digits. The separator may not appear at the start of a
|
||||
numeric value, between the leading 0 and radix specifier, or at the
|
||||
end of a numeric value. Here are some examples:
|
||||
.PP
|
||||
.CS
|
||||
.ta 9c
|
||||
\fBexpr\fR 100_000_000 \fI100000000\fR
|
||||
\fBexpr\fR 0xffff_ffff \fI4294967295\fR
|
||||
\fBformat\fR 0x%x 0b1111_1110_1101_1011 \fI0xfedb\fR
|
||||
.CE
|
||||
.PP
|
||||
.SS OPERATORS
|
||||
.PP
|
||||
For operators having both a numeric mode and a string mode, the numeric mode is
|
||||
@@ -276,7 +243,7 @@ which means that operands are not evaluated if they are
|
||||
not needed to determine the outcome. For example, in
|
||||
.PP
|
||||
.CS
|
||||
\fBexpr\fR {$v?[a]:[b]}
|
||||
\fBexpr\fR {$v ? [a] : [b]}
|
||||
.CE
|
||||
.PP
|
||||
only one of \fB[a]\fR or \fB[b]\fR is evaluated,
|
||||
@@ -493,9 +460,7 @@ value of true:
|
||||
.PP
|
||||
.CS
|
||||
set isTrue [\fBexpr\fR {
|
||||
# Does the environment variable exist, and...
|
||||
[info exists ::env(SOME_ENV_VAR)] &&
|
||||
# ...does it contain a proper true value?
|
||||
[string is true -strict $::env(SOME_ENV_VAR)]
|
||||
}]
|
||||
.CE
|
||||
@@ -509,7 +474,7 @@ set randNum [\fBexpr\fR { int(100 * rand()) }]
|
||||
array(n), for(n), if(n), mathfunc(n), mathop(n), namespace(n), proc(n),
|
||||
string(n), Tcl(n), while(n)
|
||||
.SH KEYWORDS
|
||||
arithmetic, boolean, compare, expression, fuzzy comparison, integer value
|
||||
arithmetic, boolean, compare, expression, fuzzy comparison
|
||||
.SH COPYRIGHT
|
||||
.nf
|
||||
Copyright \(co 1993 The Regents of the University of California.
|
||||
@@ -518,5 +483,4 @@ Copyright \(co 2005 by Kevin B. Kenny <kennykb@acm.org>. All rights reserved.
|
||||
.fi
|
||||
'\" Local Variables:
|
||||
'\" mode: nroff
|
||||
'\" fill-column: 78
|
||||
'\" End:
|
||||
|
||||
+2
-6
@@ -13,7 +13,7 @@
|
||||
.SH NAME
|
||||
http \- Client-side implementation of the HTTP/1.1 protocol
|
||||
.SH SYNOPSIS
|
||||
\fBpackage require http\fI ?\fB2.9\fR?
|
||||
\fBpackage require http\fI ?\fB2.8\fR?
|
||||
.\" See Also -useragent option documentation in body!
|
||||
.sp
|
||||
\fB::http::config\fR ?\fI\-option value\fR ...?
|
||||
@@ -170,7 +170,7 @@ throwing an error processing non-latin-1 characters.
|
||||
The value of the User-Agent header in the HTTP request. In an unsafe
|
||||
interpreter, the default value depends upon the operating system, and
|
||||
the version numbers of \fBhttp\fR and \fBTcl\fR, and is (for example)
|
||||
.QW "\fBMozilla/5.0 (Windows; U; Windows NT 10.0) http/2.9.0 Tcl/8.6.9\fR" .
|
||||
.QW "\fBMozilla/5.0 (Windows; U; Windows NT 10.0) http/2.8.12 Tcl/8.6.8\fR" .
|
||||
A safe interpreter cannot determine its operating system, and so the default
|
||||
in a safe interpreter is to use a Windows 10 value with the current version
|
||||
numbers of \fBhttp\fR and \fBTcl\fR.
|
||||
@@ -259,10 +259,6 @@ proc httpHandlerCallback {socket token} {
|
||||
return $nbytes
|
||||
}
|
||||
.CE
|
||||
.PP
|
||||
The \fBhttp::geturl\fR code for the \fB-handler\fR option is not compatible with either compression or chunked transfer-encoding. If \fB-handler\fR is specified, then to work around these issues \fBhttp::geturl\fR will reduce the HTTP protocol to 1.0, and override the \fB-zip\fR option (i.e. it will not send the header "\fBAccept-Encoding: gzip,deflate,compress\fR").
|
||||
.PP
|
||||
If options \fB-handler\fR and \fB-channel\fR are used together, the handler is responsible for copying the data from the HTTP socket to the specified channel. The name of the channel is available to the handler as element \fB-channel\fR of the token array.
|
||||
.RE
|
||||
.TP
|
||||
\fB\-headers\fR \fIkeyvaluelist\fR
|
||||
|
||||
+2
-2
@@ -64,7 +64,7 @@ instance of \fBoo::object\fR or one of its subclasses.
|
||||
that represents an instance of \fBoo::object\fR or one of its subclasses.
|
||||
.IP \fBproc\fR
|
||||
\fIcommandName\fR was created by \fBproc\fR.
|
||||
.IP \fBinterp\fR
|
||||
.IP \fBslave\fR
|
||||
\fIcommandName\fR was created by \fBinterp create\fR.
|
||||
.IP \fBzlibStream\fR
|
||||
\fIcommandName\fR was created by \fBzlib stream\fR.
|
||||
@@ -278,7 +278,7 @@ Returns the name of each file loaded in \fIinterp\fR va \fBload\fR as part of
|
||||
\fIpackage\fR . If \fIpackage\fR is not given, returns a list where each item
|
||||
is the name of the loaded file and the name of the package for which the file
|
||||
was loaded. For a statically-loaded package the name of the file is the empty
|
||||
string. For \fIinterp\fR, the empty string is the current interpreter.
|
||||
string. For \fInterp\fR, the empty string is the current interpreter.
|
||||
.TP
|
||||
\fBinfo locals \fR?\fIpattern\fR?
|
||||
.
|
||||
|
||||
+123
-127
@@ -19,18 +19,18 @@ interp \- Create and manipulate Tcl interpreters
|
||||
.PP
|
||||
This command makes it possible to create one or more new Tcl
|
||||
interpreters that co-exist with the creating interpreter in the
|
||||
same application. The creating interpreter is called the \fIparent\fR
|
||||
and the new interpreter is called a \fIchild\fR.
|
||||
A parent can create any number of children, and each child can
|
||||
itself create additional children for which it is parent, resulting
|
||||
same application. The creating interpreter is called the \fImaster\fR
|
||||
and the new interpreter is called a \fIslave\fR.
|
||||
A master can create any number of slaves, and each slave can
|
||||
itself create additional slaves for which it is master, resulting
|
||||
in a hierarchy of interpreters.
|
||||
.PP
|
||||
Each interpreter is independent from the others: it has its own name
|
||||
space for commands, procedures, and global variables.
|
||||
A parent interpreter may create connections between its children and
|
||||
A master interpreter may create connections between its slaves and
|
||||
itself using a mechanism called an \fIalias\fR. An \fIalias\fR is
|
||||
a command in a child interpreter which, when invoked, causes a
|
||||
command to be invoked in its parent interpreter or in another child
|
||||
a command in a slave interpreter which, when invoked, causes a
|
||||
command to be invoked in its master interpreter or in another slave
|
||||
interpreter. The only other connections between interpreters are
|
||||
through environment variables (the \fBenv\fR variable), which are
|
||||
normally shared among all interpreters in the application,
|
||||
@@ -41,7 +41,7 @@ share files and to transfer references to open files from one interpreter
|
||||
to another.
|
||||
.PP
|
||||
The \fBinterp\fR command also provides support for \fIsafe\fR
|
||||
interpreters. A safe interpreter is a child whose functions have
|
||||
interpreters. A safe interpreter is a slave whose functions have
|
||||
been greatly restricted, so that it is safe to execute untrusted
|
||||
scripts without fear of them damaging other interpreters or the
|
||||
application's environment. For example, all IO channel creation
|
||||
@@ -54,18 +54,18 @@ instead, it is \fIhidden\fR, so that only trusted interpreters can obtain
|
||||
access to it. For a detailed explanation of hidden commands, see
|
||||
\fBHIDDEN COMMANDS\fR, below.
|
||||
The alias mechanism can be used for protected communication (analogous to a
|
||||
kernel call) between a child interpreter and its parent.
|
||||
kernel call) between a slave interpreter and its master.
|
||||
See \fBALIAS INVOCATION\fR, below, for more details
|
||||
on how the alias mechanism works.
|
||||
.PP
|
||||
A qualified interpreter name is a proper Tcl list containing a subset of its
|
||||
A qualified interpreter name is a proper Tcl lists containing a subset of its
|
||||
ancestors in the interpreter hierarchy, terminated by the string naming the
|
||||
interpreter in its immediate parent. Interpreter names are relative to the
|
||||
interpreter in its immediate master. Interpreter names are relative to the
|
||||
interpreter in which they are used. For example, if
|
||||
.QW \fBa\fR
|
||||
is a child of the current interpreter and it has a child
|
||||
is a slave of the current interpreter and it has a slave
|
||||
.QW \fBa1\fR ,
|
||||
which in turn has a child
|
||||
which in turn has a slave
|
||||
.QW \fBa11\fR ,
|
||||
the qualified name of
|
||||
.QW \fBa11\fR
|
||||
@@ -77,14 +77,14 @@ is the list
|
||||
The \fBinterp\fR command, described below, accepts qualified interpreter
|
||||
names as arguments; the interpreter in which the command is being evaluated
|
||||
can always be referred to as \fB{}\fR (the empty list or string). Note that
|
||||
it is impossible to refer to a parent (ancestor) interpreter by name in a
|
||||
child interpreter except through aliases. Also, there is no global name by
|
||||
it is impossible to refer to a master (ancestor) interpreter by name in a
|
||||
slave interpreter except through aliases. Also, there is no global name by
|
||||
which one can refer to the first interpreter created in an application.
|
||||
Both restrictions are motivated by safety concerns.
|
||||
.SH "THE INTERP COMMAND"
|
||||
.PP
|
||||
The \fBinterp\fR command is used to create, delete, and manipulate
|
||||
child interpreters, and to share or transfer
|
||||
slave interpreters, and to share or transfer
|
||||
channels between interpreters. It can have any of several forms, depending
|
||||
on the \fIsubcommand\fR argument:
|
||||
.TP
|
||||
@@ -94,11 +94,11 @@ Returns a Tcl list whose elements are the \fItargetCmd\fR and
|
||||
\fIarg\fRs associated with the alias represented by \fIsrcToken\fR
|
||||
(this is the value returned when the alias was
|
||||
created; it is possible that the name of the source command in the
|
||||
child is different from \fIsrcToken\fR).
|
||||
slave is different from \fIsrcToken\fR).
|
||||
.TP
|
||||
\fBinterp\fR \fBalias\fR \fIsrcPath\fR \fIsrcToken\fR \fB{}\fR
|
||||
.
|
||||
Deletes the alias for \fIsrcToken\fR in the child interpreter identified by
|
||||
Deletes the alias for \fIsrcToken\fR in the slave interpreter identified by
|
||||
\fIsrcPath\fR.
|
||||
\fIsrcToken\fR refers to the value returned when the alias
|
||||
was created; if the source command has been renamed, the renamed
|
||||
@@ -106,9 +106,9 @@ command will be deleted.
|
||||
.TP
|
||||
\fBinterp\fR \fBalias\fR \fIsrcPath\fR \fIsrcCmd\fR \fItargetPath\fR \fItargetCmd \fR?\fIarg arg ...\fR?
|
||||
.
|
||||
This command creates an alias between one child and another (see the
|
||||
\fBalias\fR child command below for creating aliases between a child
|
||||
and its parent). In this command, either of the child interpreters
|
||||
This command creates an alias between one slave and another (see the
|
||||
\fBalias\fR slave command below for creating aliases between a slave
|
||||
and its master). In this command, either of the slave interpreters
|
||||
may be anywhere in the hierarchy of interpreters under the interpreter
|
||||
invoking the command.
|
||||
\fISrcPath\fR and \fIsrcCmd\fR identify the source of the alias.
|
||||
@@ -117,9 +117,9 @@ interpreter. For example,
|
||||
.QW "\fBa b\fR"
|
||||
identifies an interpreter
|
||||
.QW \fBb\fR ,
|
||||
which is a child of interpreter
|
||||
which is a slave of interpreter
|
||||
.QW \fBa\fR ,
|
||||
which is a child of the invoking interpreter. An empty list specifies
|
||||
which is a slave of the invoking interpreter. An empty list specifies
|
||||
the interpreter invoking the command. \fIsrcCmd\fR gives the name of
|
||||
a new command, which will be created in the source interpreter.
|
||||
\fITargetPath\fR and \fItargetCmd\fR specify a target interpreter
|
||||
@@ -169,33 +169,33 @@ used.
|
||||
.TP
|
||||
\fBinterp\fR \fBcreate \fR?\fB\-safe\fR? ?\fB\-\|\-\fR? ?\fIpath\fR?
|
||||
.
|
||||
Creates a child interpreter identified by \fIpath\fR and a new command,
|
||||
called a \fIchild command\fR. The name of the child command is the last
|
||||
component of \fIpath\fR. The new child interpreter and the child command
|
||||
Creates a slave interpreter identified by \fIpath\fR and a new command,
|
||||
called a \fIslave command\fR. The name of the slave command is the last
|
||||
component of \fIpath\fR. The new slave interpreter and the slave command
|
||||
are created in the interpreter identified by the path obtained by removing
|
||||
the last component from \fIpath\fR. For example, if \fIpath\fR is \fBa b
|
||||
c\fR then a new child interpreter and child command named \fBc\fR are
|
||||
c\fR then a new slave interpreter and slave command named \fBc\fR are
|
||||
created in the interpreter identified by the path \fBa b\fR.
|
||||
The child command may be used to manipulate the new interpreter as
|
||||
The slave command may be used to manipulate the new interpreter as
|
||||
described below. If \fIpath\fR is omitted, Tcl creates a unique name of the
|
||||
form \fBinterp\fIx\fR, where \fIx\fR is an integer, and uses it for the
|
||||
interpreter and the child command. If the \fB\-safe\fR switch is specified
|
||||
(or if the parent interpreter is a safe interpreter), the new child
|
||||
interpreter and the slave command. If the \fB\-safe\fR switch is specified
|
||||
(or if the master interpreter is a safe interpreter), the new slave
|
||||
interpreter will be created as a safe interpreter with limited
|
||||
functionality; otherwise the child will include the full set of Tcl
|
||||
functionality; otherwise the slave will include the full set of Tcl
|
||||
built-in commands and variables. The \fB\-\|\-\fR switch can be used to
|
||||
mark the end of switches; it may be needed if \fIpath\fR is an unusual
|
||||
value such as \fB\-safe\fR. The result of the command is the name of the
|
||||
new interpreter. The name of a child interpreter must be unique among all
|
||||
the children for its parent; an error occurs if a child interpreter by the
|
||||
given name already exists in this parent.
|
||||
The initial recursion limit of the child interpreter is set to the
|
||||
new interpreter. The name of a slave interpreter must be unique among all
|
||||
the slaves for its master; an error occurs if a slave interpreter by the
|
||||
given name already exists in this master.
|
||||
The initial recursion limit of the slave interpreter is set to the
|
||||
current recursion limit of its parent interpreter.
|
||||
.TP
|
||||
\fBinterp\fR \fBdebug \fIpath\fR ?\fB\-frame\fR ?\fIbool\fR??
|
||||
.
|
||||
Controls whether frame-level stack information is captured in the
|
||||
child interpreter identified by \fIpath\fR. If no arguments are
|
||||
slave interpreter identified by \fIpath\fR. If no arguments are
|
||||
given, option and current setting are returned. If \fB\-frame\fR
|
||||
is given, the debug setting is set to the given boolean if provided
|
||||
and the current setting is returned.
|
||||
@@ -237,8 +237,8 @@ consistency of the underlying interpreter's state.
|
||||
\fBinterp\fR \fBdelete \fR?\fIpath ...\fR?
|
||||
.
|
||||
Deletes zero or more interpreters given by the optional \fIpath\fR
|
||||
arguments, and for each interpreter, it also deletes its children. The
|
||||
command also deletes the child command for each interpreter deleted.
|
||||
arguments, and for each interpreter, it also deletes its slaves. The
|
||||
command also deletes the slave command for each interpreter deleted.
|
||||
For each \fIpath\fR argument, if no interpreter by that name
|
||||
exists, the command raises an error.
|
||||
.TP
|
||||
@@ -246,20 +246,20 @@ exists, the command raises an error.
|
||||
.
|
||||
This command concatenates all of the \fIarg\fR arguments in the same
|
||||
fashion as the \fBconcat\fR command, then evaluates the resulting string as
|
||||
a Tcl script in the child interpreter identified by \fIpath\fR. The result
|
||||
a Tcl script in the slave interpreter identified by \fIpath\fR. The result
|
||||
of this evaluation (including all \fBreturn\fR options,
|
||||
such as \fB\-errorinfo\fR and \fB\-errorcode\fR information, if an
|
||||
error occurs) is returned to the invoking interpreter.
|
||||
Note that the script will be executed in the current context stack frame of the
|
||||
\fIpath\fR interpreter; this is so that the implementations (in a parent
|
||||
interpreter) of aliases in a child interpreter can execute scripts in
|
||||
the child that find out information about the child's current state
|
||||
\fIpath\fR interpreter; this is so that the implementations (in a master
|
||||
interpreter) of aliases in a slave interpreter can execute scripts in
|
||||
the slave that find out information about the slave's current state
|
||||
and stack frame.
|
||||
.TP
|
||||
\fBinterp exists \fIpath\fR
|
||||
.
|
||||
Returns \fB1\fR if a child interpreter by the specified \fIpath\fR
|
||||
exists in this parent, \fB0\fR otherwise. If \fIpath\fR is omitted, the
|
||||
Returns \fB1\fR if a slave interpreter by the specified \fIpath\fR
|
||||
exists in this master, \fB0\fR otherwise. If \fIpath\fR is omitted, the
|
||||
invoking interpreter is used.
|
||||
.TP
|
||||
\fBinterp expose \fIpath\fR \fIhiddenName\fR ?\fIexposedCmdName\fR?
|
||||
@@ -285,7 +285,7 @@ Currently both \fIexposedCmdName\fR and \fIhiddenCmdName\fR can
|
||||
not contain namespace qualifiers, or an error is raised.
|
||||
Commands to be hidden by \fBinterp hide\fR are looked up in the global
|
||||
namespace even if the current namespace is not the global one. This
|
||||
prevents children from fooling a parent interpreter into hiding the wrong
|
||||
prevents slaves from fooling a master interpreter into hiding the wrong
|
||||
command, by making the current namespace be different from the global one.
|
||||
Hidden commands are explained in more detail in \fBHIDDEN COMMANDS\fR, below.
|
||||
.TP
|
||||
@@ -369,15 +369,11 @@ Both interpreters must close it to close the underlying IO channel; IO
|
||||
channels accessible in an interpreter are automatically closed when an
|
||||
interpreter is destroyed.
|
||||
.TP
|
||||
\fBinterp\fR \fBchildren\fR ?\fIpath\fR?
|
||||
.
|
||||
Returns a Tcl list of the names of all the child interpreters associated
|
||||
with the interpreter identified by \fIpath\fR. If \fIpath\fR is omitted,
|
||||
the invoking interpreter is used.
|
||||
.TP
|
||||
\fBinterp\fR \fBslaves\fR ?\fIpath\fR?
|
||||
.
|
||||
Synonym for . \fBinterp\fR \fBchildren\fR ?\fIpath\fR?
|
||||
Returns a Tcl list of the names of all the slave interpreters associated
|
||||
with the interpreter identified by \fIpath\fR. If \fIpath\fR is omitted,
|
||||
the invoking interpreter is used.
|
||||
.TP
|
||||
\fBinterp\fR \fBtarget\fR \fIpath alias\fR
|
||||
.
|
||||
@@ -395,48 +391,48 @@ The target command does not have to be defined at the time of this invocation.
|
||||
Causes the IO channel identified by \fIchannelId\fR to become available in
|
||||
the interpreter identified by \fIdestPath\fR and unavailable in the
|
||||
interpreter identified by \fIsrcPath\fR.
|
||||
.SH "CHILD COMMAND"
|
||||
.SH "SLAVE COMMAND"
|
||||
.PP
|
||||
For each child interpreter created with the \fBinterp\fR command, a
|
||||
new Tcl command is created in the parent interpreter with the same
|
||||
For each slave interpreter created with the \fBinterp\fR command, a
|
||||
new Tcl command is created in the master interpreter with the same
|
||||
name as the new interpreter. This command may be used to invoke
|
||||
various operations on the interpreter. It has the following
|
||||
general form:
|
||||
.PP
|
||||
.CS
|
||||
\fIchild command \fR?\fIarg arg ...\fR?
|
||||
\fIslave command \fR?\fIarg arg ...\fR?
|
||||
.CE
|
||||
.PP
|
||||
\fIChild\fR is the name of the interpreter, and \fIcommand\fR
|
||||
\fISlave\fR is the name of the interpreter, and \fIcommand\fR
|
||||
and the \fIarg\fRs determine the exact behavior of the command.
|
||||
The valid forms of this command are:
|
||||
.TP
|
||||
\fIchild \fBaliases\fR
|
||||
\fIslave \fBaliases\fR
|
||||
.
|
||||
Returns a Tcl list whose elements are the tokens of all the
|
||||
aliases in \fIchild\fR. The tokens correspond to the values returned when
|
||||
aliases in \fIslave\fR. The tokens correspond to the values returned when
|
||||
the aliases were created (which may not be the same
|
||||
as the current names of the commands).
|
||||
.TP
|
||||
\fIchild \fBalias \fIsrcToken\fR
|
||||
\fIslave \fBalias \fIsrcToken\fR
|
||||
.
|
||||
Returns a Tcl list whose elements are the \fItargetCmd\fR and
|
||||
\fIarg\fRs associated with the alias represented by \fIsrcToken\fR
|
||||
(this is the value returned when the alias was
|
||||
created; it is possible that the actual source command in the
|
||||
child is different from \fIsrcToken\fR).
|
||||
slave is different from \fIsrcToken\fR).
|
||||
.TP
|
||||
\fIchild \fBalias \fIsrcToken \fB{}\fR
|
||||
\fIslave \fBalias \fIsrcToken \fB{}\fR
|
||||
.
|
||||
Deletes the alias for \fIsrcToken\fR in the child interpreter.
|
||||
Deletes the alias for \fIsrcToken\fR in the slave interpreter.
|
||||
\fIsrcToken\fR refers to the value returned when the alias
|
||||
was created; if the source command has been renamed, the renamed
|
||||
command will be deleted.
|
||||
.TP
|
||||
\fIchild \fBalias \fIsrcCmd targetCmd \fR?\fIarg ..\fR?
|
||||
\fIslave \fBalias \fIsrcCmd targetCmd \fR?\fIarg ..\fR?
|
||||
.
|
||||
Creates an alias such that whenever \fIsrcCmd\fR is invoked
|
||||
in \fIchild\fR, \fItargetCmd\fR is invoked in the parent.
|
||||
in \fIslave\fR, \fItargetCmd\fR is invoked in the master.
|
||||
The \fIarg\fR arguments will be passed to \fItargetCmd\fR as additional
|
||||
arguments, prepended before any arguments passed in the invocation of
|
||||
\fIsrcCmd\fR.
|
||||
@@ -445,69 +441,69 @@ The command returns a token that uniquely identifies the command created
|
||||
\fIsrcCmd\fR, even if the command is renamed afterwards. The token may but
|
||||
does not have to be equal to \fIsrcCmd\fR.
|
||||
.TP
|
||||
\fIchild \fBbgerror\fR ?\fIcmdPrefix\fR?
|
||||
\fIslave \fBbgerror\fR ?\fIcmdPrefix\fR?
|
||||
.
|
||||
This command either gets or sets the current background exception handler
|
||||
for the \fIchild\fR interpreter. If \fIcmdPrefix\fR is
|
||||
for the \fIslave\fR interpreter. If \fIcmdPrefix\fR is
|
||||
absent, the current background exception handler is returned, and if it is
|
||||
present, it is a list of words (of minimum length one) that describes
|
||||
what to set the interpreter's background exception handler to. See the
|
||||
\fBBACKGROUND EXCEPTION HANDLING\fR section for more details.
|
||||
.TP
|
||||
\fIchild \fBeval \fIarg \fR?\fIarg ..\fR?
|
||||
\fIslave \fBeval \fIarg \fR?\fIarg ..\fR?
|
||||
.
|
||||
This command concatenates all of the \fIarg\fR arguments in
|
||||
the same fashion as the \fBconcat\fR command, then evaluates
|
||||
the resulting string as a Tcl script in \fIchild\fR.
|
||||
the resulting string as a Tcl script in \fIslave\fR.
|
||||
The result of this evaluation (including all \fBreturn\fR options,
|
||||
such as \fB\-errorinfo\fR and \fB\-errorcode\fR information, if an
|
||||
error occurs) is returned to the invoking interpreter.
|
||||
Note that the script will be executed in the current context stack frame
|
||||
of \fIchild\fR; this is so that the implementations (in a parent
|
||||
interpreter) of aliases in a child interpreter can execute scripts in
|
||||
the child that find out information about the child's current state
|
||||
of \fIslave\fR; this is so that the implementations (in a master
|
||||
interpreter) of aliases in a slave interpreter can execute scripts in
|
||||
the slave that find out information about the slave's current state
|
||||
and stack frame.
|
||||
.TP
|
||||
\fIchild \fBexpose \fIhiddenName \fR?\fIexposedCmdName\fR?
|
||||
\fIslave \fBexpose \fIhiddenName \fR?\fIexposedCmdName\fR?
|
||||
.
|
||||
This command exposes the hidden command \fIhiddenName\fR, eventually bringing
|
||||
it back under a new \fIexposedCmdName\fR name (this name is currently
|
||||
accepted only if it is a valid global name space name without any ::),
|
||||
in \fIchild\fR.
|
||||
in \fIslave\fR.
|
||||
If an exposed command with the targeted name already exists, this command
|
||||
fails.
|
||||
For more details on hidden commands, see \fBHIDDEN COMMANDS\fR, below.
|
||||
.TP
|
||||
\fIchild \fBhide \fIexposedCmdName\fR ?\fIhiddenCmdName\fR?
|
||||
\fIslave \fBhide \fIexposedCmdName\fR ?\fIhiddenCmdName\fR?
|
||||
.
|
||||
This command hides the exposed command \fIexposedCmdName\fR, renaming it to
|
||||
the hidden command \fIhiddenCmdName\fR, or keeping the same name if the
|
||||
argument is not given, in the \fIchild\fR interpreter.
|
||||
argument is not given, in the \fIslave\fR interpreter.
|
||||
If a hidden command with the targeted name already exists, this command
|
||||
fails.
|
||||
Currently both \fIexposedCmdName\fR and \fIhiddenCmdName\fR can
|
||||
not contain namespace qualifiers, or an error is raised.
|
||||
Commands to be hidden are looked up in the global
|
||||
namespace even if the current namespace is not the global one. This
|
||||
prevents children from fooling a parent interpreter into hiding the wrong
|
||||
prevents slaves from fooling a master interpreter into hiding the wrong
|
||||
command, by making the current namespace be different from the global one.
|
||||
For more details on hidden commands, see \fBHIDDEN COMMANDS\fR, below.
|
||||
.TP
|
||||
\fIchild \fBhidden\fR
|
||||
\fIslave \fBhidden\fR
|
||||
.
|
||||
Returns a list of the names of all hidden commands in \fIchild\fR.
|
||||
Returns a list of the names of all hidden commands in \fIslave\fR.
|
||||
.TP
|
||||
\fIchild \fBinvokehidden\fR ?\fI\-option ...\fR? \fIhiddenName \fR?\fIarg ..\fR?
|
||||
\fIslave \fBinvokehidden\fR ?\fI\-option ...\fR? \fIhiddenName \fR?\fIarg ..\fR?
|
||||
.
|
||||
This command invokes the hidden command \fIhiddenName\fR with the
|
||||
supplied arguments, in \fIchild\fR. No substitutions or evaluations are
|
||||
supplied arguments, in \fIslave\fR. No substitutions or evaluations are
|
||||
applied to the arguments. Three \fI\-option\fRs are supported, all
|
||||
of which start with \fB\-\fR: \fB\-namespace\fR (which takes a single
|
||||
argument afterwards, \fInsName\fR), \fB\-global\fR, and \fB\-\|\-\fR.
|
||||
If the \fB\-namespace\fR flag is given, the hidden command is invoked in
|
||||
the specified namespace in the child.
|
||||
the specified namespace in the slave.
|
||||
If the \fB\-global\fR flag is given, the command is invoked at the global
|
||||
level in the child; otherwise it is invoked at the current call frame and
|
||||
level in the slave; otherwise it is invoked at the current call frame and
|
||||
can access local variables in that or outer call frames.
|
||||
The \fB\-\|\-\fR flag allows the \fIhiddenCmdName\fR argument to start with a
|
||||
.QW \-
|
||||
@@ -515,37 +511,37 @@ character, and is otherwise unnecessary.
|
||||
If both the \fB\-namespace\fR and \fB\-global\fR flags are given, the
|
||||
\fB\-namespace\fR flag is ignored.
|
||||
Note that the hidden command will be executed (by default) in the
|
||||
current context stack frame of \fIchild\fR.
|
||||
current context stack frame of \fIslave\fR.
|
||||
For more details on hidden commands,
|
||||
see \fBHIDDEN COMMANDS\fR, below.
|
||||
.TP
|
||||
\fIchild \fBissafe\fR
|
||||
\fIslave \fBissafe\fR
|
||||
.
|
||||
Returns \fB1\fR if the child interpreter is safe, \fB0\fR otherwise.
|
||||
Returns \fB1\fR if the slave interpreter is safe, \fB0\fR otherwise.
|
||||
.TP
|
||||
\fIchild \fBlimit\fR \fIlimitType\fR ?\fI\-option\fR? ?\fIvalue\fR \fI...\fR?
|
||||
\fIslave \fBlimit\fR \fIlimitType\fR ?\fI\-option\fR? ?\fIvalue\fR \fI...\fR?
|
||||
.
|
||||
Sets up, manipulates and queries the configuration of the resource
|
||||
limit \fIlimitType\fR for the child interpreter. If no \fI\-option\fR
|
||||
limit \fIlimitType\fR for the slave interpreter. If no \fI\-option\fR
|
||||
is specified, return the current configuration of the limit. If
|
||||
\fI\-option\fR is the sole argument, return the value of that option.
|
||||
Otherwise, a list of \fI\-option\fR/\fIvalue\fR argument pairs must
|
||||
supplied. See \fBRESOURCE LIMITS\fR below for a more detailed explanation of
|
||||
what limits and options are supported.
|
||||
.TP
|
||||
\fIchild \fBmarktrusted\fR
|
||||
\fIslave \fBmarktrusted\fR
|
||||
.
|
||||
Marks the child interpreter as trusted. Can only be invoked by a
|
||||
Marks the slave interpreter as trusted. Can only be invoked by a
|
||||
trusted interpreter. This command does not expose any hidden
|
||||
commands in the child interpreter. The command has no effect if the child
|
||||
commands in the slave interpreter. The command has no effect if the slave
|
||||
is already trusted.
|
||||
.TP
|
||||
\fIchild\fR \fBrecursionlimit\fR ?\fInewlimit\fR?
|
||||
\fIslave\fR \fBrecursionlimit\fR ?\fInewlimit\fR?
|
||||
.
|
||||
Returns the maximum allowable nesting depth for the \fIchild\fR interpreter.
|
||||
If \fInewlimit\fR is specified, the recursion limit in \fIchild\fR will be
|
||||
Returns the maximum allowable nesting depth for the \fIslave\fR interpreter.
|
||||
If \fInewlimit\fR is specified, the recursion limit in \fIslave\fR will be
|
||||
set so that nesting of more than \fInewlimit\fR calls to \fBTcl_Eval()\fR
|
||||
and related procedures in \fIchild\fR will return an error.
|
||||
and related procedures in \fIslave\fR will return an error.
|
||||
The \fInewlimit\fR value is also returned.
|
||||
The \fInewlimit\fR value must be a positive integer between 1 and the
|
||||
maximum value of a non-long integer on the platform.
|
||||
@@ -569,14 +565,14 @@ For example, commands to create files on disk are removed, and the
|
||||
\fBexec\fR command is removed, since it could be used to cause damage
|
||||
through subprocesses.
|
||||
Limited access to these facilities can be provided, by creating
|
||||
aliases to the parent interpreter which check their arguments carefully
|
||||
aliases to the master interpreter which check their arguments carefully
|
||||
and provide restricted access to a safe subset of facilities.
|
||||
For example, file creation might be allowed in a particular subdirectory
|
||||
and subprocess invocation might be allowed for a carefully selected and
|
||||
fixed set of programs.
|
||||
.PP
|
||||
A safe interpreter is created by specifying the \fB\-safe\fR switch
|
||||
to the \fBinterp create\fR command. Furthermore, any child created
|
||||
to the \fBinterp create\fR command. Furthermore, any slave created
|
||||
by a safe interpreter will also be safe.
|
||||
.PP
|
||||
A safe interpreter is created with exactly the following set of
|
||||
@@ -663,15 +659,15 @@ including itself.
|
||||
.SH "ALIAS INVOCATION"
|
||||
.PP
|
||||
The alias mechanism has been carefully designed so that it can
|
||||
be used safely in an untrusted script which is being executed in a
|
||||
safe interpreter even if the target of the alias is not a safe
|
||||
interpreter. The most important thing in guaranteeing safety is to
|
||||
ensure that information passed from the child to the parent is
|
||||
never evaluated or substituted in the parent; if this were to
|
||||
occur, it would enable an evil script in the child to invoke
|
||||
arbitrary functions in the parent, which would compromise security.
|
||||
be used safely when an untrusted script is executing
|
||||
in a safe slave and the target of the alias is a trusted
|
||||
master. The most important thing in guaranteeing safety is to
|
||||
ensure that information passed from the slave to the master is
|
||||
never evaluated or substituted in the master; if this were to
|
||||
occur, it would enable an evil script in the slave to invoke
|
||||
arbitrary functions in the master, which would compromise security.
|
||||
.PP
|
||||
When the source for an alias is invoked in the child interpreter, the
|
||||
When the source for an alias is invoked in the slave interpreter, the
|
||||
usual Tcl substitutions are performed when parsing that command.
|
||||
These substitutions are carried out in the source interpreter just
|
||||
as they would be for any other command invoked in that interpreter.
|
||||
@@ -698,8 +694,8 @@ the alias's source command is parsed in the source interpreter.
|
||||
When writing the \fItargetCmd\fRs for aliases in safe interpreters,
|
||||
it is very important that the arguments to that command never be
|
||||
evaluated or substituted, since this would provide an escape
|
||||
mechanism whereby the child interpreter could execute arbitrary
|
||||
code in the parent. This in turn would compromise the security
|
||||
mechanism whereby the slave interpreter could execute arbitrary
|
||||
code in the master. This in turn would compromise the security
|
||||
of the system.
|
||||
.SH "HIDDEN COMMANDS"
|
||||
.PP
|
||||
@@ -726,28 +722,28 @@ invoke\fR. Hidden commands and exposed commands reside in separate name
|
||||
spaces. It is possible to define a hidden command and an exposed command by
|
||||
the same name within one interpreter.
|
||||
.PP
|
||||
Hidden commands in a child interpreter can be invoked in the body of
|
||||
procedures called in the parent during alias invocation. For example, an
|
||||
alias for \fBsource\fR could be created in a child interpreter. When it is
|
||||
invoked in the child interpreter, a procedure is called in the parent
|
||||
Hidden commands in a slave interpreter can be invoked in the body of
|
||||
procedures called in the master during alias invocation. For example, an
|
||||
alias for \fBsource\fR could be created in a slave interpreter. When it is
|
||||
invoked in the slave interpreter, a procedure is called in the master
|
||||
interpreter to check that the operation is allowable (e.g. it asks to
|
||||
source a file that the child interpreter is allowed to access). The
|
||||
procedure then it invokes the hidden \fBsource\fR command in the child
|
||||
source a file that the slave interpreter is allowed to access). The
|
||||
procedure then it invokes the hidden \fBsource\fR command in the slave
|
||||
interpreter to actually source in the contents of the file. Note that two
|
||||
commands named \fBsource\fR exist in the child interpreter: the alias, and
|
||||
commands named \fBsource\fR exist in the slave interpreter: the alias, and
|
||||
the hidden command.
|
||||
.PP
|
||||
Because a parent interpreter may invoke a hidden command as part of
|
||||
Because a master interpreter may invoke a hidden command as part of
|
||||
handling an alias invocation, great care must be taken to avoid evaluating
|
||||
any arguments passed in through the alias invocation.
|
||||
Otherwise, malicious child interpreters could cause a trusted parent
|
||||
Otherwise, malicious slave interpreters could cause a trusted master
|
||||
interpreter to execute dangerous commands on their behalf. See the section
|
||||
on \fBALIAS INVOCATION\fR for a more complete discussion of this topic.
|
||||
To help avoid this problem, no substitutions or evaluations are
|
||||
applied to arguments of \fBinterp invokehidden\fR.
|
||||
.PP
|
||||
Safe interpreters are not allowed to invoke hidden commands in themselves
|
||||
or in their descendants. This prevents them from gaining access to
|
||||
or in their descendants. This prevents safe slaves from gaining access to
|
||||
hidden functionality in themselves or their descendants.
|
||||
.PP
|
||||
The set of hidden commands in an interpreter can be manipulated by a trusted
|
||||
@@ -766,12 +762,12 @@ qualifiers, and you must first rename a command in a namespace to the
|
||||
global namespace before you can hide it.
|
||||
Commands to be hidden by \fBinterp hide\fR are looked up in the global
|
||||
namespace even if the current namespace is not the global one. This
|
||||
prevents children from fooling a parent interpreter into hiding the wrong
|
||||
prevents slaves from fooling a master interpreter into hiding the wrong
|
||||
command, by making the current namespace be different from the global one.
|
||||
.SH "RESOURCE LIMITS"
|
||||
.PP
|
||||
Every interpreter has two kinds of resource limits that may be imposed by any
|
||||
parent interpreter upon its children. Command limits (of type \fBcommand\fR)
|
||||
master interpreter upon its slaves. Command limits (of type \fBcommand\fR)
|
||||
restrict the total number of Tcl commands that may be executed by an
|
||||
interpreter (as can be inspected via the \fBinfo cmdcount\fR command), and
|
||||
time limits (of type \fBtime\fR) place a limit by which execution within the
|
||||
@@ -780,7 +776,7 @@ interpreter must complete. Note that time limits are expressed as
|
||||
\fBafter\fR) because they may be modified after creation.
|
||||
.PP
|
||||
When a limit is exceeded for an interpreter, first any handler callbacks
|
||||
defined by parent interpreters are called. If those callbacks increase or
|
||||
defined by master interpreters are called. If those callbacks increase or
|
||||
remove the limit, execution within the (previously) limited interpreter
|
||||
continues. If the limit is still in force, an error is generated at that point
|
||||
and normal processing of errors within the interpreter (by the \fBcatch\fR
|
||||
@@ -837,13 +833,13 @@ This option specifies the number of commands that the interpreter may execute
|
||||
before triggering the command limit. This option may be the empty string,
|
||||
which indicates that a command limit is not set for the interpreter.
|
||||
.PP
|
||||
Where an interpreter with a resource limit set on it creates a child
|
||||
interpreter, that child interpreter will have resource limits imposed on it
|
||||
that are at least as restrictive as the limits on the creating parent
|
||||
interpreter. If the parent interpreter of the limited parent wishes to relax
|
||||
Where an interpreter with a resource limit set on it creates a slave
|
||||
interpreter, that slave interpreter will have resource limits imposed on it
|
||||
that are at least as restrictive as the limits on the creating master
|
||||
interpreter. If the master interpreter of the limited master wishes to relax
|
||||
these conditions, it should hide the \fBinterp\fR command in the child and
|
||||
then use aliases and the \fBinterp invokehidden\fR subcommand to provide such
|
||||
access as it chooses to the \fBinterp\fR command to the limited parent as
|
||||
access as it chooses to the \fBinterp\fR command to the limited master as
|
||||
necessary.
|
||||
.SH "BACKGROUND EXCEPTION HANDLING"
|
||||
.PP
|
||||
@@ -904,9 +900,9 @@ set i [\fBinterp create\fR]
|
||||
}
|
||||
.CE
|
||||
.SH "SEE ALSO"
|
||||
bgerror(n), load(n), safe(n), Tcl_CreateChild(3), Tcl_Eval(3), Tcl_BackgroundException(3)
|
||||
bgerror(n), load(n), safe(n), Tcl_CreateSlave(3), Tcl_Eval(3), Tcl_BackgroundException(3)
|
||||
.SH KEYWORDS
|
||||
alias, parent interpreter, safe interpreter, child interpreter
|
||||
alias, master interpreter, safe interpreter, slave interpreter
|
||||
'\"Local Variables:
|
||||
'\"mode: nroff
|
||||
'\"End:
|
||||
|
||||
+8
-3
@@ -124,7 +124,7 @@ will read all the \fB.tcl\fR files in subdirectory \fBfoo\fR and
|
||||
generate a new index file \fBfoo/tclIndex\fR.
|
||||
.PP
|
||||
\fBAuto_mkindex\fR parses the Tcl scripts by sourcing them into a
|
||||
child interpreter and monitoring the proc and namespace commands that
|
||||
slave interpreter and monitoring the proc and namespace commands that
|
||||
are executed. Extensions can use the (undocumented)
|
||||
auto_mkindex_parser package to register other commands that can
|
||||
contribute to the auto_load index. You will have to read through
|
||||
@@ -299,13 +299,18 @@ These variables are only used in the \fBtcl_endOfWord\fR,
|
||||
This variable contains a regular expression that is used by routines
|
||||
like \fBtcl_endOfWord\fR to identify whether a character is part of a
|
||||
word or not. If the pattern matches a character, the character is
|
||||
considered to be a non-word character. The default is "\\W".
|
||||
considered to be a non-word character. On Windows platforms, spaces,
|
||||
tabs, and newlines are considered non-word characters. Under Unix,
|
||||
everything but numbers, letters and underscores are considered
|
||||
non-word characters.
|
||||
.TP
|
||||
\fBtcl_wordchars\fR
|
||||
This variable contains a regular expression that is used by routines
|
||||
like \fBtcl_endOfWord\fR to identify whether a character is part of a
|
||||
word or not. If the pattern matches a character, the character is
|
||||
considered to be a word character. The default is "\\w".
|
||||
considered to be a word character. On Windows platforms, words are
|
||||
comprised of any character that is not a space, tab, or newline. Under
|
||||
Unix, words are comprised of numbers, letters or underscores.
|
||||
.SH "SEE ALSO"
|
||||
env(n), info(n), re_syntax(n)
|
||||
.SH KEYWORDS
|
||||
|
||||
+1
-2
@@ -22,8 +22,7 @@ This command searches the elements of \fIlist\fR to see if one
|
||||
of them matches \fIpattern\fR. If so, the command returns the index
|
||||
of the first matching element
|
||||
(unless the options \fB\-all\fR or \fB\-inline\fR are specified.)
|
||||
If not, the command returns \fB\-1\fR or (if options \fB\-all\fR
|
||||
or \fB\-inline\fR are specified) the empty string. The \fIoption\fR arguments
|
||||
If not, the command returns \fB\-1\fR. The \fIoption\fR arguments
|
||||
indicates how the elements of the list are to be matched against
|
||||
\fIpattern\fR and must have one of the values below:
|
||||
.SS "MATCHING STYLE OPTIONS"
|
||||
|
||||
+2
-2
@@ -42,7 +42,7 @@ The default pattern is \fB*.tcl\fR and \fB*.[info sharedlibextension]\fR.
|
||||
\fBPkg_mkIndex\fR will create a file \fBpkgIndex.tcl\fR in \fIdir\fR
|
||||
with package information about all the files given by the \fIpattern\fR
|
||||
arguments.
|
||||
It does this by loading each file into a child
|
||||
It does this by loading each file into a slave
|
||||
interpreter and seeing what packages
|
||||
and new commands appear (this is why it is essential to have
|
||||
\fBpackage provide\fR commands or \fBTcl_PkgProvide\fR calls
|
||||
@@ -109,7 +109,7 @@ the use of \fIauto_reset\fR, and therefore its use is discouraged.
|
||||
.TP 15
|
||||
\fB\-load \fIpkgPat\fR
|
||||
The index process will pre-load any packages that exist in the
|
||||
current interpreter and match \fIpkgPat\fR into the child interpreter used to
|
||||
current interpreter and match \fIpkgPat\fR into the slave interpreter used to
|
||||
generate the index. The pattern match uses string match rules, but without
|
||||
making case distinctions.
|
||||
See \fBCOMPLEX CASES\fR below.
|
||||
|
||||
+51
-59
@@ -11,17 +11,17 @@
|
||||
.SH NAME
|
||||
safe \- Creating and manipulating safe interpreters
|
||||
.SH SYNOPSIS
|
||||
\fB::safe::interpCreate\fR ?\fIchild\fR? ?\fIoptions...\fR?
|
||||
\fB::safe::interpCreate\fR ?\fIslave\fR? ?\fIoptions...\fR?
|
||||
.sp
|
||||
\fB::safe::interpInit\fR \fIchild\fR ?\fIoptions...\fR?
|
||||
\fB::safe::interpInit\fR \fIslave\fR ?\fIoptions...\fR?
|
||||
.sp
|
||||
\fB::safe::interpConfigure\fR \fIchild\fR ?\fIoptions...\fR?
|
||||
\fB::safe::interpConfigure\fR \fIslave\fR ?\fIoptions...\fR?
|
||||
.sp
|
||||
\fB::safe::interpDelete\fR \fIchild\fR
|
||||
\fB::safe::interpDelete\fR \fIslave\fR
|
||||
.sp
|
||||
\fB::safe::interpAddToAccessPath\fR \fIchild\fR \fIdirectory\fR
|
||||
\fB::safe::interpAddToAccessPath\fR \fIslave\fR \fIdirectory\fR
|
||||
.sp
|
||||
\fB::safe::interpFindInAccessPath\fR \fIchild\fR \fIdirectory\fR
|
||||
\fB::safe::interpFindInAccessPath\fR \fIslave\fR \fIdirectory\fR
|
||||
.sp
|
||||
\fB::safe::setLogCmd\fR ?\fIcmd arg...\fR?
|
||||
.SS OPTIONS
|
||||
@@ -44,7 +44,7 @@ application or computer. Untrusted scripts are also prevented from
|
||||
disclosing information stored on the hosting computer or in the
|
||||
hosting application to any party.
|
||||
.PP
|
||||
Safe Tcl allows a parent interpreter to create safe, restricted
|
||||
Safe Tcl allows a master interpreter to create safe, restricted
|
||||
interpreters that contain a set of predefined aliases for the \fBsource\fR,
|
||||
\fBload\fR, \fBfile\fR, \fBencoding\fR, and \fBexit\fR commands and
|
||||
are able to use the auto-loading and package mechanisms.
|
||||
@@ -53,47 +53,39 @@ No knowledge of the file system structure is leaked to the
|
||||
safe interpreter, because it has access only to a virtualized path
|
||||
containing tokens. When the safe interpreter requests to source a file, it
|
||||
uses the token in the virtual path as part of the file name to source; the
|
||||
parent interpreter transparently
|
||||
master interpreter transparently
|
||||
translates the token into a real directory name and executes the
|
||||
requested operation (see the section \fBSECURITY\fR below for details).
|
||||
Different levels of security can be selected by using the optional flags
|
||||
of the commands described below.
|
||||
.PP
|
||||
All commands provided in the parent interpreter by Safe Tcl reside in
|
||||
All commands provided in the master interpreter by Safe Tcl reside in
|
||||
the \fBsafe\fR namespace.
|
||||
.SH COMMANDS
|
||||
The following commands are provided in the parent interpreter:
|
||||
The following commands are provided in the master interpreter:
|
||||
.TP
|
||||
\fB::safe::interpCreate\fR ?\fIchild\fR? ?\fIoptions...\fR?
|
||||
\fB::safe::interpCreate\fR ?\fIslave\fR? ?\fIoptions...\fR?
|
||||
Creates a safe interpreter, installs the aliases described in the section
|
||||
\fBALIASES\fR and initializes the auto-loading and package mechanism as
|
||||
specified by the supplied \fIoptions\fR.
|
||||
See the \fBOPTIONS\fR section below for a description of the
|
||||
optional arguments.
|
||||
If the \fIchild\fR argument is omitted, a name will be generated.
|
||||
If the \fIslave\fR argument is omitted, a name will be generated.
|
||||
\fB::safe::interpCreate\fR always returns the interpreter name.
|
||||
.sp
|
||||
The interpreter name \fIchild\fR may include namespace separators,
|
||||
but may not have leading or trailing namespace separators, or excess
|
||||
colon characters in namespace separators. The interpreter name is
|
||||
qualified relative to the global namespace ::, not the namespace in which
|
||||
the \fB::safe::interpCreate\fR command is evaluated.
|
||||
.TP
|
||||
\fB::safe::interpInit\fR \fIchild\fR ?\fIoptions...\fR?
|
||||
\fB::safe::interpInit\fR \fIslave\fR ?\fIoptions...\fR?
|
||||
This command is similar to \fBinterpCreate\fR except it that does not
|
||||
create the safe interpreter. \fIchild\fR must have been created by some
|
||||
other means, like \fBinterp create\fR \fB\-safe\fR. The interpreter
|
||||
name \fIchild\fR may include namespace separators, subject to the same
|
||||
restrictions as for \fBinterpCreate\fR.
|
||||
create the safe interpreter. \fIslave\fR must have been created by some
|
||||
other means, like \fBinterp create\fR \fB\-safe\fR.
|
||||
.TP
|
||||
\fB::safe::interpConfigure\fR \fIchild\fR ?\fIoptions...\fR?
|
||||
\fB::safe::interpConfigure\fR \fIslave\fR ?\fIoptions...\fR?
|
||||
If no \fIoptions\fR are given, returns the settings for all options for the
|
||||
named safe interpreter as a list of options and their current values
|
||||
for that \fIchild\fR.
|
||||
for that \fIslave\fR.
|
||||
If a single additional argument is provided,
|
||||
it will return a list of 2 elements \fIname\fR and \fIvalue\fR where
|
||||
\fIname\fR is the full name of that option and \fIvalue\fR the current value
|
||||
for that option and the \fIchild\fR.
|
||||
for that option and the \fIslave\fR.
|
||||
If more than two additional arguments are provided, it will reconfigure the
|
||||
safe interpreter and change each and only the provided options.
|
||||
See the section on \fBOPTIONS\fR below for options description.
|
||||
@@ -113,14 +105,14 @@ safe::interpConfigure $i0 \-delete {foo bar} \-statics 0
|
||||
.CE
|
||||
.RE
|
||||
.TP
|
||||
\fB::safe::interpDelete\fR \fIchild\fR
|
||||
\fB::safe::interpDelete\fR \fIslave\fR
|
||||
Deletes the safe interpreter and cleans up the corresponding
|
||||
parent interpreter data structures.
|
||||
master interpreter data structures.
|
||||
If a \fIdeleteHook\fR script was specified for this interpreter it is
|
||||
evaluated before the interpreter is deleted, with the name of the
|
||||
interpreter as an additional argument.
|
||||
.TP
|
||||
\fB::safe::interpFindInAccessPath\fR \fIchild\fR \fIdirectory\fR
|
||||
\fB::safe::interpFindInAccessPath\fR \fIslave\fR \fIdirectory\fR
|
||||
This command finds and returns the token for the real directory
|
||||
\fIdirectory\fR in the safe interpreter's current virtual access path.
|
||||
It generates an error if the directory is not found.
|
||||
@@ -128,14 +120,14 @@ Example of use:
|
||||
.RS
|
||||
.PP
|
||||
.CS
|
||||
$child eval [list set tk_library \e
|
||||
$slave eval [list set tk_library \e
|
||||
[::safe::interpFindInAccessPath $name $tk_library]]
|
||||
.CE
|
||||
.RE
|
||||
.TP
|
||||
\fB::safe::interpAddToAccessPath\fR \fIchild\fR \fIdirectory\fR
|
||||
\fB::safe::interpAddToAccessPath\fR \fIslave\fR \fIdirectory\fR
|
||||
This command adds \fIdirectory\fR to the virtual path maintained for the
|
||||
safe interpreter in the parent, and returns the token that can be used in
|
||||
safe interpreter in the master, and returns the token that can be used in
|
||||
the safe interpreter to obtain access to files in that directory.
|
||||
If the directory is already in the virtual path, it only returns the token
|
||||
without adding the directory to the virtual path again.
|
||||
@@ -143,7 +135,7 @@ Example of use:
|
||||
.RS
|
||||
.PP
|
||||
.CS
|
||||
$child eval [list set tk_library \e
|
||||
$slave eval [list set tk_library \e
|
||||
[::safe::interpAddToAccessPath $name $tk_library]]
|
||||
.CE
|
||||
.RE
|
||||
@@ -176,10 +168,10 @@ Note that the safe interpreter only received an error message saying that
|
||||
the file was not found:
|
||||
.PP
|
||||
.CS
|
||||
NOTICE for child interp10 : Created
|
||||
NOTICE for child interp10 : Setting accessPath=(/foo/bar) staticsok=1 nestedok=0 deletehook=()
|
||||
NOTICE for child interp10 : auto_path in interp10 has been set to {$p(:0:)}
|
||||
ERROR for child interp10 : /foo/bar/init.tcl: no such file or directory
|
||||
NOTICE for slave interp10 : Created
|
||||
NOTICE for slave interp10 : Setting accessPath=(/foo/bar) staticsok=1 nestedok=0 deletehook=()
|
||||
NOTICE for slave interp10 : auto_path in interp10 has been set to {$p(:0:)}
|
||||
ERROR for slave interp10 : /foo/bar/init.tcl: no such file or directory
|
||||
.CE
|
||||
.RE
|
||||
.SS OPTIONS
|
||||
@@ -195,7 +187,7 @@ This option sets the list of directories from which the safe interpreter
|
||||
can \fBsource\fR and \fBload\fR files.
|
||||
If this option is not specified, or if it is given as the
|
||||
empty list, the safe interpreter will use the same directories as its
|
||||
parent for auto-loading.
|
||||
master for auto-loading.
|
||||
See the section \fBSECURITY\fR below for more detail about virtual paths,
|
||||
tokens and access control.
|
||||
.TP
|
||||
@@ -224,7 +216,7 @@ to load packages into its own sub-interpreters.
|
||||
.TP
|
||||
\fB\-deleteHook\fR \fIscript\fR
|
||||
When this option is given a non-empty \fIscript\fR, it will be
|
||||
evaluated in the parent with the name of
|
||||
evaluated in the master with the name of
|
||||
the safe interpreter as an additional argument
|
||||
just before actually deleting the safe interpreter.
|
||||
Giving an empty value removes any currently installed deletion hook
|
||||
@@ -289,8 +281,8 @@ potential for information leakage about its directory structure.
|
||||
To prevent this, commands that take file names as arguments in a safe
|
||||
interpreter use tokens instead of the real directory names.
|
||||
These tokens are translated to the real directory name while a request to,
|
||||
e.g., source a file is mediated by the parent interpreter.
|
||||
This virtual path system is maintained in the parent interpreter for each safe
|
||||
e.g., source a file is mediated by the master interpreter.
|
||||
This virtual path system is maintained in the master interpreter for each safe
|
||||
interpreter created by \fB::safe::interpCreate\fR or initialized by
|
||||
\fB::safe::interpInit\fR and
|
||||
the path maps tokens accessible in the safe interpreter into real path
|
||||
@@ -299,7 +291,7 @@ from gaining knowledge about the
|
||||
structure of the file system of the host on which the interpreter is
|
||||
executing.
|
||||
The only valid file names arguments
|
||||
for the \fBsource\fR and \fBload\fR aliases provided to the child
|
||||
for the \fBsource\fR and \fBload\fR aliases provided to the slave
|
||||
are path in the form of
|
||||
\fB[file join \fItoken filename\fB]\fR (i.e. when using the
|
||||
native file path formats: \fItoken\fB/\fIfilename\fR
|
||||
@@ -328,26 +320,26 @@ or be called
|
||||
.PP
|
||||
Each element of the initial access path
|
||||
list will be assigned a token that will be set in
|
||||
the child \fBauto_path\fR and the first element of that list will be set as
|
||||
the \fBtcl_library\fR for that child.
|
||||
the slave \fBauto_path\fR and the first element of that list will be set as
|
||||
the \fBtcl_library\fR for that slave.
|
||||
.PP
|
||||
If the access path argument is not given or is the empty list,
|
||||
the default behavior is to let the child access the same packages
|
||||
as the parent has access to (Or to be more precise:
|
||||
the default behavior is to let the slave access the same packages
|
||||
as the master has access to (Or to be more precise:
|
||||
only packages written in Tcl (which by definition cannot be dangerous
|
||||
as they run in the child interpreter) and C extensions that
|
||||
provides a _SafeInit entry point). For that purpose, the parent's
|
||||
\fBauto_path\fR will be used to construct the child access path.
|
||||
In order that the child successfully loads the Tcl library files
|
||||
as they run in the slave interpreter) and C extensions that
|
||||
provides a _SafeInit entry point). For that purpose, the master's
|
||||
\fBauto_path\fR will be used to construct the slave access path.
|
||||
In order that the slave successfully loads the Tcl library files
|
||||
(which includes the auto-loading mechanism itself) the \fBtcl_library\fR will be
|
||||
added or moved to the first position if necessary, in the
|
||||
child access path, so the child
|
||||
\fBtcl_library\fR will be the same as the parent's (its real
|
||||
path will still be invisible to the child though).
|
||||
In order that auto-loading works the same for the child and
|
||||
the parent in this by default case, the first-level
|
||||
sub directories of each directory in the parent \fBauto_path\fR will
|
||||
also be added (if not already included) to the child access path.
|
||||
slave access path, so the slave
|
||||
\fBtcl_library\fR will be the same as the master's (its real
|
||||
path will still be invisible to the slave though).
|
||||
In order that auto-loading works the same for the slave and
|
||||
the master in this by default case, the first-level
|
||||
sub directories of each directory in the master \fBauto_path\fR will
|
||||
also be added (if not already included) to the slave access path.
|
||||
You can always specify a more
|
||||
restrictive path for which sub directories will never be searched by
|
||||
explicitly specifying your directory list with the \fB\-accessPath\fR flag
|
||||
@@ -360,8 +352,8 @@ to synchronize its \fBauto_index\fR with the new token list.
|
||||
.SH "SEE ALSO"
|
||||
interp(n), library(n), load(n), package(n), source(n), unknown(n)
|
||||
.SH KEYWORDS
|
||||
alias, auto\-loading, auto_mkindex, load, parent interpreter, safe
|
||||
interpreter, child interpreter, source
|
||||
alias, auto\-loading, auto_mkindex, load, master interpreter, safe
|
||||
interpreter, slave interpreter, source
|
||||
'\" Local Variables:
|
||||
'\" mode: nroff
|
||||
'\" End:
|
||||
|
||||
+1
-1
@@ -47,7 +47,7 @@ A leading BOM (Byte order mark) contained in the file is ignored for unicode enc
|
||||
.PP
|
||||
The \fB\-encoding\fR option is used to specify the encoding of
|
||||
the data stored in \fIfileName\fR. When the \fB\-encoding\fR option
|
||||
is omitted, the utf-8 encoding is assumed.
|
||||
is omitted, the system encoding is assumed.
|
||||
.SH EXAMPLE
|
||||
.PP
|
||||
Run the script in the file \fBfoo.tcl\fR and then the script in the
|
||||
|
||||
+1
-1
@@ -505,7 +505,7 @@ if {$length == 0} {
|
||||
.SH "SEE ALSO"
|
||||
expr(n), list(n)
|
||||
.SH KEYWORDS
|
||||
case conversion, compare, index, integer value, match, pattern, string, word, equal,
|
||||
case conversion, compare, index, match, pattern, string, word, equal,
|
||||
ctype, character, reverse
|
||||
.\" Local Variables:
|
||||
.\" mode: nroff
|
||||
|
||||
+11
-11
@@ -203,7 +203,7 @@ array. Returns an empty string.
|
||||
.TP
|
||||
\fBrunAllTests\fR
|
||||
.
|
||||
This is a main command meant to run an entire suite of tests,
|
||||
This is a master command meant to run an entire suite of tests,
|
||||
spanning multiple files and/or directories, as governed by
|
||||
the configurable options of \fBtcltest\fR. See \fBRUNNING ALL TESTS\fR
|
||||
below for a complete description of the many variations possible
|
||||
@@ -804,17 +804,17 @@ then a copy of \fBinterpreter\fR will be \fBexec\fR'd to
|
||||
evaluate each file. The multi-process operation is useful
|
||||
when testing can cause errors so severe that a process
|
||||
terminates. Although such an error may terminate a child
|
||||
process evaluating one file, the main process can continue
|
||||
process evaluating one file, the master process can continue
|
||||
with the rest of the test suite. In multi-process operation,
|
||||
the configuration of \fBtcltest\fR in the main process is
|
||||
the configuration of \fBtcltest\fR in the master process is
|
||||
passed to the child processes as command line arguments,
|
||||
with the exception of \fBconfigure \-outfile\fR. The
|
||||
\fBrunAllTests\fR command in the
|
||||
main process collects all output from the child processes
|
||||
and collates their results into one main report. Any
|
||||
master process collects all output from the child processes
|
||||
and collates their results into one master report. Any
|
||||
reports of individual test failures, or messages requested
|
||||
by a \fBconfigure \-verbose\fR setting are passed directly
|
||||
on to \fBoutputChannel\fR by the main process.
|
||||
on to \fBoutputChannel\fR by the master process.
|
||||
.PP
|
||||
After evaluating all selected test files, a summary of the
|
||||
results is printed to \fBoutputChannel\fR. The summary
|
||||
@@ -1134,7 +1134,7 @@ A good namespace to use is a child namespace \fBtest\fR of the namespace
|
||||
of the module you are testing.
|
||||
.PP
|
||||
A test file should also be able to be evaluated directly as a script,
|
||||
not depending on being called by a main \fBrunAllTests\fR. This
|
||||
not depending on being called by a master \fBrunAllTests\fR. This
|
||||
means that each test file should process command line arguments to give
|
||||
the tester all the configuration control that \fBtcltest\fR provides.
|
||||
.PP
|
||||
@@ -1145,7 +1145,7 @@ Here is a sketch of a sample test file illustrating those points:
|
||||
.RS
|
||||
.PP
|
||||
.CS
|
||||
package require tcltest 2.5
|
||||
package require tcltest 2.2
|
||||
eval \fB::tcltest::configure\fR $argv
|
||||
package require example
|
||||
namespace eval ::example::test {
|
||||
@@ -1175,12 +1175,12 @@ doing any necessary setup. This script is usually named \fBall.tcl\fR
|
||||
because that is the default name used by \fBrunAllTests\fR when combining
|
||||
multiple test suites into one testing run.
|
||||
.IP [8]
|
||||
Here is a sketch of a sample test suite main script:
|
||||
Here is a sketch of a sample test suite master script:
|
||||
.RS
|
||||
.PP
|
||||
.CS
|
||||
package require Tcl 8.6
|
||||
package require tcltest 2.5
|
||||
package require Tcl 8.4
|
||||
package require tcltest 2.2
|
||||
package require example
|
||||
\fB::tcltest::configure\fR -testdir \e
|
||||
[file dirname [file normalize [info script]]]
|
||||
|
||||
+8
-14
@@ -193,18 +193,10 @@ How hard to compress the data. Must be an integer from 0 (uncompressed) to 9
|
||||
.TP
|
||||
\fB\-limit\fI readaheadLimit\fR
|
||||
.
|
||||
The maximum number of bytes ahead to read when decompressing.
|
||||
.RS
|
||||
.PP
|
||||
This option has become \fBirrelevant\fR. It was originally introduced
|
||||
to prevent Tcl from reading beyond the end of a compressed stream in
|
||||
multi-stream channels to ensure that the data after was left alone for
|
||||
further reading, at the cost of speed.
|
||||
.PP
|
||||
Tcl now automatically returns any bytes it has read beyond the end of
|
||||
a compressed stream back to the channel, making them appear as unread
|
||||
to further readers.
|
||||
.RE
|
||||
The maximum number of bytes ahead to read when decompressing. This defaults to
|
||||
1, which ensures that data is always decompressed correctly, but may be
|
||||
increased to improve performance. This is more useful when the channel is
|
||||
non-blocking.
|
||||
.PP
|
||||
Both compressing and decompressing channel transformations add extra
|
||||
configuration options that may be accessed through \fBchan configure\fR. The
|
||||
@@ -246,8 +238,10 @@ off the data stream.
|
||||
\fB\-limit\fI readaheadLimit\fR
|
||||
.
|
||||
This read-write option is used by decompressing channels to control the
|
||||
maximum number of bytes ahead to read from the underlying data source. See
|
||||
above for more information.
|
||||
maximum number of bytes ahead to read from the underlying data source. This
|
||||
defaults to 1, which ensures that data is always decompressed correctly, but
|
||||
may be increased to improve performance. This is more useful when the channel
|
||||
is non-blocking.
|
||||
.RE
|
||||
.SS "STREAMING SUBCOMMAND"
|
||||
.TP
|
||||
|
||||
+16
-16
@@ -56,7 +56,7 @@ static const chr *scanplain(struct vars *);
|
||||
static void onechr(struct vars *, pchr, struct state *, struct state *);
|
||||
static void dovec(struct vars *, struct cvec *, struct state *, struct state *);
|
||||
static void wordchrs(struct vars *);
|
||||
static struct subre *sub_re(struct vars *, int, int, struct state *, struct state *);
|
||||
static struct subre *subre(struct vars *, int, int, struct state *, struct state *);
|
||||
static void freesubre(struct vars *, struct subre *);
|
||||
static void freesrnode(struct vars *, struct subre *);
|
||||
static int numst(struct subre *, int);
|
||||
@@ -663,7 +663,7 @@ parse(
|
||||
|
||||
assert(stopper == ')' || stopper == EOS);
|
||||
|
||||
branches = sub_re(v, '|', LONGER, init, final);
|
||||
branches = subre(v, '|', LONGER, init, final);
|
||||
NOERRN();
|
||||
branch = branches;
|
||||
firstbranch = 1;
|
||||
@@ -673,7 +673,7 @@ parse(
|
||||
* Need a place to hang the branch.
|
||||
*/
|
||||
|
||||
branch->right = sub_re(v, '|', LONGER, init, final);
|
||||
branch->right = subre(v, '|', LONGER, init, final);
|
||||
NOERRN();
|
||||
branch = branch->right;
|
||||
}
|
||||
@@ -744,7 +744,7 @@ parsebranch(
|
||||
|
||||
lp = left;
|
||||
seencontent = 0;
|
||||
t = sub_re(v, '=', 0, left, right); /* op '=' is tentative */
|
||||
t = subre(v, '=', 0, left, right); /* op '=' is tentative */
|
||||
NOERRN();
|
||||
while (!SEE('|') && !SEE(stopper) && !SEE(EOS)) {
|
||||
if (seencontent) { /* implicit concat operator */
|
||||
@@ -977,7 +977,7 @@ parseqatom(
|
||||
NOERR();
|
||||
if (cap) {
|
||||
v->subs[subno] = atom;
|
||||
t = sub_re(v, '(', atom->flags|CAP, lp, rp);
|
||||
t = subre(v, '(', atom->flags|CAP, lp, rp);
|
||||
NOERR();
|
||||
t->subno = subno;
|
||||
t->left = atom;
|
||||
@@ -995,7 +995,7 @@ parseqatom(
|
||||
INSIST(v->subs[v->nextvalue] != NULL, REG_ESUBREG);
|
||||
NOERR();
|
||||
assert(v->nextvalue > 0);
|
||||
atom = sub_re(v, 'b', BACKR, lp, rp);
|
||||
atom = subre(v, 'b', BACKR, lp, rp);
|
||||
NOERR();
|
||||
subno = v->nextvalue;
|
||||
atom->subno = subno;
|
||||
@@ -1110,7 +1110,7 @@ parseqatom(
|
||||
*/
|
||||
|
||||
if (atom == NULL) {
|
||||
atom = sub_re(v, '=', 0, lp, rp);
|
||||
atom = subre(v, '=', 0, lp, rp);
|
||||
NOERR();
|
||||
}
|
||||
|
||||
@@ -1147,7 +1147,7 @@ parseqatom(
|
||||
* Break remaining subRE into x{...} and what follows.
|
||||
*/
|
||||
|
||||
t = sub_re(v, '.', COMBINE(qprefer, atom->flags), lp, rp);
|
||||
t = subre(v, '.', COMBINE(qprefer, atom->flags), lp, rp);
|
||||
NOERR();
|
||||
t->left = atom;
|
||||
atomp = &t->left;
|
||||
@@ -1161,7 +1161,7 @@ parseqatom(
|
||||
*/
|
||||
|
||||
assert(top->op == '=' && top->left == NULL && top->right == NULL);
|
||||
top->left = sub_re(v, '=', top->flags, top->begin, lp);
|
||||
top->left = subre(v, '=', top->flags, top->begin, lp);
|
||||
NOERR();
|
||||
top->op = '.';
|
||||
top->right = t;
|
||||
@@ -1230,9 +1230,9 @@ parseqatom(
|
||||
assert(m >= 1 && m != DUPINF && n >= 1);
|
||||
repeat(v, s, atom->begin, m-1, (n == DUPINF) ? n : n-1);
|
||||
f = COMBINE(qprefer, atom->flags);
|
||||
t = sub_re(v, '.', f, s, atom->end); /* prefix and atom */
|
||||
t = subre(v, '.', f, s, atom->end); /* prefix and atom */
|
||||
NOERR();
|
||||
t->left = sub_re(v, '=', PREF(f), s, atom->begin);
|
||||
t->left = subre(v, '=', PREF(f), s, atom->begin);
|
||||
NOERR();
|
||||
t->right = atom;
|
||||
*atomp = t;
|
||||
@@ -1247,7 +1247,7 @@ parseqatom(
|
||||
dupnfa(v->nfa, atom->begin, atom->end, s, s2);
|
||||
repeat(v, s, s2, m, n);
|
||||
f = COMBINE(qprefer, atom->flags);
|
||||
t = sub_re(v, '*', f, s, s2);
|
||||
t = subre(v, '*', f, s, s2);
|
||||
NOERR();
|
||||
t->min = (short) m;
|
||||
t->max = (short) n;
|
||||
@@ -1265,7 +1265,7 @@ parseqatom(
|
||||
t->right = parsebranch(v, stopper, type, s2, rp, 1);
|
||||
} else {
|
||||
EMPTYARC(s2, rp);
|
||||
t->right = sub_re(v, '=', 0, s2, rp);
|
||||
t->right = subre(v, '=', 0, s2, rp);
|
||||
}
|
||||
NOERR();
|
||||
assert(SEE('|') || SEE(stopper) || SEE(EOS));
|
||||
@@ -1717,12 +1717,12 @@ wordchrs(
|
||||
}
|
||||
|
||||
/*
|
||||
- sub_re - allocate a subre
|
||||
^ static struct subre *sub_re(struct vars *, int, int, struct state *,
|
||||
- subre - allocate a subre
|
||||
^ static struct subre *subre(struct vars *, int, int, struct state *,
|
||||
^ struct state *);
|
||||
*/
|
||||
static struct subre *
|
||||
sub_re(
|
||||
subre(
|
||||
struct vars *v,
|
||||
int op,
|
||||
int flags,
|
||||
|
||||
+1
-1
@@ -73,7 +73,7 @@ struct dfa {
|
||||
chr *lastnopr; /* location of last cache-flushed NOPROGRESS */
|
||||
struct sset *search; /* replacement-search-pointer memory */
|
||||
int cptsmalloced; /* were the areas individually malloced? */
|
||||
char *mallocarea; /* self, or malloced area, or NULL */
|
||||
char *mallocarea; /* self, or master malloced area, or NULL */
|
||||
};
|
||||
|
||||
#define WORK 1 /* number of work bitvectors needed */
|
||||
|
||||
+8
-8
@@ -316,12 +316,12 @@ declare 85 {
|
||||
int flags)
|
||||
}
|
||||
declare 86 {
|
||||
int Tcl_CreateAlias(Tcl_Interp *childInterp, const char *childCmd,
|
||||
int Tcl_CreateAlias(Tcl_Interp *slave, const char *slaveCmd,
|
||||
Tcl_Interp *target, const char *targetCmd, int argc,
|
||||
const char *const *argv)
|
||||
}
|
||||
declare 87 {
|
||||
int Tcl_CreateAliasObj(Tcl_Interp *childInterp, const char *childCmd,
|
||||
int Tcl_CreateAliasObj(Tcl_Interp *slave, const char *slaveCmd,
|
||||
Tcl_Interp *target, const char *targetCmd, int objc,
|
||||
Tcl_Obj *const objv[])
|
||||
}
|
||||
@@ -364,7 +364,7 @@ declare 96 {
|
||||
Tcl_CmdDeleteProc *deleteProc)
|
||||
}
|
||||
declare 97 {
|
||||
Tcl_Interp *Tcl_CreateChild(Tcl_Interp *interp, const char *name,
|
||||
Tcl_Interp *Tcl_CreateSlave(Tcl_Interp *interp, const char *slaveName,
|
||||
int isSafe)
|
||||
}
|
||||
declare 98 {
|
||||
@@ -527,12 +527,12 @@ declare 147 {deprecated {see TIP #559. Use Tcl_ResetResult}} {
|
||||
void Tcl_FreeResult(Tcl_Interp *interp)
|
||||
}
|
||||
declare 148 {
|
||||
int Tcl_GetAlias(Tcl_Interp *interp, const char *childCmd,
|
||||
int Tcl_GetAlias(Tcl_Interp *interp, const char *slaveCmd,
|
||||
Tcl_Interp **targetInterpPtr, const char **targetCmdPtr,
|
||||
int *argcPtr, const char ***argvPtr)
|
||||
}
|
||||
declare 149 {
|
||||
int Tcl_GetAliasObj(Tcl_Interp *interp, const char *childCmd,
|
||||
int Tcl_GetAliasObj(Tcl_Interp *interp, const char *slaveCmd,
|
||||
Tcl_Interp **targetInterpPtr, const char **targetCmdPtr,
|
||||
int *objcPtr, Tcl_Obj ***objv)
|
||||
}
|
||||
@@ -582,10 +582,10 @@ declare 162 {
|
||||
const char *Tcl_GetHostName(void)
|
||||
}
|
||||
declare 163 {
|
||||
int Tcl_GetInterpPath(Tcl_Interp *interp, Tcl_Interp *childInterp)
|
||||
int Tcl_GetInterpPath(Tcl_Interp *askInterp, Tcl_Interp *slaveInterp)
|
||||
}
|
||||
declare 164 {
|
||||
Tcl_Interp *Tcl_GetParent(Tcl_Interp *interp)
|
||||
Tcl_Interp *Tcl_GetMaster(Tcl_Interp *interp)
|
||||
}
|
||||
declare 165 {
|
||||
const char *Tcl_GetNameOfExecutable(void)
|
||||
@@ -616,7 +616,7 @@ declare 171 {
|
||||
int Tcl_GetServiceMode(void)
|
||||
}
|
||||
declare 172 {
|
||||
Tcl_Interp *Tcl_GetChild(Tcl_Interp *interp, const char *name)
|
||||
Tcl_Interp *Tcl_GetSlave(Tcl_Interp *interp, const char *slaveName)
|
||||
}
|
||||
declare 173 {
|
||||
Tcl_Channel Tcl_GetStdChannel(int type)
|
||||
|
||||
+7
-10
@@ -361,7 +361,7 @@ typedef long LONG;
|
||||
*/
|
||||
|
||||
#if !defined(TCL_WIDE_INT_TYPE)&&!defined(TCL_WIDE_INT_IS_LONG)
|
||||
# if defined(_WIN32) && (!defined(__USE_MINGW_ANSI_STDIO) || !__USE_MINGW_ANSI_STDIO)
|
||||
# if defined(_MSC_VER) || defined(_WIN32)
|
||||
# define TCL_WIDE_INT_TYPE __int64
|
||||
# define TCL_LL_MODIFIER "I64"
|
||||
# if defined(_WIN64)
|
||||
@@ -973,14 +973,11 @@ typedef struct Tcl_DString {
|
||||
#define TCL_DONT_QUOTE_HASH 8
|
||||
|
||||
/*
|
||||
* Flags that may be passed to Tcl_GetIndexFromObj.
|
||||
* TCL_EXACT disallows abbreviated strings.
|
||||
* TCL_INDEX_TEMP_TABLE disallows caching of lookups. A possible use case is
|
||||
* a table that will not live long enough to make it worthwhile.
|
||||
* Flag that may be passed to Tcl_GetIndexFromObj to force it to disallow
|
||||
* abbreviated strings.
|
||||
*/
|
||||
|
||||
#define TCL_EXACT 1
|
||||
#define TCL_INDEX_TEMP_TABLE 2
|
||||
#define TCL_EXACT 1
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------------------
|
||||
@@ -2117,8 +2114,8 @@ typedef struct Tcl_EncodingType {
|
||||
* The maximum number of bytes that are necessary to represent a single
|
||||
* Unicode character in UTF-8. The valid values are 3 and 4
|
||||
* (or perhaps 1 if we want to support a non-unicode enabled core). If 3,
|
||||
* then Tcl_UniChar must be 2-bytes in size (UTF-16) (the default). If > 3,
|
||||
* then Tcl_UniChar must be 4-bytes in size (UCS-4). At this time UTF-16 mode
|
||||
* then Tcl_UniChar must be 2-bytes in size (UCS-2) (the default). If > 3,
|
||||
* then Tcl_UniChar must be 4-bytes in size (UCS-4). At this time UCS-2 mode
|
||||
* is the default and recommended mode.
|
||||
*/
|
||||
|
||||
@@ -2479,7 +2476,7 @@ EXTERN int TclZipfs_AppHook(int *argc, char ***argv);
|
||||
# define Tcl_DecrRefCount(objPtr) \
|
||||
do { \
|
||||
Tcl_Obj *_objPtr = (objPtr); \
|
||||
if (_objPtr->refCount-- <= 1) { \
|
||||
if ((_objPtr)->refCount-- <= 1) { \
|
||||
TclFreeObj(_objPtr); \
|
||||
} \
|
||||
} while(0)
|
||||
|
||||
+2
-2
@@ -24,7 +24,7 @@
|
||||
#include "tclInt.h"
|
||||
#if !TCL_THREADS || !defined(USE_THREAD_ALLOC)
|
||||
|
||||
#if defined(USE_TCLALLOC) && USE_TCLALLOC
|
||||
#if USE_TCLALLOC
|
||||
|
||||
/*
|
||||
* We should really make use of AC_CHECK_TYPE(caddr_t) here, but it can wait
|
||||
@@ -345,7 +345,7 @@ TclpAlloc(
|
||||
|
||||
nextf[bucket] = overPtr->next;
|
||||
overPtr->overMagic0 = overPtr->overMagic1 = MAGIC;
|
||||
overPtr->bucketIndex = UCHAR(bucket);
|
||||
overPtr->bucketIndex = (unsigned char) bucket;
|
||||
|
||||
#ifdef MSTATS
|
||||
numMallocs[bucket]++;
|
||||
|
||||
@@ -131,7 +131,7 @@ enum BasicBlockFlags {
|
||||
* Source instruction type recognized by the assembler.
|
||||
*/
|
||||
|
||||
typedef enum {
|
||||
typedef enum TalInstType {
|
||||
ASSEM_1BYTE, /* Fixed arity, 1-byte instruction */
|
||||
ASSEM_BEGIN_CATCH, /* Begin catch: one 4-byte jump offset to be
|
||||
* converted to appropriate exception
|
||||
@@ -145,6 +145,8 @@ typedef enum {
|
||||
* 1 */
|
||||
ASSEM_DICT_GET, /* 'dict get' and related - consumes N+1
|
||||
* operands, produces 1, N > 0 */
|
||||
ASSEM_DICT_GET_DEF, /* 'dict getwithdefault' - consumes N+2
|
||||
* operands, produces 1, N > 0 */
|
||||
ASSEM_DICT_SET, /* specifies key count and LVT index, consumes
|
||||
* N+1 operands, produces 1, N > 0 */
|
||||
ASSEM_DICT_UNSET, /* specifies key count and LVT index, consumes
|
||||
@@ -187,10 +189,8 @@ typedef enum {
|
||||
* produces N */
|
||||
ASSEM_SINT1, /* One 1-byte signed-integer operand
|
||||
* (INCR_STK_IMM) */
|
||||
ASSEM_SINT4_LVT4, /* Signed 4-byte integer operand followed by
|
||||
ASSEM_SINT4_LVT4 /* Signed 4-byte integer operand followed by
|
||||
* LVT entry. Fixed arity */
|
||||
ASSEM_DICT_GET_DEF /* 'dict getwithdefault' - consumes N+2
|
||||
* operands, produces 1, N > 0 */
|
||||
} TalInstType;
|
||||
|
||||
/*
|
||||
@@ -815,7 +815,7 @@ TclNRAssembleObjCmd(
|
||||
Tcl_AddErrorInfo(interp, "\n (\"");
|
||||
Tcl_AppendObjToErrorInfo(interp, objv[0]);
|
||||
Tcl_AddErrorInfo(interp, "\" body, line ");
|
||||
TclNewIntObj(backtrace, Tcl_GetErrorLine(interp));
|
||||
backtrace = Tcl_NewWideIntObj(Tcl_GetErrorLine(interp));
|
||||
Tcl_AppendObjToErrorInfo(interp, backtrace);
|
||||
Tcl_AddErrorInfo(interp, ")");
|
||||
return TCL_ERROR;
|
||||
@@ -1266,7 +1266,7 @@ AssembleOneLine(
|
||||
Tcl_Obj* instNameObj; /* Name of the instruction */
|
||||
int tblIdx; /* Index in TalInstructionTable of the
|
||||
* instruction */
|
||||
TalInstType instType; /* Type of the instruction */
|
||||
enum TalInstType instType; /* Type of the instruction */
|
||||
Tcl_Obj* operand1Obj = NULL;
|
||||
/* First operand to the instruction */
|
||||
const char* operand1; /* String rep of the operand */
|
||||
@@ -2098,9 +2098,8 @@ GetNextOperand(
|
||||
* with \-substitutions done. */
|
||||
{
|
||||
Tcl_Interp* interp = (Tcl_Interp*) assemEnvPtr->envPtr->iPtr;
|
||||
Tcl_Obj* operandObj;
|
||||
Tcl_Obj* operandObj = Tcl_NewObj();
|
||||
|
||||
TclNewObj(operandObj);
|
||||
if (!TclWordKnownAtCompileTime(*tokenPtrPtr, operandObj)) {
|
||||
Tcl_DecrRefCount(operandObj);
|
||||
if (assemEnvPtr->flags & TCL_EVAL_DIRECT) {
|
||||
@@ -4270,7 +4269,7 @@ AddBasicBlockRangeToErrorInfo(
|
||||
Tcl_Obj* lineNo; /* Line number in the source */
|
||||
|
||||
Tcl_AddErrorInfo(interp, "\n in assembly code between lines ");
|
||||
TclNewIntObj(lineNo, bbPtr->startLine);
|
||||
lineNo = Tcl_NewWideIntObj(bbPtr->startLine);
|
||||
Tcl_IncrRefCount(lineNo);
|
||||
Tcl_AppendObjToErrorInfo(interp, lineNo);
|
||||
Tcl_AddErrorInfo(interp, " and ");
|
||||
|
||||
+71
-72
@@ -684,7 +684,7 @@ Tcl_CreateInterp(void)
|
||||
TclRegisterCommandTypeName(TclEnsembleImplementationCmd, "ensemble");
|
||||
TclRegisterCommandTypeName(TclAliasObjCmd, "alias");
|
||||
TclRegisterCommandTypeName(TclLocalAliasObjCmd, "alias");
|
||||
TclRegisterCommandTypeName(TclChildObjCmd, "interp");
|
||||
TclRegisterCommandTypeName(TclSlaveObjCmd, "slave");
|
||||
TclRegisterCommandTypeName(TclInvokeImportedCmd, "import");
|
||||
TclRegisterCommandTypeName(TclOOPublicObjectCmd, "object");
|
||||
TclRegisterCommandTypeName(TclOOPrivateObjectCmd, "privateObject");
|
||||
@@ -708,7 +708,7 @@ Tcl_CreateInterp(void)
|
||||
#endif
|
||||
iPtr->freeProc = NULL;
|
||||
iPtr->errorLine = 0;
|
||||
TclNewObj(iPtr->objResultPtr);
|
||||
iPtr->objResultPtr = Tcl_NewObj();
|
||||
Tcl_IncrRefCount(iPtr->objResultPtr);
|
||||
iPtr->handle = TclHandleCreate(iPtr);
|
||||
iPtr->globalNsPtr = NULL;
|
||||
@@ -796,7 +796,8 @@ Tcl_CreateInterp(void)
|
||||
iPtr->activeInterpTracePtr = NULL;
|
||||
iPtr->assocData = NULL;
|
||||
iPtr->execEnvPtr = NULL; /* Set after namespaces initialized. */
|
||||
TclNewObj(iPtr->emptyObjPtr); /* Another empty object. */
|
||||
iPtr->emptyObjPtr = Tcl_NewObj();
|
||||
/* Another empty object. */
|
||||
Tcl_IncrRefCount(iPtr->emptyObjPtr);
|
||||
#ifndef TCL_NO_DEPRECATED
|
||||
iPtr->resultSpace[0] = 0;
|
||||
@@ -862,7 +863,7 @@ Tcl_CreateInterp(void)
|
||||
* TIP #285, Script cancellation support.
|
||||
*/
|
||||
|
||||
TclNewObj(iPtr->asyncCancelMsg);
|
||||
iPtr->asyncCancelMsg = Tcl_NewObj();
|
||||
|
||||
cancelInfo = (CancelInfo *)ckalloc(sizeof(CancelInfo));
|
||||
cancelInfo->interp = interp;
|
||||
@@ -2784,8 +2785,6 @@ TclCreateObjCommandInNs(
|
||||
Command *refCmdPtr = oldRefPtr->importedCmdPtr;
|
||||
|
||||
dataPtr = (ImportedCmdData*)refCmdPtr->objClientData;
|
||||
cmdPtr->refCount++;
|
||||
TclCleanupCommandMacro(dataPtr->realCmdPtr);
|
||||
dataPtr->realCmdPtr = cmdPtr;
|
||||
oldRefPtr = oldRefPtr->nextPtr;
|
||||
}
|
||||
@@ -2989,7 +2988,7 @@ TclRenameCommand(
|
||||
}
|
||||
|
||||
cmdNsPtr = cmdPtr->nsPtr;
|
||||
TclNewObj(oldFullName);
|
||||
oldFullName = Tcl_NewObj();
|
||||
Tcl_IncrRefCount(oldFullName);
|
||||
Tcl_GetCommandFullName(interp, cmd, oldFullName);
|
||||
|
||||
@@ -3375,7 +3374,7 @@ Tcl_GetCommandFullName(
|
||||
* separator, and the command name.
|
||||
*/
|
||||
|
||||
if ((cmdPtr != NULL) && TclRoutineHasName(cmdPtr)) {
|
||||
if (cmdPtr != NULL) {
|
||||
if (cmdPtr->nsPtr != NULL) {
|
||||
Tcl_AppendToObj(objPtr, cmdPtr->nsPtr->fullName, -1);
|
||||
if (cmdPtr->nsPtr != iPtr->globalNsPtr) {
|
||||
@@ -3465,7 +3464,7 @@ Tcl_DeleteCommandFromToken(
|
||||
* and skip nested deletes.
|
||||
*/
|
||||
|
||||
if (cmdPtr->flags & CMD_DYING) {
|
||||
if (cmdPtr->flags & CMD_IS_DELETED) {
|
||||
/*
|
||||
* Another deletion is already in progress. Remove the hash table
|
||||
* entry now, but don't invoke a callback or free the command
|
||||
@@ -3497,7 +3496,7 @@ Tcl_DeleteCommandFromToken(
|
||||
* be ignored.
|
||||
*/
|
||||
|
||||
cmdPtr->flags |= CMD_DYING;
|
||||
cmdPtr->flags |= CMD_IS_DELETED;
|
||||
|
||||
/*
|
||||
* Call trace functions for the command being deleted. Then delete its
|
||||
@@ -3527,7 +3526,7 @@ Tcl_DeleteCommandFromToken(
|
||||
}
|
||||
|
||||
/*
|
||||
* The list of commands exported from the namespace might have changed.
|
||||
* The list of command exported from the namespace might have changed.
|
||||
* However, we do not need to recompute this just yet; next time we need
|
||||
* the info will be soon enough.
|
||||
*/
|
||||
@@ -3548,19 +3547,6 @@ Tcl_DeleteCommandFromToken(
|
||||
iPtr->compileEpoch++;
|
||||
}
|
||||
|
||||
if (!(cmdPtr->flags & CMD_REDEF_IN_PROGRESS)) {
|
||||
/*
|
||||
* Delete any imports of this routine before deleting this routine itself.
|
||||
* See issue 688fcc7082fa.
|
||||
*/
|
||||
for (refPtr = cmdPtr->importRefPtr; refPtr != NULL;
|
||||
refPtr = nextRefPtr) {
|
||||
nextRefPtr = refPtr->nextPtr;
|
||||
importCmd = (Tcl_Command) refPtr->importedCmdPtr;
|
||||
Tcl_DeleteCommandFromToken(interp, importCmd);
|
||||
}
|
||||
}
|
||||
|
||||
if (cmdPtr->deleteProc != NULL) {
|
||||
/*
|
||||
* Delete the command's client data. If this was an imported command
|
||||
@@ -3580,6 +3566,20 @@ Tcl_DeleteCommandFromToken(
|
||||
cmdPtr->deleteProc(cmdPtr->deleteData);
|
||||
}
|
||||
|
||||
/*
|
||||
* If this command was imported into other namespaces, then imported
|
||||
* commands were created that refer back to this command. Delete these
|
||||
* imported commands now.
|
||||
*/
|
||||
if (!(cmdPtr->flags & CMD_REDEF_IN_PROGRESS)) {
|
||||
for (refPtr = cmdPtr->importRefPtr; refPtr != NULL;
|
||||
refPtr = nextRefPtr) {
|
||||
nextRefPtr = refPtr->nextPtr;
|
||||
importCmd = (Tcl_Command) refPtr->importedCmdPtr;
|
||||
Tcl_DeleteCommandFromToken(interp, importCmd);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Don't use hPtr to delete the hash entry here, because it's possible
|
||||
* that the deletion callback renamed the command. Instead, use
|
||||
@@ -3617,7 +3617,6 @@ Tcl_DeleteCommandFromToken(
|
||||
* TclNRExecuteByteCode looks up the command in the command hashtable).
|
||||
*/
|
||||
|
||||
cmdPtr->flags |= CMD_DEAD;
|
||||
TclCleanupCommandMacro(cmdPtr);
|
||||
return 0;
|
||||
}
|
||||
@@ -3662,7 +3661,7 @@ CallCommandTraces(
|
||||
* While a rename trace is active, we will not process any more rename
|
||||
* traces; while a delete trace is active we will never reach here -
|
||||
* because Tcl_DeleteCommandFromToken checks for the condition
|
||||
* (cmdPtr->flags & CMD_DYING) and returns immediately when a
|
||||
* (cmdPtr->flags & CMD_IS_DELETED) and returns immediately when a
|
||||
* command deletion is in progress. For all other traces, delete
|
||||
* traces will not be invoked but a call to TraceCommandProc will
|
||||
* ensure that tracePtr->clientData is freed whenever the command
|
||||
@@ -3793,11 +3792,11 @@ CancelEvalProc(
|
||||
TclSetCancelFlags(iPtr, cancelInfo->flags | CANCELED);
|
||||
|
||||
/*
|
||||
* Now, we must set the script cancellation flags on all the child
|
||||
* Now, we must set the script cancellation flags on all the slave
|
||||
* interpreters belonging to this one.
|
||||
*/
|
||||
|
||||
TclSetChildCancelFlags((Tcl_Interp *) iPtr,
|
||||
TclSetSlaveCancelFlags((Tcl_Interp *) iPtr,
|
||||
cancelInfo->flags | CANCELED, 0);
|
||||
|
||||
/*
|
||||
@@ -4042,7 +4041,7 @@ OldMathFuncProc(
|
||||
if (funcResult.type == TCL_INT) {
|
||||
TclNewIntObj(valuePtr, funcResult.intValue);
|
||||
} else if (funcResult.type == TCL_WIDE_INT) {
|
||||
TclNewIntObj(valuePtr, funcResult.wideValue);
|
||||
valuePtr = Tcl_NewWideIntObj(funcResult.wideValue);
|
||||
} else {
|
||||
return CheckDoubleResult(interp, funcResult.doubleValue);
|
||||
}
|
||||
@@ -4201,7 +4200,7 @@ Tcl_ListMathFuncs(
|
||||
if (TCL_OK == Tcl_EvalObjEx(interp, script, 0)) {
|
||||
result = Tcl_DuplicateObj(Tcl_GetObjResult(interp));
|
||||
} else {
|
||||
TclNewObj(result);
|
||||
result = Tcl_NewObj();
|
||||
}
|
||||
Tcl_DecrRefCount(script);
|
||||
Tcl_RestoreInterpState(interp, state);
|
||||
@@ -4322,7 +4321,7 @@ TclResetCancellation(
|
||||
* Tcl_Canceled --
|
||||
*
|
||||
* Check if the script in progress has been canceled, i.e.,
|
||||
* Tcl_CancelEval was called for this interpreter or any of its parent
|
||||
* Tcl_CancelEval was called for this interpreter or any of its master
|
||||
* interpreters.
|
||||
*
|
||||
* Results:
|
||||
@@ -4687,7 +4686,7 @@ EvalObjvCore(
|
||||
* Caller gave it to us.
|
||||
*/
|
||||
|
||||
if (!(preCmdPtr->flags & CMD_DEAD)) {
|
||||
if (!(preCmdPtr->flags & CMD_IS_DELETED)) {
|
||||
/*
|
||||
* So long as it exists, use it.
|
||||
*/
|
||||
@@ -5215,7 +5214,7 @@ TEOV_RunLeaveTraces(
|
||||
int length;
|
||||
const char *command = TclGetStringFromObj(commandPtr, &length);
|
||||
|
||||
if (!(cmdPtr->flags & CMD_DYING)) {
|
||||
if (!(cmdPtr->flags & CMD_IS_DELETED)) {
|
||||
if (cmdPtr->flags & CMD_HAS_EXEC_TRACES) {
|
||||
traceCode = TclCheckExecutionTraces(interp, command, length,
|
||||
cmdPtr, result, TCL_TRACE_LEAVE_EXEC, objc, objv);
|
||||
@@ -5408,7 +5407,7 @@ TclEvalEx(
|
||||
* the embedded command, which is refered to
|
||||
* by 'script'. The 'clNextOuter' refers to
|
||||
* the current entry in the table of
|
||||
* continuation lines in this "main script",
|
||||
* continuation lines in this "master script",
|
||||
* and the character offsets are relative to
|
||||
* the 'outerScript' as well.
|
||||
*
|
||||
@@ -6461,7 +6460,7 @@ TclNREvalObjEx(
|
||||
/*
|
||||
* Shimmer protection! Always pass an unshared obj. The caller could
|
||||
* incr the refCount of objPtr AFTER calling us! To be completely safe
|
||||
* we always make a copy. The callback takes care of the refCounts for
|
||||
* we always make a copy. The callback takes care od the refCounts for
|
||||
* both listPtr and objPtr.
|
||||
*
|
||||
* TODO: Create a test to demo this need, or eliminate it.
|
||||
@@ -7030,7 +7029,7 @@ TclObjInvoke(
|
||||
|
||||
int
|
||||
TclNRInvoke(
|
||||
TCL_UNUSED(void *),
|
||||
TCL_UNUSED(ClientData),
|
||||
Tcl_Interp *interp,
|
||||
int objc,
|
||||
Tcl_Obj *const objv[])
|
||||
@@ -7512,7 +7511,7 @@ Tcl_GetVersion(
|
||||
|
||||
static int
|
||||
ExprCeilFunc(
|
||||
TCL_UNUSED(void *),
|
||||
TCL_UNUSED(ClientData),
|
||||
Tcl_Interp *interp, /* The interpreter in which to execute the
|
||||
* function. */
|
||||
int objc, /* Actual parameter count. */
|
||||
@@ -7552,7 +7551,7 @@ ExprCeilFunc(
|
||||
|
||||
static int
|
||||
ExprFloorFunc(
|
||||
TCL_UNUSED(void *),
|
||||
TCL_UNUSED(ClientData),
|
||||
Tcl_Interp *interp, /* The interpreter in which to execute the
|
||||
* function. */
|
||||
int objc, /* Actual parameter count. */
|
||||
@@ -7592,7 +7591,7 @@ ExprFloorFunc(
|
||||
|
||||
static int
|
||||
ExprIsqrtFunc(
|
||||
TCL_UNUSED(void *),
|
||||
TCL_UNUSED(ClientData),
|
||||
Tcl_Interp *interp, /* The interpreter in which to execute. */
|
||||
int objc, /* Actual parameter count. */
|
||||
Tcl_Obj *const *objv) /* Actual parameter list. */
|
||||
@@ -7698,7 +7697,7 @@ ExprIsqrtFunc(
|
||||
|
||||
static int
|
||||
ExprSqrtFunc(
|
||||
TCL_UNUSED(void *),
|
||||
TCL_UNUSED(ClientData),
|
||||
Tcl_Interp *interp, /* The interpreter in which to execute the
|
||||
* function. */
|
||||
int objc, /* Actual parameter count. */
|
||||
@@ -7866,7 +7865,7 @@ ExprBinaryFunc(
|
||||
|
||||
static int
|
||||
ExprAbsFunc(
|
||||
TCL_UNUSED(void *),
|
||||
TCL_UNUSED(ClientData),
|
||||
Tcl_Interp *interp, /* The interpreter in which to execute the
|
||||
* function. */
|
||||
int objc, /* Actual parameter count. */
|
||||
@@ -7965,7 +7964,7 @@ ExprAbsFunc(
|
||||
|
||||
static int
|
||||
ExprBoolFunc(
|
||||
TCL_UNUSED(void *),
|
||||
TCL_UNUSED(ClientData),
|
||||
Tcl_Interp *interp, /* The interpreter in which to execute the
|
||||
* function. */
|
||||
int objc, /* Actual parameter count. */
|
||||
@@ -7986,7 +7985,7 @@ ExprBoolFunc(
|
||||
|
||||
static int
|
||||
ExprDoubleFunc(
|
||||
TCL_UNUSED(void *),
|
||||
TCL_UNUSED(ClientData),
|
||||
Tcl_Interp *interp, /* The interpreter in which to execute the
|
||||
* function. */
|
||||
int objc, /* Actual parameter count. */
|
||||
@@ -8013,7 +8012,7 @@ ExprDoubleFunc(
|
||||
|
||||
static int
|
||||
ExprIntFunc(
|
||||
TCL_UNUSED(void *),
|
||||
TCL_UNUSED(ClientData),
|
||||
Tcl_Interp *interp, /* The interpreter in which to execute the
|
||||
* function. */
|
||||
int objc, /* Actual parameter count. */
|
||||
@@ -8069,7 +8068,7 @@ ExprIntFunc(
|
||||
|
||||
static int
|
||||
ExprWideFunc(
|
||||
TCL_UNUSED(void *),
|
||||
TCL_UNUSED(ClientData),
|
||||
Tcl_Interp *interp, /* The interpreter in which to execute the
|
||||
* function. */
|
||||
int objc, /* Actual parameter count. */
|
||||
@@ -8090,7 +8089,7 @@ ExprWideFunc(
|
||||
*/
|
||||
static int
|
||||
ExprMaxMinFunc(
|
||||
TCL_UNUSED(void *),
|
||||
TCL_UNUSED(ClientData),
|
||||
Tcl_Interp *interp, /* The interpreter in which to execute the
|
||||
* function. */
|
||||
int objc, /* Actual parameter count. */
|
||||
@@ -8130,7 +8129,7 @@ ExprMaxMinFunc(
|
||||
|
||||
static int
|
||||
ExprMaxFunc(
|
||||
TCL_UNUSED(void *),
|
||||
TCL_UNUSED(ClientData),
|
||||
Tcl_Interp *interp, /* The interpreter in which to execute the
|
||||
* function. */
|
||||
int objc, /* Actual parameter count. */
|
||||
@@ -8141,7 +8140,7 @@ ExprMaxFunc(
|
||||
|
||||
static int
|
||||
ExprMinFunc(
|
||||
TCL_UNUSED(void *),
|
||||
TCL_UNUSED(ClientData),
|
||||
Tcl_Interp *interp, /* The interpreter in which to execute the
|
||||
* function. */
|
||||
int objc, /* Actual parameter count. */
|
||||
@@ -8152,7 +8151,7 @@ ExprMinFunc(
|
||||
|
||||
static int
|
||||
ExprRandFunc(
|
||||
TCL_UNUSED(void *),
|
||||
TCL_UNUSED(ClientData),
|
||||
Tcl_Interp *interp, /* The interpreter in which to execute the
|
||||
* function. */
|
||||
int objc, /* Actual parameter count. */
|
||||
@@ -8245,7 +8244,7 @@ ExprRandFunc(
|
||||
|
||||
static int
|
||||
ExprRoundFunc(
|
||||
TCL_UNUSED(void *),
|
||||
TCL_UNUSED(ClientData),
|
||||
Tcl_Interp *interp, /* The interpreter in which to execute the
|
||||
* function. */
|
||||
int objc, /* Actual parameter count. */
|
||||
@@ -8324,7 +8323,7 @@ ExprRoundFunc(
|
||||
|
||||
static int
|
||||
ExprSrandFunc(
|
||||
TCL_UNUSED(void *),
|
||||
TCL_UNUSED(ClientData),
|
||||
Tcl_Interp *interp, /* The interpreter in which to execute the
|
||||
* function. */
|
||||
int objc, /* Actual parameter count. */
|
||||
@@ -8513,7 +8512,7 @@ ClassifyDouble(
|
||||
|
||||
static int
|
||||
ExprIsFiniteFunc(
|
||||
TCL_UNUSED(void *),
|
||||
TCL_UNUSED(ClientData),
|
||||
Tcl_Interp *interp, /* The interpreter in which to execute the
|
||||
* function. */
|
||||
int objc, /* Actual parameter count */
|
||||
@@ -8544,7 +8543,7 @@ ExprIsFiniteFunc(
|
||||
|
||||
static int
|
||||
ExprIsInfinityFunc(
|
||||
TCL_UNUSED(void *),
|
||||
TCL_UNUSED(ClientData),
|
||||
Tcl_Interp *interp, /* The interpreter in which to execute the
|
||||
* function. */
|
||||
int objc, /* Actual parameter count */
|
||||
@@ -8574,7 +8573,7 @@ ExprIsInfinityFunc(
|
||||
|
||||
static int
|
||||
ExprIsNaNFunc(
|
||||
TCL_UNUSED(void *),
|
||||
TCL_UNUSED(ClientData),
|
||||
Tcl_Interp *interp, /* The interpreter in which to execute the
|
||||
* function. */
|
||||
int objc, /* Actual parameter count */
|
||||
@@ -8604,7 +8603,7 @@ ExprIsNaNFunc(
|
||||
|
||||
static int
|
||||
ExprIsNormalFunc(
|
||||
TCL_UNUSED(void *),
|
||||
TCL_UNUSED(ClientData),
|
||||
Tcl_Interp *interp, /* The interpreter in which to execute the
|
||||
* function. */
|
||||
int objc, /* Actual parameter count */
|
||||
@@ -8634,7 +8633,7 @@ ExprIsNormalFunc(
|
||||
|
||||
static int
|
||||
ExprIsSubnormalFunc(
|
||||
TCL_UNUSED(void *),
|
||||
TCL_UNUSED(ClientData),
|
||||
Tcl_Interp *interp, /* The interpreter in which to execute the
|
||||
* function. */
|
||||
int objc, /* Actual parameter count */
|
||||
@@ -8664,7 +8663,7 @@ ExprIsSubnormalFunc(
|
||||
|
||||
static int
|
||||
ExprIsUnorderedFunc(
|
||||
TCL_UNUSED(void *),
|
||||
TCL_UNUSED(ClientData),
|
||||
Tcl_Interp *interp, /* The interpreter in which to execute the
|
||||
* function. */
|
||||
int objc, /* Actual parameter count */
|
||||
@@ -8705,7 +8704,7 @@ ExprIsUnorderedFunc(
|
||||
|
||||
static int
|
||||
FloatClassifyObjCmd(
|
||||
TCL_UNUSED(void *),
|
||||
TCL_UNUSED(ClientData),
|
||||
Tcl_Interp *interp, /* The interpreter in which to execute the
|
||||
* function. */
|
||||
int objc, /* Actual parameter count */
|
||||
@@ -8790,8 +8789,8 @@ MathFuncWrongNumArgs(
|
||||
}
|
||||
}
|
||||
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
|
||||
"%s arguments for math function \"%s\"",
|
||||
(found < expected ? "not enough" : "too many"), name));
|
||||
"too %s arguments for math function \"%s\"",
|
||||
(found < expected ? "few" : "many"), name));
|
||||
Tcl_SetErrorCode(interp, "TCL", "WRONGARGS", NULL);
|
||||
}
|
||||
|
||||
@@ -8814,7 +8813,7 @@ MathFuncWrongNumArgs(
|
||||
|
||||
static int
|
||||
DTraceObjCmd(
|
||||
TCL_UNUSED(void *),
|
||||
TCL_UNUSED(ClientData),
|
||||
TCL_UNUSED(Tcl_Interp *),
|
||||
int objc, /* Number of arguments. */
|
||||
Tcl_Obj *const objv[]) /* Argument objects. */
|
||||
@@ -9198,7 +9197,7 @@ TclSetTailcall(
|
||||
|
||||
int
|
||||
TclNRTailcallObjCmd(
|
||||
TCL_UNUSED(void *),
|
||||
TCL_UNUSED(ClientData),
|
||||
Tcl_Interp *interp,
|
||||
int objc,
|
||||
Tcl_Obj *const objv[])
|
||||
@@ -9391,7 +9390,7 @@ TclNRYieldObjCmd(
|
||||
|
||||
int
|
||||
TclNRYieldToObjCmd(
|
||||
TCL_UNUSED(void *),
|
||||
TCL_UNUSED(ClientData),
|
||||
Tcl_Interp *interp,
|
||||
int objc,
|
||||
Tcl_Obj *const objv[])
|
||||
@@ -9514,7 +9513,7 @@ NRCoroutineCallerCallback(
|
||||
SAVE_CONTEXT(corPtr->running);
|
||||
RESTORE_CONTEXT(corPtr->caller);
|
||||
|
||||
if (cmdPtr->flags & CMD_DYING) {
|
||||
if (cmdPtr->flags & CMD_IS_DELETED) {
|
||||
/*
|
||||
* The command was deleted while it was running: wind down the
|
||||
* execEnv, this will do the complete cleanup. RewindCoroutine will
|
||||
@@ -9701,7 +9700,7 @@ TclNREvalList(
|
||||
|
||||
static int
|
||||
CoroTypeObjCmd(
|
||||
TCL_UNUSED(void *),
|
||||
TCL_UNUSED(ClientData),
|
||||
Tcl_Interp *interp,
|
||||
int objc,
|
||||
Tcl_Obj *const objv[])
|
||||
@@ -9791,7 +9790,7 @@ GetCoroutineFromObj(
|
||||
|
||||
static int
|
||||
TclNRCoroInjectObjCmd(
|
||||
TCL_UNUSED(void *),
|
||||
TCL_UNUSED(ClientData),
|
||||
Tcl_Interp *interp,
|
||||
int objc,
|
||||
Tcl_Obj *const objv[])
|
||||
@@ -9836,7 +9835,7 @@ TclNRCoroInjectObjCmd(
|
||||
|
||||
static int
|
||||
TclNRCoroProbeObjCmd(
|
||||
TCL_UNUSED(void *),
|
||||
TCL_UNUSED(ClientData),
|
||||
Tcl_Interp *interp,
|
||||
int objc,
|
||||
Tcl_Obj *const objv[])
|
||||
@@ -9960,7 +9959,7 @@ InjectHandler(
|
||||
* I don't think this is reachable...
|
||||
*/
|
||||
|
||||
Tcl_ListObjAppendElement(NULL, listPtr, Tcl_NewWideIntObj(nargs));
|
||||
Tcl_ListObjAppendElement(NULL, listPtr, Tcl_NewIntObj(nargs));
|
||||
}
|
||||
Tcl_ListObjAppendElement(NULL, listPtr, Tcl_GetObjResult(interp));
|
||||
}
|
||||
@@ -10029,7 +10028,7 @@ InjectHandlerPostCall(
|
||||
|
||||
static int
|
||||
NRInjectObjCmd(
|
||||
TCL_UNUSED(void *),
|
||||
TCL_UNUSED(ClientData),
|
||||
Tcl_Interp *interp,
|
||||
int objc,
|
||||
Tcl_Obj *const objv[])
|
||||
@@ -10138,7 +10137,7 @@ TclNRInterpCoroutine(
|
||||
|
||||
int
|
||||
TclNRCoroutineObjCmd(
|
||||
TCL_UNUSED(void *),
|
||||
TCL_UNUSED(ClientData),
|
||||
Tcl_Interp *interp, /* Current interpreter. */
|
||||
int objc, /* Number of arguments. */
|
||||
Tcl_Obj *const objv[]) /* Argument objects. */
|
||||
@@ -10271,7 +10270,7 @@ TclNRCoroutineObjCmd(
|
||||
|
||||
int
|
||||
TclInfoCoroutineCmd(
|
||||
TCL_UNUSED(void *),
|
||||
TCL_UNUSED(ClientData),
|
||||
Tcl_Interp *interp,
|
||||
int objc,
|
||||
Tcl_Obj *const objv[])
|
||||
@@ -10283,7 +10282,7 @@ TclInfoCoroutineCmd(
|
||||
return TCL_ERROR;
|
||||
}
|
||||
|
||||
if (corPtr && !(corPtr->cmdPtr->flags & CMD_DYING)) {
|
||||
if (corPtr && !(corPtr->cmdPtr->flags & CMD_IS_DELETED)) {
|
||||
Tcl_Obj *namePtr;
|
||||
|
||||
TclNewObj(namePtr);
|
||||
|
||||
+29
-61
@@ -274,7 +274,7 @@ typedef struct ByteArray {
|
||||
* array. */
|
||||
unsigned int allocated; /* The amount of space actually allocated
|
||||
* minus 1 byte. */
|
||||
unsigned char bytes[TCLFLEXARRAY]; /* The array of bytes. The actual size of this
|
||||
unsigned char bytes[1]; /* The array of bytes. The actual size of this
|
||||
* field depends on the 'allocated' field
|
||||
* above. */
|
||||
} ByteArray;
|
||||
@@ -470,16 +470,16 @@ TclGetBytesFromObj(
|
||||
if (irPtr == NULL) {
|
||||
if (interp) {
|
||||
const char *nonbyte;
|
||||
int ucs4;
|
||||
Tcl_UniChar ch;
|
||||
|
||||
irPtr = TclFetchIntRep(objPtr, &tclByteArrayType);
|
||||
baPtr = GET_BYTEARRAY(irPtr);
|
||||
nonbyte = Tcl_UtfAtIndex(Tcl_GetString(objPtr), baPtr->bad);
|
||||
TclUtfToUCS4(nonbyte, &ucs4);
|
||||
Tcl_UtfToUniChar(nonbyte, &ch);
|
||||
|
||||
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
|
||||
"expected byte sequence but character %d "
|
||||
"was '%1s' (U+%06X)", baPtr->bad, nonbyte, ucs4));
|
||||
"was '%1s' (U+%04X)", baPtr->bad, nonbyte, ch));
|
||||
Tcl_SetErrorCode(interp, "TCL", "VALUE", "BYTES", NULL);
|
||||
}
|
||||
return NULL;
|
||||
@@ -1163,7 +1163,7 @@ BinaryFormatCmd(
|
||||
* bytes and filling with nulls.
|
||||
*/
|
||||
|
||||
TclNewObj(resultPtr);
|
||||
resultPtr = Tcl_NewObj();
|
||||
buffer = Tcl_SetByteArrayLength(resultPtr, length);
|
||||
memset(buffer, 0, length);
|
||||
|
||||
@@ -1595,7 +1595,7 @@ BinaryScanCmd(
|
||||
}
|
||||
}
|
||||
src = buffer + offset;
|
||||
TclNewObj(valuePtr);
|
||||
valuePtr = Tcl_NewObj();
|
||||
Tcl_SetObjLength(valuePtr, count);
|
||||
dest = TclGetString(valuePtr);
|
||||
|
||||
@@ -1650,7 +1650,7 @@ BinaryScanCmd(
|
||||
}
|
||||
}
|
||||
src = buffer + offset;
|
||||
TclNewObj(valuePtr);
|
||||
valuePtr = Tcl_NewObj();
|
||||
Tcl_SetObjLength(valuePtr, count);
|
||||
dest = TclGetString(valuePtr);
|
||||
|
||||
@@ -1734,7 +1734,7 @@ BinaryScanCmd(
|
||||
if ((length - offset) < (count * size)) {
|
||||
goto done;
|
||||
}
|
||||
TclNewObj(valuePtr);
|
||||
valuePtr = Tcl_NewObj();
|
||||
src = buffer + offset;
|
||||
for (i = 0; i < count; i++) {
|
||||
elementPtr = ScanNumber(src, cmd, flags, &numberCachePtr);
|
||||
@@ -2376,9 +2376,8 @@ ScanNumber(
|
||||
return (Tcl_Obj *)Tcl_GetHashValue(hPtr);
|
||||
}
|
||||
if (tablePtr->numEntries <= BINARY_SCAN_MAX_CACHE) {
|
||||
Tcl_Obj *objPtr;
|
||||
Tcl_Obj *objPtr = Tcl_NewWideIntObj(value);
|
||||
|
||||
TclNewIntObj(objPtr, value);
|
||||
Tcl_IncrRefCount(objPtr);
|
||||
Tcl_SetHashValue(hPtr, objPtr);
|
||||
return objPtr;
|
||||
@@ -2596,7 +2595,7 @@ BinaryDecodeHex(
|
||||
unsigned char *data, *datastart, *dataend;
|
||||
unsigned char *begin, *cursor, c;
|
||||
int i, index, value, size, pure = 1, count = 0, cut = 0, strict = 0;
|
||||
int ucs4;
|
||||
Tcl_UniChar ch = 0;
|
||||
enum {OPT_STRICT };
|
||||
static const char *const optStrings[] = { "-strict", NULL };
|
||||
|
||||
@@ -2668,14 +2667,14 @@ BinaryDecodeHex(
|
||||
|
||||
badChar:
|
||||
if (pure) {
|
||||
ucs4 = c;
|
||||
ch = c;
|
||||
} else {
|
||||
TclUtfToUCS4((const char *)(data - 1), &ucs4);
|
||||
TclUtfToUniChar((const char *)(data - 1), &ch);
|
||||
}
|
||||
TclDecrRefCount(resultObj);
|
||||
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
|
||||
"invalid hexadecimal digit \"%c\" (U+%06X) at position %d",
|
||||
ucs4, ucs4, (int) (data - datastart - 1)));
|
||||
"invalid hexadecimal digit \"%c\" at position %d",
|
||||
ch, (int) (data - datastart - 1)));
|
||||
Tcl_SetErrorCode(interp, "TCL", "BINARY", "DECODE", "INVALID", NULL);
|
||||
return TCL_ERROR;
|
||||
}
|
||||
@@ -2762,7 +2761,7 @@ BinaryEncode64(
|
||||
maxlen = 0;
|
||||
}
|
||||
|
||||
TclNewObj(resultObj);
|
||||
resultObj = Tcl_NewObj();
|
||||
data = Tcl_GetByteArrayFromObj(objv[objc - 1], &count);
|
||||
if (count > 0) {
|
||||
unsigned char *cursor = NULL;
|
||||
@@ -2842,7 +2841,7 @@ BinaryEncodeUu(
|
||||
unsigned char *data, *start, *cursor;
|
||||
int offset, count, rawLength, n, i, j, bits, index;
|
||||
int lineLength = 61;
|
||||
const unsigned char SingleNewline[] = { UCHAR('\n') };
|
||||
const unsigned char SingleNewline[] = { (unsigned char) '\n' };
|
||||
const unsigned char *wrapchar = SingleNewline;
|
||||
int wrapcharlen = sizeof(SingleNewline);
|
||||
enum { OPT_MAXLEN, OPT_WRAPCHAR };
|
||||
@@ -2864,47 +2863,16 @@ BinaryEncodeUu(
|
||||
&lineLength) != TCL_OK) {
|
||||
return TCL_ERROR;
|
||||
}
|
||||
if (lineLength < 5 || lineLength > 85) {
|
||||
if (lineLength < 3 || lineLength > 85) {
|
||||
Tcl_SetObjResult(interp, Tcl_NewStringObj(
|
||||
"line length out of range", -1));
|
||||
Tcl_SetErrorCode(interp, "TCL", "BINARY", "ENCODE",
|
||||
"LINE_LENGTH", NULL);
|
||||
return TCL_ERROR;
|
||||
}
|
||||
lineLength = ((lineLength - 1) & -4) + 1; /* 5, 9, 13 ... */
|
||||
break;
|
||||
case OPT_WRAPCHAR:
|
||||
wrapchar = (const unsigned char *) TclGetStringFromObj(
|
||||
objv[i + 1], &wrapcharlen);
|
||||
{
|
||||
const unsigned char *p = wrapchar;
|
||||
int numBytes = wrapcharlen;
|
||||
|
||||
while (numBytes) {
|
||||
switch (*p) {
|
||||
case '\t':
|
||||
case '\v':
|
||||
case '\f':
|
||||
case '\r':
|
||||
p++; numBytes--;
|
||||
continue;
|
||||
case '\n':
|
||||
numBytes--;
|
||||
break;
|
||||
default:
|
||||
badwrap:
|
||||
Tcl_SetObjResult(interp, Tcl_NewStringObj(
|
||||
"invalid wrapchar; will defeat decoding",
|
||||
-1));
|
||||
Tcl_SetErrorCode(interp, "TCL", "BINARY",
|
||||
"ENCODE", "WRAPCHAR", NULL);
|
||||
return TCL_ERROR;
|
||||
}
|
||||
}
|
||||
if (numBytes) {
|
||||
goto badwrap;
|
||||
}
|
||||
}
|
||||
wrapchar = Tcl_GetByteArrayFromObj(objv[i + 1], &wrapcharlen);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -2914,7 +2882,7 @@ BinaryEncodeUu(
|
||||
* enough".
|
||||
*/
|
||||
|
||||
TclNewObj(resultObj);
|
||||
resultObj = Tcl_NewObj();
|
||||
offset = 0;
|
||||
data = Tcl_GetByteArrayFromObj(objv[objc - 1], &count);
|
||||
rawLength = (lineLength - 1) * 3 / 4;
|
||||
@@ -2991,7 +2959,7 @@ BinaryDecodeUu(
|
||||
unsigned char *begin, *cursor;
|
||||
int i, index, size, pure = 1, count = 0, strict = 0, lineLen;
|
||||
unsigned char c;
|
||||
int ucs4;
|
||||
Tcl_UniChar ch = 0;
|
||||
enum { OPT_STRICT };
|
||||
static const char *const optStrings[] = { "-strict", NULL };
|
||||
|
||||
@@ -3124,13 +3092,13 @@ BinaryDecodeUu(
|
||||
|
||||
badUu:
|
||||
if (pure) {
|
||||
ucs4 = c;
|
||||
ch = c;
|
||||
} else {
|
||||
TclUtfToUCS4((const char *)(data - 1), &ucs4);
|
||||
TclUtfToUniChar((const char *)(data - 1), &ch);
|
||||
}
|
||||
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
|
||||
"invalid uuencode character \"%c\" (U+%06X) at position %d",
|
||||
ucs4, ucs4, (int) (data - datastart - 1)));
|
||||
"invalid uuencode character \"%c\" at position %d",
|
||||
ch, (int) (data - datastart - 1)));
|
||||
Tcl_SetErrorCode(interp, "TCL", "BINARY", "DECODE", "INVALID", NULL);
|
||||
TclDecrRefCount(resultObj);
|
||||
return TCL_ERROR;
|
||||
@@ -3165,7 +3133,7 @@ BinaryDecode64(
|
||||
unsigned char *cursor = NULL;
|
||||
int pure = 1, strict = 0;
|
||||
int i, index, size, cut = 0, count = 0;
|
||||
int ucs4;
|
||||
Tcl_UniChar ch = 0;
|
||||
enum { OPT_STRICT };
|
||||
static const char *const optStrings[] = { "-strict", NULL };
|
||||
|
||||
@@ -3293,19 +3261,19 @@ BinaryDecode64(
|
||||
|
||||
bad64:
|
||||
if (pure) {
|
||||
ucs4 = c;
|
||||
ch = c;
|
||||
} else {
|
||||
/* The decoder is byte-oriented. If we saw a byte that's not a
|
||||
* valid member of the base64 alphabet, it could be the lead byte
|
||||
* of a multi-byte character. */
|
||||
|
||||
/* Safe because we know data is NUL-terminated */
|
||||
TclUtfToUCS4((const char *)(data - 1), &ucs4);
|
||||
TclUtfToUniChar((const char *)(data - 1), &ch);
|
||||
}
|
||||
|
||||
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
|
||||
"invalid base64 character \"%c\" (U+%06X) at position %d",
|
||||
ucs4, ucs4, (int) (data - datastart - 1)));
|
||||
"invalid base64 character \"%c\" at position %d", ch,
|
||||
(int) (data - datastart - 1)));
|
||||
Tcl_SetErrorCode(interp, "TCL", "BINARY", "DECODE", "INVALID", NULL);
|
||||
TclDecrRefCount(resultObj);
|
||||
return TCL_ERROR;
|
||||
|
||||
@@ -810,7 +810,7 @@ Tcl_AttemptRealloc(
|
||||
*/
|
||||
static int
|
||||
MemoryCmd(
|
||||
TCL_UNUSED(ClientData),
|
||||
ClientData clientData,
|
||||
Tcl_Interp *interp,
|
||||
int objc, /* Number of arguments. */
|
||||
Tcl_Obj *const objv[]) /* Obj values of arguments. */
|
||||
@@ -1288,7 +1288,7 @@ TclFinalizeMemorySubsystem(void)
|
||||
Tcl_MutexUnlock(ckallocMutexPtr);
|
||||
#endif
|
||||
|
||||
#if defined(USE_TCLALLOC) && USE_TCLALLOC
|
||||
#if USE_TCLALLOC
|
||||
TclFinalizeAllocSubsystem();
|
||||
#endif
|
||||
}
|
||||
|
||||
+1
-1
@@ -263,7 +263,7 @@ TclClockInit(
|
||||
};
|
||||
|
||||
/*
|
||||
* Safe interps get [::clock] as alias to a parent, so do not need their
|
||||
* Safe interps get [::clock] as alias to a master, so do not need their
|
||||
* own copies of the support routines.
|
||||
*/
|
||||
|
||||
|
||||
+3
-3
@@ -59,7 +59,7 @@ static int GetStatBuf(Tcl_Interp *interp, Tcl_Obj *pathPtr,
|
||||
static const char * GetTypeFromMode(int mode);
|
||||
static int StoreStatData(Tcl_Interp *interp, Tcl_Obj *varName,
|
||||
Tcl_StatBuf *statPtr);
|
||||
static int EachloopCmd(Tcl_Interp *interp, int collect,
|
||||
static inline int EachloopCmd(Tcl_Interp *interp, int collect,
|
||||
int objc, Tcl_Obj *const objv[]);
|
||||
static Tcl_NRPostProc CatchObjCmdCallback;
|
||||
static Tcl_NRPostProc ExprCallback;
|
||||
@@ -211,7 +211,7 @@ Tcl_CaseObjCmd(
|
||||
|
||||
pat = TclGetString(caseObjv[i]);
|
||||
for (p = pat; *p != '\0'; p++) {
|
||||
if (TclIsSpaceProcM(*p) || (*p == '\\')) {
|
||||
if (TclIsSpaceProc(*p) || (*p == '\\')) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -2599,7 +2599,7 @@ TclNRLmapCmd(
|
||||
return EachloopCmd(interp, TCL_EACH_COLLECT, objc, objv);
|
||||
}
|
||||
|
||||
static int
|
||||
static inline int
|
||||
EachloopCmd(
|
||||
Tcl_Interp *interp, /* Our context for variables and script
|
||||
* evaluation. */
|
||||
|
||||
+29
-35
@@ -383,7 +383,7 @@ Tcl_IncrObjCmd(
|
||||
if (objc == 3) {
|
||||
incrPtr = objv[2];
|
||||
} else {
|
||||
TclNewIntObj(incrPtr, 1);
|
||||
incrPtr = Tcl_NewWideIntObj(1);
|
||||
}
|
||||
Tcl_IncrRefCount(incrPtr);
|
||||
newValuePtr = TclIncrObjVar2(interp, objv[1], NULL,
|
||||
@@ -691,7 +691,7 @@ InfoCommandsCmd(
|
||||
if (entryPtr != NULL) {
|
||||
if (specificNsInPattern) {
|
||||
cmd = (Tcl_Command)Tcl_GetHashValue(entryPtr);
|
||||
TclNewObj(elemObjPtr);
|
||||
elemObjPtr = Tcl_NewObj();
|
||||
Tcl_GetCommandFullName(interp, cmd, elemObjPtr);
|
||||
} else {
|
||||
cmdName = (const char *)Tcl_GetHashKey(&nsPtr->cmdTable, entryPtr);
|
||||
@@ -742,7 +742,7 @@ InfoCommandsCmd(
|
||||
|| Tcl_StringMatch(cmdName, simplePattern)) {
|
||||
if (specificNsInPattern) {
|
||||
cmd = (Tcl_Command)Tcl_GetHashValue(entryPtr);
|
||||
TclNewObj(elemObjPtr);
|
||||
elemObjPtr = Tcl_NewObj();
|
||||
Tcl_GetCommandFullName(interp, cmd, elemObjPtr);
|
||||
} else {
|
||||
elemObjPtr = Tcl_NewStringObj(cmdName, -1);
|
||||
@@ -969,9 +969,8 @@ InfoDefaultCmd(
|
||||
}
|
||||
Tcl_SetObjResult(interp, Tcl_NewWideIntObj(1));
|
||||
} else {
|
||||
Tcl_Obj *nullObjPtr;
|
||||
Tcl_Obj *nullObjPtr = Tcl_NewObj();
|
||||
|
||||
TclNewObj(nullObjPtr);
|
||||
valueObjPtr = Tcl_ObjSetVar2(interp, objv[3], NULL,
|
||||
nullObjPtr, TCL_LEAVE_ERR_MSG);
|
||||
if (valueObjPtr == NULL) {
|
||||
@@ -1027,7 +1026,7 @@ InfoErrorStackCmd(
|
||||
|
||||
target = interp;
|
||||
if (objc == 2) {
|
||||
target = Tcl_GetChild(interp, TclGetString(objv[1]));
|
||||
target = Tcl_GetSlave(interp, TclGetString(objv[1]));
|
||||
if (target == NULL) {
|
||||
return TCL_ERROR;
|
||||
}
|
||||
@@ -1886,7 +1885,7 @@ InfoProcsCmd(
|
||||
} else {
|
||||
simpleProcOK:
|
||||
if (specificNsInPattern) {
|
||||
TclNewObj(elemObjPtr);
|
||||
elemObjPtr = Tcl_NewObj();
|
||||
Tcl_GetCommandFullName(interp, (Tcl_Command) cmdPtr,
|
||||
elemObjPtr);
|
||||
} else {
|
||||
@@ -1907,15 +1906,15 @@ InfoProcsCmd(
|
||||
|
||||
if (!TclIsProc(cmdPtr)) {
|
||||
realCmdPtr = (Command *)
|
||||
TclGetOriginalCommand((Tcl_Command)cmdPtr);
|
||||
TclGetOriginalCommand((Tcl_Command) cmdPtr);
|
||||
if (realCmdPtr != NULL && TclIsProc(realCmdPtr)) {
|
||||
goto procOK;
|
||||
}
|
||||
} else {
|
||||
procOK:
|
||||
if (specificNsInPattern) {
|
||||
TclNewObj(elemObjPtr);
|
||||
Tcl_GetCommandFullName(interp, (Tcl_Command)cmdPtr,
|
||||
elemObjPtr = Tcl_NewObj();
|
||||
Tcl_GetCommandFullName(interp, (Tcl_Command) cmdPtr,
|
||||
elemObjPtr);
|
||||
} else {
|
||||
elemObjPtr = Tcl_NewStringObj(cmdName, -1);
|
||||
@@ -2143,7 +2142,7 @@ InfoCmdTypeCmd(
|
||||
}
|
||||
|
||||
/*
|
||||
* There's one special case: safe interpreters can't see aliases as
|
||||
* There's one special case: safe slave interpreters can't see aliases as
|
||||
* aliases as they're part of the security mechanisms.
|
||||
*/
|
||||
|
||||
@@ -2218,7 +2217,7 @@ Tcl_JoinObjCmd(
|
||||
} else {
|
||||
int i;
|
||||
|
||||
TclNewObj(resObjPtr);
|
||||
resObjPtr = Tcl_NewObj();
|
||||
for (i = 0; i < listLen; i++) {
|
||||
if (i > 0) {
|
||||
|
||||
@@ -3157,7 +3156,7 @@ Tcl_LsearchObjCmd(
|
||||
"-real", "-regexp", "-sorted", "-start", "-stride",
|
||||
"-subindices", NULL
|
||||
};
|
||||
enum lsearchoptions {
|
||||
enum options {
|
||||
LSEARCH_ALL, LSEARCH_ASCII, LSEARCH_BISECT, LSEARCH_DECREASING,
|
||||
LSEARCH_DICTIONARY, LSEARCH_EXACT, LSEARCH_GLOB, LSEARCH_INCREASING,
|
||||
LSEARCH_INDEX, LSEARCH_INLINE, LSEARCH_INTEGER, LSEARCH_NOCASE,
|
||||
@@ -3205,7 +3204,7 @@ Tcl_LsearchObjCmd(
|
||||
result = TCL_ERROR;
|
||||
goto done;
|
||||
}
|
||||
switch ((enum lsearchoptions) index) {
|
||||
switch ((enum options) index) {
|
||||
case LSEARCH_ALL: /* -all */
|
||||
allMatches = 1;
|
||||
break;
|
||||
@@ -3306,7 +3305,7 @@ Tcl_LsearchObjCmd(
|
||||
if (groupSize < 1) {
|
||||
Tcl_SetObjResult(interp, Tcl_NewStringObj(
|
||||
"stride length must be at least 1", -1));
|
||||
Tcl_SetErrorCode(interp, "TCL", "OPERATION", "LSEARCH",
|
||||
Tcl_SetErrorCode(interp, "TCL", "OPERATION", "LSORT",
|
||||
"BADSTRIDE", NULL);
|
||||
result = TCL_ERROR;
|
||||
goto done;
|
||||
@@ -3514,8 +3513,7 @@ Tcl_LsearchObjCmd(
|
||||
if (allMatches || inlineReturn) {
|
||||
Tcl_ResetResult(interp);
|
||||
} else {
|
||||
TclNewIntObj(itemPtr, TCL_INDEX_NONE);
|
||||
Tcl_SetObjResult(interp, itemPtr);
|
||||
Tcl_SetObjResult(interp, Tcl_NewWideIntObj(-1));
|
||||
}
|
||||
goto done;
|
||||
}
|
||||
@@ -3642,11 +3640,11 @@ Tcl_LsearchObjCmd(
|
||||
/*
|
||||
* Normally, binary search is written to stop when it finds a
|
||||
* match. If there are duplicates of an element in the list,
|
||||
* our first match might not be the first occurrence.
|
||||
* our first match might not be the first occurance.
|
||||
* Consider: 0 0 0 1 1 1 2 2 2
|
||||
*
|
||||
* To maintain consistancy with standard lsearch semantics, we
|
||||
* must find the leftmost occurrence of the pattern in the
|
||||
* must find the leftmost occurance of the pattern in the
|
||||
* list. Thus we don't just stop searching here. This
|
||||
* variation means that a search always makes log n
|
||||
* comparisons (normal binary search might "get lucky" with an
|
||||
@@ -3804,11 +3802,10 @@ Tcl_LsearchObjCmd(
|
||||
} else if (returnSubindices) {
|
||||
int j;
|
||||
|
||||
TclNewIntObj(itemPtr, i+groupOffset);
|
||||
itemPtr = Tcl_NewWideIntObj(i+groupOffset);
|
||||
for (j=0 ; j<sortInfo.indexc ; j++) {
|
||||
Tcl_Obj *elObj;
|
||||
TclNewIntObj(elObj, TclIndexDecode(sortInfo.indexv[j], listc));
|
||||
Tcl_ListObjAppendElement(interp, itemPtr, elObj);
|
||||
Tcl_ListObjAppendElement(interp, itemPtr, Tcl_NewWideIntObj(
|
||||
TclIndexDecode(sortInfo.indexv[j], listc)));
|
||||
}
|
||||
Tcl_ListObjAppendElement(interp, listPtr, itemPtr);
|
||||
} else {
|
||||
@@ -3827,17 +3824,14 @@ Tcl_LsearchObjCmd(
|
||||
if (returnSubindices) {
|
||||
int j;
|
||||
|
||||
TclNewIntObj(itemPtr, index+groupOffset);
|
||||
itemPtr = Tcl_NewWideIntObj(index+groupOffset);
|
||||
for (j=0 ; j<sortInfo.indexc ; j++) {
|
||||
Tcl_Obj *elObj;
|
||||
TclNewIntObj(elObj, TclIndexDecode(sortInfo.indexv[j], listc));
|
||||
Tcl_ListObjAppendElement(interp, itemPtr, elObj);
|
||||
Tcl_ListObjAppendElement(interp, itemPtr, Tcl_NewWideIntObj(
|
||||
TclIndexDecode(sortInfo.indexv[j], listc)));
|
||||
}
|
||||
Tcl_SetObjResult(interp, itemPtr);
|
||||
} else {
|
||||
Tcl_Obj *elObj;
|
||||
TclNewIntObj(elObj, index);
|
||||
Tcl_SetObjResult(interp, elObj);
|
||||
Tcl_SetObjResult(interp, Tcl_NewWideIntObj(index));
|
||||
}
|
||||
} else if (index < 0) {
|
||||
/*
|
||||
@@ -4420,7 +4414,7 @@ Tcl_LsortObjCmd(
|
||||
idx = elementPtr->payload.index;
|
||||
for (j = 0; j < groupSize; j++) {
|
||||
if (indices) {
|
||||
TclNewIntObj(objPtr, idx + j - groupOffset);
|
||||
objPtr = Tcl_NewWideIntObj(idx + j - groupOffset);
|
||||
newArray[i++] = objPtr;
|
||||
Tcl_IncrRefCount(objPtr);
|
||||
} else {
|
||||
@@ -4432,7 +4426,7 @@ Tcl_LsortObjCmd(
|
||||
}
|
||||
} else if (indices) {
|
||||
for (i=0; elementPtr != NULL ; elementPtr = elementPtr->nextPtr) {
|
||||
TclNewIntObj(objPtr, elementPtr->payload.index);
|
||||
objPtr = Tcl_NewWideIntObj(elementPtr->payload.index);
|
||||
newArray[i++] = objPtr;
|
||||
Tcl_IncrRefCount(objPtr);
|
||||
}
|
||||
@@ -4703,7 +4697,7 @@ static int
|
||||
DictionaryCompare(
|
||||
const char *left, const char *right) /* The strings to compare. */
|
||||
{
|
||||
int uniLeft = 0, uniRight = 0, uniLeftLower, uniRightLower;
|
||||
Tcl_UniChar uniLeft = 0, uniRight = 0, uniLeftLower, uniRightLower;
|
||||
int diff, zeros;
|
||||
int secondaryDiff = 0;
|
||||
|
||||
@@ -4772,8 +4766,8 @@ DictionaryCompare(
|
||||
*/
|
||||
|
||||
if ((*left != '\0') && (*right != '\0')) {
|
||||
left += TclUtfToUCS4(left, &uniLeft);
|
||||
right += TclUtfToUCS4(right, &uniRight);
|
||||
left += TclUtfToUniChar(left, &uniLeft);
|
||||
right += TclUtfToUniChar(right, &uniRight);
|
||||
|
||||
/*
|
||||
* Convert both chars to lower for the comparison, because
|
||||
|
||||
+80
-74
@@ -137,7 +137,7 @@ Tcl_RegexpObjCmd(
|
||||
"-expanded", "-line", "-linestop", "-lineanchor",
|
||||
"-nocase", "-start", "--", NULL
|
||||
};
|
||||
enum regexpoptions {
|
||||
enum options {
|
||||
REGEXP_ALL, REGEXP_ABOUT, REGEXP_INDICES, REGEXP_INLINE,
|
||||
REGEXP_EXPANDED,REGEXP_LINE, REGEXP_LINESTOP,REGEXP_LINEANCHOR,
|
||||
REGEXP_NOCASE, REGEXP_START, REGEXP_LAST
|
||||
@@ -162,7 +162,7 @@ Tcl_RegexpObjCmd(
|
||||
&index) != TCL_OK) {
|
||||
goto optionError;
|
||||
}
|
||||
switch ((enum regexpoptions) index) {
|
||||
switch ((enum options) index) {
|
||||
case REGEXP_ALL:
|
||||
all = 1;
|
||||
break;
|
||||
@@ -195,7 +195,7 @@ Tcl_RegexpObjCmd(
|
||||
if (++i >= objc) {
|
||||
goto endOfForLoop;
|
||||
}
|
||||
if (TclGetIntForIndexM(interp, objv[i], INT_MAX - 1, &temp) != TCL_OK) {
|
||||
if (TclGetIntForIndexM(interp, objv[i], 0, &temp) != TCL_OK) {
|
||||
goto optionError;
|
||||
}
|
||||
if (startIndex) {
|
||||
@@ -357,7 +357,7 @@ Tcl_RegexpObjCmd(
|
||||
|
||||
objc = info.nsubs + 1;
|
||||
if (all <= 1) {
|
||||
TclNewObj(resultPtr);
|
||||
resultPtr = Tcl_NewObj();
|
||||
}
|
||||
}
|
||||
for (i = 0; i < objc; i++) {
|
||||
@@ -389,8 +389,8 @@ Tcl_RegexpObjCmd(
|
||||
end = -1;
|
||||
}
|
||||
|
||||
TclNewIntObj(objs[0], start);
|
||||
TclNewIntObj(objs[1], end);
|
||||
objs[0] = Tcl_NewWideIntObj(start);
|
||||
objs[1] = Tcl_NewWideIntObj(end);
|
||||
|
||||
newPtr = Tcl_NewListObj(2, objs);
|
||||
} else {
|
||||
@@ -399,7 +399,7 @@ Tcl_RegexpObjCmd(
|
||||
offset + info.matches[i].start,
|
||||
offset + info.matches[i].end - 1);
|
||||
} else {
|
||||
TclNewObj(newPtr);
|
||||
newPtr = Tcl_NewObj();
|
||||
}
|
||||
}
|
||||
if (doinline) {
|
||||
@@ -499,7 +499,7 @@ Tcl_RegsubObjCmd(
|
||||
"-linestop", "-lineanchor", "-nocase", "-start",
|
||||
"--", NULL
|
||||
};
|
||||
enum regsubobjoptions {
|
||||
enum options {
|
||||
REGSUB_ALL, REGSUB_COMMAND, REGSUB_EXPANDED, REGSUB_LINE,
|
||||
REGSUB_LINESTOP, REGSUB_LINEANCHOR, REGSUB_NOCASE, REGSUB_START,
|
||||
REGSUB_LAST
|
||||
@@ -523,7 +523,7 @@ Tcl_RegsubObjCmd(
|
||||
TCL_EXACT, &index) != TCL_OK) {
|
||||
goto optionError;
|
||||
}
|
||||
switch ((enum regsubobjoptions) index) {
|
||||
switch ((enum options) index) {
|
||||
case REGSUB_ALL:
|
||||
all = 1;
|
||||
break;
|
||||
@@ -550,7 +550,7 @@ Tcl_RegsubObjCmd(
|
||||
if (++idx >= objc) {
|
||||
goto endOfForLoop;
|
||||
}
|
||||
if (TclGetIntForIndexM(interp, objv[idx], INT_MAX - 1, &temp) != TCL_OK) {
|
||||
if (TclGetIntForIndexM(interp, objv[idx], 0, &temp) != TCL_OK) {
|
||||
goto optionError;
|
||||
}
|
||||
if (startIndex) {
|
||||
@@ -788,7 +788,7 @@ Tcl_RegsubObjCmd(
|
||||
args[idx + numParts] = Tcl_NewUnicodeObj(
|
||||
wstring + offset + subStart, subEnd - subStart);
|
||||
} else {
|
||||
TclNewObj(args[idx + numParts]);
|
||||
args[idx + numParts] = Tcl_NewObj();
|
||||
}
|
||||
Tcl_IncrRefCount(args[idx + numParts]);
|
||||
}
|
||||
@@ -1174,7 +1174,7 @@ Tcl_SplitObjCmd(
|
||||
int objc, /* Number of arguments. */
|
||||
Tcl_Obj *const objv[]) /* Argument objects. */
|
||||
{
|
||||
int ch = 0;
|
||||
Tcl_UniChar ch = 0;
|
||||
int len;
|
||||
const char *splitChars;
|
||||
const char *stringPtr;
|
||||
@@ -1194,7 +1194,7 @@ Tcl_SplitObjCmd(
|
||||
|
||||
stringPtr = TclGetStringFromObj(objv[1], &stringLen);
|
||||
end = stringPtr + stringLen;
|
||||
TclNewObj(listPtr);
|
||||
listPtr = Tcl_NewObj();
|
||||
|
||||
if (stringLen == 0) {
|
||||
/*
|
||||
@@ -1217,8 +1217,23 @@ Tcl_SplitObjCmd(
|
||||
Tcl_InitHashTable(&charReuseTable, TCL_ONE_WORD_KEYS);
|
||||
|
||||
for ( ; stringPtr < end; stringPtr += len) {
|
||||
len = TclUtfToUCS4(stringPtr, &ch);
|
||||
hPtr = Tcl_CreateHashEntry(&charReuseTable, INT2PTR(ch), &isNew);
|
||||
int fullchar;
|
||||
len = TclUtfToUniChar(stringPtr, &ch);
|
||||
fullchar = ch;
|
||||
|
||||
#if TCL_UTF_MAX <= 3
|
||||
if ((ch >= 0xD800) && (len < 3)) {
|
||||
len += TclUtfToUniChar(stringPtr + len, &ch);
|
||||
fullchar = (((fullchar & 0x3FF) << 10) | (ch & 0x3FF)) + 0x10000;
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Assume Tcl_UniChar is an integral type...
|
||||
*/
|
||||
|
||||
hPtr = Tcl_CreateHashEntry(&charReuseTable, INT2PTR(fullchar),
|
||||
&isNew);
|
||||
if (isNew) {
|
||||
TclNewStringObj(objPtr, stringPtr, len);
|
||||
|
||||
@@ -1253,7 +1268,7 @@ Tcl_SplitObjCmd(
|
||||
} else {
|
||||
const char *element, *p, *splitEnd;
|
||||
int splitLen;
|
||||
int splitChar;
|
||||
Tcl_UniChar splitChar = 0;
|
||||
|
||||
/*
|
||||
* Normal case: split on any of a given set of characters. Discard
|
||||
@@ -1263,9 +1278,9 @@ Tcl_SplitObjCmd(
|
||||
splitEnd = splitChars + splitCharLen;
|
||||
|
||||
for (element = stringPtr; stringPtr < end; stringPtr += len) {
|
||||
len = TclUtfToUCS4(stringPtr, &ch);
|
||||
len = TclUtfToUniChar(stringPtr, &ch);
|
||||
for (p = splitChars; p < splitEnd; p += splitLen) {
|
||||
splitLen = TclUtfToUCS4(p, &splitChar);
|
||||
splitLen = TclUtfToUniChar(p, &splitChar);
|
||||
if (ch == splitChar) {
|
||||
TclNewStringObj(objPtr, element, stringPtr - element);
|
||||
Tcl_ListObjAppendElement(NULL, listPtr, objPtr);
|
||||
@@ -1424,7 +1439,7 @@ StringIndexCmd(
|
||||
*/
|
||||
|
||||
if (TclIsPureByteArray(objv[1])) {
|
||||
unsigned char uch = UCHAR(ch);
|
||||
unsigned char uch = (unsigned char) ch;
|
||||
|
||||
Tcl_SetObjResult(interp, Tcl_NewByteArrayObj(&uch, 1));
|
||||
} else {
|
||||
@@ -1523,6 +1538,7 @@ StringIsCmd(
|
||||
Tcl_Obj *const objv[]) /* Argument objects. */
|
||||
{
|
||||
const char *string1, *end, *stop;
|
||||
Tcl_UniChar ch = 0;
|
||||
int (*chcomp)(int) = NULL; /* The UniChar comparison function. */
|
||||
int i, failat = 0, result = 1, strict = 0, index, length1, length2;
|
||||
Tcl_Obj *objPtr, *failVarObj = NULL;
|
||||
@@ -1536,7 +1552,7 @@ StringIsCmd(
|
||||
"space", "true", "upper", "wideinteger",
|
||||
"wordchar", "xdigit", NULL
|
||||
};
|
||||
enum isClassesEnum {
|
||||
enum isClasses {
|
||||
STR_IS_ALNUM, STR_IS_ALPHA, STR_IS_ASCII, STR_IS_CONTROL,
|
||||
STR_IS_BOOL, STR_IS_DICT, STR_IS_DIGIT, STR_IS_DOUBLE,
|
||||
STR_IS_ENTIER, STR_IS_FALSE, STR_IS_GRAPH, STR_IS_INT,
|
||||
@@ -1547,7 +1563,7 @@ StringIsCmd(
|
||||
static const char *const isOptions[] = {
|
||||
"-strict", "-failindex", NULL
|
||||
};
|
||||
enum isOptionsEnum {
|
||||
enum isOptions {
|
||||
OPT_STRICT, OPT_FAILIDX
|
||||
};
|
||||
|
||||
@@ -1569,7 +1585,7 @@ StringIsCmd(
|
||||
&idx2) != TCL_OK) {
|
||||
return TCL_ERROR;
|
||||
}
|
||||
switch ((enum isOptionsEnum) idx2) {
|
||||
switch ((enum isOptions) idx2) {
|
||||
case OPT_STRICT:
|
||||
strict = 1;
|
||||
break;
|
||||
@@ -1598,7 +1614,7 @@ StringIsCmd(
|
||||
* When entering here, result == 1 and failat == 0.
|
||||
*/
|
||||
|
||||
switch ((enum isClassesEnum) index) {
|
||||
switch ((enum isClasses) index) {
|
||||
case STR_IS_ALNUM:
|
||||
chcomp = Tcl_UniCharIsAlnum;
|
||||
break;
|
||||
@@ -1845,7 +1861,7 @@ StringIsCmd(
|
||||
* if it is the first "element" that has the failure.
|
||||
*/
|
||||
|
||||
while (TclIsSpaceProcM(*p)) {
|
||||
while (TclIsSpaceProc(*p)) {
|
||||
p++;
|
||||
}
|
||||
TclNewStringObj(tmpStr, string1, p-string1);
|
||||
@@ -1890,10 +1906,16 @@ StringIsCmd(
|
||||
}
|
||||
end = string1 + length1;
|
||||
for (; string1 < end; string1 += length2, failat++) {
|
||||
int ucs4;
|
||||
|
||||
length2 = TclUtfToUCS4(string1, &ucs4);
|
||||
if (!chcomp(ucs4)) {
|
||||
int fullchar;
|
||||
length2 = TclUtfToUniChar(string1, &ch);
|
||||
fullchar = ch;
|
||||
#if TCL_UTF_MAX <= 3
|
||||
if ((ch >= 0xD800) && (length2 < 3)) {
|
||||
length2 += TclUtfToUniChar(string1 + length2, &ch);
|
||||
fullchar = (((fullchar & 0x3FF) << 10) | (ch & 0x3FF)) + 0x10000;
|
||||
}
|
||||
#endif
|
||||
if (!chcomp(fullchar)) {
|
||||
result = 0;
|
||||
break;
|
||||
}
|
||||
@@ -1906,11 +1928,10 @@ StringIsCmd(
|
||||
*/
|
||||
|
||||
str_is_done:
|
||||
if ((result == 0) && (failVarObj != NULL)) {
|
||||
TclNewIntObj(objPtr, failat);
|
||||
if (Tcl_ObjSetVar2(interp, failVarObj, NULL, objPtr, TCL_LEAVE_ERR_MSG) == NULL) {
|
||||
return TCL_ERROR;
|
||||
}
|
||||
if ((result == 0) && (failVarObj != NULL) &&
|
||||
Tcl_ObjSetVar2(interp, failVarObj, NULL, Tcl_NewWideIntObj(failat),
|
||||
TCL_LEAVE_ERR_MSG) == NULL) {
|
||||
return TCL_ERROR;
|
||||
}
|
||||
Tcl_SetObjResult(interp, Tcl_NewBooleanObj(result));
|
||||
return TCL_OK;
|
||||
@@ -2481,7 +2502,9 @@ StringRevCmd(
|
||||
* StringStartCmd --
|
||||
*
|
||||
* This procedure is invoked to process the "string wordstart" Tcl
|
||||
* command. See the user documentation for details on what it does.
|
||||
* command. See the user documentation for details on what it does. Note
|
||||
* that this command only functions correctly on properly formed Tcl UTF
|
||||
* strings.
|
||||
*
|
||||
* Results:
|
||||
* A standard Tcl result.
|
||||
@@ -2499,10 +2522,9 @@ StringStartCmd(
|
||||
int objc, /* Number of arguments. */
|
||||
Tcl_Obj *const objv[]) /* Argument objects. */
|
||||
{
|
||||
int ch;
|
||||
Tcl_UniChar ch = 0;
|
||||
const char *p, *string;
|
||||
int cur, index, length, numChars;
|
||||
Tcl_Obj *obj;
|
||||
|
||||
if (objc != 3) {
|
||||
Tcl_WrongNumArgs(interp, 1, objv, "string index");
|
||||
@@ -2521,29 +2543,18 @@ StringStartCmd(
|
||||
cur = 0;
|
||||
if (index > 0) {
|
||||
p = Tcl_UtfAtIndex(string, index);
|
||||
|
||||
TclUtfToUCS4(p, &ch);
|
||||
for (cur = index; cur >= 0; cur--) {
|
||||
int delta = 0;
|
||||
const char *next;
|
||||
|
||||
TclUtfToUniChar(p, &ch);
|
||||
if (!Tcl_UniCharIsWordChar(ch)) {
|
||||
break;
|
||||
}
|
||||
|
||||
next = TclUtfPrev(p, string);
|
||||
do {
|
||||
next += delta;
|
||||
delta = TclUtfToUCS4(next, &ch);
|
||||
} while (next + delta < p);
|
||||
p = next;
|
||||
p = Tcl_UtfPrev(p, string);
|
||||
}
|
||||
if (cur != index) {
|
||||
cur += 1;
|
||||
}
|
||||
}
|
||||
TclNewIntObj(obj, cur);
|
||||
Tcl_SetObjResult(interp, obj);
|
||||
Tcl_SetObjResult(interp, Tcl_NewWideIntObj(cur));
|
||||
return TCL_OK;
|
||||
}
|
||||
|
||||
@@ -2553,7 +2564,8 @@ StringStartCmd(
|
||||
* StringEndCmd --
|
||||
*
|
||||
* This procedure is invoked to process the "string wordend" Tcl command.
|
||||
* See the user documentation for details on what it does.
|
||||
* See the user documentation for details on what it does. Note that this
|
||||
* command only functions correctly on properly formed Tcl UTF strings.
|
||||
*
|
||||
* Results:
|
||||
* A standard Tcl result.
|
||||
@@ -2571,10 +2583,9 @@ StringEndCmd(
|
||||
int objc, /* Number of arguments. */
|
||||
Tcl_Obj *const objv[]) /* Argument objects. */
|
||||
{
|
||||
int ch;
|
||||
Tcl_UniChar ch = 0;
|
||||
const char *p, *end, *string;
|
||||
int cur, index, length, numChars;
|
||||
Tcl_Obj *obj;
|
||||
|
||||
if (objc != 3) {
|
||||
Tcl_WrongNumArgs(interp, 1, objv, "string index");
|
||||
@@ -2594,7 +2605,7 @@ StringEndCmd(
|
||||
p = Tcl_UtfAtIndex(string, index);
|
||||
end = string+length;
|
||||
for (cur = index; p < end; cur++) {
|
||||
p += TclUtfToUCS4(p, &ch);
|
||||
p += TclUtfToUniChar(p, &ch);
|
||||
if (!Tcl_UniCharIsWordChar(ch)) {
|
||||
break;
|
||||
}
|
||||
@@ -2605,8 +2616,7 @@ StringEndCmd(
|
||||
} else {
|
||||
cur = numChars;
|
||||
}
|
||||
TclNewIntObj(obj, cur);
|
||||
Tcl_SetObjResult(interp, obj);
|
||||
Tcl_SetObjResult(interp, Tcl_NewWideIntObj(cur));
|
||||
return TCL_OK;
|
||||
}
|
||||
|
||||
@@ -3484,7 +3494,7 @@ TclNRSwitchObjCmd(
|
||||
"-exact", "-glob", "-indexvar", "-matchvar", "-nocase", "-regexp",
|
||||
"--", NULL
|
||||
};
|
||||
enum switchOptionsEnum {
|
||||
enum options {
|
||||
OPT_EXACT, OPT_GLOB, OPT_INDEXV, OPT_MATCHV, OPT_NOCASE, OPT_REGEXP,
|
||||
OPT_LAST
|
||||
};
|
||||
@@ -3505,7 +3515,7 @@ TclNRSwitchObjCmd(
|
||||
&index) != TCL_OK) {
|
||||
return TCL_ERROR;
|
||||
}
|
||||
switch ((enum switchOptionsEnum) index) {
|
||||
switch ((enum options) index) {
|
||||
/*
|
||||
* General options.
|
||||
*/
|
||||
@@ -3775,11 +3785,10 @@ TclNRSwitchObjCmd(
|
||||
Tcl_Obj *rangeObjAry[2];
|
||||
|
||||
if (info.matches[j].end > 0) {
|
||||
TclNewIntObj(rangeObjAry[0], info.matches[j].start);
|
||||
TclNewIntObj(rangeObjAry[1], info.matches[j].end-1);
|
||||
rangeObjAry[0] = Tcl_NewWideIntObj(info.matches[j].start);
|
||||
rangeObjAry[1] = Tcl_NewWideIntObj(info.matches[j].end-1);
|
||||
} else {
|
||||
TclNewIntObj(rangeObjAry[1], TCL_INDEX_NONE);
|
||||
rangeObjAry[0] = rangeObjAry[1];
|
||||
rangeObjAry[0] = rangeObjAry[1] = Tcl_NewWideIntObj(-1);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -4171,7 +4180,7 @@ Tcl_TimeRateObjCmd(
|
||||
static const char *const options[] = {
|
||||
"-direct", "-overhead", "-calibrate", "--", NULL
|
||||
};
|
||||
enum timeRateOptionsEnum {
|
||||
enum options {
|
||||
TMRT_EV_DIRECT, TMRT_OVERHEAD, TMRT_CALIBRATE, TMRT_LAST
|
||||
};
|
||||
NRE_callback *rootPtr;
|
||||
@@ -4188,7 +4197,7 @@ Tcl_TimeRateObjCmd(
|
||||
i++;
|
||||
break;
|
||||
}
|
||||
switch ((enum timeRateOptionsEnum)index) {
|
||||
switch (index) {
|
||||
case TMRT_EV_DIRECT:
|
||||
direct = objv[i];
|
||||
break;
|
||||
@@ -4203,8 +4212,6 @@ Tcl_TimeRateObjCmd(
|
||||
case TMRT_CALIBRATE:
|
||||
calibrate = objv[i];
|
||||
break;
|
||||
case TMRT_LAST:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4319,7 +4326,7 @@ Tcl_TimeRateObjCmd(
|
||||
*/
|
||||
|
||||
measureOverhead = 0;
|
||||
Tcl_SetObjResult(interp, Tcl_NewWideIntObj(0));
|
||||
Tcl_SetObjResult(interp, Tcl_NewLongObj(0));
|
||||
return TCL_OK;
|
||||
}
|
||||
|
||||
@@ -4550,8 +4557,7 @@ Tcl_TimeRateObjCmd(
|
||||
#endif /* TCL_WIDE_CLICKS */
|
||||
|
||||
if (!count) { /* no iterations - avoid divide by zero */
|
||||
TclNewIntObj(objs[4], 0);
|
||||
objs[0] = objs[2] = objs[4];
|
||||
objs[0] = objs[2] = objs[4] = Tcl_NewWideIntObj(0);
|
||||
goto retRes;
|
||||
}
|
||||
|
||||
@@ -4592,7 +4598,7 @@ Tcl_TimeRateObjCmd(
|
||||
|
||||
val = usec / count; /* microsecs per iteration */
|
||||
if (val >= 1000000) {
|
||||
TclNewIntObj(objs[0], val);
|
||||
objs[0] = Tcl_NewWideIntObj(val);
|
||||
} else {
|
||||
if (val < 10) {
|
||||
digits = 6;
|
||||
@@ -4608,7 +4614,7 @@ Tcl_TimeRateObjCmd(
|
||||
objs[0] = Tcl_ObjPrintf("%.*f", digits, ((double) usec)/count);
|
||||
}
|
||||
|
||||
TclNewIntObj(objs[2], count); /* iterations */
|
||||
objs[2] = Tcl_NewWideIntObj(count); /* iterations */
|
||||
|
||||
/*
|
||||
* Calculate speed as rate (count) per sec
|
||||
@@ -4630,7 +4636,7 @@ Tcl_TimeRateObjCmd(
|
||||
objs[4] = Tcl_ObjPrintf("%.*f",
|
||||
digits, ((double) (count * 1000000)) / usec);
|
||||
} else {
|
||||
TclNewIntObj(objs[4], val);
|
||||
objs[4] = Tcl_NewWideIntObj(val);
|
||||
}
|
||||
} else {
|
||||
objs[4] = Tcl_NewWideIntObj((count / usec) * 1000000);
|
||||
@@ -4645,7 +4651,7 @@ Tcl_TimeRateObjCmd(
|
||||
if (usec >= 1) {
|
||||
objs[6] = Tcl_ObjPrintf("%.3f", (double)usec / 1000);
|
||||
} else {
|
||||
TclNewIntObj(objs[6], 0);
|
||||
objs[6] = Tcl_NewWideIntObj(0);
|
||||
}
|
||||
TclNewLiteralStringObj(objs[7], "net-ms");
|
||||
}
|
||||
@@ -4723,7 +4729,7 @@ TclNRTryObjCmd(
|
||||
return TCL_ERROR;
|
||||
}
|
||||
bodyObj = objv[1];
|
||||
TclNewObj(handlersObj);
|
||||
handlersObj = Tcl_NewObj();
|
||||
bodyShared = 0;
|
||||
haveHandlers = 0;
|
||||
for (i=2 ; i<objc ; i++) {
|
||||
|
||||
+51
-51
@@ -126,9 +126,9 @@ TclCompileAppendCmd(
|
||||
* compiled. */
|
||||
CompileEnv *envPtr) /* Holds resulting instructions. */
|
||||
{
|
||||
DefineLineInformation; /* TIP #280 */
|
||||
Tcl_Token *varTokenPtr, *valueTokenPtr;
|
||||
int isScalar, localIndex, numWords, i;
|
||||
DefineLineInformation; /* TIP #280 */
|
||||
|
||||
/* TODO: Consider support for compiling expanded args. */
|
||||
numWords = parsePtr->numWords;
|
||||
@@ -298,7 +298,7 @@ TclCompileArraySetCmd(
|
||||
|
||||
varTokenPtr = TokenAfter(parsePtr->tokenPtr);
|
||||
dataTokenPtr = TokenAfter(varTokenPtr);
|
||||
TclNewObj(literalObj);
|
||||
literalObj = Tcl_NewObj();
|
||||
isDataLiteral = TclWordKnownAtCompileTime(dataTokenPtr, literalObj);
|
||||
isDataValid = (isDataLiteral
|
||||
&& Tcl_ListObjLength(NULL, literalObj, &len) == TCL_OK);
|
||||
@@ -390,9 +390,9 @@ TclCompileArraySetCmd(
|
||||
keyVar = AnonymousLocal(envPtr);
|
||||
valVar = AnonymousLocal(envPtr);
|
||||
|
||||
infoPtr = (ForeachInfo *)ckalloc(offsetof(ForeachInfo, varLists) + sizeof(ForeachVarList *));
|
||||
infoPtr = (ForeachInfo *)ckalloc(sizeof(ForeachInfo));
|
||||
infoPtr->numLists = 1;
|
||||
infoPtr->varLists[0] = (ForeachVarList *)ckalloc(offsetof(ForeachVarList, varIndexes) + 2 * sizeof(int));
|
||||
infoPtr->varLists[0] = (ForeachVarList *)ckalloc(sizeof(ForeachVarList) + sizeof(int));
|
||||
infoPtr->varLists[0]->numVars = 2;
|
||||
infoPtr->varLists[0]->varIndexes[0] = keyVar;
|
||||
infoPtr->varLists[0]->varIndexes[1] = valVar;
|
||||
@@ -572,10 +572,10 @@ TclCompileCatchCmd(
|
||||
TCL_UNUSED(Command *),
|
||||
CompileEnv *envPtr) /* Holds resulting instructions. */
|
||||
{
|
||||
DefineLineInformation; /* TIP #280 */
|
||||
JumpFixup jumpFixup;
|
||||
Tcl_Token *cmdTokenPtr, *resultNameTokenPtr, *optsNameTokenPtr;
|
||||
int resultIndex, optsIndex, range, dropScript = 0;
|
||||
DefineLineInformation; /* TIP #280 */
|
||||
int depth = TclGetStackDepth(envPtr);
|
||||
|
||||
/*
|
||||
@@ -875,10 +875,10 @@ TclCompileConcatCmd(
|
||||
* implement with a simple push.
|
||||
*/
|
||||
|
||||
TclNewObj(listObj);
|
||||
listObj = Tcl_NewObj();
|
||||
for (i = 1, tokenPtr = parsePtr->tokenPtr; i < parsePtr->numWords; i++) {
|
||||
tokenPtr = TokenAfter(tokenPtr);
|
||||
TclNewObj(objPtr);
|
||||
objPtr = Tcl_NewObj();
|
||||
if (!TclWordKnownAtCompileTime(tokenPtr, objPtr)) {
|
||||
Tcl_DecrRefCount(objPtr);
|
||||
Tcl_DecrRefCount(listObj);
|
||||
@@ -1003,9 +1003,9 @@ TclCompileDictSetCmd(
|
||||
TCL_UNUSED(Command *),
|
||||
CompileEnv *envPtr) /* Holds resulting instructions. */
|
||||
{
|
||||
DefineLineInformation; /* TIP #280 */
|
||||
Tcl_Token *tokenPtr;
|
||||
int i, dictVarIndex;
|
||||
DefineLineInformation; /* TIP #280 */
|
||||
Tcl_Token *varTokenPtr;
|
||||
|
||||
/*
|
||||
@@ -1128,9 +1128,9 @@ TclCompileDictGetCmd(
|
||||
TCL_UNUSED(Command *),
|
||||
CompileEnv *envPtr) /* Holds resulting instructions. */
|
||||
{
|
||||
DefineLineInformation; /* TIP #280 */
|
||||
Tcl_Token *tokenPtr;
|
||||
int i;
|
||||
DefineLineInformation; /* TIP #280 */
|
||||
|
||||
/*
|
||||
* There must be at least two arguments after the command (the single-arg
|
||||
@@ -1164,9 +1164,9 @@ TclCompileDictGetWithDefaultCmd(
|
||||
TCL_UNUSED(Command *),
|
||||
CompileEnv *envPtr) /* Holds resulting instructions. */
|
||||
{
|
||||
DefineLineInformation; /* TIP #280 */
|
||||
Tcl_Token *tokenPtr;
|
||||
int i;
|
||||
DefineLineInformation; /* TIP #280 */
|
||||
|
||||
/*
|
||||
* There must be at least three arguments after the command.
|
||||
@@ -1195,9 +1195,9 @@ TclCompileDictExistsCmd(
|
||||
TCL_UNUSED(Command *),
|
||||
CompileEnv *envPtr) /* Holds resulting instructions. */
|
||||
{
|
||||
DefineLineInformation; /* TIP #280 */
|
||||
Tcl_Token *tokenPtr;
|
||||
int i;
|
||||
DefineLineInformation; /* TIP #280 */
|
||||
|
||||
/*
|
||||
* There must be at least two arguments after the command (the single-arg
|
||||
@@ -1232,8 +1232,8 @@ TclCompileDictUnsetCmd(
|
||||
* compiled. */
|
||||
CompileEnv *envPtr) /* Holds resulting instructions. */
|
||||
{
|
||||
DefineLineInformation; /* TIP #280 */
|
||||
Tcl_Token *tokenPtr;
|
||||
DefineLineInformation; /* TIP #280 */
|
||||
int i, dictVarIndex;
|
||||
|
||||
/*
|
||||
@@ -1301,10 +1301,10 @@ TclCompileDictCreateCmd(
|
||||
*/
|
||||
|
||||
tokenPtr = TokenAfter(parsePtr->tokenPtr);
|
||||
TclNewObj(dictObj);
|
||||
dictObj = Tcl_NewObj();
|
||||
Tcl_IncrRefCount(dictObj);
|
||||
for (i=1 ; i<parsePtr->numWords ; i+=2) {
|
||||
TclNewObj(keyObj);
|
||||
keyObj = Tcl_NewObj();
|
||||
Tcl_IncrRefCount(keyObj);
|
||||
if (!TclWordKnownAtCompileTime(tokenPtr, keyObj)) {
|
||||
Tcl_DecrRefCount(keyObj);
|
||||
@@ -1312,7 +1312,7 @@ TclCompileDictCreateCmd(
|
||||
goto nonConstant;
|
||||
}
|
||||
tokenPtr = TokenAfter(tokenPtr);
|
||||
TclNewObj(valueObj);
|
||||
valueObj = Tcl_NewObj();
|
||||
Tcl_IncrRefCount(valueObj);
|
||||
if (!TclWordKnownAtCompileTime(tokenPtr, valueObj)) {
|
||||
Tcl_DecrRefCount(keyObj);
|
||||
@@ -1789,7 +1789,7 @@ TclCompileDictUpdateCmd(
|
||||
* that are to be used.
|
||||
*/
|
||||
|
||||
duiPtr = (DictUpdateInfo *)ckalloc(offsetof(DictUpdateInfo, varIndices) + sizeof(int) * numVars);
|
||||
duiPtr = (DictUpdateInfo *)ckalloc(sizeof(DictUpdateInfo) + sizeof(int) * (numVars - 1));
|
||||
duiPtr->length = numVars;
|
||||
keyTokenPtrs = (Tcl_Token **)TclStackAlloc(interp, sizeof(Tcl_Token *) * numVars);
|
||||
tokenPtr = TokenAfter(dictVarTokenPtr);
|
||||
@@ -2271,7 +2271,7 @@ DupDictUpdateInfo(
|
||||
size_t len;
|
||||
|
||||
dui1Ptr = (DictUpdateInfo *)clientData;
|
||||
len = offsetof(DictUpdateInfo, varIndices) + sizeof(int) * dui1Ptr->length;
|
||||
len = sizeof(DictUpdateInfo) + sizeof(int) * (dui1Ptr->length - 1);
|
||||
dui2Ptr = (DictUpdateInfo *)ckalloc(len);
|
||||
memcpy(dui2Ptr, dui1Ptr, len);
|
||||
return dui2Ptr;
|
||||
@@ -2311,12 +2311,11 @@ DisassembleDictUpdateInfo(
|
||||
{
|
||||
DictUpdateInfo *duiPtr = (DictUpdateInfo *)clientData;
|
||||
int i;
|
||||
Tcl_Obj *variables;
|
||||
Tcl_Obj *variables = Tcl_NewObj();
|
||||
|
||||
TclNewObj(variables);
|
||||
for (i=0 ; i<duiPtr->length ; i++) {
|
||||
Tcl_ListObjAppendElement(NULL, variables,
|
||||
Tcl_NewWideIntObj(duiPtr->varIndices[i]));
|
||||
Tcl_NewIntObj(duiPtr->varIndices[i]));
|
||||
}
|
||||
Tcl_DictObjPut(NULL, dictObj, Tcl_NewStringObj("variables", -1),
|
||||
variables);
|
||||
@@ -2348,13 +2347,13 @@ TclCompileErrorCmd(
|
||||
TCL_UNUSED(Command *),
|
||||
CompileEnv *envPtr) /* Holds resulting instructions. */
|
||||
{
|
||||
DefineLineInformation; /* TIP #280 */
|
||||
Tcl_Token *tokenPtr;
|
||||
|
||||
/*
|
||||
* General syntax: [error message ?errorInfo? ?errorCode?]
|
||||
*/
|
||||
|
||||
Tcl_Token *tokenPtr;
|
||||
DefineLineInformation; /* TIP #280 */
|
||||
|
||||
if (parsePtr->numWords < 2 || parsePtr->numWords > 4) {
|
||||
return TCL_ERROR;
|
||||
}
|
||||
@@ -2465,11 +2464,11 @@ TclCompileForCmd(
|
||||
TCL_UNUSED(Command *),
|
||||
CompileEnv *envPtr) /* Holds resulting instructions. */
|
||||
{
|
||||
DefineLineInformation; /* TIP #280 */
|
||||
Tcl_Token *startTokenPtr, *testTokenPtr, *nextTokenPtr, *bodyTokenPtr;
|
||||
JumpFixup jumpEvalCondFixup;
|
||||
int bodyCodeOffset, nextCodeOffset, jumpDist;
|
||||
int bodyRange, nextRange;
|
||||
DefineLineInformation; /* TIP #280 */
|
||||
|
||||
if (parsePtr->numWords != 5) {
|
||||
return TCL_ERROR;
|
||||
@@ -2677,7 +2676,6 @@ CompileEachloopCmd(
|
||||
int collect) /* Select collecting or accumulating mode
|
||||
* (TCL_EACH_*) */
|
||||
{
|
||||
DefineLineInformation; /* TIP #280 */
|
||||
Proc *procPtr = envPtr->procPtr;
|
||||
ForeachInfo *infoPtr=NULL; /* Points to the structure describing this
|
||||
* foreach command. Stored in a AuxData
|
||||
@@ -2687,6 +2685,7 @@ CompileEachloopCmd(
|
||||
int jumpBackOffset, infoIndex, range;
|
||||
int numWords, numLists, i, j, code = TCL_OK;
|
||||
Tcl_Obj *varListObj = NULL;
|
||||
DefineLineInformation; /* TIP #280 */
|
||||
|
||||
/*
|
||||
* If the foreach command isn't in a procedure, don't compile it inline:
|
||||
@@ -2722,8 +2721,8 @@ CompileEachloopCmd(
|
||||
*/
|
||||
|
||||
numLists = (numWords - 2)/2;
|
||||
infoPtr = (ForeachInfo *)ckalloc(offsetof(ForeachInfo, varLists)
|
||||
+ numLists * sizeof(ForeachVarList *));
|
||||
infoPtr = (ForeachInfo *)ckalloc(sizeof(ForeachInfo)
|
||||
+ (numLists - 1) * sizeof(ForeachVarList *));
|
||||
infoPtr->numLists = 0; /* Count this up as we go */
|
||||
|
||||
/*
|
||||
@@ -2732,7 +2731,7 @@ CompileEachloopCmd(
|
||||
* a scalar, or if any var list needs substitutions.
|
||||
*/
|
||||
|
||||
TclNewObj(varListObj);
|
||||
varListObj = Tcl_NewObj();
|
||||
for (i = 0, tokenPtr = parsePtr->tokenPtr;
|
||||
i < numWords-1;
|
||||
i++, tokenPtr = TokenAfter(tokenPtr)) {
|
||||
@@ -2756,8 +2755,8 @@ CompileEachloopCmd(
|
||||
goto done;
|
||||
}
|
||||
|
||||
varListPtr = (ForeachVarList *)ckalloc(offsetof(ForeachVarList, varIndexes)
|
||||
+ numVars * sizeof(int));
|
||||
varListPtr = (ForeachVarList *)ckalloc(sizeof(ForeachVarList)
|
||||
+ (numVars - 1) * sizeof(int));
|
||||
varListPtr->numVars = numVars;
|
||||
infoPtr->varLists[i/2] = varListPtr;
|
||||
infoPtr->numLists++;
|
||||
@@ -2892,7 +2891,7 @@ DupForeachInfo(
|
||||
ForeachVarList *srcListPtr, *dupListPtr;
|
||||
int numVars, i, j, numLists = srcPtr->numLists;
|
||||
|
||||
dupPtr = (ForeachInfo *)ckalloc(offsetof(ForeachInfo, varLists)
|
||||
dupPtr = (ForeachInfo *)ckalloc(sizeof(ForeachInfo)
|
||||
+ numLists * sizeof(ForeachVarList *));
|
||||
dupPtr->numLists = numLists;
|
||||
dupPtr->firstValueTemp = srcPtr->firstValueTemp;
|
||||
@@ -2901,7 +2900,7 @@ DupForeachInfo(
|
||||
for (i = 0; i < numLists; i++) {
|
||||
srcListPtr = srcPtr->varLists[i];
|
||||
numVars = srcListPtr->numVars;
|
||||
dupListPtr = (ForeachVarList *)ckalloc(offsetof(ForeachVarList, varIndexes)
|
||||
dupListPtr = (ForeachVarList *)ckalloc(sizeof(ForeachVarList)
|
||||
+ numVars * sizeof(int));
|
||||
dupListPtr->numVars = numVars;
|
||||
for (j = 0; j < numVars; j++) {
|
||||
@@ -3051,10 +3050,10 @@ DisassembleForeachInfo(
|
||||
* Data stores.
|
||||
*/
|
||||
|
||||
TclNewObj(objPtr);
|
||||
objPtr = Tcl_NewObj();
|
||||
for (i=0 ; i<infoPtr->numLists ; i++) {
|
||||
Tcl_ListObjAppendElement(NULL, objPtr,
|
||||
Tcl_NewWideIntObj(infoPtr->firstValueTemp + i));
|
||||
Tcl_NewIntObj(infoPtr->firstValueTemp + i));
|
||||
}
|
||||
Tcl_DictObjPut(NULL, dictObj, Tcl_NewStringObj("data", -1), objPtr);
|
||||
|
||||
@@ -3063,19 +3062,19 @@ DisassembleForeachInfo(
|
||||
*/
|
||||
|
||||
Tcl_DictObjPut(NULL, dictObj, Tcl_NewStringObj("loop", -1),
|
||||
Tcl_NewWideIntObj(infoPtr->loopCtTemp));
|
||||
Tcl_NewIntObj(infoPtr->loopCtTemp));
|
||||
|
||||
/*
|
||||
* Assignment targets.
|
||||
*/
|
||||
|
||||
TclNewObj(objPtr);
|
||||
objPtr = Tcl_NewObj();
|
||||
for (i=0 ; i<infoPtr->numLists ; i++) {
|
||||
TclNewObj(innerPtr);
|
||||
innerPtr = Tcl_NewObj();
|
||||
varsPtr = infoPtr->varLists[i];
|
||||
for (j=0 ; j<varsPtr->numVars ; j++) {
|
||||
Tcl_ListObjAppendElement(NULL, innerPtr,
|
||||
Tcl_NewWideIntObj(varsPtr->varIndexes[j]));
|
||||
Tcl_NewIntObj(varsPtr->varIndexes[j]));
|
||||
}
|
||||
Tcl_ListObjAppendElement(NULL, objPtr, innerPtr);
|
||||
}
|
||||
@@ -3099,19 +3098,19 @@ DisassembleNewForeachInfo(
|
||||
*/
|
||||
|
||||
Tcl_DictObjPut(NULL, dictObj, Tcl_NewStringObj("jumpOffset", -1),
|
||||
Tcl_NewWideIntObj(infoPtr->loopCtTemp));
|
||||
Tcl_NewIntObj(infoPtr->loopCtTemp));
|
||||
|
||||
/*
|
||||
* Assignment targets.
|
||||
*/
|
||||
|
||||
TclNewObj(objPtr);
|
||||
objPtr = Tcl_NewObj();
|
||||
for (i=0 ; i<infoPtr->numLists ; i++) {
|
||||
TclNewObj(innerPtr);
|
||||
innerPtr = Tcl_NewObj();
|
||||
varsPtr = infoPtr->varLists[i];
|
||||
for (j=0 ; j<varsPtr->numVars ; j++) {
|
||||
Tcl_ListObjAppendElement(NULL, innerPtr,
|
||||
Tcl_NewWideIntObj(varsPtr->varIndexes[j]));
|
||||
Tcl_NewIntObj(varsPtr->varIndexes[j]));
|
||||
}
|
||||
Tcl_ListObjAppendElement(NULL, objPtr, innerPtr);
|
||||
}
|
||||
@@ -3164,7 +3163,7 @@ TclCompileFormatCmd(
|
||||
* a case we can handle by compiling to a constant.
|
||||
*/
|
||||
|
||||
TclNewObj(formatObj);
|
||||
formatObj = Tcl_NewObj();
|
||||
Tcl_IncrRefCount(formatObj);
|
||||
tokenPtr = TokenAfter(tokenPtr);
|
||||
if (!TclWordKnownAtCompileTime(tokenPtr, formatObj)) {
|
||||
@@ -3175,7 +3174,7 @@ TclCompileFormatCmd(
|
||||
objv = (Tcl_Obj **)ckalloc((parsePtr->numWords-2) * sizeof(Tcl_Obj *));
|
||||
for (i=0 ; i+2 < parsePtr->numWords ; i++) {
|
||||
tokenPtr = TokenAfter(tokenPtr);
|
||||
TclNewObj(objv[i]);
|
||||
objv[i] = Tcl_NewObj();
|
||||
Tcl_IncrRefCount(objv[i]);
|
||||
if (!TclWordKnownAtCompileTime(tokenPtr, objv[i])) {
|
||||
goto checkForStringConcatCase;
|
||||
@@ -3267,7 +3266,7 @@ TclCompileFormatCmd(
|
||||
start = Tcl_GetString(formatObj);
|
||||
/* The start of the currently-scanned literal
|
||||
* in the format string. */
|
||||
TclNewObj(tmpObj); /* The buffer used to accumulate the literal
|
||||
tmpObj = Tcl_NewObj(); /* The buffer used to accumulate the literal
|
||||
* being built. */
|
||||
for (bytes = start ; *bytes ; bytes++) {
|
||||
if (*bytes == '%') {
|
||||
@@ -3285,7 +3284,7 @@ TclCompileFormatCmd(
|
||||
if (len > 0) {
|
||||
PushLiteral(envPtr, b, len);
|
||||
Tcl_DecrRefCount(tmpObj);
|
||||
TclNewObj(tmpObj);
|
||||
tmpObj = Tcl_NewObj();
|
||||
i++;
|
||||
}
|
||||
|
||||
@@ -3447,10 +3446,10 @@ TclPushVarName(
|
||||
/*
|
||||
* last char is ')' => potential array reference.
|
||||
*/
|
||||
last = &name[nameLen-1];
|
||||
last = Tcl_UtfPrev(name + nameLen, name);
|
||||
|
||||
if (*last == ')') {
|
||||
for (p = name; p < last; p++) {
|
||||
for (p = name; p < last; p = Tcl_UtfNext(p)) {
|
||||
if (*p == '(') {
|
||||
elName = p + 1;
|
||||
elNameLen = last - elName;
|
||||
@@ -3478,14 +3477,15 @@ TclPushVarName(
|
||||
} else if (interp && ((n = varTokenPtr->numComponents) > 1)
|
||||
&& (varTokenPtr[1].type == TCL_TOKEN_TEXT)
|
||||
&& (varTokenPtr[n].type == TCL_TOKEN_TEXT)
|
||||
&& (*(varTokenPtr[n].start + varTokenPtr[n].size - 1) == ')')) {
|
||||
&& (*((p = varTokenPtr[n].start + varTokenPtr[n].size)-1) == ')')
|
||||
&& (*Tcl_UtfPrev(p, varTokenPtr[n].start) == ')')) {
|
||||
/*
|
||||
* Check for parentheses inside first token.
|
||||
*/
|
||||
|
||||
simpleVarName = 0;
|
||||
for (p = varTokenPtr[1].start,
|
||||
last = p + varTokenPtr[1].size; p < last; p++) {
|
||||
last = p + varTokenPtr[1].size; p < last; p = Tcl_UtfNext(p)) {
|
||||
if (*p == '(') {
|
||||
simpleVarName = 1;
|
||||
break;
|
||||
@@ -3553,7 +3553,7 @@ TclPushVarName(
|
||||
|
||||
int hasNsQualifiers = 0;
|
||||
|
||||
for (p = name, last = p + nameLen-1; p < last; p++) {
|
||||
for (p = name, last = p + nameLen-1; p < last; p = Tcl_UtfNext(p)) {
|
||||
if ((*p == ':') && (*(p+1) == ':')) {
|
||||
hasNsQualifiers = 1;
|
||||
break;
|
||||
|
||||
+32
-33
@@ -53,10 +53,9 @@ TclGetIndexFromToken(
|
||||
int after,
|
||||
int *indexPtr)
|
||||
{
|
||||
Tcl_Obj *tmpObj;
|
||||
Tcl_Obj *tmpObj = Tcl_NewObj();
|
||||
int result = TCL_ERROR;
|
||||
|
||||
TclNewObj(tmpObj);
|
||||
if (TclWordKnownAtCompileTime(tokenPtr, tmpObj)) {
|
||||
result = TclIndexEncode(NULL, tmpObj, before, after, indexPtr);
|
||||
}
|
||||
@@ -90,9 +89,9 @@ TclCompileGlobalCmd(
|
||||
TCL_UNUSED(Command *),
|
||||
CompileEnv *envPtr) /* Holds resulting instructions. */
|
||||
{
|
||||
DefineLineInformation; /* TIP #280 */
|
||||
Tcl_Token *varTokenPtr;
|
||||
int localIndex, numWords, i;
|
||||
DefineLineInformation; /* TIP #280 */
|
||||
|
||||
/* TODO: Consider support for compiling expanded args. */
|
||||
numWords = parsePtr->numWords;
|
||||
@@ -171,7 +170,6 @@ TclCompileIfCmd(
|
||||
TCL_UNUSED(Command *),
|
||||
CompileEnv *envPtr) /* Holds resulting instructions. */
|
||||
{
|
||||
DefineLineInformation; /* TIP #280 */
|
||||
JumpFixupArray jumpFalseFixupArray;
|
||||
/* Used to fix the ifFalse jump after each
|
||||
* test when its target PC is determined. */
|
||||
@@ -187,6 +185,7 @@ TclCompileIfCmd(
|
||||
* "if 0 {..}" */
|
||||
int boolVal; /* Value of static condition. */
|
||||
int compileScripts = 1;
|
||||
DefineLineInformation; /* TIP #280 */
|
||||
|
||||
/*
|
||||
* Only compile the "if" command if all arguments are simple words, in
|
||||
@@ -473,9 +472,9 @@ TclCompileIncrCmd(
|
||||
TCL_UNUSED(Command *),
|
||||
CompileEnv *envPtr) /* Holds resulting instructions. */
|
||||
{
|
||||
DefineLineInformation; /* TIP #280 */
|
||||
Tcl_Token *varTokenPtr, *incrTokenPtr;
|
||||
int isScalar, localIndex, haveImmValue, immValue;
|
||||
DefineLineInformation; /* TIP #280 */
|
||||
|
||||
if ((parsePtr->numWords != 2) && (parsePtr->numWords != 3)) {
|
||||
return TCL_ERROR;
|
||||
@@ -599,7 +598,7 @@ TclCompileInfoCommandsCmd(
|
||||
return TCL_ERROR;
|
||||
}
|
||||
tokenPtr = TokenAfter(parsePtr->tokenPtr);
|
||||
TclNewObj(objPtr);
|
||||
objPtr = Tcl_NewObj();
|
||||
Tcl_IncrRefCount(objPtr);
|
||||
if (!TclWordKnownAtCompileTime(tokenPtr, objPtr)) {
|
||||
goto notCompilable;
|
||||
@@ -668,9 +667,9 @@ TclCompileInfoExistsCmd(
|
||||
TCL_UNUSED(Command *),
|
||||
CompileEnv *envPtr) /* Holds resulting instructions. */
|
||||
{
|
||||
DefineLineInformation; /* TIP #280 */
|
||||
Tcl_Token *tokenPtr;
|
||||
int isScalar, localIndex;
|
||||
DefineLineInformation; /* TIP #280 */
|
||||
|
||||
if (parsePtr->numWords != 2) {
|
||||
return TCL_ERROR;
|
||||
@@ -841,9 +840,9 @@ TclCompileLappendCmd(
|
||||
TCL_UNUSED(Command *),
|
||||
CompileEnv *envPtr) /* Holds resulting instructions. */
|
||||
{
|
||||
DefineLineInformation; /* TIP #280 */
|
||||
Tcl_Token *varTokenPtr, *valueTokenPtr;
|
||||
int isScalar, localIndex, numWords, i;
|
||||
DefineLineInformation; /* TIP #280 */
|
||||
|
||||
/* TODO: Consider support for compiling expanded args. */
|
||||
numWords = parsePtr->numWords;
|
||||
@@ -874,7 +873,7 @@ TclCompileLappendCmd(
|
||||
*/
|
||||
|
||||
if (numWords > 2) {
|
||||
valueTokenPtr = TokenAfter(varTokenPtr);
|
||||
Tcl_Token *valueTokenPtr = TokenAfter(varTokenPtr);
|
||||
|
||||
CompileWord(envPtr, valueTokenPtr, interp, 2);
|
||||
}
|
||||
@@ -956,9 +955,9 @@ TclCompileLassignCmd(
|
||||
TCL_UNUSED(Command *),
|
||||
CompileEnv *envPtr) /* Holds resulting instructions. */
|
||||
{
|
||||
DefineLineInformation; /* TIP #280 */
|
||||
Tcl_Token *tokenPtr;
|
||||
int isScalar, localIndex, numWords, idx;
|
||||
DefineLineInformation; /* TIP #280 */
|
||||
|
||||
numWords = parsePtr->numWords;
|
||||
|
||||
@@ -1059,12 +1058,12 @@ TclCompileLindexCmd(
|
||||
TCL_UNUSED(Command *),
|
||||
CompileEnv *envPtr) /* Holds resulting instructions. */
|
||||
{
|
||||
DefineLineInformation; /* TIP #280 */
|
||||
Tcl_Token *idxTokenPtr, *valTokenPtr;
|
||||
int i, idx, numWords = parsePtr->numWords;
|
||||
DefineLineInformation; /* TIP #280 */
|
||||
|
||||
/*
|
||||
* Quit if not enough args.
|
||||
* Quit if too few args.
|
||||
*/
|
||||
|
||||
/* TODO: Consider support for compiling expanded args. */
|
||||
@@ -1170,9 +1169,9 @@ TclCompileListCmd(
|
||||
|
||||
numWords = parsePtr->numWords;
|
||||
valueTokenPtr = TokenAfter(parsePtr->tokenPtr);
|
||||
TclNewObj(listObj);
|
||||
listObj = Tcl_NewObj();
|
||||
for (i = 1; i < numWords && listObj != NULL; i++) {
|
||||
TclNewObj(objPtr);
|
||||
objPtr = Tcl_NewObj();
|
||||
if (TclWordKnownAtCompileTime(valueTokenPtr, objPtr)) {
|
||||
(void) Tcl_ListObjAppendElement(NULL, listObj, objPtr);
|
||||
} else {
|
||||
@@ -1262,8 +1261,8 @@ TclCompileLlengthCmd(
|
||||
TCL_UNUSED(Command *),
|
||||
CompileEnv *envPtr) /* Holds resulting instructions. */
|
||||
{
|
||||
DefineLineInformation; /* TIP #280 */
|
||||
Tcl_Token *varTokenPtr;
|
||||
DefineLineInformation; /* TIP #280 */
|
||||
|
||||
if (parsePtr->numWords != 2) {
|
||||
return TCL_ERROR;
|
||||
@@ -1294,8 +1293,8 @@ TclCompileLrangeCmd(
|
||||
TCL_UNUSED(Command *),
|
||||
CompileEnv *envPtr) /* Holds the resulting instructions. */
|
||||
{
|
||||
DefineLineInformation; /* TIP #280 */
|
||||
Tcl_Token *tokenPtr, *listTokenPtr;
|
||||
DefineLineInformation; /* TIP #280 */
|
||||
int idx1, idx2;
|
||||
|
||||
if (parsePtr->numWords != 4) {
|
||||
@@ -1354,8 +1353,8 @@ TclCompileLinsertCmd(
|
||||
TCL_UNUSED(Command *),
|
||||
CompileEnv *envPtr) /* Holds the resulting instructions. */
|
||||
{
|
||||
DefineLineInformation; /* TIP #280 */
|
||||
Tcl_Token *tokenPtr, *listTokenPtr;
|
||||
DefineLineInformation; /* TIP #280 */
|
||||
int idx, i;
|
||||
|
||||
if (parsePtr->numWords < 3) {
|
||||
@@ -1456,8 +1455,8 @@ TclCompileLreplaceCmd(
|
||||
TCL_UNUSED(Command *),
|
||||
CompileEnv *envPtr) /* Holds the resulting instructions. */
|
||||
{
|
||||
DefineLineInformation; /* TIP #280 */
|
||||
Tcl_Token *tokenPtr, *listTokenPtr;
|
||||
DefineLineInformation; /* TIP #280 */
|
||||
int idx1, idx2, i;
|
||||
int emptyPrefix=1, suffixStart = 0;
|
||||
|
||||
@@ -1619,7 +1618,6 @@ TclCompileLsetCmd(
|
||||
TCL_UNUSED(Command *),
|
||||
CompileEnv *envPtr) /* Holds the resulting instructions. */
|
||||
{
|
||||
DefineLineInformation; /* TIP #280 */
|
||||
int tempDepth; /* Depth used for emitting one part of the
|
||||
* code burst. */
|
||||
Tcl_Token *varTokenPtr; /* Pointer to the Tcl_Token representing the
|
||||
@@ -1627,6 +1625,7 @@ TclCompileLsetCmd(
|
||||
int localIndex; /* Index of var in local var table. */
|
||||
int isScalar; /* Flag == 1 if scalar, 0 if array. */
|
||||
int i;
|
||||
DefineLineInformation; /* TIP #280 */
|
||||
|
||||
/*
|
||||
* Check argument count.
|
||||
@@ -1789,8 +1788,8 @@ TclCompileNamespaceCodeCmd(
|
||||
TCL_UNUSED(Command *),
|
||||
CompileEnv *envPtr) /* Holds resulting instructions. */
|
||||
{
|
||||
DefineLineInformation; /* TIP #280 */
|
||||
Tcl_Token *tokenPtr;
|
||||
DefineLineInformation; /* TIP #280 */
|
||||
|
||||
if (parsePtr->numWords != 2) {
|
||||
return TCL_ERROR;
|
||||
@@ -1838,8 +1837,8 @@ TclCompileNamespaceOriginCmd(
|
||||
TCL_UNUSED(Command *),
|
||||
CompileEnv *envPtr) /* Holds resulting instructions. */
|
||||
{
|
||||
DefineLineInformation; /* TIP #280 */
|
||||
Tcl_Token *tokenPtr;
|
||||
DefineLineInformation; /* TIP #280 */
|
||||
|
||||
if (parsePtr->numWords != 2) {
|
||||
return TCL_ERROR;
|
||||
@@ -1859,8 +1858,8 @@ TclCompileNamespaceQualifiersCmd(
|
||||
TCL_UNUSED(Command *),
|
||||
CompileEnv *envPtr) /* Holds resulting instructions. */
|
||||
{
|
||||
DefineLineInformation; /* TIP #280 */
|
||||
Tcl_Token *tokenPtr = TokenAfter(parsePtr->tokenPtr);
|
||||
DefineLineInformation; /* TIP #280 */
|
||||
int off;
|
||||
|
||||
if (parsePtr->numWords != 2) {
|
||||
@@ -1894,8 +1893,8 @@ TclCompileNamespaceTailCmd(
|
||||
TCL_UNUSED(Command *),
|
||||
CompileEnv *envPtr) /* Holds resulting instructions. */
|
||||
{
|
||||
DefineLineInformation; /* TIP #280 */
|
||||
Tcl_Token *tokenPtr = TokenAfter(parsePtr->tokenPtr);
|
||||
DefineLineInformation; /* TIP #280 */
|
||||
JumpFixup jumpFixup;
|
||||
|
||||
if (parsePtr->numWords != 2) {
|
||||
@@ -1930,9 +1929,9 @@ TclCompileNamespaceUpvarCmd(
|
||||
TCL_UNUSED(Command *),
|
||||
CompileEnv *envPtr) /* Holds resulting instructions. */
|
||||
{
|
||||
DefineLineInformation; /* TIP #280 */
|
||||
Tcl_Token *tokenPtr, *otherTokenPtr, *localTokenPtr;
|
||||
int localIndex, numWords, i;
|
||||
DefineLineInformation; /* TIP #280 */
|
||||
|
||||
if (envPtr->procPtr == NULL) {
|
||||
return TCL_ERROR;
|
||||
@@ -2053,11 +2052,11 @@ TclCompileRegexpCmd(
|
||||
TCL_UNUSED(Command *),
|
||||
CompileEnv *envPtr) /* Holds the resulting instructions. */
|
||||
{
|
||||
DefineLineInformation; /* TIP #280 */
|
||||
Tcl_Token *varTokenPtr; /* Pointer to the Tcl_Token representing the
|
||||
* parse of the RE or string. */
|
||||
int i, len, nocase, exact, sawLast, simple;
|
||||
const char *str;
|
||||
DefineLineInformation; /* TIP #280 */
|
||||
|
||||
/*
|
||||
* We are only interested in compiling simple regexp cases. Currently
|
||||
@@ -2265,7 +2264,7 @@ TclCompileRegsubCmd(
|
||||
|
||||
Tcl_DStringInit(&pattern);
|
||||
tokenPtr = TokenAfter(tokenPtr);
|
||||
TclNewObj(patternObj);
|
||||
patternObj = Tcl_NewObj();
|
||||
if (!TclWordKnownAtCompileTime(tokenPtr, patternObj)) {
|
||||
goto done;
|
||||
}
|
||||
@@ -2276,7 +2275,7 @@ TclCompileRegsubCmd(
|
||||
}
|
||||
tokenPtr = TokenAfter(tokenPtr);
|
||||
Tcl_DecrRefCount(patternObj);
|
||||
TclNewObj(patternObj);
|
||||
patternObj = Tcl_NewObj();
|
||||
if (!TclWordKnownAtCompileTime(tokenPtr, patternObj)) {
|
||||
goto done;
|
||||
}
|
||||
@@ -2291,7 +2290,7 @@ TclCompileRegsubCmd(
|
||||
|
||||
stringTokenPtr = TokenAfter(tokenPtr);
|
||||
tokenPtr = TokenAfter(stringTokenPtr);
|
||||
TclNewObj(replacementObj);
|
||||
replacementObj = Tcl_NewObj();
|
||||
if (!TclWordKnownAtCompileTime(tokenPtr, replacementObj)) {
|
||||
goto done;
|
||||
}
|
||||
@@ -2391,7 +2390,6 @@ TclCompileReturnCmd(
|
||||
TCL_UNUSED(Command *),
|
||||
CompileEnv *envPtr) /* Holds resulting instructions. */
|
||||
{
|
||||
DefineLineInformation; /* TIP #280 */
|
||||
/*
|
||||
* General syntax: [return ?-option value ...? ?result?]
|
||||
* An even number of words means an explicit result argument is present.
|
||||
@@ -2402,6 +2400,7 @@ TclCompileReturnCmd(
|
||||
int numOptionWords = numWords - 1 - explicitResult;
|
||||
Tcl_Obj *returnOpts, **objv;
|
||||
Tcl_Token *wordTokenPtr = TokenAfter(parsePtr->tokenPtr);
|
||||
DefineLineInformation; /* TIP #280 */
|
||||
|
||||
/*
|
||||
* Check for special case which can always be compiled:
|
||||
@@ -2441,7 +2440,7 @@ TclCompileReturnCmd(
|
||||
*/
|
||||
|
||||
for (objc = 0; objc < numOptionWords; objc++) {
|
||||
TclNewObj(objv[objc]);
|
||||
objv[objc] = Tcl_NewObj();
|
||||
Tcl_IncrRefCount(objv[objc]);
|
||||
if (!TclWordKnownAtCompileTime(wordTokenPtr, objv[objc])) {
|
||||
/*
|
||||
@@ -2642,9 +2641,9 @@ TclCompileUpvarCmd(
|
||||
TCL_UNUSED(Command *),
|
||||
CompileEnv *envPtr) /* Holds resulting instructions. */
|
||||
{
|
||||
DefineLineInformation; /* TIP #280 */
|
||||
Tcl_Token *tokenPtr, *otherTokenPtr, *localTokenPtr;
|
||||
int localIndex, numWords, i;
|
||||
DefineLineInformation; /* TIP #280 */
|
||||
Tcl_Obj *objPtr;
|
||||
|
||||
if (envPtr->procPtr == NULL) {
|
||||
@@ -2660,7 +2659,7 @@ TclCompileUpvarCmd(
|
||||
* Push the frame index if it is known at compile time
|
||||
*/
|
||||
|
||||
TclNewObj(objPtr);
|
||||
objPtr = Tcl_NewObj();
|
||||
tokenPtr = TokenAfter(parsePtr->tokenPtr);
|
||||
if (TclWordKnownAtCompileTime(tokenPtr, objPtr)) {
|
||||
CallFrame *framePtr;
|
||||
@@ -2748,9 +2747,9 @@ TclCompileVariableCmd(
|
||||
TCL_UNUSED(Command *),
|
||||
CompileEnv *envPtr) /* Holds resulting instructions. */
|
||||
{
|
||||
DefineLineInformation; /* TIP #280 */
|
||||
Tcl_Token *varTokenPtr, *valueTokenPtr;
|
||||
int localIndex, numWords, i;
|
||||
DefineLineInformation; /* TIP #280 */
|
||||
|
||||
numWords = parsePtr->numWords;
|
||||
if (numWords < 2) {
|
||||
|
||||
+29
-31
@@ -129,9 +129,9 @@ TclCompileSetCmd(
|
||||
TCL_UNUSED(Command *),
|
||||
CompileEnv *envPtr) /* Holds resulting instructions. */
|
||||
{
|
||||
DefineLineInformation; /* TIP #280 */
|
||||
Tcl_Token *varTokenPtr, *valueTokenPtr;
|
||||
int isAssignment, isScalar, localIndex, numWords;
|
||||
DefineLineInformation; /* TIP #280 */
|
||||
|
||||
numWords = parsePtr->numWords;
|
||||
if ((numWords != 2) && (numWords != 3)) {
|
||||
@@ -222,10 +222,10 @@ TclCompileStringCatCmd(
|
||||
TCL_UNUSED(Command *),
|
||||
CompileEnv *envPtr) /* Holds resulting instructions. */
|
||||
{
|
||||
DefineLineInformation; /* TIP #280 */
|
||||
int i, numWords = parsePtr->numWords, numArgs;
|
||||
Tcl_Token *wordTokenPtr;
|
||||
Tcl_Obj *obj, *folded;
|
||||
DefineLineInformation; /* TIP #280 */
|
||||
|
||||
/* Trivial case, no arg */
|
||||
|
||||
@@ -241,7 +241,7 @@ TclCompileStringCatCmd(
|
||||
folded = NULL;
|
||||
wordTokenPtr = TokenAfter(parsePtr->tokenPtr);
|
||||
for (i = 1; i < numWords; i++) {
|
||||
TclNewObj(obj);
|
||||
obj = Tcl_NewObj();
|
||||
if (TclWordKnownAtCompileTime(wordTokenPtr, obj)) {
|
||||
if (folded) {
|
||||
Tcl_AppendObjToObj(folded, obj);
|
||||
@@ -444,8 +444,8 @@ TclCompileStringInsertCmd(
|
||||
TCL_UNUSED(Command *),
|
||||
CompileEnv *envPtr) /* Holds resulting instructions. */
|
||||
{
|
||||
DefineLineInformation; /* TIP #280 */
|
||||
Tcl_Token *tokenPtr;
|
||||
DefineLineInformation; /* TIP #280 */
|
||||
int idx;
|
||||
|
||||
if (parsePtr->numWords != 4) {
|
||||
@@ -462,7 +462,7 @@ TclCompileStringInsertCmd(
|
||||
TCL_INDEX_END, &idx)) {
|
||||
|
||||
/* Nothing useful knowable - cease compile; let it direct eval */
|
||||
return TCL_ERROR;
|
||||
return TCL_OK;
|
||||
}
|
||||
|
||||
/* Compute and push the string to be inserted */
|
||||
@@ -511,7 +511,7 @@ TclCompileStringIsCmd(
|
||||
"true", "upper", "wideinteger", "wordchar",
|
||||
"xdigit", NULL
|
||||
};
|
||||
enum isClassesEnum {
|
||||
enum isClasses {
|
||||
STR_IS_ALNUM, STR_IS_ALPHA, STR_IS_ASCII, STR_IS_CONTROL,
|
||||
STR_IS_BOOL, STR_IS_DICT, STR_IS_DIGIT, STR_IS_DOUBLE, STR_IS_ENTIER,
|
||||
STR_IS_FALSE, STR_IS_GRAPH, STR_IS_INT, STR_IS_LIST,
|
||||
@@ -526,7 +526,7 @@ TclCompileStringIsCmd(
|
||||
if (parsePtr->numWords < 3 || parsePtr->numWords > 6) {
|
||||
return TCL_ERROR;
|
||||
}
|
||||
TclNewObj(isClass);
|
||||
isClass = Tcl_NewObj();
|
||||
if (!TclWordKnownAtCompileTime(tokenPtr, isClass)) {
|
||||
Tcl_DecrRefCount(isClass);
|
||||
return TCL_ERROR;
|
||||
@@ -575,7 +575,7 @@ TclCompileStringIsCmd(
|
||||
|
||||
CompileWord(envPtr, tokenPtr, interp, parsePtr->numWords-1);
|
||||
|
||||
switch ((enum isClassesEnum) t) {
|
||||
switch ((enum isClasses) t) {
|
||||
case STR_IS_ALNUM:
|
||||
strClassType = STR_CLASS_ALNUM;
|
||||
goto compileStrClass;
|
||||
@@ -930,7 +930,7 @@ TclCompileStringMapCmd(
|
||||
}
|
||||
mapTokenPtr = TokenAfter(parsePtr->tokenPtr);
|
||||
stringTokenPtr = TokenAfter(mapTokenPtr);
|
||||
TclNewObj(mapObj);
|
||||
mapObj = Tcl_NewObj();
|
||||
Tcl_IncrRefCount(mapObj);
|
||||
if (!TclWordKnownAtCompileTime(mapTokenPtr, mapObj)) {
|
||||
Tcl_DecrRefCount(mapObj);
|
||||
@@ -1046,8 +1046,8 @@ TclCompileStringReplaceCmd(
|
||||
TCL_UNUSED(Command *),
|
||||
CompileEnv *envPtr) /* Holds the resulting instructions. */
|
||||
{
|
||||
DefineLineInformation; /* TIP #280 */
|
||||
Tcl_Token *tokenPtr, *valueTokenPtr;
|
||||
DefineLineInformation; /* TIP #280 */
|
||||
int first, last;
|
||||
|
||||
if (parsePtr->numWords < 4 || parsePtr->numWords > 5) {
|
||||
@@ -1415,7 +1415,7 @@ StringClassDesc const tclStringClassTable[] = {
|
||||
{"upper", Tcl_UniCharIsUpper},
|
||||
{"word", Tcl_UniCharIsWordChar},
|
||||
{"xdigit", UniCharIsHexDigit},
|
||||
{"", NULL}
|
||||
{NULL, NULL}
|
||||
};
|
||||
|
||||
/*
|
||||
@@ -1446,13 +1446,13 @@ TclCompileSubstCmd(
|
||||
TCL_UNUSED(Command *),
|
||||
CompileEnv *envPtr) /* Holds resulting instructions. */
|
||||
{
|
||||
DefineLineInformation; /* TIP #280 */
|
||||
int numArgs = parsePtr->numWords - 1;
|
||||
int numOpts = numArgs - 1;
|
||||
int objc, flags = TCL_SUBST_ALL;
|
||||
Tcl_Obj **objv/*, *toSubst = NULL*/;
|
||||
Tcl_Token *wordTokenPtr = TokenAfter(parsePtr->tokenPtr);
|
||||
int code = TCL_ERROR;
|
||||
DefineLineInformation; /* TIP #280 */
|
||||
|
||||
if (numArgs == 0) {
|
||||
return TCL_ERROR;
|
||||
@@ -1461,7 +1461,7 @@ TclCompileSubstCmd(
|
||||
objv = (Tcl_Obj **)TclStackAlloc(interp, /*numArgs*/ numOpts * sizeof(Tcl_Obj *));
|
||||
|
||||
for (objc = 0; objc < /*numArgs*/ numOpts; objc++) {
|
||||
TclNewObj(objv[objc]);
|
||||
objv[objc] = Tcl_NewObj();
|
||||
Tcl_IncrRefCount(objv[objc]);
|
||||
if (!TclWordKnownAtCompileTime(wordTokenPtr, objv[objc])) {
|
||||
objc++;
|
||||
@@ -1778,7 +1778,6 @@ TclCompileSwitchCmd(
|
||||
TCL_UNUSED(Command *),
|
||||
CompileEnv *envPtr) /* Holds resulting instructions. */
|
||||
{
|
||||
DefineLineInformation; /* TIP #280 */
|
||||
Tcl_Token *tokenPtr; /* Pointer to tokens in command. */
|
||||
int numWords; /* Number of words in command. */
|
||||
|
||||
@@ -1795,6 +1794,7 @@ TclCompileSwitchCmd(
|
||||
int foundMode = 0; /* Have we seen a mode flag yet? */
|
||||
int i, valueIndex;
|
||||
int result = TCL_ERROR;
|
||||
DefineLineInformation; /* TIP #280 */
|
||||
int *clNext = envPtr->clNext;
|
||||
|
||||
/*
|
||||
@@ -2610,19 +2610,18 @@ DisassembleJumptableInfo(
|
||||
TCL_UNUSED(unsigned int))
|
||||
{
|
||||
JumptableInfo *jtPtr = (JumptableInfo *)clientData;
|
||||
Tcl_Obj *mapping;
|
||||
Tcl_Obj *mapping = Tcl_NewObj();
|
||||
Tcl_HashEntry *hPtr;
|
||||
Tcl_HashSearch search;
|
||||
const char *keyPtr;
|
||||
size_t offset;
|
||||
int offset;
|
||||
|
||||
TclNewObj(mapping);
|
||||
hPtr = Tcl_FirstHashEntry(&jtPtr->hashTable, &search);
|
||||
for (; hPtr ; hPtr = Tcl_NextHashEntry(&search)) {
|
||||
keyPtr = (const char *)Tcl_GetHashKey(&jtPtr->hashTable, hPtr);
|
||||
offset = PTR2INT(Tcl_GetHashValue(hPtr));
|
||||
Tcl_DictObjPut(NULL, mapping, Tcl_NewStringObj(keyPtr, -1),
|
||||
Tcl_NewWideIntObj(offset));
|
||||
Tcl_NewIntObj(offset));
|
||||
}
|
||||
Tcl_DictObjPut(NULL, dictObj, Tcl_NewStringObj("mapping", -1), mapping);
|
||||
}
|
||||
@@ -3611,9 +3610,9 @@ TclCompileUnsetCmd(
|
||||
TCL_UNUSED(Command *),
|
||||
CompileEnv *envPtr) /* Holds resulting instructions. */
|
||||
{
|
||||
DefineLineInformation; /* TIP #280 */
|
||||
Tcl_Token *varTokenPtr;
|
||||
int isScalar, localIndex, flags = 1, i, varCount = 0, haveFlags = 0;
|
||||
DefineLineInformation; /* TIP #280 */
|
||||
|
||||
/* TODO: Consider support for compiling expanded args. */
|
||||
|
||||
@@ -3624,9 +3623,8 @@ TclCompileUnsetCmd(
|
||||
*/
|
||||
|
||||
for (i=1,varTokenPtr=parsePtr->tokenPtr ; i<parsePtr->numWords ; i++) {
|
||||
Tcl_Obj *leadingWord;
|
||||
Tcl_Obj *leadingWord = Tcl_NewObj();
|
||||
|
||||
TclNewObj(leadingWord);
|
||||
varTokenPtr = TokenAfter(varTokenPtr);
|
||||
if (!TclWordKnownAtCompileTime(varTokenPtr, leadingWord)) {
|
||||
TclDecrRefCount(leadingWord);
|
||||
@@ -3749,13 +3747,13 @@ TclCompileWhileCmd(
|
||||
TCL_UNUSED(Command *),
|
||||
CompileEnv *envPtr) /* Holds resulting instructions. */
|
||||
{
|
||||
DefineLineInformation; /* TIP #280 */
|
||||
Tcl_Token *testTokenPtr, *bodyTokenPtr;
|
||||
JumpFixup jumpEvalCondFixup;
|
||||
int testCodeOffset, bodyCodeOffset, jumpDist, range, code, boolVal;
|
||||
int loopMayEnd = 1; /* This is set to 0 if it is recognized as an
|
||||
* infinite loop. */
|
||||
Tcl_Obj *boolObj;
|
||||
DefineLineInformation; /* TIP #280 */
|
||||
|
||||
if (parsePtr->numWords != 3) {
|
||||
return TCL_ERROR;
|
||||
@@ -4011,8 +4009,8 @@ CompileUnaryOpCmd(
|
||||
int instruction,
|
||||
CompileEnv *envPtr)
|
||||
{
|
||||
DefineLineInformation; /* TIP #280 */
|
||||
Tcl_Token *tokenPtr;
|
||||
DefineLineInformation; /* TIP #280 */
|
||||
|
||||
if (parsePtr->numWords != 2) {
|
||||
return TCL_ERROR;
|
||||
@@ -4053,8 +4051,8 @@ CompileAssociativeBinaryOpCmd(
|
||||
int instruction,
|
||||
CompileEnv *envPtr)
|
||||
{
|
||||
DefineLineInformation; /* TIP #280 */
|
||||
Tcl_Token *tokenPtr = parsePtr->tokenPtr;
|
||||
DefineLineInformation; /* TIP #280 */
|
||||
int words;
|
||||
|
||||
/* TODO: Consider support for compiling expanded args. */
|
||||
@@ -4138,8 +4136,8 @@ CompileComparisonOpCmd(
|
||||
int instruction,
|
||||
CompileEnv *envPtr)
|
||||
{
|
||||
DefineLineInformation; /* TIP #280 */
|
||||
Tcl_Token *tokenPtr;
|
||||
DefineLineInformation; /* TIP #280 */
|
||||
|
||||
/* TODO: Consider support for compiling expanded args. */
|
||||
if (parsePtr->numWords < 3) {
|
||||
@@ -4292,15 +4290,15 @@ TclCompilePowOpCmd(
|
||||
TCL_UNUSED(Command *),
|
||||
CompileEnv *envPtr)
|
||||
{
|
||||
DefineLineInformation; /* TIP #280 */
|
||||
Tcl_Token *tokenPtr = parsePtr->tokenPtr;
|
||||
int words;
|
||||
|
||||
/*
|
||||
* This one has its own implementation because the ** operator is the only
|
||||
* one with right associativity.
|
||||
*/
|
||||
|
||||
Tcl_Token *tokenPtr = parsePtr->tokenPtr;
|
||||
DefineLineInformation; /* TIP #280 */
|
||||
int words;
|
||||
|
||||
for (words=1 ; words<parsePtr->numWords ; words++) {
|
||||
tokenPtr = TokenAfter(tokenPtr);
|
||||
CompileWord(envPtr, tokenPtr, interp, words);
|
||||
@@ -4493,8 +4491,8 @@ TclCompileMinusOpCmd(
|
||||
TCL_UNUSED(Command *),
|
||||
CompileEnv *envPtr)
|
||||
{
|
||||
DefineLineInformation; /* TIP #280 */
|
||||
Tcl_Token *tokenPtr = parsePtr->tokenPtr;
|
||||
DefineLineInformation; /* TIP #280 */
|
||||
int words;
|
||||
|
||||
/* TODO: Consider support for compiling expanded args. */
|
||||
@@ -4538,8 +4536,8 @@ TclCompileDivOpCmd(
|
||||
TCL_UNUSED(Command *),
|
||||
CompileEnv *envPtr)
|
||||
{
|
||||
DefineLineInformation; /* TIP #280 */
|
||||
Tcl_Token *tokenPtr = parsePtr->tokenPtr;
|
||||
DefineLineInformation; /* TIP #280 */
|
||||
int words;
|
||||
|
||||
/* TODO: Consider support for compiling expanded args. */
|
||||
|
||||
+23
-71
@@ -164,8 +164,6 @@ enum Marks {
|
||||
* "=" is encountered. */
|
||||
#define INVALID 5 /* A parse error. Used when any punctuation
|
||||
* appears that's not a supported operator. */
|
||||
#define COMMENT 6 /* Comment. Lasts to end of line or end of
|
||||
* expression, whichever comes first. */
|
||||
|
||||
/* Leaf lexemes */
|
||||
|
||||
@@ -464,7 +462,7 @@ static const unsigned char Lexeme[] = {
|
||||
INVALID /* FS */, INVALID /* GS */,
|
||||
INVALID /* RS */, INVALID /* US */,
|
||||
INVALID /* SPACE */, 0 /* ! or != */,
|
||||
QUOTED /* " */, 0 /* # */,
|
||||
QUOTED /* " */, INVALID /* # */,
|
||||
VARIABLE /* $ */, MOD /* % */,
|
||||
0 /* & or && */, INVALID /* ' */,
|
||||
OPEN_PAREN /* ( */, CLOSE_PAREN /* ) */,
|
||||
@@ -676,10 +674,9 @@ ParseExpr(
|
||||
OpNode *newPtr = NULL;
|
||||
|
||||
do {
|
||||
if (size <= UINT_MAX/sizeof(OpNode)) {
|
||||
newPtr = (OpNode *) attemptckrealloc(nodes,
|
||||
size * sizeof(OpNode));
|
||||
}
|
||||
if (size <= UINT_MAX/sizeof(OpNode)) {
|
||||
newPtr = (OpNode *)attemptckrealloc(nodes, size * sizeof(OpNode));
|
||||
}
|
||||
} while ((newPtr == NULL)
|
||||
&& ((size -= (size - nodesUsed) / 2) > nodesUsed));
|
||||
if (newPtr == NULL) {
|
||||
@@ -711,10 +708,6 @@ ParseExpr(
|
||||
int b;
|
||||
|
||||
switch (lexeme) {
|
||||
case COMMENT:
|
||||
start += scanned;
|
||||
numBytes -= scanned;
|
||||
continue;
|
||||
case INVALID:
|
||||
msg = Tcl_ObjPrintf("invalid character \"%.*s\"",
|
||||
scanned, start);
|
||||
@@ -749,32 +742,6 @@ ParseExpr(
|
||||
} else if (Tcl_GetBooleanFromObj(NULL,literal,&b) == TCL_OK) {
|
||||
lexeme = BOOLEAN;
|
||||
} else {
|
||||
/*
|
||||
* Tricky case: see test expr-62.10
|
||||
*/
|
||||
|
||||
int scanned2 = scanned;
|
||||
do {
|
||||
scanned2 += TclParseAllWhiteSpace(
|
||||
start + scanned2, numBytes - scanned2);
|
||||
scanned2 += ParseLexeme(
|
||||
start + scanned2, numBytes - scanned2, &lexeme,
|
||||
NULL);
|
||||
} while (lexeme == COMMENT);
|
||||
if (lexeme == OPEN_PAREN) {
|
||||
/*
|
||||
* Actually a function call, but with obscuring
|
||||
* comments. Skip to the start of the parentheses.
|
||||
* Note that we assume that open parentheses are one
|
||||
* byte long.
|
||||
*/
|
||||
|
||||
lexeme = FUNCTION;
|
||||
Tcl_ListObjAppendElement(NULL, funcList, literal);
|
||||
scanned = scanned2 - 1;
|
||||
break;
|
||||
}
|
||||
|
||||
Tcl_DecrRefCount(literal);
|
||||
msg = Tcl_ObjPrintf("invalid bareword \"%.*s%s\"",
|
||||
(scanned < limit) ? scanned : limit - 3, start,
|
||||
@@ -1042,7 +1009,7 @@ ParseExpr(
|
||||
* later.
|
||||
*/
|
||||
|
||||
TclNewObj(literal);
|
||||
literal = Tcl_NewObj();
|
||||
if (TclWordKnownAtCompileTime(tokenPtr, literal)) {
|
||||
Tcl_ListObjAppendElement(NULL, litList, literal);
|
||||
complete = lastParsed = OT_LITERAL;
|
||||
@@ -1869,13 +1836,11 @@ Tcl_ParseExpr(
|
||||
{
|
||||
int code;
|
||||
OpNode *opTree = NULL; /* Will point to the tree of operators. */
|
||||
Tcl_Obj *litList; /* List to hold the literals. */
|
||||
Tcl_Obj *funcList; /* List to hold the functon names. */
|
||||
Tcl_Obj *litList = Tcl_NewObj(); /* List to hold the literals. */
|
||||
Tcl_Obj *funcList = Tcl_NewObj(); /* List to hold the functon names. */
|
||||
Tcl_Parse *exprParsePtr = (Tcl_Parse *)TclStackAlloc(interp, sizeof(Tcl_Parse));
|
||||
/* Holds the Tcl_Tokens of substitutions. */
|
||||
|
||||
TclNewObj(litList);
|
||||
TclNewObj(funcList);
|
||||
if (numBytes < 0) {
|
||||
numBytes = (start ? strlen(start) : 0);
|
||||
}
|
||||
@@ -1927,7 +1892,7 @@ ParseLexeme(
|
||||
storage, if non-NULL. */
|
||||
{
|
||||
const char *end;
|
||||
int scanned, size;
|
||||
int scanned;
|
||||
Tcl_UniChar ch = 0;
|
||||
Tcl_Obj *literal = NULL;
|
||||
unsigned char byte;
|
||||
@@ -1942,16 +1907,6 @@ ParseLexeme(
|
||||
return 1;
|
||||
}
|
||||
switch (byte) {
|
||||
case '#':
|
||||
/*
|
||||
* Scan forward over the comment contents.
|
||||
*/
|
||||
for (size = 0; byte != '\n' && byte != 0 && size < numBytes; size++) {
|
||||
byte = UCHAR(start[size]);
|
||||
}
|
||||
*lexemePtr = COMMENT;
|
||||
return size - (byte == '\n');
|
||||
|
||||
case '*':
|
||||
if ((numBytes > 1) && (start[1] == '*')) {
|
||||
*lexemePtr = EXPON;
|
||||
@@ -2085,7 +2040,7 @@ ParseLexeme(
|
||||
break;
|
||||
}
|
||||
|
||||
TclNewObj(literal);
|
||||
literal = Tcl_NewObj();
|
||||
if (TclParseNumber(NULL, literal, NULL, start, numBytes, &end,
|
||||
TCL_PARSE_NO_WHITESPACE) == TCL_OK) {
|
||||
if (end < start + numBytes && !TclIsBareword(*end)) {
|
||||
@@ -2199,15 +2154,12 @@ TclCompileExpr(
|
||||
int optimize) /* 0 for one-off expressions. */
|
||||
{
|
||||
OpNode *opTree = NULL; /* Will point to the tree of operators */
|
||||
Tcl_Obj *litList; /* List to hold the literals */
|
||||
Tcl_Obj *funcList; /* List to hold the functon names*/
|
||||
Tcl_Obj *litList = Tcl_NewObj(); /* List to hold the literals */
|
||||
Tcl_Obj *funcList = Tcl_NewObj(); /* List to hold the functon names*/
|
||||
Tcl_Parse *parsePtr = (Tcl_Parse *)TclStackAlloc(interp, sizeof(Tcl_Parse));
|
||||
/* Holds the Tcl_Tokens of substitutions */
|
||||
int code;
|
||||
|
||||
TclNewObj(litList);
|
||||
TclNewObj(funcList);
|
||||
code = ParseExpr(interp, script, numBytes, &opTree, litList,
|
||||
int code = ParseExpr(interp, script, numBytes, &opTree, litList,
|
||||
funcList, parsePtr, 0 /* parseOnly */);
|
||||
|
||||
if (code == TCL_OK) {
|
||||
@@ -2506,8 +2458,8 @@ CompileExprTree(
|
||||
if (optimize) {
|
||||
int length;
|
||||
const char *bytes = TclGetStringFromObj(literal, &length);
|
||||
int idx = TclRegisterLiteral(envPtr, bytes, length, 0);
|
||||
Tcl_Obj *objPtr = TclFetchLiteral(envPtr, idx);
|
||||
int index = TclRegisterLiteral(envPtr, bytes, length, 0);
|
||||
Tcl_Obj *objPtr = TclFetchLiteral(envPtr, index);
|
||||
|
||||
if ((objPtr->typePtr == NULL) && (literal->typePtr != NULL)) {
|
||||
/*
|
||||
@@ -2527,7 +2479,7 @@ CompileExprTree(
|
||||
objPtr->internalRep = literal->internalRep;
|
||||
literal->typePtr = NULL;
|
||||
}
|
||||
TclEmitPush(idx, envPtr);
|
||||
TclEmitPush(index, envPtr);
|
||||
} else {
|
||||
/*
|
||||
* When optimize==0, we know the expression is a one-off and
|
||||
@@ -2553,7 +2505,7 @@ CompileExprTree(
|
||||
|
||||
if (ExecConstantExprTree(interp, nodes, next, litObjvPtr)
|
||||
== TCL_OK) {
|
||||
int idx;
|
||||
int index;
|
||||
Tcl_Obj *objPtr = Tcl_GetObjResult(interp);
|
||||
|
||||
/*
|
||||
@@ -2567,8 +2519,8 @@ CompileExprTree(
|
||||
const char *bytes
|
||||
= Tcl_GetStringFromObj(objPtr, &numBytes);
|
||||
|
||||
idx = TclRegisterLiteral(envPtr, bytes, numBytes, 0);
|
||||
tableValue = TclFetchLiteral(envPtr, idx);
|
||||
index = TclRegisterLiteral(envPtr, bytes, numBytes, 0);
|
||||
tableValue = TclFetchLiteral(envPtr, index);
|
||||
if ((tableValue->typePtr == NULL) &&
|
||||
(objPtr->typePtr != NULL)) {
|
||||
/*
|
||||
@@ -2580,9 +2532,9 @@ CompileExprTree(
|
||||
objPtr->typePtr = NULL;
|
||||
}
|
||||
} else {
|
||||
idx = TclAddLiteralObj(envPtr, objPtr, NULL);
|
||||
index = TclAddLiteralObj(envPtr, objPtr, NULL);
|
||||
}
|
||||
TclEmitPush(idx, envPtr);
|
||||
TclEmitPush(index, envPtr);
|
||||
} else {
|
||||
TclCompileSyntaxError(interp, envPtr);
|
||||
}
|
||||
@@ -2759,7 +2711,7 @@ TclVariadicOpCmd(
|
||||
int code;
|
||||
|
||||
if (objc < 2) {
|
||||
Tcl_SetObjResult(interp, Tcl_NewWideIntObj(occdPtr->i.identity));
|
||||
Tcl_SetObjResult(interp, Tcl_NewIntObj(occdPtr->i.identity));
|
||||
return TCL_OK;
|
||||
}
|
||||
|
||||
@@ -2773,7 +2725,7 @@ TclVariadicOpCmd(
|
||||
Tcl_Obj *const *litObjPtrPtr = litObjv;
|
||||
|
||||
if (lexeme == EXPON) {
|
||||
TclNewIntObj(litObjv[1], occdPtr->i.identity);
|
||||
litObjv[1] = Tcl_NewIntObj(occdPtr->i.identity);
|
||||
Tcl_IncrRefCount(litObjv[1]);
|
||||
decrMe = 1;
|
||||
litObjv[0] = objv[1];
|
||||
@@ -2789,7 +2741,7 @@ TclVariadicOpCmd(
|
||||
if (lexeme == DIVIDE) {
|
||||
litObjv[0] = Tcl_NewDoubleObj(1.0);
|
||||
} else {
|
||||
TclNewIntObj(litObjv[0], occdPtr->i.identity);
|
||||
litObjv[0] = Tcl_NewIntObj(occdPtr->i.identity);
|
||||
}
|
||||
Tcl_IncrRefCount(litObjv[0]);
|
||||
litObjv[1] = objv[1];
|
||||
|
||||
@@ -848,7 +848,7 @@ TclSetByteCodeFromAny(
|
||||
* faster code in some cases, and more compact code in more.
|
||||
*/
|
||||
|
||||
if (Tcl_GetParent(interp) == NULL &&
|
||||
if (Tcl_GetMaster(interp) == NULL &&
|
||||
!Tcl_LimitTypeEnabled(interp, TCL_LIMIT_COMMANDS|TCL_LIMIT_TIME)
|
||||
&& IsCompactibleCompileEnv(&compEnv)) {
|
||||
TclFreeCompileEnv(&compEnv);
|
||||
@@ -1746,7 +1746,7 @@ TclWordKnownAtCompileTime(
|
||||
}
|
||||
tokenPtr++;
|
||||
if (valuePtr != NULL) {
|
||||
TclNewObj(tempPtr);
|
||||
tempPtr = Tcl_NewObj();
|
||||
Tcl_IncrRefCount(tempPtr);
|
||||
}
|
||||
while (numComponents--) {
|
||||
@@ -1834,7 +1834,7 @@ CompileCmdLiteral(
|
||||
bytes = TclGetStringFromObj(cmdObj, &numBytes);
|
||||
cmdLitIdx = TclRegisterLiteral(envPtr, bytes, numBytes, extraLiteralFlags);
|
||||
|
||||
if (cmdPtr && TclRoutineHasName(cmdPtr)) {
|
||||
if (cmdPtr) {
|
||||
TclSetCmdNameObj(interp, TclFetchLiteral(envPtr, cmdLitIdx), cmdPtr);
|
||||
}
|
||||
TclEmitPush(cmdLitIdx, envPtr);
|
||||
@@ -1848,8 +1848,8 @@ TclCompileInvocation(
|
||||
int numWords,
|
||||
CompileEnv *envPtr)
|
||||
{
|
||||
DefineLineInformation;
|
||||
int wordIdx = 0, depth = TclGetStackDepth(envPtr);
|
||||
DefineLineInformation;
|
||||
|
||||
if (cmdObj) {
|
||||
CompileCmdLiteral(interp, cmdObj, envPtr);
|
||||
@@ -1892,8 +1892,8 @@ CompileExpanded(
|
||||
int numWords,
|
||||
CompileEnv *envPtr)
|
||||
{
|
||||
DefineLineInformation;
|
||||
int wordIdx = 0;
|
||||
DefineLineInformation;
|
||||
int depth = TclGetStackDepth(envPtr);
|
||||
|
||||
StartExpanding(envPtr);
|
||||
@@ -1951,8 +1951,8 @@ CompileCmdCompileProc(
|
||||
Command *cmdPtr,
|
||||
CompileEnv *envPtr)
|
||||
{
|
||||
DefineLineInformation;
|
||||
int unwind = 0, incrOffset = -1;
|
||||
DefineLineInformation;
|
||||
int depth = TclGetStackDepth(envPtr);
|
||||
|
||||
/*
|
||||
@@ -2035,7 +2035,7 @@ CompileCommandTokens(
|
||||
Interp *iPtr = (Interp *) interp;
|
||||
Tcl_Token *tokenPtr = parsePtr->tokenPtr;
|
||||
ExtCmdLoc *eclPtr = envPtr->extCmdMapPtr;
|
||||
Tcl_Obj *cmdObj;
|
||||
Tcl_Obj *cmdObj = Tcl_NewObj();
|
||||
Command *cmdPtr = NULL;
|
||||
int code = TCL_ERROR;
|
||||
int cmdKnown, expand = -1;
|
||||
@@ -2050,7 +2050,6 @@ CompileCommandTokens(
|
||||
|
||||
/* Pre-Compile */
|
||||
|
||||
TclNewObj(cmdObj);
|
||||
envPtr->numCommands++;
|
||||
EnterCmdStartData(envPtr, cmdIdx,
|
||||
parsePtr->commandStart - envPtr->source, startCodeOffset);
|
||||
|
||||
@@ -927,7 +927,7 @@ typedef enum InstStringClassType {
|
||||
} InstStringClassType;
|
||||
|
||||
typedef struct StringClassDesc {
|
||||
char name[8]; /* Name of the class. */
|
||||
const char *name; /* Name of the class. */
|
||||
int (*comparator)(int); /* Function to test if a single unicode
|
||||
* character is a member of the class. */
|
||||
} StringClassDesc;
|
||||
@@ -991,7 +991,7 @@ typedef struct JumpFixupArray {
|
||||
|
||||
typedef struct ForeachVarList {
|
||||
int numVars; /* The number of variables in the list. */
|
||||
int varIndexes[TCLFLEXARRAY];/* An array of the indexes ("slot numbers")
|
||||
int varIndexes[1]; /* An array of the indexes ("slot numbers")
|
||||
* for each variable in the procedure's array
|
||||
* of local variables. Only scalar variables
|
||||
* are supported. The actual size of this
|
||||
@@ -1015,7 +1015,7 @@ typedef struct ForeachInfo {
|
||||
* the loop's iteration count. Used to
|
||||
* determine next value list element to assign
|
||||
* each loop var. */
|
||||
ForeachVarList *varLists[TCLFLEXARRAY];/* An array of pointers to ForeachVarList
|
||||
ForeachVarList *varLists[1];/* An array of pointers to ForeachVarList
|
||||
* structures describing each var list. The
|
||||
* actual size of this field will be large
|
||||
* enough to numVars indexes. THIS MUST BE THE
|
||||
@@ -1046,7 +1046,7 @@ MODULE_SCOPE const AuxDataType tclJumptableInfoType;
|
||||
|
||||
typedef struct {
|
||||
int length; /* Size of array */
|
||||
int varIndices[TCLFLEXARRAY]; /* Array of variable indices to manage when
|
||||
int varIndices[1]; /* Array of variable indices to manage when
|
||||
* processing the start and end of a [dict
|
||||
* update]. There is really more than one
|
||||
* entry, and the structure is allocated to
|
||||
|
||||
+149
-149
@@ -102,6 +102,9 @@ typedef enum _MERIDIAN {
|
||||
MERam, MERpm, MER24
|
||||
} MERIDIAN;
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* yyparse will accept a 'struct DateInfo' as its parameter; that's where the
|
||||
* parsed fields will be returned.
|
||||
@@ -207,9 +210,6 @@ typedef enum _DSTMODE {
|
||||
DSTon, DSToff, DSTmaybe
|
||||
} DSTMODE;
|
||||
|
||||
|
||||
|
||||
|
||||
# ifndef YY_NULLPTR
|
||||
# if defined __cplusplus && 201103L <= __cplusplus
|
||||
# define YY_NULLPTR nullptr
|
||||
@@ -560,7 +560,7 @@ union yyalloc
|
||||
/* YYFINAL -- State number of the termination state. */
|
||||
#define YYFINAL 2
|
||||
/* YYLAST -- Last index in YYTABLE. */
|
||||
#define YYLAST 81
|
||||
#define YYLAST 79
|
||||
|
||||
/* YYNTOKENS -- Number of terminals. */
|
||||
#define YYNTOKENS 26
|
||||
@@ -569,7 +569,7 @@ union yyalloc
|
||||
/* YYNRULES -- Number of rules. */
|
||||
#define YYNRULES 56
|
||||
/* YYNSTATES -- Number of states. */
|
||||
#define YYNSTATES 85
|
||||
#define YYNSTATES 83
|
||||
|
||||
/* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned
|
||||
by yylex, with out-of-bounds checking. */
|
||||
@@ -587,7 +587,7 @@ static const yytype_uint8 yytranslate[] =
|
||||
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
|
||||
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
|
||||
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
|
||||
2, 2, 2, 25, 21, 23, 24, 22, 2, 2,
|
||||
2, 2, 2, 25, 22, 21, 24, 23, 2, 2,
|
||||
2, 2, 2, 2, 2, 2, 2, 2, 20, 2,
|
||||
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
|
||||
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
|
||||
@@ -618,11 +618,11 @@ static const yytype_uint8 yytranslate[] =
|
||||
static const yytype_uint16 yyrline[] =
|
||||
{
|
||||
0, 223, 223, 224, 227, 230, 233, 236, 239, 242,
|
||||
245, 249, 254, 257, 263, 269, 277, 282, 287, 291,
|
||||
297, 301, 305, 309, 313, 319, 323, 328, 333, 338,
|
||||
343, 347, 352, 356, 361, 368, 372, 378, 388, 397,
|
||||
406, 416, 430, 435, 438, 441, 444, 447, 450, 455,
|
||||
458, 463, 467, 471, 477, 495, 498
|
||||
245, 249, 254, 257, 263, 269, 277, 283, 294, 298,
|
||||
302, 308, 312, 316, 320, 324, 330, 334, 339, 344,
|
||||
349, 354, 358, 363, 367, 372, 379, 383, 389, 398,
|
||||
407, 417, 431, 436, 439, 442, 445, 448, 451, 456,
|
||||
459, 464, 468, 472, 478, 496, 499
|
||||
};
|
||||
#endif
|
||||
|
||||
@@ -634,7 +634,7 @@ static const char *const yytname[] =
|
||||
"$end", "error", "$undefined", "tAGO", "tDAY", "tDAYZONE", "tID",
|
||||
"tMERIDIAN", "tMONTH", "tMONTH_UNIT", "tSTARDATE", "tSEC_UNIT",
|
||||
"tSNUMBER", "tUNUMBER", "tZONE", "tEPOCH", "tDST", "tISOBASE",
|
||||
"tDAY_UNIT", "tNEXT", "':'", "','", "'/'", "'-'", "'.'", "'+'",
|
||||
"tDAY_UNIT", "tNEXT", "':'", "'-'", "','", "'/'", "'.'", "'+'",
|
||||
"$accept", "spec", "item", "time", "zone", "day", "date", "ordMonth",
|
||||
"iso", "trek", "relspec", "relunits", "sign", "unit", "number",
|
||||
"o_merid", YY_NULLPTR
|
||||
@@ -648,14 +648,14 @@ static const yytype_uint16 yytoknum[] =
|
||||
{
|
||||
0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
|
||||
265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
|
||||
58, 44, 47, 45, 46, 43
|
||||
58, 45, 44, 47, 46, 43
|
||||
};
|
||||
# endif
|
||||
|
||||
#define YYPACT_NINF -18
|
||||
#define YYPACT_NINF -22
|
||||
|
||||
#define yypact_value_is_default(Yystate) \
|
||||
(!!((Yystate) == (-18)))
|
||||
(!!((Yystate) == (-22)))
|
||||
|
||||
#define YYTABLE_NINF -1
|
||||
|
||||
@@ -666,15 +666,15 @@ static const yytype_uint16 yytoknum[] =
|
||||
STATE-NUM. */
|
||||
static const yytype_int8 yypact[] =
|
||||
{
|
||||
-18, 2, -18, -17, -18, -4, -18, 10, -18, 22,
|
||||
8, -18, 18, -18, 39, -18, -18, -18, -18, -18,
|
||||
-18, -18, -18, -18, -18, -18, 25, 21, -18, -18,
|
||||
-18, 16, 14, -18, -18, 28, 36, 41, -5, -18,
|
||||
-18, 5, -18, -18, -18, 47, -18, -18, 42, 46,
|
||||
48, -18, -6, 40, 43, 44, 49, -18, -18, -18,
|
||||
-18, -18, -18, -18, -18, 50, -18, 51, 55, 57,
|
||||
58, 65, -18, -18, 59, 54, -18, 62, 63, 60,
|
||||
-18, 64, 61, 66, -18
|
||||
-22, 2, -22, -21, -22, -4, -22, 1, -22, 22,
|
||||
18, -22, 8, -22, 40, -22, -22, -22, -22, -22,
|
||||
-22, -22, -22, -22, -22, -22, 32, 28, -22, -22,
|
||||
-22, 24, 26, -22, -22, 42, 47, -5, 49, -22,
|
||||
-22, 15, -22, -22, -22, 48, -22, -22, 43, 50,
|
||||
51, -22, 17, 44, 46, 45, 52, -22, -22, -22,
|
||||
-22, -22, -22, -22, -22, 56, 57, -22, 58, 60,
|
||||
61, 62, -3, -22, -22, -22, -22, 59, 63, -22,
|
||||
64, -22, -22
|
||||
};
|
||||
|
||||
/* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM.
|
||||
@@ -682,29 +682,29 @@ static const yytype_int8 yypact[] =
|
||||
means the default is an error. */
|
||||
static const yytype_uint8 yydefact[] =
|
||||
{
|
||||
2, 0, 1, 20, 18, 0, 53, 0, 51, 54,
|
||||
17, 33, 27, 52, 0, 49, 50, 3, 4, 5,
|
||||
2, 0, 1, 21, 20, 0, 53, 0, 51, 54,
|
||||
19, 34, 28, 52, 0, 49, 50, 3, 4, 5,
|
||||
8, 6, 7, 10, 11, 9, 43, 0, 48, 12,
|
||||
21, 30, 0, 22, 13, 32, 0, 0, 0, 45,
|
||||
16, 0, 40, 24, 35, 0, 46, 42, 19, 0,
|
||||
0, 34, 55, 25, 0, 0, 0, 38, 36, 47,
|
||||
23, 44, 31, 41, 56, 0, 14, 0, 0, 0,
|
||||
0, 55, 26, 28, 29, 0, 15, 0, 0, 0,
|
||||
39, 0, 0, 0, 37
|
||||
22, 31, 0, 23, 13, 33, 0, 0, 0, 45,
|
||||
18, 0, 40, 25, 36, 0, 46, 42, 0, 0,
|
||||
0, 35, 55, 0, 0, 26, 0, 38, 37, 47,
|
||||
24, 44, 32, 41, 56, 0, 0, 14, 0, 0,
|
||||
0, 0, 55, 15, 29, 30, 27, 0, 0, 16,
|
||||
0, 17, 39
|
||||
};
|
||||
|
||||
/* YYPGOTO[NTERM-NUM]. */
|
||||
static const yytype_int8 yypgoto[] =
|
||||
{
|
||||
-18, -18, -18, -18, -18, -18, -18, -18, -18, -18,
|
||||
-18, -18, -18, -9, -18, 7
|
||||
-22, -22, -22, -22, -22, -22, -22, -22, -22, -22,
|
||||
-22, -22, -22, -9, -22, 6
|
||||
};
|
||||
|
||||
/* YYDEFGOTO[NTERM-NUM]. */
|
||||
static const yytype_int8 yydefgoto[] =
|
||||
{
|
||||
-1, 1, 17, 18, 19, 20, 21, 22, 23, 24,
|
||||
25, 26, 27, 28, 29, 66
|
||||
25, 26, 27, 28, 29, 67
|
||||
};
|
||||
|
||||
/* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If
|
||||
@@ -712,28 +712,26 @@ static const yytype_int8 yydefgoto[] =
|
||||
number is the opposite. If YYTABLE_NINF, syntax error. */
|
||||
static const yytype_uint8 yytable[] =
|
||||
{
|
||||
39, 64, 2, 54, 30, 46, 3, 4, 55, 31,
|
||||
5, 6, 7, 8, 65, 9, 10, 11, 56, 12,
|
||||
13, 14, 57, 32, 40, 15, 33, 16, 47, 34,
|
||||
35, 6, 41, 8, 48, 42, 59, 49, 50, 61,
|
||||
13, 51, 36, 43, 37, 38, 60, 44, 6, 52,
|
||||
8, 6, 45, 8, 53, 58, 6, 13, 8, 62,
|
||||
13, 63, 67, 71, 72, 13, 68, 69, 73, 70,
|
||||
74, 75, 64, 77, 78, 79, 80, 82, 76, 84,
|
||||
81, 83
|
||||
39, 30, 2, 53, 64, 46, 3, 4, 54, 31,
|
||||
5, 6, 7, 8, 32, 9, 10, 11, 78, 12,
|
||||
13, 14, 41, 15, 64, 42, 33, 16, 56, 34,
|
||||
35, 6, 57, 8, 40, 47, 59, 65, 66, 61,
|
||||
13, 48, 36, 37, 43, 38, 49, 60, 44, 6,
|
||||
50, 8, 6, 45, 8, 51, 58, 6, 13, 8,
|
||||
52, 13, 55, 62, 63, 68, 13, 69, 70, 72,
|
||||
73, 74, 71, 75, 76, 77, 81, 82, 79, 80
|
||||
};
|
||||
|
||||
static const yytype_uint8 yycheck[] =
|
||||
{
|
||||
9, 7, 0, 8, 21, 14, 4, 5, 13, 13,
|
||||
8, 9, 10, 11, 20, 13, 14, 15, 13, 17,
|
||||
18, 19, 17, 13, 16, 23, 4, 25, 3, 7,
|
||||
8, 9, 14, 11, 13, 17, 45, 21, 24, 48,
|
||||
18, 13, 20, 4, 22, 23, 4, 8, 9, 13,
|
||||
11, 9, 13, 11, 13, 8, 9, 18, 11, 13,
|
||||
18, 13, 22, 13, 13, 18, 23, 23, 13, 20,
|
||||
13, 13, 7, 14, 20, 13, 13, 13, 71, 13,
|
||||
20, 20
|
||||
9, 22, 0, 8, 7, 14, 4, 5, 13, 13,
|
||||
8, 9, 10, 11, 13, 13, 14, 15, 21, 17,
|
||||
18, 19, 14, 21, 7, 17, 4, 25, 13, 7,
|
||||
8, 9, 17, 11, 16, 3, 45, 20, 21, 48,
|
||||
18, 13, 20, 21, 4, 23, 22, 4, 8, 9,
|
||||
24, 11, 9, 13, 11, 13, 8, 9, 18, 11,
|
||||
13, 18, 13, 13, 13, 21, 18, 21, 23, 13,
|
||||
13, 13, 20, 13, 13, 13, 13, 13, 72, 20
|
||||
};
|
||||
|
||||
/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
|
||||
@@ -741,23 +739,23 @@ static const yytype_uint8 yycheck[] =
|
||||
static const yytype_uint8 yystos[] =
|
||||
{
|
||||
0, 27, 0, 4, 5, 8, 9, 10, 11, 13,
|
||||
14, 15, 17, 18, 19, 23, 25, 28, 29, 30,
|
||||
14, 15, 17, 18, 19, 21, 25, 28, 29, 30,
|
||||
31, 32, 33, 34, 35, 36, 37, 38, 39, 40,
|
||||
21, 13, 13, 4, 7, 8, 20, 22, 23, 39,
|
||||
16, 14, 17, 4, 8, 13, 39, 3, 13, 21,
|
||||
24, 13, 13, 13, 8, 13, 13, 17, 8, 39,
|
||||
4, 39, 13, 13, 7, 20, 41, 22, 23, 23,
|
||||
20, 13, 13, 13, 13, 13, 41, 14, 20, 13,
|
||||
13, 20, 13, 20, 13
|
||||
22, 13, 13, 4, 7, 8, 20, 21, 23, 39,
|
||||
16, 14, 17, 4, 8, 13, 39, 3, 13, 22,
|
||||
24, 13, 13, 8, 13, 13, 13, 17, 8, 39,
|
||||
4, 39, 13, 13, 7, 20, 21, 41, 21, 21,
|
||||
23, 20, 13, 13, 13, 13, 13, 13, 21, 41,
|
||||
20, 13, 13
|
||||
};
|
||||
|
||||
/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
|
||||
static const yytype_uint8 yyr1[] =
|
||||
{
|
||||
0, 26, 27, 27, 28, 28, 28, 28, 28, 28,
|
||||
28, 28, 28, 29, 29, 29, 30, 30, 30, 30,
|
||||
31, 31, 31, 31, 31, 32, 32, 32, 32, 32,
|
||||
32, 32, 32, 32, 32, 33, 33, 34, 34, 34,
|
||||
28, 28, 28, 29, 29, 29, 29, 29, 30, 30,
|
||||
30, 31, 31, 31, 31, 31, 32, 32, 32, 32,
|
||||
32, 32, 32, 32, 32, 32, 33, 33, 34, 34,
|
||||
34, 35, 36, 36, 37, 37, 37, 37, 37, 38,
|
||||
38, 39, 39, 39, 40, 41, 41
|
||||
};
|
||||
@@ -766,9 +764,9 @@ static const yytype_uint8 yyr1[] =
|
||||
static const yytype_uint8 yyr2[] =
|
||||
{
|
||||
0, 2, 0, 2, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 2, 4, 6, 2, 1, 1, 2,
|
||||
1, 2, 2, 3, 2, 3, 5, 1, 5, 5,
|
||||
2, 4, 2, 1, 3, 2, 3, 11, 3, 7,
|
||||
1, 1, 1, 2, 4, 5, 6, 7, 2, 1,
|
||||
1, 1, 2, 2, 3, 2, 3, 5, 1, 5,
|
||||
5, 2, 4, 2, 1, 3, 2, 3, 3, 7,
|
||||
2, 4, 2, 1, 3, 2, 2, 3, 1, 1,
|
||||
1, 1, 1, 1, 1, 0, 1
|
||||
};
|
||||
@@ -1640,6 +1638,19 @@ yyreduce:
|
||||
|
||||
case 15:
|
||||
|
||||
{
|
||||
yyHour = (yyvsp[-4].Number);
|
||||
yyMinutes = (yyvsp[-2].Number);
|
||||
yyMeridian = MER24;
|
||||
yyDSTmode = DSToff;
|
||||
yyTimezone = ((yyvsp[0].Number) % 100 + ((yyvsp[0].Number) / 100) * 60);
|
||||
++yyHaveZone;
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case 16:
|
||||
|
||||
{
|
||||
yyHour = (yyvsp[-5].Number);
|
||||
yyMinutes = (yyvsp[-3].Number);
|
||||
@@ -1649,22 +1660,16 @@ yyreduce:
|
||||
|
||||
break;
|
||||
|
||||
case 16:
|
||||
|
||||
{
|
||||
yyTimezone = (yyvsp[-1].Number);
|
||||
if (yyTimezone > HOUR( 12)) yyTimezone -= HOUR(100);
|
||||
yyDSTmode = DSTon;
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case 17:
|
||||
|
||||
{
|
||||
yyTimezone = (yyvsp[0].Number);
|
||||
if (yyTimezone > HOUR( 12)) yyTimezone -= HOUR(100);
|
||||
yyHour = (yyvsp[-6].Number);
|
||||
yyMinutes = (yyvsp[-4].Number);
|
||||
yySeconds = (yyvsp[-2].Number);
|
||||
yyMeridian = MER24;
|
||||
yyDSTmode = DSToff;
|
||||
yyTimezone = ((yyvsp[0].Number) % 100 + ((yyvsp[0].Number) / 100) * 60);
|
||||
++yyHaveZone;
|
||||
}
|
||||
|
||||
break;
|
||||
@@ -1672,7 +1677,7 @@ yyreduce:
|
||||
case 18:
|
||||
|
||||
{
|
||||
yyTimezone = (yyvsp[0].Number);
|
||||
yyTimezone = (yyvsp[-1].Number);
|
||||
yyDSTmode = DSTon;
|
||||
}
|
||||
|
||||
@@ -1681,7 +1686,7 @@ yyreduce:
|
||||
case 19:
|
||||
|
||||
{
|
||||
yyTimezone = -(yyvsp[-1].Number)*((yyvsp[0].Number) % 100 + ((yyvsp[0].Number) / 100) * 60);
|
||||
yyTimezone = (yyvsp[0].Number);
|
||||
yyDSTmode = DSToff;
|
||||
}
|
||||
|
||||
@@ -1690,8 +1695,8 @@ yyreduce:
|
||||
case 20:
|
||||
|
||||
{
|
||||
yyDayOrdinal = 1;
|
||||
yyDayNumber = (yyvsp[0].Number);
|
||||
yyTimezone = (yyvsp[0].Number);
|
||||
yyDSTmode = DSTon;
|
||||
}
|
||||
|
||||
break;
|
||||
@@ -1700,13 +1705,22 @@ yyreduce:
|
||||
|
||||
{
|
||||
yyDayOrdinal = 1;
|
||||
yyDayNumber = (yyvsp[-1].Number);
|
||||
yyDayNumber = (yyvsp[0].Number);
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case 22:
|
||||
|
||||
{
|
||||
yyDayOrdinal = 1;
|
||||
yyDayNumber = (yyvsp[-1].Number);
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case 23:
|
||||
|
||||
{
|
||||
yyDayOrdinal = (yyvsp[-1].Number);
|
||||
yyDayNumber = (yyvsp[0].Number);
|
||||
@@ -1714,7 +1728,7 @@ yyreduce:
|
||||
|
||||
break;
|
||||
|
||||
case 23:
|
||||
case 24:
|
||||
|
||||
{
|
||||
yyDayOrdinal = (yyvsp[-2].Number) * (yyvsp[-1].Number);
|
||||
@@ -1723,7 +1737,7 @@ yyreduce:
|
||||
|
||||
break;
|
||||
|
||||
case 24:
|
||||
case 25:
|
||||
|
||||
{
|
||||
yyDayOrdinal = 2;
|
||||
@@ -1732,7 +1746,7 @@ yyreduce:
|
||||
|
||||
break;
|
||||
|
||||
case 25:
|
||||
case 26:
|
||||
|
||||
{
|
||||
yyMonth = (yyvsp[-2].Number);
|
||||
@@ -1741,7 +1755,7 @@ yyreduce:
|
||||
|
||||
break;
|
||||
|
||||
case 26:
|
||||
case 27:
|
||||
|
||||
{
|
||||
yyMonth = (yyvsp[-4].Number);
|
||||
@@ -1751,7 +1765,7 @@ yyreduce:
|
||||
|
||||
break;
|
||||
|
||||
case 27:
|
||||
case 28:
|
||||
|
||||
{
|
||||
yyYear = (yyvsp[0].Number) / 10000;
|
||||
@@ -1761,7 +1775,7 @@ yyreduce:
|
||||
|
||||
break;
|
||||
|
||||
case 28:
|
||||
case 29:
|
||||
|
||||
{
|
||||
yyDay = (yyvsp[-4].Number);
|
||||
@@ -1771,7 +1785,7 @@ yyreduce:
|
||||
|
||||
break;
|
||||
|
||||
case 29:
|
||||
case 30:
|
||||
|
||||
{
|
||||
yyMonth = (yyvsp[-2].Number);
|
||||
@@ -1781,7 +1795,7 @@ yyreduce:
|
||||
|
||||
break;
|
||||
|
||||
case 30:
|
||||
case 31:
|
||||
|
||||
{
|
||||
yyMonth = (yyvsp[-1].Number);
|
||||
@@ -1790,7 +1804,7 @@ yyreduce:
|
||||
|
||||
break;
|
||||
|
||||
case 31:
|
||||
case 32:
|
||||
|
||||
{
|
||||
yyMonth = (yyvsp[-3].Number);
|
||||
@@ -1800,7 +1814,7 @@ yyreduce:
|
||||
|
||||
break;
|
||||
|
||||
case 32:
|
||||
case 33:
|
||||
|
||||
{
|
||||
yyMonth = (yyvsp[0].Number);
|
||||
@@ -1809,7 +1823,7 @@ yyreduce:
|
||||
|
||||
break;
|
||||
|
||||
case 33:
|
||||
case 34:
|
||||
|
||||
{
|
||||
yyMonth = 1;
|
||||
@@ -1819,7 +1833,7 @@ yyreduce:
|
||||
|
||||
break;
|
||||
|
||||
case 34:
|
||||
case 35:
|
||||
|
||||
{
|
||||
yyMonth = (yyvsp[-1].Number);
|
||||
@@ -1829,7 +1843,7 @@ yyreduce:
|
||||
|
||||
break;
|
||||
|
||||
case 35:
|
||||
case 36:
|
||||
|
||||
{
|
||||
yyMonthOrdinal = 1;
|
||||
@@ -1838,7 +1852,7 @@ yyreduce:
|
||||
|
||||
break;
|
||||
|
||||
case 36:
|
||||
case 37:
|
||||
|
||||
{
|
||||
yyMonthOrdinal = (yyvsp[-1].Number);
|
||||
@@ -1847,24 +1861,10 @@ yyreduce:
|
||||
|
||||
break;
|
||||
|
||||
case 37:
|
||||
|
||||
{
|
||||
if ((yyvsp[-5].Number) != HOUR( 7) + HOUR(100)) YYABORT;
|
||||
yyYear = (yyvsp[-10].Number);
|
||||
yyMonth = (yyvsp[-8].Number);
|
||||
yyDay = (yyvsp[-6].Number);
|
||||
yyHour = (yyvsp[-4].Number);
|
||||
yyMinutes = (yyvsp[-2].Number);
|
||||
yySeconds = (yyvsp[0].Number);
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case 38:
|
||||
|
||||
{
|
||||
if ((yyvsp[-1].Number) != HOUR( 7) + HOUR(100)) YYABORT;
|
||||
if ((yyvsp[-1].Number) != HOUR( 7)) YYABORT;
|
||||
yyYear = (yyvsp[-2].Number) / 10000;
|
||||
yyMonth = ((yyvsp[-2].Number) % 10000)/100;
|
||||
yyDay = (yyvsp[-2].Number) % 100;
|
||||
@@ -1878,7 +1878,7 @@ yyreduce:
|
||||
case 39:
|
||||
|
||||
{
|
||||
if ((yyvsp[-5].Number) != HOUR( 7) + HOUR(100)) YYABORT;
|
||||
if ((yyvsp[-5].Number) != HOUR( 7)) YYABORT;
|
||||
yyYear = (yyvsp[-6].Number) / 10000;
|
||||
yyMonth = ((yyvsp[-6].Number) % 10000)/100;
|
||||
yyDay = (yyvsp[-6].Number) % 100;
|
||||
@@ -2459,31 +2459,31 @@ static const TABLE TimezoneTable[] = {
|
||||
*/
|
||||
|
||||
static const TABLE MilitaryTable[] = {
|
||||
{ "a", tZONE, -HOUR( 1) + HOUR(100) },
|
||||
{ "b", tZONE, -HOUR( 2) + HOUR(100) },
|
||||
{ "c", tZONE, -HOUR( 3) + HOUR(100) },
|
||||
{ "d", tZONE, -HOUR( 4) + HOUR(100) },
|
||||
{ "e", tZONE, -HOUR( 5) + HOUR(100) },
|
||||
{ "f", tZONE, -HOUR( 6) + HOUR(100) },
|
||||
{ "g", tZONE, -HOUR( 7) + HOUR(100) },
|
||||
{ "h", tZONE, -HOUR( 8) + HOUR(100) },
|
||||
{ "i", tZONE, -HOUR( 9) + HOUR(100) },
|
||||
{ "k", tZONE, -HOUR(10) + HOUR(100) },
|
||||
{ "l", tZONE, -HOUR(11) + HOUR(100) },
|
||||
{ "m", tZONE, -HOUR(12) + HOUR(100) },
|
||||
{ "n", tZONE, HOUR( 1) + HOUR(100) },
|
||||
{ "o", tZONE, HOUR( 2) + HOUR(100) },
|
||||
{ "p", tZONE, HOUR( 3) + HOUR(100) },
|
||||
{ "q", tZONE, HOUR( 4) + HOUR(100) },
|
||||
{ "r", tZONE, HOUR( 5) + HOUR(100) },
|
||||
{ "s", tZONE, HOUR( 6) + HOUR(100) },
|
||||
{ "t", tZONE, HOUR( 7) + HOUR(100) },
|
||||
{ "u", tZONE, HOUR( 8) + HOUR(100) },
|
||||
{ "v", tZONE, HOUR( 9) + HOUR(100) },
|
||||
{ "w", tZONE, HOUR( 10) + HOUR(100) },
|
||||
{ "x", tZONE, HOUR( 11) + HOUR(100) },
|
||||
{ "y", tZONE, HOUR( 12) + HOUR(100) },
|
||||
{ "z", tZONE, HOUR( 0) + HOUR(100) },
|
||||
{ "a", tZONE, -HOUR( 1) },
|
||||
{ "b", tZONE, -HOUR( 2) },
|
||||
{ "c", tZONE, -HOUR( 3) },
|
||||
{ "d", tZONE, -HOUR( 4) },
|
||||
{ "e", tZONE, -HOUR( 5) },
|
||||
{ "f", tZONE, -HOUR( 6) },
|
||||
{ "g", tZONE, -HOUR( 7) },
|
||||
{ "h", tZONE, -HOUR( 8) },
|
||||
{ "i", tZONE, -HOUR( 9) },
|
||||
{ "k", tZONE, -HOUR(10) },
|
||||
{ "l", tZONE, -HOUR(11) },
|
||||
{ "m", tZONE, -HOUR(12) },
|
||||
{ "n", tZONE, HOUR( 1) },
|
||||
{ "o", tZONE, HOUR( 2) },
|
||||
{ "p", tZONE, HOUR( 3) },
|
||||
{ "q", tZONE, HOUR( 4) },
|
||||
{ "r", tZONE, HOUR( 5) },
|
||||
{ "s", tZONE, HOUR( 6) },
|
||||
{ "t", tZONE, HOUR( 7) },
|
||||
{ "u", tZONE, HOUR( 8) },
|
||||
{ "v", tZONE, HOUR( 9) },
|
||||
{ "w", tZONE, HOUR( 10) },
|
||||
{ "x", tZONE, HOUR( 11) },
|
||||
{ "y", tZONE, HOUR( 12) },
|
||||
{ "z", tZONE, HOUR( 0) },
|
||||
{ NULL, 0, 0 }
|
||||
};
|
||||
|
||||
@@ -2501,12 +2501,12 @@ TclDateerror(
|
||||
Tcl_AppendToObj(infoPtr->messages, infoPtr->separatrix, -1);
|
||||
Tcl_AppendToObj(infoPtr->messages, s, -1);
|
||||
Tcl_AppendToObj(infoPtr->messages, " (characters ", -1);
|
||||
TclNewIntObj(t, location->first_column);
|
||||
t = Tcl_NewIntObj(location->first_column);
|
||||
Tcl_IncrRefCount(t);
|
||||
Tcl_AppendObjToObj(infoPtr->messages, t);
|
||||
Tcl_DecrRefCount(t);
|
||||
Tcl_AppendToObj(infoPtr->messages, "-", -1);
|
||||
TclNewIntObj(t, location->last_column);
|
||||
t = Tcl_NewIntObj(location->last_column);
|
||||
Tcl_IncrRefCount(t);
|
||||
Tcl_AppendObjToObj(infoPtr->messages, t);
|
||||
Tcl_DecrRefCount(t);
|
||||
@@ -2681,7 +2681,7 @@ TclDatelex(
|
||||
|
||||
location->first_column = yyInput - info->dateStart;
|
||||
for ( ; ; ) {
|
||||
while (TclIsSpaceProcM(*yyInput)) {
|
||||
while (TclIsSpaceProc(UCHAR(*yyInput))) {
|
||||
yyInput++;
|
||||
}
|
||||
|
||||
@@ -2744,7 +2744,7 @@ TclDatelex(
|
||||
|
||||
int
|
||||
TclClockOldscanObjCmd(
|
||||
TCL_UNUSED(void *),
|
||||
TCL_UNUSED(ClientData),
|
||||
Tcl_Interp *interp, /* Tcl interpreter */
|
||||
int objc, /* Count of paraneters */
|
||||
Tcl_Obj *const *objv) /* Parameters */
|
||||
@@ -2787,7 +2787,7 @@ TclClockOldscanObjCmd(
|
||||
yyHaveRel = 0;
|
||||
yyRelMonth = 0; yyRelDay = 0; yyRelSeconds = 0; yyRelPointer = NULL;
|
||||
|
||||
TclNewObj(dateInfo.messages);
|
||||
dateInfo.messages = Tcl_NewObj();
|
||||
dateInfo.separatrix = "";
|
||||
Tcl_IncrRefCount(dateInfo.messages);
|
||||
|
||||
@@ -2844,8 +2844,8 @@ TclClockOldscanObjCmd(
|
||||
return TCL_ERROR;
|
||||
}
|
||||
|
||||
TclNewObj(result);
|
||||
TclNewObj(resultElement);
|
||||
result = Tcl_NewObj();
|
||||
resultElement = Tcl_NewObj();
|
||||
if (yyHaveDate) {
|
||||
Tcl_ListObjAppendElement(interp, resultElement,
|
||||
Tcl_NewIntObj((int) yyYear));
|
||||
@@ -2863,7 +2863,7 @@ TclClockOldscanObjCmd(
|
||||
Tcl_ListObjAppendElement(interp, result, Tcl_NewObj());
|
||||
}
|
||||
|
||||
TclNewObj(resultElement);
|
||||
resultElement = Tcl_NewObj();
|
||||
if (yyHaveZone) {
|
||||
Tcl_ListObjAppendElement(interp, resultElement,
|
||||
Tcl_NewIntObj((int) -yyTimezone));
|
||||
@@ -2872,7 +2872,7 @@ TclClockOldscanObjCmd(
|
||||
}
|
||||
Tcl_ListObjAppendElement(interp, result, resultElement);
|
||||
|
||||
TclNewObj(resultElement);
|
||||
resultElement = Tcl_NewObj();
|
||||
if (yyHaveRel) {
|
||||
Tcl_ListObjAppendElement(interp, resultElement,
|
||||
Tcl_NewIntObj((int) yyRelMonth));
|
||||
@@ -2883,7 +2883,7 @@ TclClockOldscanObjCmd(
|
||||
}
|
||||
Tcl_ListObjAppendElement(interp, result, resultElement);
|
||||
|
||||
TclNewObj(resultElement);
|
||||
resultElement = Tcl_NewObj();
|
||||
if (yyHaveDay && !yyHaveDate) {
|
||||
Tcl_ListObjAppendElement(interp, resultElement,
|
||||
Tcl_NewIntObj((int) yyDayOrdinal));
|
||||
@@ -2892,7 +2892,7 @@ TclClockOldscanObjCmd(
|
||||
}
|
||||
Tcl_ListObjAppendElement(interp, result, resultElement);
|
||||
|
||||
TclNewObj(resultElement);
|
||||
resultElement = Tcl_NewObj();
|
||||
if (yyHaveOrdinalMonth) {
|
||||
Tcl_ListObjAppendElement(interp, resultElement,
|
||||
Tcl_NewIntObj((int) yyMonthOrdinal));
|
||||
|
||||
+27
-35
@@ -300,13 +300,13 @@ EXTERN int Tcl_ConvertElement(const char *src, char *dst,
|
||||
EXTERN int Tcl_ConvertCountedElement(const char *src,
|
||||
int length, char *dst, int flags);
|
||||
/* 86 */
|
||||
EXTERN int Tcl_CreateAlias(Tcl_Interp *childInterp,
|
||||
const char *childCmd, Tcl_Interp *target,
|
||||
EXTERN int Tcl_CreateAlias(Tcl_Interp *slave,
|
||||
const char *slaveCmd, Tcl_Interp *target,
|
||||
const char *targetCmd, int argc,
|
||||
const char *const *argv);
|
||||
/* 87 */
|
||||
EXTERN int Tcl_CreateAliasObj(Tcl_Interp *childInterp,
|
||||
const char *childCmd, Tcl_Interp *target,
|
||||
EXTERN int Tcl_CreateAliasObj(Tcl_Interp *slave,
|
||||
const char *slaveCmd, Tcl_Interp *target,
|
||||
const char *targetCmd, int objc,
|
||||
Tcl_Obj *const objv[]);
|
||||
/* 88 */
|
||||
@@ -345,8 +345,8 @@ EXTERN Tcl_Command Tcl_CreateObjCommand(Tcl_Interp *interp,
|
||||
ClientData clientData,
|
||||
Tcl_CmdDeleteProc *deleteProc);
|
||||
/* 97 */
|
||||
EXTERN Tcl_Interp * Tcl_CreateChild(Tcl_Interp *interp, const char *name,
|
||||
int isSafe);
|
||||
EXTERN Tcl_Interp * Tcl_CreateSlave(Tcl_Interp *interp,
|
||||
const char *slaveName, int isSafe);
|
||||
/* 98 */
|
||||
EXTERN Tcl_TimerToken Tcl_CreateTimerHandler(int milliseconds,
|
||||
Tcl_TimerProc *proc, ClientData clientData);
|
||||
@@ -482,13 +482,13 @@ TCL_DEPRECATED("see TIP #559. Use Tcl_ResetResult")
|
||||
void Tcl_FreeResult(Tcl_Interp *interp);
|
||||
/* 148 */
|
||||
EXTERN int Tcl_GetAlias(Tcl_Interp *interp,
|
||||
const char *childCmd,
|
||||
const char *slaveCmd,
|
||||
Tcl_Interp **targetInterpPtr,
|
||||
const char **targetCmdPtr, int *argcPtr,
|
||||
const char ***argvPtr);
|
||||
/* 149 */
|
||||
EXTERN int Tcl_GetAliasObj(Tcl_Interp *interp,
|
||||
const char *childCmd,
|
||||
const char *slaveCmd,
|
||||
Tcl_Interp **targetInterpPtr,
|
||||
const char **targetCmdPtr, int *objcPtr,
|
||||
Tcl_Obj ***objv);
|
||||
@@ -527,10 +527,10 @@ EXTERN int Tcl_GetErrno(void);
|
||||
/* 162 */
|
||||
EXTERN const char * Tcl_GetHostName(void);
|
||||
/* 163 */
|
||||
EXTERN int Tcl_GetInterpPath(Tcl_Interp *interp,
|
||||
Tcl_Interp *childInterp);
|
||||
EXTERN int Tcl_GetInterpPath(Tcl_Interp *askInterp,
|
||||
Tcl_Interp *slaveInterp);
|
||||
/* 164 */
|
||||
EXTERN Tcl_Interp * Tcl_GetParent(Tcl_Interp *interp);
|
||||
EXTERN Tcl_Interp * Tcl_GetMaster(Tcl_Interp *interp);
|
||||
/* 165 */
|
||||
EXTERN const char * Tcl_GetNameOfExecutable(void);
|
||||
/* 166 */
|
||||
@@ -556,7 +556,8 @@ EXTERN int Tcl_GetsObj(Tcl_Channel chan, Tcl_Obj *objPtr);
|
||||
/* 171 */
|
||||
EXTERN int Tcl_GetServiceMode(void);
|
||||
/* 172 */
|
||||
EXTERN Tcl_Interp * Tcl_GetChild(Tcl_Interp *interp, const char *name);
|
||||
EXTERN Tcl_Interp * Tcl_GetSlave(Tcl_Interp *interp,
|
||||
const char *slaveName);
|
||||
/* 173 */
|
||||
EXTERN Tcl_Channel Tcl_GetStdChannel(int type);
|
||||
/* 174 */
|
||||
@@ -2033,8 +2034,8 @@ typedef struct TclStubs {
|
||||
char * (*tcl_Concat) (int argc, const char *const *argv); /* 83 */
|
||||
int (*tcl_ConvertElement) (const char *src, char *dst, int flags); /* 84 */
|
||||
int (*tcl_ConvertCountedElement) (const char *src, int length, char *dst, int flags); /* 85 */
|
||||
int (*tcl_CreateAlias) (Tcl_Interp *childInterp, const char *childCmd, Tcl_Interp *target, const char *targetCmd, int argc, const char *const *argv); /* 86 */
|
||||
int (*tcl_CreateAliasObj) (Tcl_Interp *childInterp, const char *childCmd, Tcl_Interp *target, const char *targetCmd, int objc, Tcl_Obj *const objv[]); /* 87 */
|
||||
int (*tcl_CreateAlias) (Tcl_Interp *slave, const char *slaveCmd, Tcl_Interp *target, const char *targetCmd, int argc, const char *const *argv); /* 86 */
|
||||
int (*tcl_CreateAliasObj) (Tcl_Interp *slave, const char *slaveCmd, Tcl_Interp *target, const char *targetCmd, int objc, Tcl_Obj *const objv[]); /* 87 */
|
||||
Tcl_Channel (*tcl_CreateChannel) (const Tcl_ChannelType *typePtr, const char *chanName, ClientData instanceData, int mask); /* 88 */
|
||||
void (*tcl_CreateChannelHandler) (Tcl_Channel chan, int mask, Tcl_ChannelProc *proc, ClientData clientData); /* 89 */
|
||||
void (*tcl_CreateCloseHandler) (Tcl_Channel chan, Tcl_CloseProc *proc, ClientData clientData); /* 90 */
|
||||
@@ -2044,7 +2045,7 @@ typedef struct TclStubs {
|
||||
Tcl_Interp * (*tcl_CreateInterp) (void); /* 94 */
|
||||
TCL_DEPRECATED_API("") void (*tcl_CreateMathFunc) (Tcl_Interp *interp, const char *name, int numArgs, Tcl_ValueType *argTypes, Tcl_MathProc *proc, ClientData clientData); /* 95 */
|
||||
Tcl_Command (*tcl_CreateObjCommand) (Tcl_Interp *interp, const char *cmdName, Tcl_ObjCmdProc *proc, ClientData clientData, Tcl_CmdDeleteProc *deleteProc); /* 96 */
|
||||
Tcl_Interp * (*tcl_CreateChild) (Tcl_Interp *interp, const char *name, int isSafe); /* 97 */
|
||||
Tcl_Interp * (*tcl_CreateSlave) (Tcl_Interp *interp, const char *slaveName, int isSafe); /* 97 */
|
||||
Tcl_TimerToken (*tcl_CreateTimerHandler) (int milliseconds, Tcl_TimerProc *proc, ClientData clientData); /* 98 */
|
||||
Tcl_Trace (*tcl_CreateTrace) (Tcl_Interp *interp, int level, Tcl_CmdTraceProc *proc, ClientData clientData); /* 99 */
|
||||
void (*tcl_DeleteAssocData) (Tcl_Interp *interp, const char *name); /* 100 */
|
||||
@@ -2095,8 +2096,8 @@ typedef struct TclStubs {
|
||||
Tcl_HashEntry * (*tcl_FirstHashEntry) (Tcl_HashTable *tablePtr, Tcl_HashSearch *searchPtr); /* 145 */
|
||||
int (*tcl_Flush) (Tcl_Channel chan); /* 146 */
|
||||
TCL_DEPRECATED_API("see TIP #559. Use Tcl_ResetResult") void (*tcl_FreeResult) (Tcl_Interp *interp); /* 147 */
|
||||
int (*tcl_GetAlias) (Tcl_Interp *interp, const char *childCmd, Tcl_Interp **targetInterpPtr, const char **targetCmdPtr, int *argcPtr, const char ***argvPtr); /* 148 */
|
||||
int (*tcl_GetAliasObj) (Tcl_Interp *interp, const char *childCmd, Tcl_Interp **targetInterpPtr, const char **targetCmdPtr, int *objcPtr, Tcl_Obj ***objv); /* 149 */
|
||||
int (*tcl_GetAlias) (Tcl_Interp *interp, const char *slaveCmd, Tcl_Interp **targetInterpPtr, const char **targetCmdPtr, int *argcPtr, const char ***argvPtr); /* 148 */
|
||||
int (*tcl_GetAliasObj) (Tcl_Interp *interp, const char *slaveCmd, Tcl_Interp **targetInterpPtr, const char **targetCmdPtr, int *objcPtr, Tcl_Obj ***objv); /* 149 */
|
||||
ClientData (*tcl_GetAssocData) (Tcl_Interp *interp, const char *name, Tcl_InterpDeleteProc **procPtr); /* 150 */
|
||||
Tcl_Channel (*tcl_GetChannel) (Tcl_Interp *interp, const char *chanName, int *modePtr); /* 151 */
|
||||
int (*tcl_GetChannelBufferSize) (Tcl_Channel chan); /* 152 */
|
||||
@@ -2110,8 +2111,8 @@ typedef struct TclStubs {
|
||||
const char * (*tcl_GetCommandName) (Tcl_Interp *interp, Tcl_Command command); /* 160 */
|
||||
int (*tcl_GetErrno) (void); /* 161 */
|
||||
const char * (*tcl_GetHostName) (void); /* 162 */
|
||||
int (*tcl_GetInterpPath) (Tcl_Interp *interp, Tcl_Interp *childInterp); /* 163 */
|
||||
Tcl_Interp * (*tcl_GetParent) (Tcl_Interp *interp); /* 164 */
|
||||
int (*tcl_GetInterpPath) (Tcl_Interp *askInterp, Tcl_Interp *slaveInterp); /* 163 */
|
||||
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 */
|
||||
@@ -2127,7 +2128,7 @@ typedef struct TclStubs {
|
||||
int (*tcl_Gets) (Tcl_Channel chan, Tcl_DString *dsPtr); /* 169 */
|
||||
int (*tcl_GetsObj) (Tcl_Channel chan, Tcl_Obj *objPtr); /* 170 */
|
||||
int (*tcl_GetServiceMode) (void); /* 171 */
|
||||
Tcl_Interp * (*tcl_GetChild) (Tcl_Interp *interp, const char *name); /* 172 */
|
||||
Tcl_Interp * (*tcl_GetSlave) (Tcl_Interp *interp, const char *slaveName); /* 172 */
|
||||
Tcl_Channel (*tcl_GetStdChannel) (int type); /* 173 */
|
||||
const char * (*tcl_GetStringResult) (Tcl_Interp *interp); /* 174 */
|
||||
TCL_DEPRECATED_API("No longer in use, changed to macro") const char * (*tcl_GetVar) (Tcl_Interp *interp, const char *varName, int flags); /* 175 */
|
||||
@@ -2824,8 +2825,8 @@ extern const TclStubs *tclStubsPtr;
|
||||
(tclStubsPtr->tcl_CreateMathFunc) /* 95 */
|
||||
#define Tcl_CreateObjCommand \
|
||||
(tclStubsPtr->tcl_CreateObjCommand) /* 96 */
|
||||
#define Tcl_CreateChild \
|
||||
(tclStubsPtr->tcl_CreateChild) /* 97 */
|
||||
#define Tcl_CreateSlave \
|
||||
(tclStubsPtr->tcl_CreateSlave) /* 97 */
|
||||
#define Tcl_CreateTimerHandler \
|
||||
(tclStubsPtr->tcl_CreateTimerHandler) /* 98 */
|
||||
#define Tcl_CreateTrace \
|
||||
@@ -2958,8 +2959,8 @@ extern const TclStubs *tclStubsPtr;
|
||||
(tclStubsPtr->tcl_GetHostName) /* 162 */
|
||||
#define Tcl_GetInterpPath \
|
||||
(tclStubsPtr->tcl_GetInterpPath) /* 163 */
|
||||
#define Tcl_GetParent \
|
||||
(tclStubsPtr->tcl_GetParent) /* 164 */
|
||||
#define Tcl_GetMaster \
|
||||
(tclStubsPtr->tcl_GetMaster) /* 164 */
|
||||
#define Tcl_GetNameOfExecutable \
|
||||
(tclStubsPtr->tcl_GetNameOfExecutable) /* 165 */
|
||||
#define Tcl_GetObjResult \
|
||||
@@ -2980,8 +2981,8 @@ extern const TclStubs *tclStubsPtr;
|
||||
(tclStubsPtr->tcl_GetsObj) /* 170 */
|
||||
#define Tcl_GetServiceMode \
|
||||
(tclStubsPtr->tcl_GetServiceMode) /* 171 */
|
||||
#define Tcl_GetChild \
|
||||
(tclStubsPtr->tcl_GetChild) /* 172 */
|
||||
#define Tcl_GetSlave \
|
||||
(tclStubsPtr->tcl_GetSlave) /* 172 */
|
||||
#define Tcl_GetStdChannel \
|
||||
(tclStubsPtr->tcl_GetStdChannel) /* 173 */
|
||||
#define Tcl_GetStringResult \
|
||||
@@ -4177,13 +4178,4 @@ extern const TclStubs *tclStubsPtr;
|
||||
#define Tcl_Close(interp, chan) Tcl_CloseEx(interp, chan, 0)
|
||||
#endif
|
||||
|
||||
#if defined(USE_TCL_STUBS) && (TCL_UTF_MAX > 3)
|
||||
# undef Tcl_UtfCharComplete
|
||||
# define Tcl_UtfCharComplete(src, length) (((unsigned)((unsigned char)*(src) - 0xF0) < 5) \
|
||||
? ((length) >= 4) : tclStubsPtr->tcl_UtfCharComplete((src), (length)))
|
||||
#endif
|
||||
#define Tcl_CreateSlave Tcl_CreateChild
|
||||
#define Tcl_GetSlave Tcl_GetChild
|
||||
#define Tcl_GetMaster Tcl_GetParent
|
||||
|
||||
#endif /* _TCLDECLS */
|
||||
|
||||
@@ -2037,7 +2037,7 @@ DictSizeCmd(
|
||||
}
|
||||
result = Tcl_DictObjSize(interp, objv[1], &size);
|
||||
if (result == TCL_OK) {
|
||||
Tcl_SetObjResult(interp, Tcl_NewWideIntObj(size));
|
||||
Tcl_SetObjResult(interp, Tcl_NewIntObj(size));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -2212,7 +2212,7 @@ DictIncrCmd(
|
||||
Tcl_DictObjPut(NULL, dictPtr, objv[2], objv[3]);
|
||||
}
|
||||
} else {
|
||||
Tcl_DictObjPut(NULL, dictPtr, objv[2], Tcl_NewWideIntObj(1));
|
||||
Tcl_DictObjPut(NULL, dictPtr, objv[2], Tcl_NewIntObj(1));
|
||||
}
|
||||
} else {
|
||||
/*
|
||||
@@ -2226,9 +2226,8 @@ DictIncrCmd(
|
||||
if (objc == 4) {
|
||||
code = TclIncrObj(interp, valuePtr, objv[3]);
|
||||
} else {
|
||||
Tcl_Obj *incrPtr;
|
||||
Tcl_Obj *incrPtr = Tcl_NewIntObj(1);
|
||||
|
||||
TclNewIntObj(incrPtr, 1);
|
||||
Tcl_IncrRefCount(incrPtr);
|
||||
code = TclIncrObj(interp, valuePtr, incrPtr);
|
||||
TclDecrRefCount(incrPtr);
|
||||
|
||||
+46
-35
@@ -284,7 +284,7 @@ DisassembleByteCodeObj(
|
||||
PrintSourceToObj(bufferObj, codePtr->source,
|
||||
TclMin(codePtr->numSrcBytes, 55));
|
||||
GetLocationInformation(codePtr->procPtr, &fileObj, &line);
|
||||
if (line >= 0 && fileObj != NULL) {
|
||||
if (line > -1 && fileObj != NULL) {
|
||||
Tcl_AppendPrintfToObj(bufferObj, "\n File \"%s\" Line %d",
|
||||
Tcl_GetString(fileObj), line);
|
||||
}
|
||||
@@ -804,9 +804,8 @@ Tcl_Obj *
|
||||
TclNewInstNameObj(
|
||||
unsigned char inst)
|
||||
{
|
||||
Tcl_Obj *objPtr;
|
||||
Tcl_Obj *objPtr = Tcl_NewObj();
|
||||
|
||||
TclNewObj(objPtr);
|
||||
TclInvalidateStringRep(objPtr);
|
||||
InstNameSetIntRep(objPtr, (long) inst);
|
||||
|
||||
@@ -863,6 +862,7 @@ PrintSourceToObj(
|
||||
{
|
||||
const char *p;
|
||||
int i = 0, len;
|
||||
Tcl_UniChar ch = 0;
|
||||
|
||||
if (stringPtr == NULL) {
|
||||
Tcl_AppendToObj(appendObj, "\"\"", -1);
|
||||
@@ -872,10 +872,9 @@ PrintSourceToObj(
|
||||
Tcl_AppendToObj(appendObj, "\"", -1);
|
||||
p = stringPtr;
|
||||
for (; (*p != '\0') && (i < maxChars); p+=len) {
|
||||
int ucs4;
|
||||
|
||||
len = TclUtfToUCS4(p, &ucs4);
|
||||
switch (ucs4) {
|
||||
len = TclUtfToUniChar(p, &ch);
|
||||
switch (ch) {
|
||||
case '"':
|
||||
Tcl_AppendToObj(appendObj, "\\\"", -1);
|
||||
i += 2;
|
||||
@@ -901,14 +900,28 @@ PrintSourceToObj(
|
||||
i += 2;
|
||||
continue;
|
||||
default:
|
||||
if (ucs4 > 0xFFFF) {
|
||||
Tcl_AppendPrintfToObj(appendObj, "\\U%08x", ucs4);
|
||||
#if TCL_UTF_MAX > 3
|
||||
if (ch > 0xFFFF) {
|
||||
Tcl_AppendPrintfToObj(appendObj, "\\U%08x", ch);
|
||||
i += 10;
|
||||
} else if (ucs4 < 0x20 || ucs4 >= 0x7F) {
|
||||
Tcl_AppendPrintfToObj(appendObj, "\\u%04x", ucs4);
|
||||
} else
|
||||
#else
|
||||
/* If len == 0, this means we have a char > 0xFFFF, resulting in
|
||||
* TclUtfToUniChar producing a surrogate pair. We want to output
|
||||
* this pair as a single Unicode character.
|
||||
*/
|
||||
if (len == 0) {
|
||||
int upper = ((ch & 0x3FF) + 1) << 10;
|
||||
len = TclUtfToUniChar(p, &ch);
|
||||
Tcl_AppendPrintfToObj(appendObj, "\\U%08x", upper + (ch & 0x3FF));
|
||||
i += 10;
|
||||
} else
|
||||
#endif
|
||||
if (ch < 0x20 || ch >= 0x7F) {
|
||||
Tcl_AppendPrintfToObj(appendObj, "\\u%04x", ch);
|
||||
i += 6;
|
||||
} else {
|
||||
Tcl_AppendPrintfToObj(appendObj, "%c", ucs4);
|
||||
Tcl_AppendPrintfToObj(appendObj, "%c", ch);
|
||||
i++;
|
||||
}
|
||||
continue;
|
||||
@@ -951,7 +964,7 @@ DisassembleByteCodeAsDicts(
|
||||
* Get the literals from the bytecode.
|
||||
*/
|
||||
|
||||
TclNewObj(literals);
|
||||
literals = Tcl_NewObj();
|
||||
for (i=0 ; i<codePtr->numLitObjects ; i++) {
|
||||
Tcl_ListObjAppendElement(NULL, literals, codePtr->objArrayPtr[i]);
|
||||
}
|
||||
@@ -960,7 +973,7 @@ DisassembleByteCodeAsDicts(
|
||||
* Get the variables from the bytecode.
|
||||
*/
|
||||
|
||||
TclNewObj(variables);
|
||||
variables = Tcl_NewObj();
|
||||
if (codePtr->procPtr) {
|
||||
int localCount = codePtr->procPtr->numCompiledLocals;
|
||||
CompiledLocal *localPtr = codePtr->procPtr->firstLocalPtr;
|
||||
@@ -968,7 +981,7 @@ DisassembleByteCodeAsDicts(
|
||||
for (i=0 ; i<localCount ; i++,localPtr=localPtr->nextPtr) {
|
||||
Tcl_Obj *descriptor[2];
|
||||
|
||||
TclNewObj(descriptor[0]);
|
||||
descriptor[0] = Tcl_NewObj();
|
||||
if (!(localPtr->flags & (VAR_ARRAY|VAR_LINK))) {
|
||||
Tcl_ListObjAppendElement(NULL, descriptor[0],
|
||||
Tcl_NewStringObj("scalar", -1));
|
||||
@@ -1008,12 +1021,12 @@ DisassembleByteCodeAsDicts(
|
||||
* Get the instructions from the bytecode.
|
||||
*/
|
||||
|
||||
TclNewObj(instructions);
|
||||
instructions = Tcl_NewObj();
|
||||
for (pc=codePtr->codeStart; pc<codePtr->codeStart+codePtr->numCodeBytes;){
|
||||
const InstructionDesc *instDesc = &tclInstructionTable[*pc];
|
||||
int address = pc - codePtr->codeStart;
|
||||
|
||||
TclNewObj(inst);
|
||||
inst = Tcl_NewObj();
|
||||
Tcl_ListObjAppendElement(NULL, inst, Tcl_NewStringObj(
|
||||
instDesc->name, -1));
|
||||
opnd = pc + 1;
|
||||
@@ -1035,7 +1048,7 @@ DisassembleByteCodeAsDicts(
|
||||
val = TclGetUInt4AtPtr(opnd);
|
||||
opnd += 4;
|
||||
formatNumber:
|
||||
Tcl_ListObjAppendElement(NULL, inst, Tcl_NewWideIntObj(val));
|
||||
Tcl_ListObjAppendElement(NULL, inst, Tcl_NewIntObj(val));
|
||||
break;
|
||||
|
||||
case OPERAND_OFFSET1:
|
||||
@@ -1103,7 +1116,7 @@ DisassembleByteCodeAsDicts(
|
||||
Tcl_Panic("opcode %d with more than zero 'no' operands", *pc);
|
||||
}
|
||||
}
|
||||
Tcl_DictObjPut(NULL, instructions, Tcl_NewWideIntObj(address), inst);
|
||||
Tcl_DictObjPut(NULL, instructions, Tcl_NewIntObj(address), inst);
|
||||
pc += instDesc->numBytes;
|
||||
}
|
||||
|
||||
@@ -1111,23 +1124,21 @@ DisassembleByteCodeAsDicts(
|
||||
* Get the auxiliary data from the bytecode.
|
||||
*/
|
||||
|
||||
TclNewObj(aux);
|
||||
aux = Tcl_NewObj();
|
||||
for (i=0 ; i<codePtr->numAuxDataItems ; i++) {
|
||||
AuxData *auxData = &codePtr->auxDataArrayPtr[i];
|
||||
Tcl_Obj *auxDesc = Tcl_NewStringObj(auxData->type->name, -1);
|
||||
|
||||
if (auxData->type->disassembleProc) {
|
||||
Tcl_Obj *desc;
|
||||
Tcl_Obj *desc = Tcl_NewObj();
|
||||
|
||||
TclNewObj(desc);
|
||||
Tcl_DictObjPut(NULL, desc, Tcl_NewStringObj("name", -1), auxDesc);
|
||||
auxDesc = desc;
|
||||
auxData->type->disassembleProc(auxData->clientData, auxDesc,
|
||||
codePtr, 0);
|
||||
} else if (auxData->type->printProc) {
|
||||
Tcl_Obj *desc;
|
||||
Tcl_Obj *desc = Tcl_NewObj();
|
||||
|
||||
TclNewObj(desc);
|
||||
auxData->type->printProc(auxData->clientData, desc, codePtr, 0);
|
||||
Tcl_ListObjAppendElement(NULL, auxDesc, desc);
|
||||
}
|
||||
@@ -1138,7 +1149,7 @@ DisassembleByteCodeAsDicts(
|
||||
* Get the exception ranges from the bytecode.
|
||||
*/
|
||||
|
||||
TclNewObj(exn);
|
||||
exn = Tcl_NewObj();
|
||||
for (i=0 ; i<codePtr->numExceptRanges ; i++) {
|
||||
ExceptionRange *rangePtr = &codePtr->exceptArrayPtr[i];
|
||||
|
||||
@@ -1173,7 +1184,7 @@ DisassembleByteCodeAsDicts(
|
||||
? ((ptr)+=5 , TclGetInt4AtPtr((ptr)-4)) \
|
||||
: ((ptr)+=1 , TclGetInt1AtPtr((ptr)-1)))
|
||||
|
||||
TclNewObj(commands);
|
||||
commands = Tcl_NewObj();
|
||||
codeOffPtr = codePtr->codeDeltaStart;
|
||||
codeLenPtr = codePtr->codeLengthStart;
|
||||
srcOffPtr = codePtr->srcDeltaStart;
|
||||
@@ -1186,11 +1197,11 @@ DisassembleByteCodeAsDicts(
|
||||
codeLength = Decode(codeLenPtr);
|
||||
sourceOffset += Decode(srcOffPtr);
|
||||
sourceLength = Decode(srcLenPtr);
|
||||
TclNewObj(cmd);
|
||||
cmd = Tcl_NewObj();
|
||||
Tcl_DictObjPut(NULL, cmd, Tcl_NewStringObj("codefrom", -1),
|
||||
Tcl_NewWideIntObj(codeOffset));
|
||||
Tcl_NewIntObj(codeOffset));
|
||||
Tcl_DictObjPut(NULL, cmd, Tcl_NewStringObj("codeto", -1),
|
||||
Tcl_NewWideIntObj(codeOffset + codeLength - 1));
|
||||
Tcl_NewIntObj(codeOffset + codeLength - 1));
|
||||
|
||||
/*
|
||||
* Convert byte offsets to character offsets; important if multibyte
|
||||
@@ -1198,10 +1209,10 @@ DisassembleByteCodeAsDicts(
|
||||
*/
|
||||
|
||||
Tcl_DictObjPut(NULL, cmd, Tcl_NewStringObj("scriptfrom", -1),
|
||||
Tcl_NewWideIntObj(Tcl_NumUtfChars(codePtr->source,
|
||||
Tcl_NewIntObj(Tcl_NumUtfChars(codePtr->source,
|
||||
sourceOffset)));
|
||||
Tcl_DictObjPut(NULL, cmd, Tcl_NewStringObj("scriptto", -1),
|
||||
Tcl_NewWideIntObj(Tcl_NumUtfChars(codePtr->source,
|
||||
Tcl_NewIntObj(Tcl_NumUtfChars(codePtr->source,
|
||||
sourceOffset + sourceLength - 1)));
|
||||
Tcl_DictObjPut(NULL, cmd, Tcl_NewStringObj("script", -1),
|
||||
Tcl_NewStringObj(codePtr->source+sourceOffset, sourceLength));
|
||||
@@ -1221,7 +1232,7 @@ DisassembleByteCodeAsDicts(
|
||||
* Build the overall result.
|
||||
*/
|
||||
|
||||
TclNewObj(description);
|
||||
description = Tcl_NewObj();
|
||||
Tcl_DictObjPut(NULL, description, Tcl_NewStringObj("literals", -1),
|
||||
literals);
|
||||
Tcl_DictObjPut(NULL, description, Tcl_NewStringObj("variables", -1),
|
||||
@@ -1237,13 +1248,13 @@ DisassembleByteCodeAsDicts(
|
||||
Tcl_DictObjPut(NULL, description, Tcl_NewStringObj("namespace", -1),
|
||||
Tcl_NewStringObj(codePtr->nsPtr->fullName, -1));
|
||||
Tcl_DictObjPut(NULL, description, Tcl_NewStringObj("stackdepth", -1),
|
||||
Tcl_NewWideIntObj(codePtr->maxStackDepth));
|
||||
Tcl_NewIntObj(codePtr->maxStackDepth));
|
||||
Tcl_DictObjPut(NULL, description, Tcl_NewStringObj("exceptdepth", -1),
|
||||
Tcl_NewWideIntObj(codePtr->maxExceptDepth));
|
||||
if (line >= 0) {
|
||||
Tcl_NewIntObj(codePtr->maxExceptDepth));
|
||||
if (line > -1) {
|
||||
Tcl_DictObjPut(NULL, description,
|
||||
Tcl_NewStringObj("initiallinenumber", -1),
|
||||
Tcl_NewWideIntObj(line));
|
||||
Tcl_NewIntObj(line));
|
||||
}
|
||||
if (file) {
|
||||
Tcl_DictObjPut(NULL, description,
|
||||
|
||||
+18
-17
@@ -116,7 +116,7 @@ typedef struct {
|
||||
* entry in this array is 1, otherwise it is
|
||||
* 0. */
|
||||
int numSubTables; /* Length of following array. */
|
||||
EscapeSubTable subTables[TCLFLEXARRAY];/* Information about each EscapeSubTable used
|
||||
EscapeSubTable subTables[1];/* Information about each EscapeSubTable used
|
||||
* by this encoding type. The actual size is
|
||||
* as large as necessary to hold all
|
||||
* EscapeSubTables. */
|
||||
@@ -469,13 +469,12 @@ FillEncodingFileMap(void)
|
||||
*/
|
||||
|
||||
int j, numFiles;
|
||||
Tcl_Obj *directory, *matchFileList;
|
||||
Tcl_Obj *directory, *matchFileList = Tcl_NewObj();
|
||||
Tcl_Obj **filev;
|
||||
Tcl_GlobTypeData readableFiles = {
|
||||
TCL_GLOB_TYPE_FILE, TCL_GLOB_PERM_R, NULL, NULL
|
||||
};
|
||||
|
||||
TclNewObj(matchFileList);
|
||||
Tcl_ListObjIndex(NULL, searchPath, i, &directory);
|
||||
Tcl_IncrRefCount(directory);
|
||||
Tcl_IncrRefCount(matchFileList);
|
||||
@@ -916,11 +915,10 @@ Tcl_GetEncodingNames(
|
||||
Tcl_HashTable table;
|
||||
Tcl_HashSearch search;
|
||||
Tcl_HashEntry *hPtr;
|
||||
Tcl_Obj *map, *name, *result;
|
||||
Tcl_Obj *map, *name, *result = Tcl_NewObj();
|
||||
Tcl_DictSearch mapSearch;
|
||||
int dummy, done = 0;
|
||||
|
||||
TclNewObj(result);
|
||||
Tcl_InitObjHashTable(&table);
|
||||
|
||||
/*
|
||||
@@ -2055,7 +2053,7 @@ LoadEscapeEncoding(
|
||||
Tcl_DStringFree(&lineString);
|
||||
}
|
||||
|
||||
size = offsetof(EscapeEncodingData, subTables)
|
||||
size = sizeof(EscapeEncodingData) - sizeof(EscapeSubTable)
|
||||
+ Tcl_DStringLength(&escapeData);
|
||||
dataPtr = (EscapeEncodingData *)ckalloc(size);
|
||||
dataPtr->initLen = strlen(init);
|
||||
@@ -2302,7 +2300,7 @@ UtfToUtfProc(
|
||||
const char *srcStart, *srcEnd, *srcClose;
|
||||
const char *dstStart, *dstEnd;
|
||||
int result, numChars, charLimit = INT_MAX;
|
||||
int *chPtr = (int *) statePtr;
|
||||
Tcl_UniChar *chPtr = (Tcl_UniChar *) statePtr;
|
||||
|
||||
if (flags & TCL_ENCODING_START) {
|
||||
*statePtr = 0;
|
||||
@@ -2323,7 +2321,7 @@ UtfToUtfProc(
|
||||
dstEnd = dst + dstLen - TCL_UTF_MAX;
|
||||
|
||||
for (numChars = 0; src < srcEnd && numChars <= charLimit; numChars++) {
|
||||
if ((src > srcClose) && (!TclUCS4Complete(src, srcEnd - src))) {
|
||||
if ((src > srcClose) && (!Tcl_UtfCharComplete(src, srcEnd - src))) {
|
||||
/*
|
||||
* If there is more string to follow, this will ensure that the
|
||||
* last UTF-8 character in the source buffer hasn't been cut off.
|
||||
@@ -2343,7 +2341,6 @@ UtfToUtfProc(
|
||||
*/
|
||||
|
||||
*dst++ = *src++;
|
||||
*chPtr = 0; /* reset surrogate handling */
|
||||
} else if (pureNullMode == 1 && UCHAR(*src) == 0xC0 &&
|
||||
(src + 1 < srcEnd) && UCHAR(*(src+1)) == 0x80) {
|
||||
/*
|
||||
@@ -2351,25 +2348,24 @@ UtfToUtfProc(
|
||||
*/
|
||||
|
||||
*dst++ = 0;
|
||||
*chPtr = 0; /* reset surrogate handling */
|
||||
src += 2;
|
||||
} else if (!TclUCS4Complete(src, srcEnd - src)) {
|
||||
} else if (!Tcl_UtfCharComplete(src, srcEnd - src)) {
|
||||
/*
|
||||
* Always check before using TclUtfToUCS4. Not doing can so
|
||||
* Always check before using TclUtfToUniChar. Not doing can so
|
||||
* cause it run beyond the end of the buffer! If we happen such an
|
||||
* incomplete char its bytes are made to represent themselves.
|
||||
*/
|
||||
|
||||
*chPtr = UCHAR(*src);
|
||||
*chPtr = (unsigned char) *src;
|
||||
src += 1;
|
||||
dst += Tcl_UniCharToUtf(*chPtr, dst);
|
||||
} else {
|
||||
src += TclUtfToUCS4(src, chPtr);
|
||||
src += TclUtfToUniChar(src, chPtr);
|
||||
if ((*chPtr | 0x7FF) == 0xDFFF) {
|
||||
/* A surrogate character is detected, handle especially */
|
||||
int low = *chPtr;
|
||||
size_t len = (src <= srcEnd-3) ? TclUtfToUCS4(src, &low) : 0;
|
||||
if (((low & ~0x3FF) != 0xDC00) || (*chPtr & 0x400)) {
|
||||
Tcl_UniChar low = *chPtr;
|
||||
size_t len = (src <= srcEnd-3) ? Tcl_UtfToUniChar(src, &low) : 0;
|
||||
if (((low | 0x3FF) != 0xDFFF) || (*chPtr & 0x400)) {
|
||||
*dst++ = (char) (((*chPtr >> 12) | 0xE0) & 0xEF);
|
||||
*dst++ = (char) (((*chPtr >> 6) | 0x80) & 0xBF);
|
||||
*dst++ = (char) ((*chPtr | 0x80) & 0xBF);
|
||||
@@ -2561,6 +2557,11 @@ UtfToUtf16Proc(
|
||||
}
|
||||
src += TclUtfToUniChar(src, chPtr);
|
||||
|
||||
/*
|
||||
* Need to handle this in a way that won't cause misalignment by
|
||||
* casting dst to a Tcl_UniChar. [Bug 1122671]
|
||||
*/
|
||||
|
||||
if (clientData) {
|
||||
#if TCL_UTF_MAX > 3
|
||||
if (*chPtr <= 0xFFFF) {
|
||||
|
||||
+10
-12
@@ -2906,18 +2906,17 @@ TclCompileEnsemble(
|
||||
* compiled. */
|
||||
CompileEnv *envPtr) /* Holds resulting instructions. */
|
||||
{
|
||||
DefineLineInformation;
|
||||
Tcl_Token *tokenPtr = TokenAfter(parsePtr->tokenPtr);
|
||||
Tcl_Obj *mapObj, *subcmdObj, *targetCmdObj, *listObj, **elems;
|
||||
Tcl_Obj *replaced, *replacement;
|
||||
Tcl_Obj *replaced = Tcl_NewObj(), *replacement;
|
||||
Tcl_Command ensemble = (Tcl_Command) cmdPtr;
|
||||
Command *oldCmdPtr = cmdPtr, *newCmdPtr;
|
||||
int len, result, flags = 0, i, depth = 1, invokeAnyway = 0;
|
||||
int ourResult = TCL_ERROR;
|
||||
unsigned numBytes;
|
||||
const char *word;
|
||||
DefineLineInformation;
|
||||
|
||||
TclNewObj(replaced);
|
||||
Tcl_IncrRefCount(replaced);
|
||||
if (parsePtr->numWords < depth + 1) {
|
||||
goto failed;
|
||||
@@ -3162,7 +3161,7 @@ TclCompileEnsemble(
|
||||
}
|
||||
|
||||
/*
|
||||
* Now that the mapping process is done we actually try to compile.
|
||||
* Now we've done the mapping process, can now actually try to compile.
|
||||
* If there is a subcommand compiler and that successfully produces code,
|
||||
* we'll use that. Otherwise, we fall back to generating opcodes to do the
|
||||
* invoke at runtime.
|
||||
@@ -3245,7 +3244,6 @@ TclAttemptCompileProc(
|
||||
Command *cmdPtr,
|
||||
CompileEnv *envPtr) /* Holds resulting instructions. */
|
||||
{
|
||||
DefineLineInformation;
|
||||
int result, i;
|
||||
Tcl_Token *saveTokenPtr = parsePtr->tokenPtr;
|
||||
int savedStackDepth = envPtr->currStackDepth;
|
||||
@@ -3255,6 +3253,7 @@ TclAttemptCompileProc(
|
||||
#ifdef TCL_COMPILE_DEBUG
|
||||
int savedExceptDepth = envPtr->exceptDepth;
|
||||
#endif
|
||||
DefineLineInformation;
|
||||
|
||||
if (cmdPtr->compileProc == NULL) {
|
||||
return TCL_ERROR;
|
||||
@@ -3262,9 +3261,9 @@ TclAttemptCompileProc(
|
||||
|
||||
/*
|
||||
* Advance parsePtr->tokenPtr so that it points at the last subcommand.
|
||||
* This will be wrong but it will not matter, and it will put the
|
||||
* tokens for the arguments in the right place without the need to
|
||||
* allocate a synthetic Tcl_Parse struct or copy tokens around.
|
||||
* This will be wrong, but it will not matter, and it will put the
|
||||
* tokens for the arguments in the right place without the needed to
|
||||
* allocate a synthetic Tcl_Parse struct, or copy tokens around.
|
||||
*/
|
||||
|
||||
for (i = 0; i < depth - 1; i++) {
|
||||
@@ -3378,11 +3377,11 @@ CompileToInvokedCommand(
|
||||
Command *cmdPtr,
|
||||
CompileEnv *envPtr) /* Holds resulting instructions. */
|
||||
{
|
||||
DefineLineInformation;
|
||||
Tcl_Token *tokPtr;
|
||||
Tcl_Obj *objPtr, **words;
|
||||
const char *bytes;
|
||||
int i, numWords, cmdLit, extraLiteralFlags = LITERAL_CMD_NAME;
|
||||
DefineLineInformation;
|
||||
|
||||
/*
|
||||
* Push the words of the command. Take care; the command words may be
|
||||
@@ -3421,7 +3420,7 @@ CompileToInvokedCommand(
|
||||
* the implementation.
|
||||
*/
|
||||
|
||||
TclNewObj(objPtr);
|
||||
objPtr = Tcl_NewObj();
|
||||
Tcl_GetCommandFullName(interp, (Tcl_Command) cmdPtr, objPtr);
|
||||
bytes = TclGetString(objPtr);
|
||||
if ((cmdPtr != NULL) && (cmdPtr->flags & CMD_VIA_RESOLVER)) {
|
||||
@@ -3460,9 +3459,8 @@ CompileBasicNArgCommand(
|
||||
* compiled. */
|
||||
CompileEnv *envPtr) /* Holds resulting instructions. */
|
||||
{
|
||||
Tcl_Obj *objPtr;
|
||||
Tcl_Obj *objPtr = Tcl_NewObj();
|
||||
|
||||
TclNewObj(objPtr);
|
||||
Tcl_IncrRefCount(objPtr);
|
||||
Tcl_GetCommandFullName(interp, (Tcl_Command) cmdPtr, objPtr);
|
||||
TclCompileInvocation(interp, parsePtr->tokenPtr, objPtr,
|
||||
|
||||
@@ -127,17 +127,6 @@ TclSetupEnv(
|
||||
/*msg*/ 0, /*createPart1*/ 0, /*createPart2*/ 0, &arrayPtr);
|
||||
TclFindArrayPtrElements(varPtr, &namesHash);
|
||||
|
||||
#if defined(_WIN32)
|
||||
if (tenviron == NULL) {
|
||||
/*
|
||||
* When we are started from main(), the _wenviron array could
|
||||
* be NULL and will be initialized by the first _wgetenv() call.
|
||||
*/
|
||||
|
||||
(void) _wgetenv(L"WINDIR");
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Go through the environment array and transfer its values into Tcl. At
|
||||
* the same time, remove those elements we add/update from the hash table
|
||||
|
||||
+8
-8
@@ -311,7 +311,7 @@ HandleBgErrors(
|
||||
|
||||
int
|
||||
TclDefaultBgErrorHandlerObjCmd(
|
||||
TCL_UNUSED(void *),
|
||||
TCL_UNUSED(ClientData),
|
||||
Tcl_Interp *interp, /* Current interpreter. */
|
||||
int objc, /* Number of arguments. */
|
||||
Tcl_Obj *const objv[]) /* Argument objects. */
|
||||
@@ -1046,9 +1046,9 @@ Tcl_InitSubsystems(void)
|
||||
* implementation of self-initializing locks.
|
||||
*/
|
||||
|
||||
TclInitThreadStorage(); /* Creates hash table for
|
||||
TclInitThreadStorage(); /* Creates master hash table for
|
||||
* thread local storage */
|
||||
#if defined(USE_TCLALLOC) && USE_TCLALLOC
|
||||
#if USE_TCLALLOC
|
||||
TclInitAlloc(); /* Process wide mutex init */
|
||||
#endif
|
||||
#if TCL_THREADS && defined(USE_THREAD_ALLOC)
|
||||
@@ -1163,7 +1163,7 @@ Tcl_Finalize(void)
|
||||
TclFinalizeFilesystem();
|
||||
|
||||
/*
|
||||
* Undo all Tcl_ObjType registrations, and reset the global list of free
|
||||
* Undo all Tcl_ObjType registrations, and reset the master list of free
|
||||
* Tcl_Obj's. After this returns, no more Tcl_Obj's should be allocated or
|
||||
* freed.
|
||||
*
|
||||
@@ -1398,7 +1398,7 @@ TclInThreadExit(void)
|
||||
|
||||
int
|
||||
Tcl_VwaitObjCmd(
|
||||
TCL_UNUSED(void *),
|
||||
TCL_UNUSED(ClientData),
|
||||
Tcl_Interp *interp, /* Current interpreter. */
|
||||
int objc, /* Number of arguments. */
|
||||
Tcl_Obj *const objv[]) /* Argument objects. */
|
||||
@@ -1494,7 +1494,7 @@ VwaitVarProc(
|
||||
|
||||
int
|
||||
Tcl_UpdateObjCmd(
|
||||
TCL_UNUSED(void *),
|
||||
TCL_UNUSED(ClientData),
|
||||
Tcl_Interp *interp, /* Current interpreter. */
|
||||
int objc, /* Number of arguments. */
|
||||
Tcl_Obj *const objv[]) /* Argument objects. */
|
||||
@@ -1502,7 +1502,7 @@ Tcl_UpdateObjCmd(
|
||||
int optionIndex;
|
||||
int flags = 0; /* Initialized to avoid compiler warning. */
|
||||
static const char *const updateOptions[] = {"idletasks", NULL};
|
||||
enum updateOptionsEnum {OPT_IDLETASKS};
|
||||
enum updateOptions {OPT_IDLETASKS};
|
||||
|
||||
if (objc == 1) {
|
||||
flags = TCL_ALL_EVENTS|TCL_DONT_WAIT;
|
||||
@@ -1511,7 +1511,7 @@ Tcl_UpdateObjCmd(
|
||||
"option", 0, &optionIndex) != TCL_OK) {
|
||||
return TCL_ERROR;
|
||||
}
|
||||
switch ((enum updateOptionsEnum) optionIndex) {
|
||||
switch ((enum updateOptions) optionIndex) {
|
||||
case OPT_IDLETASKS:
|
||||
flags = TCL_WINDOW_EVENTS|TCL_IDLE_EVENTS|TCL_DONT_WAIT;
|
||||
break;
|
||||
|
||||
+35
-79
@@ -855,8 +855,8 @@ TclCreateExecEnv(
|
||||
* [sizeof(Tcl_Obj*)] */
|
||||
{
|
||||
ExecEnv *eePtr = (ExecEnv *)ckalloc(sizeof(ExecEnv));
|
||||
ExecStack *esPtr = (ExecStack *)ckalloc(offsetof(ExecStack, stackWords)
|
||||
+ size * sizeof(Tcl_Obj *));
|
||||
ExecStack *esPtr = (ExecStack *)ckalloc(sizeof(ExecStack)
|
||||
+ (size_t) (size-1) * sizeof(Tcl_Obj *));
|
||||
|
||||
eePtr->execStackPtr = esPtr;
|
||||
TclNewIntObj(eePtr->constants[0], 0);
|
||||
@@ -1121,7 +1121,7 @@ GrowEvaluationStack(
|
||||
newElems = needed;
|
||||
#endif
|
||||
|
||||
newBytes = offsetof(ExecStack, stackWords) + newElems * sizeof(Tcl_Obj *);
|
||||
newBytes = sizeof(ExecStack) + (newElems-1) * sizeof(Tcl_Obj *);
|
||||
|
||||
oldPtr = esPtr;
|
||||
esPtr = (ExecStack *)ckalloc(newBytes);
|
||||
@@ -2130,22 +2130,6 @@ TEBCresume(
|
||||
if (!pc) {
|
||||
/* bytecode is starting from scratch */
|
||||
pc = codePtr->codeStart;
|
||||
|
||||
/*
|
||||
* Reset the interp's result to avoid possible duplications of large
|
||||
* objects [3c6e47363e], [781585], [804681], This can happen by start
|
||||
* also in nested compiled blocks (enclosed in parent cycle).
|
||||
* See else branch below for opposite handling by continuation/resume.
|
||||
*/
|
||||
|
||||
objPtr = iPtr->objResultPtr;
|
||||
if (objPtr->refCount > 1) {
|
||||
TclDecrRefCount(objPtr);
|
||||
TclNewObj(objPtr);
|
||||
Tcl_IncrRefCount(objPtr);
|
||||
iPtr->objResultPtr = objPtr;
|
||||
}
|
||||
|
||||
goto cleanup0;
|
||||
} else {
|
||||
/* resume from invocation */
|
||||
@@ -2185,7 +2169,7 @@ TEBCresume(
|
||||
objc, cmdNameBuf), Tcl_GetObjResult(interp));
|
||||
|
||||
/*
|
||||
* Obtain and reset interp's result to avoid possible duplications of
|
||||
* Reset the interp's result to avoid possible duplications of large
|
||||
* objects [Bug 781585]. We do not call Tcl_ResetResult to avoid any
|
||||
* side effects caused by the resetting of errorInfo and errorCode
|
||||
* [Bug 804681], which are not needed here. We chose instead to
|
||||
@@ -3635,7 +3619,7 @@ TEBCresume(
|
||||
case INST_INCR_SCALAR_STK_IMM:
|
||||
case INST_INCR_STK_IMM:
|
||||
increment = TclGetInt1AtPtr(pc+1);
|
||||
TclNewIntObj(incrPtr, increment);
|
||||
incrPtr = Tcl_NewIntObj(increment);
|
||||
Tcl_IncrRefCount(incrPtr);
|
||||
pcAdjustment = 2;
|
||||
|
||||
@@ -3670,7 +3654,7 @@ TEBCresume(
|
||||
case INST_INCR_ARRAY1_IMM:
|
||||
opnd = TclGetUInt1AtPtr(pc+1);
|
||||
increment = TclGetInt1AtPtr(pc+2);
|
||||
TclNewIntObj(incrPtr, increment);
|
||||
incrPtr = Tcl_NewIntObj(increment);
|
||||
Tcl_IncrRefCount(incrPtr);
|
||||
pcAdjustment = 3;
|
||||
|
||||
@@ -3736,7 +3720,7 @@ TEBCresume(
|
||||
TRACE(("%u %ld => ", opnd, increment));
|
||||
if (Tcl_IsShared(objPtr)) {
|
||||
objPtr->refCount--; /* We know it's shared. */
|
||||
TclNewIntObj(objResultPtr, w + increment);
|
||||
objResultPtr = Tcl_NewWideIntObj(w+increment);
|
||||
Tcl_IncrRefCount(objResultPtr);
|
||||
varPtr->value.objPtr = objResultPtr;
|
||||
} else {
|
||||
@@ -4464,7 +4448,7 @@ TEBCresume(
|
||||
CoroutineData *corPtr = iPtr->execEnvPtr->corPtr;
|
||||
|
||||
TclNewObj(objResultPtr);
|
||||
if (corPtr && !(corPtr->cmdPtr->flags & CMD_DYING)) {
|
||||
if (corPtr && !(corPtr->cmdPtr->flags & CMD_IS_DELETED)) {
|
||||
Tcl_GetCommandFullName(interp, (Tcl_Command) corPtr->cmdPtr,
|
||||
objResultPtr);
|
||||
}
|
||||
@@ -4524,18 +4508,6 @@ TEBCresume(
|
||||
TRACE(("\"%.30s\" => ", O2S(OBJ_AT_TOS)));
|
||||
cmd = Tcl_GetCommandFromObj(interp, OBJ_AT_TOS);
|
||||
if (cmd == NULL) {
|
||||
goto instOriginError;
|
||||
}
|
||||
origCmd = TclGetOriginalCommand(cmd);
|
||||
if (origCmd == NULL) {
|
||||
origCmd = cmd;
|
||||
}
|
||||
|
||||
TclNewObj(objResultPtr);
|
||||
Tcl_GetCommandFullName(interp, origCmd, objResultPtr);
|
||||
if (TclCheckEmptyString(objResultPtr) == TCL_EMPTYSTRING_YES ) {
|
||||
Tcl_DecrRefCount(objResultPtr);
|
||||
instOriginError:
|
||||
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
|
||||
"invalid command name \"%s\"", TclGetString(OBJ_AT_TOS)));
|
||||
DECACHE_STACK_INFO();
|
||||
@@ -4545,6 +4517,12 @@ TEBCresume(
|
||||
TRACE_APPEND(("ERROR: not command\n"));
|
||||
goto gotError;
|
||||
}
|
||||
origCmd = TclGetOriginalCommand(cmd);
|
||||
if (origCmd == NULL) {
|
||||
origCmd = cmd;
|
||||
}
|
||||
TclNewObj(objResultPtr);
|
||||
Tcl_GetCommandFullName(interp, origCmd, objResultPtr);
|
||||
TRACE_APPEND(("\"%.30s\"", O2S(OBJ_AT_TOS)));
|
||||
NEXT_INST_F(1, 1, 1);
|
||||
}
|
||||
@@ -4863,19 +4841,13 @@ TEBCresume(
|
||||
*/
|
||||
|
||||
if ((TclListObjGetElements(interp, valuePtr, &objc, &objv) == TCL_OK)
|
||||
&& !TclHasIntRep(value2Ptr, &tclListType)) {
|
||||
int code;
|
||||
|
||||
DECACHE_STACK_INFO();
|
||||
code = TclGetIntForIndexM(interp, value2Ptr, objc-1, &index);
|
||||
CACHE_STACK_INFO();
|
||||
if (code == TCL_OK) {
|
||||
TclDecrRefCount(value2Ptr);
|
||||
tosPtr--;
|
||||
pcAdjustment = 1;
|
||||
goto lindexFastPath;
|
||||
}
|
||||
Tcl_ResetResult(interp);
|
||||
&& !TclHasIntRep(value2Ptr, &tclListType)
|
||||
&& (TclGetIntForIndexM(NULL, value2Ptr, objc-1,
|
||||
&index) == TCL_OK)) {
|
||||
TclDecrRefCount(value2Ptr);
|
||||
tosPtr--;
|
||||
pcAdjustment = 1;
|
||||
goto lindexFastPath;
|
||||
}
|
||||
|
||||
objResultPtr = TclLindexList(interp, valuePtr, value2Ptr);
|
||||
@@ -5076,7 +5048,7 @@ TEBCresume(
|
||||
|
||||
if (toIdx == TCL_INDEX_NONE) {
|
||||
emptyList:
|
||||
TclNewObj(objResultPtr);
|
||||
objResultPtr = Tcl_NewObj();
|
||||
TRACE_APPEND(("\"%.30s\"", O2S(objResultPtr)));
|
||||
NEXT_INST_F(9, 1, 1);
|
||||
}
|
||||
@@ -5310,13 +5282,10 @@ TEBCresume(
|
||||
*/
|
||||
|
||||
length = Tcl_GetCharLength(valuePtr);
|
||||
DECACHE_STACK_INFO();
|
||||
if (TclGetIntForIndexM(interp, value2Ptr, length-1, &index)!=TCL_OK) {
|
||||
CACHE_STACK_INFO();
|
||||
TRACE_ERROR(interp);
|
||||
goto gotError;
|
||||
}
|
||||
CACHE_STACK_INFO();
|
||||
|
||||
if ((index < 0) || (index >= length)) {
|
||||
TclNewObj(objResultPtr);
|
||||
@@ -5336,7 +5305,7 @@ TEBCresume(
|
||||
* practical use.
|
||||
*/
|
||||
if (ch == -1) {
|
||||
TclNewObj(objResultPtr);
|
||||
objResultPtr = Tcl_NewObj();
|
||||
} else {
|
||||
length = Tcl_UniCharToUtf(ch, buf);
|
||||
if ((ch >= 0xD800) && (length < 3)) {
|
||||
@@ -5353,21 +5322,13 @@ TEBCresume(
|
||||
TRACE(("\"%.20s\" %.20s %.20s =>",
|
||||
O2S(OBJ_AT_DEPTH(2)), O2S(OBJ_UNDER_TOS), O2S(OBJ_AT_TOS)));
|
||||
length = Tcl_GetCharLength(OBJ_AT_DEPTH(2)) - 1;
|
||||
|
||||
DECACHE_STACK_INFO();
|
||||
if (TclGetIntForIndexM(interp, OBJ_UNDER_TOS, length,
|
||||
&fromIdx) != TCL_OK) {
|
||||
CACHE_STACK_INFO();
|
||||
TRACE_ERROR(interp);
|
||||
goto gotError;
|
||||
}
|
||||
if (TclGetIntForIndexM(interp, OBJ_AT_TOS, length,
|
||||
&fromIdx) != TCL_OK
|
||||
|| TclGetIntForIndexM(interp, OBJ_AT_TOS, length,
|
||||
&toIdx) != TCL_OK) {
|
||||
CACHE_STACK_INFO();
|
||||
TRACE_ERROR(interp);
|
||||
goto gotError;
|
||||
}
|
||||
CACHE_STACK_INFO();
|
||||
|
||||
if (fromIdx < 0) {
|
||||
fromIdx = 0;
|
||||
@@ -5450,17 +5411,14 @@ TEBCresume(
|
||||
endIdx = Tcl_GetCharLength(valuePtr) - 1;
|
||||
TRACE(("\"%.20s\" %s %s \"%.20s\" => ", O2S(valuePtr),
|
||||
O2S(OBJ_UNDER_TOS), O2S(OBJ_AT_TOS), O2S(value3Ptr)));
|
||||
DECACHE_STACK_INFO();
|
||||
if (TclGetIntForIndexM(interp, OBJ_UNDER_TOS, endIdx,
|
||||
&fromIdx) != TCL_OK
|
||||
|| TclGetIntForIndexM(interp, OBJ_AT_TOS, endIdx,
|
||||
&toIdx) != TCL_OK) {
|
||||
CACHE_STACK_INFO();
|
||||
TclDecrRefCount(value3Ptr);
|
||||
TRACE_ERROR(interp);
|
||||
goto gotError;
|
||||
}
|
||||
CACHE_STACK_INFO();
|
||||
TclDecrRefCount(OBJ_AT_TOS);
|
||||
(void) POP_OBJECT();
|
||||
TclDecrRefCount(OBJ_AT_TOS);
|
||||
@@ -5585,11 +5543,9 @@ TEBCresume(
|
||||
ustring1 = Tcl_GetUnicodeFromObj(valuePtr, &length);
|
||||
match = 1;
|
||||
if (length > 0) {
|
||||
int ch;
|
||||
end = ustring1 + length;
|
||||
for (p=ustring1 ; p<end ; ) {
|
||||
p += TclUniCharToUCS4(p, &ch);
|
||||
if (!tclStringClassTable[opnd].comparator(ch)) {
|
||||
for (p=ustring1 ; p<end ; p++) {
|
||||
if (!tclStringClassTable[opnd].comparator(*p)) {
|
||||
match = 0;
|
||||
break;
|
||||
}
|
||||
@@ -6156,7 +6112,7 @@ TEBCresume(
|
||||
wideResultOfArithmetic:
|
||||
TRACE(("%s %s => ", O2S(valuePtr), O2S(value2Ptr)));
|
||||
if (Tcl_IsShared(valuePtr)) {
|
||||
TclNewIntObj(objResultPtr, wResult);
|
||||
objResultPtr = Tcl_NewWideIntObj(wResult);
|
||||
TRACE(("%s\n", O2S(objResultPtr)));
|
||||
NEXT_INST_F(1, 2, 1);
|
||||
}
|
||||
@@ -6427,8 +6383,8 @@ TEBCresume(
|
||||
if (TclHasIntRep(valuePtr, &tclBooleanType)) {
|
||||
objResultPtr = TCONST(1);
|
||||
} else {
|
||||
int res = (TclSetBooleanFromAny(NULL, valuePtr) == TCL_OK);
|
||||
objResultPtr = TCONST(res);
|
||||
int result = (TclSetBooleanFromAny(NULL, valuePtr) == TCL_OK);
|
||||
objResultPtr = TCONST(result);
|
||||
}
|
||||
TRACE_WITH_OBJ(("\"%.30s\" => ", O2S(valuePtr)), objResultPtr);
|
||||
NEXT_INST_F(1, 0, 1);
|
||||
@@ -6622,7 +6578,7 @@ TEBCresume(
|
||||
}
|
||||
{
|
||||
ForeachInfo *infoPtr;
|
||||
Tcl_Obj *listPtr, **elements;
|
||||
Tcl_Obj *listPtr, **elements, *tmpPtr;
|
||||
ForeachVarList *varListPtr;
|
||||
int numLists, listLen, numVars;
|
||||
int listTmpDepth;
|
||||
@@ -7046,9 +7002,9 @@ TEBCresume(
|
||||
break;
|
||||
}
|
||||
if (valuePtr == NULL) {
|
||||
Tcl_DictObjPut(NULL, dictPtr, OBJ_AT_TOS, Tcl_NewWideIntObj(opnd));
|
||||
Tcl_DictObjPut(NULL, dictPtr, OBJ_AT_TOS,Tcl_NewIntObj(opnd));
|
||||
} else {
|
||||
TclNewIntObj(value2Ptr, opnd);
|
||||
value2Ptr = Tcl_NewIntObj(opnd);
|
||||
Tcl_IncrRefCount(value2Ptr);
|
||||
if (Tcl_IsShared(valuePtr)) {
|
||||
valuePtr = Tcl_DuplicateObj(valuePtr);
|
||||
@@ -7564,7 +7520,7 @@ TEBCresume(
|
||||
default:
|
||||
Tcl_Panic("clockRead instruction with unknown clock#");
|
||||
}
|
||||
TclNewIntObj(objResultPtr, wval);
|
||||
objResultPtr = Tcl_NewWideIntObj(wval);
|
||||
TRACE_WITH_OBJ(("=> "), objResultPtr);
|
||||
NEXT_INST_F(2, 0, 1);
|
||||
}
|
||||
@@ -9719,7 +9675,7 @@ EvalStatsCmd(
|
||||
|
||||
#define Percent(a,b) ((a) * 100.0 / (b))
|
||||
|
||||
TclNewObj(objPtr);
|
||||
objPtr = Tcl_NewObj();
|
||||
Tcl_IncrRefCount(objPtr);
|
||||
|
||||
numInstructions = 0.0;
|
||||
|
||||
+3
-3
@@ -904,7 +904,7 @@ FileBasename(
|
||||
}
|
||||
}
|
||||
if (resultPtr == NULL) {
|
||||
TclNewObj(resultPtr);
|
||||
resultPtr = Tcl_NewObj();
|
||||
}
|
||||
Tcl_IncrRefCount(resultPtr);
|
||||
Tcl_DecrRefCount(splitPtr);
|
||||
@@ -1085,7 +1085,7 @@ TclFileAttrsCmd(
|
||||
}
|
||||
|
||||
if (Tcl_GetIndexFromObj(interp, objv[0], attributeStrings,
|
||||
"option", TCL_INDEX_TEMP_TABLE, &index) != TCL_OK) {
|
||||
"option", INDEX_TEMP_TABLE, &index) != TCL_OK) {
|
||||
goto end;
|
||||
}
|
||||
if (Tcl_FSFileAttrsGet(interp, index, filePtr,
|
||||
@@ -1110,7 +1110,7 @@ TclFileAttrsCmd(
|
||||
|
||||
for (i = 0; i < objc ; i += 2) {
|
||||
if (Tcl_GetIndexFromObj(interp, objv[i], attributeStrings,
|
||||
"option", TCL_INDEX_TEMP_TABLE, &index) != TCL_OK) {
|
||||
"option", INDEX_TEMP_TABLE, &index) != TCL_OK) {
|
||||
goto end;
|
||||
}
|
||||
if (i + 1 == objc) {
|
||||
|
||||
+12
-22
@@ -587,8 +587,7 @@ Tcl_SplitPath(
|
||||
* plus the argv pointers and the terminating NULL pointer.
|
||||
*/
|
||||
|
||||
*argvPtr = (const char **)ckalloc(
|
||||
((((*argcPtr) + 1) * sizeof(char *)) + size));
|
||||
*argvPtr = (const char **)ckalloc((((*argcPtr) + 1) * sizeof(char *)) + size);
|
||||
|
||||
/*
|
||||
* Position p after the last argv pointer and copy the contents of the
|
||||
@@ -599,7 +598,7 @@ Tcl_SplitPath(
|
||||
for (i = 0; i < *argcPtr; i++) {
|
||||
Tcl_ListObjIndex(NULL, resultPtr, i, &eltPtr);
|
||||
str = TclGetStringFromObj(eltPtr, &len);
|
||||
memcpy(p, str, len + 1);
|
||||
memcpy(p, str, len+1);
|
||||
p += len+1;
|
||||
}
|
||||
|
||||
@@ -645,13 +644,12 @@ SplitUnixPath(
|
||||
{
|
||||
int length;
|
||||
const char *origPath = path, *elementStart;
|
||||
Tcl_Obj *result;
|
||||
Tcl_Obj *result = Tcl_NewObj();
|
||||
|
||||
/*
|
||||
* Deal with the root directory as a special case.
|
||||
*/
|
||||
|
||||
TclNewObj(result);
|
||||
if (*path == '/') {
|
||||
Tcl_Obj *rootElt;
|
||||
++path;
|
||||
@@ -737,10 +735,9 @@ SplitWinPath(
|
||||
const char *p, *elementStart;
|
||||
Tcl_PathType type = TCL_PATH_ABSOLUTE;
|
||||
Tcl_DString buf;
|
||||
Tcl_Obj *result;
|
||||
Tcl_Obj *result = Tcl_NewObj();
|
||||
Tcl_DStringInit(&buf);
|
||||
|
||||
TclNewObj(result);
|
||||
p = ExtractWinRoot(path, &buf, 0, &type);
|
||||
|
||||
/*
|
||||
@@ -980,7 +977,7 @@ Tcl_JoinPath(
|
||||
Tcl_DString *resultPtr) /* Pointer to previously initialized DString */
|
||||
{
|
||||
int i, len;
|
||||
Tcl_Obj *listObj;
|
||||
Tcl_Obj *listObj = Tcl_NewObj();
|
||||
Tcl_Obj *resultObj;
|
||||
const char *resultStr;
|
||||
|
||||
@@ -988,7 +985,6 @@ Tcl_JoinPath(
|
||||
* Build the list of paths.
|
||||
*/
|
||||
|
||||
TclNewObj(listObj);
|
||||
for (i = 0; i < argc; i++) {
|
||||
Tcl_ListObjAppendElement(NULL, listObj,
|
||||
Tcl_NewStringObj(argv[i], -1));
|
||||
@@ -1238,7 +1234,7 @@ Tcl_GlobObjCmd(
|
||||
"-directory", "-join", "-nocomplain", "-path", "-tails",
|
||||
"-types", "--", NULL
|
||||
};
|
||||
enum globOptionsEnum {
|
||||
enum options {
|
||||
GLOB_DIR, GLOB_JOIN, GLOB_NOCOMPLAIN, GLOB_PATH, GLOB_TAILS,
|
||||
GLOB_TYPE, GLOB_LAST
|
||||
};
|
||||
@@ -1271,7 +1267,7 @@ Tcl_GlobObjCmd(
|
||||
}
|
||||
}
|
||||
|
||||
switch ((enum globOptionsEnum) index) {
|
||||
switch (index) {
|
||||
case GLOB_NOCOMPLAIN: /* -nocomplain */
|
||||
globFlags |= TCL_GLOBMODE_NO_COMPLAIN;
|
||||
break;
|
||||
@@ -1284,10 +1280,7 @@ Tcl_GlobObjCmd(
|
||||
}
|
||||
if (dir != PATH_NONE) {
|
||||
Tcl_SetObjResult(interp, Tcl_NewStringObj(
|
||||
dir == PATH_DIR
|
||||
? "\"-directory\" may only be used once"
|
||||
: "\"-directory\" cannot be used with \"-path\"",
|
||||
-1));
|
||||
"\"-directory\" cannot be used with \"-path\"", -1));
|
||||
Tcl_SetErrorCode(interp, "TCL", "OPERATION", "GLOB",
|
||||
"BADOPTIONCOMBINATION", NULL);
|
||||
return TCL_ERROR;
|
||||
@@ -1312,10 +1305,7 @@ Tcl_GlobObjCmd(
|
||||
}
|
||||
if (dir != PATH_NONE) {
|
||||
Tcl_SetObjResult(interp, Tcl_NewStringObj(
|
||||
dir == PATH_GENERAL
|
||||
? "\"-path\" may only be used once"
|
||||
: "\"-path\" cannot be used with \"-dictionary\"",
|
||||
-1));
|
||||
"\"-path\" cannot be used with \"-directory\"", -1));
|
||||
Tcl_SetErrorCode(interp, "TCL", "OPERATION", "GLOB",
|
||||
"BADOPTIONCOMBINATION", NULL);
|
||||
return TCL_ERROR;
|
||||
@@ -2065,7 +2055,7 @@ TclGlob(
|
||||
* SkipToChar --
|
||||
*
|
||||
* This function traverses a glob pattern looking for the next unquoted
|
||||
* occurrence of the specified character at the same braces nesting level.
|
||||
* occurance of the specified character at the same braces nesting level.
|
||||
*
|
||||
* Results:
|
||||
* Updates stringPtr to point to the matching character, or to the end of
|
||||
@@ -2455,7 +2445,7 @@ DoGlob(
|
||||
int len;
|
||||
const char *joined = TclGetStringFromObj(joinedPtr,&len);
|
||||
|
||||
if ((len > 0) && (strchr(separators, joined[len-1]) == NULL)) {
|
||||
if (strchr(separators, joined[len-1]) == NULL) {
|
||||
Tcl_AppendToObj(joinedPtr, "/", 1);
|
||||
}
|
||||
}
|
||||
@@ -2492,7 +2482,7 @@ DoGlob(
|
||||
int len;
|
||||
const char *joined = TclGetStringFromObj(joinedPtr,&len);
|
||||
|
||||
if ((len > 0) && (strchr(separators, joined[len-1]) == NULL)) {
|
||||
if (strchr(separators, joined[len-1]) == NULL) {
|
||||
if (Tcl_FSGetPathType(pathPtr) != TCL_PATH_VOLUME_RELATIVE) {
|
||||
Tcl_AppendToObj(joinedPtr, "/", 1);
|
||||
}
|
||||
|
||||
+58
-56
@@ -16,7 +16,7 @@
|
||||
|
||||
%parse-param {DateInfo* info}
|
||||
%lex-param {DateInfo* info}
|
||||
%define api.pure
|
||||
%pure-parser
|
||||
/* %error-verbose would be nice, but our token names are meaningless */
|
||||
%locations
|
||||
|
||||
@@ -266,32 +266,43 @@ time : tUNUMBER tMERIDIAN {
|
||||
yySeconds = 0;
|
||||
yyMeridian = $4;
|
||||
}
|
||||
| tUNUMBER ':' tUNUMBER '-' tUNUMBER {
|
||||
yyHour = $1;
|
||||
yyMinutes = $3;
|
||||
yyMeridian = MER24;
|
||||
yyDSTmode = DSToff;
|
||||
yyTimezone = ($5 % 100 + ($5 / 100) * 60);
|
||||
++yyHaveZone;
|
||||
}
|
||||
| tUNUMBER ':' tUNUMBER ':' tUNUMBER o_merid {
|
||||
yyHour = $1;
|
||||
yyMinutes = $3;
|
||||
yySeconds = $5;
|
||||
yyMeridian = $6;
|
||||
}
|
||||
| tUNUMBER ':' tUNUMBER ':' tUNUMBER '-' tUNUMBER {
|
||||
yyHour = $1;
|
||||
yyMinutes = $3;
|
||||
yySeconds = $5;
|
||||
yyMeridian = MER24;
|
||||
yyDSTmode = DSToff;
|
||||
yyTimezone = ($7 % 100 + ($7 / 100) * 60);
|
||||
++yyHaveZone;
|
||||
}
|
||||
;
|
||||
|
||||
zone : tZONE tDST {
|
||||
yyTimezone = $1;
|
||||
if (yyTimezone > HOUR( 12)) yyTimezone -= HOUR(100);
|
||||
yyDSTmode = DSTon;
|
||||
}
|
||||
| tZONE {
|
||||
yyTimezone = $1;
|
||||
if (yyTimezone > HOUR( 12)) yyTimezone -= HOUR(100);
|
||||
yyDSTmode = DSToff;
|
||||
}
|
||||
| tDAYZONE {
|
||||
yyTimezone = $1;
|
||||
yyDSTmode = DSTon;
|
||||
}
|
||||
| sign tUNUMBER {
|
||||
yyTimezone = -$1*($2 % 100 + ($2 / 100) * 60);
|
||||
yyDSTmode = DSToff;
|
||||
}
|
||||
;
|
||||
|
||||
day : tDAY {
|
||||
@@ -375,18 +386,8 @@ ordMonth: tNEXT tMONTH {
|
||||
}
|
||||
;
|
||||
|
||||
iso : tUNUMBER '-' tUNUMBER '-' tUNUMBER tZONE
|
||||
tUNUMBER ':' tUNUMBER ':' tUNUMBER {
|
||||
if ($6 != HOUR( 7) + HOUR(100)) YYABORT;
|
||||
yyYear = $1;
|
||||
yyMonth = $3;
|
||||
yyDay = $5;
|
||||
yyHour = $7;
|
||||
yyMinutes = $9;
|
||||
yySeconds = $11;
|
||||
}
|
||||
| tISOBASE tZONE tISOBASE {
|
||||
if ($2 != HOUR( 7) + HOUR(100)) YYABORT;
|
||||
iso : tISOBASE tZONE tISOBASE {
|
||||
if ($2 != HOUR( 7)) YYABORT;
|
||||
yyYear = $1 / 10000;
|
||||
yyMonth = ($1 % 10000)/100;
|
||||
yyDay = $1 % 100;
|
||||
@@ -395,7 +396,7 @@ iso : tUNUMBER '-' tUNUMBER '-' tUNUMBER tZONE
|
||||
yySeconds = $3 % 100;
|
||||
}
|
||||
| tISOBASE tZONE tUNUMBER ':' tUNUMBER ':' tUNUMBER {
|
||||
if ($2 != HOUR( 7) + HOUR(100)) YYABORT;
|
||||
if ($2 != HOUR( 7)) YYABORT;
|
||||
yyYear = $1 / 10000;
|
||||
yyMonth = ($1 % 10000)/100;
|
||||
yyDay = $1 % 100;
|
||||
@@ -674,31 +675,31 @@ static const TABLE TimezoneTable[] = {
|
||||
*/
|
||||
|
||||
static const TABLE MilitaryTable[] = {
|
||||
{ "a", tZONE, -HOUR( 1) + HOUR(100) },
|
||||
{ "b", tZONE, -HOUR( 2) + HOUR(100) },
|
||||
{ "c", tZONE, -HOUR( 3) + HOUR(100) },
|
||||
{ "d", tZONE, -HOUR( 4) + HOUR(100) },
|
||||
{ "e", tZONE, -HOUR( 5) + HOUR(100) },
|
||||
{ "f", tZONE, -HOUR( 6) + HOUR(100) },
|
||||
{ "g", tZONE, -HOUR( 7) + HOUR(100) },
|
||||
{ "h", tZONE, -HOUR( 8) + HOUR(100) },
|
||||
{ "i", tZONE, -HOUR( 9) + HOUR(100) },
|
||||
{ "k", tZONE, -HOUR(10) + HOUR(100) },
|
||||
{ "l", tZONE, -HOUR(11) + HOUR(100) },
|
||||
{ "m", tZONE, -HOUR(12) + HOUR(100) },
|
||||
{ "n", tZONE, HOUR( 1) + HOUR(100) },
|
||||
{ "o", tZONE, HOUR( 2) + HOUR(100) },
|
||||
{ "p", tZONE, HOUR( 3) + HOUR(100) },
|
||||
{ "q", tZONE, HOUR( 4) + HOUR(100) },
|
||||
{ "r", tZONE, HOUR( 5) + HOUR(100) },
|
||||
{ "s", tZONE, HOUR( 6) + HOUR(100) },
|
||||
{ "t", tZONE, HOUR( 7) + HOUR(100) },
|
||||
{ "u", tZONE, HOUR( 8) + HOUR(100) },
|
||||
{ "v", tZONE, HOUR( 9) + HOUR(100) },
|
||||
{ "w", tZONE, HOUR( 10) + HOUR(100) },
|
||||
{ "x", tZONE, HOUR( 11) + HOUR(100) },
|
||||
{ "y", tZONE, HOUR( 12) + HOUR(100) },
|
||||
{ "z", tZONE, HOUR( 0) + HOUR(100) },
|
||||
{ "a", tZONE, -HOUR( 1) },
|
||||
{ "b", tZONE, -HOUR( 2) },
|
||||
{ "c", tZONE, -HOUR( 3) },
|
||||
{ "d", tZONE, -HOUR( 4) },
|
||||
{ "e", tZONE, -HOUR( 5) },
|
||||
{ "f", tZONE, -HOUR( 6) },
|
||||
{ "g", tZONE, -HOUR( 7) },
|
||||
{ "h", tZONE, -HOUR( 8) },
|
||||
{ "i", tZONE, -HOUR( 9) },
|
||||
{ "k", tZONE, -HOUR(10) },
|
||||
{ "l", tZONE, -HOUR(11) },
|
||||
{ "m", tZONE, -HOUR(12) },
|
||||
{ "n", tZONE, HOUR( 1) },
|
||||
{ "o", tZONE, HOUR( 2) },
|
||||
{ "p", tZONE, HOUR( 3) },
|
||||
{ "q", tZONE, HOUR( 4) },
|
||||
{ "r", tZONE, HOUR( 5) },
|
||||
{ "s", tZONE, HOUR( 6) },
|
||||
{ "t", tZONE, HOUR( 7) },
|
||||
{ "u", tZONE, HOUR( 8) },
|
||||
{ "v", tZONE, HOUR( 9) },
|
||||
{ "w", tZONE, HOUR( 10) },
|
||||
{ "x", tZONE, HOUR( 11) },
|
||||
{ "y", tZONE, HOUR( 12) },
|
||||
{ "z", tZONE, HOUR( 0) },
|
||||
{ NULL, 0, 0 }
|
||||
};
|
||||
|
||||
@@ -716,12 +717,12 @@ TclDateerror(
|
||||
Tcl_AppendToObj(infoPtr->messages, infoPtr->separatrix, -1);
|
||||
Tcl_AppendToObj(infoPtr->messages, s, -1);
|
||||
Tcl_AppendToObj(infoPtr->messages, " (characters ", -1);
|
||||
TclNewIntObj(t, location->first_column);
|
||||
t = Tcl_NewIntObj(location->first_column);
|
||||
Tcl_IncrRefCount(t);
|
||||
Tcl_AppendObjToObj(infoPtr->messages, t);
|
||||
Tcl_DecrRefCount(t);
|
||||
Tcl_AppendToObj(infoPtr->messages, "-", -1);
|
||||
TclNewIntObj(t, location->last_column);
|
||||
t = Tcl_NewIntObj(location->last_column);
|
||||
Tcl_IncrRefCount(t);
|
||||
Tcl_AppendObjToObj(infoPtr->messages, t);
|
||||
Tcl_DecrRefCount(t);
|
||||
@@ -896,7 +897,7 @@ TclDatelex(
|
||||
|
||||
location->first_column = yyInput - info->dateStart;
|
||||
for ( ; ; ) {
|
||||
while (TclIsSpaceProcM(*yyInput)) {
|
||||
while (TclIsSpaceProc(UCHAR(*yyInput))) {
|
||||
yyInput++;
|
||||
}
|
||||
|
||||
@@ -959,7 +960,7 @@ TclDatelex(
|
||||
|
||||
int
|
||||
TclClockOldscanObjCmd(
|
||||
TCL_UNUSED(void *),
|
||||
void *dummy, /* Unused */
|
||||
Tcl_Interp *interp, /* Tcl interpreter */
|
||||
int objc, /* Count of paraneters */
|
||||
Tcl_Obj *const *objv) /* Parameters */
|
||||
@@ -969,6 +970,7 @@ TclClockOldscanObjCmd(
|
||||
DateInfo dateInfo;
|
||||
DateInfo* info = &dateInfo;
|
||||
int status;
|
||||
(void)dummy;
|
||||
|
||||
if (objc != 5) {
|
||||
Tcl_WrongNumArgs(interp, 1, objv,
|
||||
@@ -1002,7 +1004,7 @@ TclClockOldscanObjCmd(
|
||||
yyHaveRel = 0;
|
||||
yyRelMonth = 0; yyRelDay = 0; yyRelSeconds = 0; yyRelPointer = NULL;
|
||||
|
||||
TclNewObj(dateInfo.messages);
|
||||
dateInfo.messages = Tcl_NewObj();
|
||||
dateInfo.separatrix = "";
|
||||
Tcl_IncrRefCount(dateInfo.messages);
|
||||
|
||||
@@ -1059,8 +1061,8 @@ TclClockOldscanObjCmd(
|
||||
return TCL_ERROR;
|
||||
}
|
||||
|
||||
TclNewObj(result);
|
||||
TclNewObj(resultElement);
|
||||
result = Tcl_NewObj();
|
||||
resultElement = Tcl_NewObj();
|
||||
if (yyHaveDate) {
|
||||
Tcl_ListObjAppendElement(interp, resultElement,
|
||||
Tcl_NewIntObj((int) yyYear));
|
||||
@@ -1078,7 +1080,7 @@ TclClockOldscanObjCmd(
|
||||
Tcl_ListObjAppendElement(interp, result, Tcl_NewObj());
|
||||
}
|
||||
|
||||
TclNewObj(resultElement);
|
||||
resultElement = Tcl_NewObj();
|
||||
if (yyHaveZone) {
|
||||
Tcl_ListObjAppendElement(interp, resultElement,
|
||||
Tcl_NewIntObj((int) -yyTimezone));
|
||||
@@ -1087,7 +1089,7 @@ TclClockOldscanObjCmd(
|
||||
}
|
||||
Tcl_ListObjAppendElement(interp, result, resultElement);
|
||||
|
||||
TclNewObj(resultElement);
|
||||
resultElement = Tcl_NewObj();
|
||||
if (yyHaveRel) {
|
||||
Tcl_ListObjAppendElement(interp, resultElement,
|
||||
Tcl_NewIntObj((int) yyRelMonth));
|
||||
@@ -1098,7 +1100,7 @@ TclClockOldscanObjCmd(
|
||||
}
|
||||
Tcl_ListObjAppendElement(interp, result, resultElement);
|
||||
|
||||
TcNewObj(resultElement);
|
||||
resultElement = Tcl_NewObj();
|
||||
if (yyHaveDay && !yyHaveDate) {
|
||||
Tcl_ListObjAppendElement(interp, resultElement,
|
||||
Tcl_NewIntObj((int) yyDayOrdinal));
|
||||
@@ -1107,7 +1109,7 @@ TclClockOldscanObjCmd(
|
||||
}
|
||||
Tcl_ListObjAppendElement(interp, result, resultElement);
|
||||
|
||||
TclNewObj(resultElement);
|
||||
resultElement = Tcl_NewObj();
|
||||
if (yyHaveOrdinalMonth) {
|
||||
Tcl_ListObjAppendElement(interp, resultElement,
|
||||
Tcl_NewIntObj((int) yyMonthOrdinal));
|
||||
|
||||
+31
-44
@@ -287,9 +287,9 @@ static int WillRead(Channel *chanPtr);
|
||||
|
||||
#define IsBufferOverflowing(bufPtr) ((bufPtr)->nextAdded>(bufPtr)->bufLength)
|
||||
|
||||
#define InsertPoint(bufPtr) (&(bufPtr)->buf[(bufPtr)->nextAdded])
|
||||
#define InsertPoint(bufPtr) ((bufPtr)->buf + (bufPtr)->nextAdded)
|
||||
|
||||
#define RemovePoint(bufPtr) (&(bufPtr)->buf[(bufPtr)->nextRemoved])
|
||||
#define RemovePoint(bufPtr) ((bufPtr)->buf + (bufPtr)->nextRemoved)
|
||||
|
||||
/*
|
||||
* For working with channel state flag bits.
|
||||
@@ -3219,9 +3219,6 @@ CutChannel(
|
||||
*/
|
||||
|
||||
ChanThreadAction((Channel *) chan, TCL_CHANNEL_THREAD_REMOVE);
|
||||
|
||||
/* Channel is not managed by any thread */
|
||||
statePtr->managingThread = NULL;
|
||||
}
|
||||
|
||||
void
|
||||
@@ -3266,9 +3263,6 @@ Tcl_CutChannel(
|
||||
for (; chanPtr != NULL ; chanPtr = chanPtr->upChanPtr) {
|
||||
ChanThreadAction(chanPtr, TCL_CHANNEL_THREAD_REMOVE);
|
||||
}
|
||||
|
||||
/* Channel is not managed by any thread */
|
||||
statePtr->managingThread = NULL;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -4175,8 +4169,13 @@ Tcl_WriteChars(
|
||||
}
|
||||
|
||||
objPtr = Tcl_NewStringObj(src, len);
|
||||
src = (char *) Tcl_GetByteArrayFromObj(objPtr, &len);
|
||||
result = WriteBytes(chanPtr, src, len);
|
||||
src = (char *) TclGetBytesFromObj(NULL, objPtr, &len);
|
||||
if (src) {
|
||||
result = WriteBytes(chanPtr, src, len);
|
||||
} else {
|
||||
src = TclGetStringFromObj(objPtr, &len);
|
||||
result = Write(chanPtr, src, len, GetBinaryEncoding());
|
||||
}
|
||||
TclDecrRefCount(objPtr);
|
||||
return result;
|
||||
}
|
||||
@@ -4227,12 +4226,24 @@ Tcl_WriteObj(
|
||||
return -1;
|
||||
}
|
||||
if (statePtr->encoding == NULL) {
|
||||
src = (char *) Tcl_GetByteArrayFromObj(objPtr, &srcLen);
|
||||
return WriteBytes(chanPtr, src, srcLen);
|
||||
} else {
|
||||
/* We have a binary channel... */
|
||||
|
||||
src = (const char *) TclGetBytesFromObj(NULL, objPtr, &srcLen);
|
||||
if (src) {
|
||||
/* ... and value to write that is properly expressed as bytes. */
|
||||
|
||||
return WriteBytes(chanPtr, src, srcLen);
|
||||
}
|
||||
|
||||
/* We have some non-byte content to write, encode in iso8859-1 */
|
||||
|
||||
src = TclGetStringFromObj(objPtr, &srcLen);
|
||||
return WriteChars(chanPtr, src, srcLen);
|
||||
return Write(chanPtr, src, srcLen, GetBinaryEncoding());
|
||||
}
|
||||
|
||||
/* If either one is false, need to process encodings for correctness */
|
||||
src = TclGetStringFromObj(objPtr, &srcLen);
|
||||
return WriteChars(chanPtr, src, srcLen);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -4756,7 +4767,7 @@ Tcl_GetsObj(
|
||||
gs.rawRead -= rawRead;
|
||||
gs.bytesWrote--;
|
||||
gs.charsWrote--;
|
||||
memmove(dst, dst + 1, dstEnd - dst);
|
||||
memmove(dst, dst + 1, (size_t) (dstEnd - dst));
|
||||
dstEnd--;
|
||||
}
|
||||
}
|
||||
@@ -5862,11 +5873,7 @@ DoReadChars(
|
||||
&& (statePtr->inputTranslation == TCL_TRANSLATE_LF)
|
||||
&& (statePtr->inEofChar == '\0');
|
||||
|
||||
if (appendFlag) {
|
||||
if (binaryMode && (NULL == TclGetBytesFromObj(NULL, objPtr, NULL))) {
|
||||
binaryMode = 0;
|
||||
}
|
||||
} else {
|
||||
if (appendFlag == 0) {
|
||||
if (binaryMode) {
|
||||
Tcl_SetByteArrayLength(objPtr, 0);
|
||||
} else {
|
||||
@@ -7711,7 +7718,7 @@ Tcl_BadChannelOption(
|
||||
}
|
||||
Tcl_ResetResult(interp);
|
||||
errObj = Tcl_ObjPrintf("bad option \"%s\": should be one of ",
|
||||
optionName ? optionName : "");
|
||||
optionName);
|
||||
argc--;
|
||||
for (i = 0; i < argc; i++) {
|
||||
Tcl_AppendPrintfToObj(errObj, "-%s, ", argv[i]);
|
||||
@@ -8399,13 +8406,6 @@ Tcl_NotifyChannel(
|
||||
TclChannelPreserve((Tcl_Channel)channel);
|
||||
Tcl_Preserve(statePtr);
|
||||
|
||||
/*
|
||||
* Avoid processing if the channel owner has been changed.
|
||||
*/
|
||||
if (statePtr->managingThread != Tcl_GetCurrentThread()) {
|
||||
goto done;
|
||||
}
|
||||
|
||||
/*
|
||||
* If we are flushing in the background, be sure to call FlushChannel for
|
||||
* writable events. Note that we have to discard the writable event so we
|
||||
@@ -8440,13 +8440,6 @@ Tcl_NotifyChannel(
|
||||
} else {
|
||||
chPtr = chPtr->nextPtr;
|
||||
}
|
||||
|
||||
/*
|
||||
* Stop if the channel owner has been changed in-between.
|
||||
*/
|
||||
if (chanPtr->state->managingThread != Tcl_GetCurrentThread()) {
|
||||
goto done;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -8464,7 +8457,6 @@ Tcl_NotifyChannel(
|
||||
UpdateInterest(chanPtr);
|
||||
}
|
||||
|
||||
done:
|
||||
Tcl_Release(statePtr);
|
||||
TclChannelRelease(channel);
|
||||
|
||||
@@ -8963,11 +8955,6 @@ TclChannelEventScriptInvoker(
|
||||
int mask = esPtr->mask;
|
||||
int result; /* Result of call to eval script. */
|
||||
|
||||
/*
|
||||
* Be sure event executed in managed channel (covering bugs similar [f583715154]).
|
||||
*/
|
||||
assert(chanPtr->state->managingThread == Tcl_GetCurrentThread());
|
||||
|
||||
/*
|
||||
* We must preserve the interpreter so we can report errors on it later.
|
||||
* Note that we do not need to preserve the channel because that is done
|
||||
@@ -10509,7 +10496,7 @@ Tcl_IsChannelExisting(
|
||||
}
|
||||
|
||||
if ((*chanName == *name) &&
|
||||
(memcmp(name, chanName, chanNameLen + 1) == 0)) {
|
||||
(memcmp(name, chanName, (size_t) chanNameLen + 1) == 0)) {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
@@ -11130,7 +11117,7 @@ FixLevelCode(
|
||||
if (0 == strcmp(TclGetString(lv[i]), "-level")) {
|
||||
if (newlevel >= 0) {
|
||||
lvn[j++] = lv[i];
|
||||
lvn[j++] = Tcl_NewWideIntObj(newlevel);
|
||||
lvn[j++] = Tcl_NewIntObj(newlevel);
|
||||
newlevel = -1;
|
||||
lignore = 1;
|
||||
continue;
|
||||
@@ -11140,7 +11127,7 @@ FixLevelCode(
|
||||
} else if (0 == strcmp(TclGetString(lv[i]), "-code")) {
|
||||
if (newcode >= 0) {
|
||||
lvn[j++] = lv[i];
|
||||
lvn[j++] = Tcl_NewWideIntObj(newcode);
|
||||
lvn[j++] = Tcl_NewIntObj(newcode);
|
||||
newcode = -1;
|
||||
cignore = 1;
|
||||
continue;
|
||||
|
||||
+1
-1
@@ -44,7 +44,7 @@ typedef struct ChannelBuffer {
|
||||
int bufLength; /* How big is the buffer? */
|
||||
struct ChannelBuffer *nextPtr;
|
||||
/* Next buffer in chain. */
|
||||
char buf[TCLFLEXARRAY]; /* Placeholder for real buffer. The real
|
||||
char buf[1]; /* Placeholder for real buffer. The real
|
||||
* buffer occuppies this space + bufSize-1
|
||||
* bytes. This must be the last field in the
|
||||
* structure. */
|
||||
|
||||
+15
-15
@@ -314,7 +314,7 @@ Tcl_GetsObjCmd(
|
||||
}
|
||||
|
||||
TclChannelPreserve(chan);
|
||||
TclNewObj(linePtr);
|
||||
linePtr = Tcl_NewObj();
|
||||
lineLen = Tcl_GetsObj(chan, linePtr);
|
||||
if (lineLen < 0) {
|
||||
if (!Tcl_Eof(chan) && !Tcl_InputBlocked(chan)) {
|
||||
@@ -343,7 +343,7 @@ Tcl_GetsObjCmd(
|
||||
code = TCL_ERROR;
|
||||
goto done;
|
||||
}
|
||||
Tcl_SetObjResult(interp, Tcl_NewWideIntObj(lineLen));
|
||||
Tcl_SetObjResult(interp, Tcl_NewIntObj(lineLen));
|
||||
} else {
|
||||
Tcl_SetObjResult(interp, linePtr);
|
||||
}
|
||||
@@ -453,7 +453,7 @@ Tcl_ReadObjCmd(
|
||||
}
|
||||
}
|
||||
|
||||
TclNewObj(resultPtr);
|
||||
resultPtr = Tcl_NewObj();
|
||||
Tcl_IncrRefCount(resultPtr);
|
||||
TclChannelPreserve(chan);
|
||||
charactersRead = Tcl_ReadChars(chan, resultPtr, toRead, 0);
|
||||
@@ -888,7 +888,7 @@ Tcl_ExecObjCmd(
|
||||
static const char *const options[] = {
|
||||
"-ignorestderr", "-keepnewline", "--", NULL
|
||||
};
|
||||
enum execOptionsEnum {
|
||||
enum options {
|
||||
EXEC_IGNORESTDERR, EXEC_KEEPNEWLINE, EXEC_LAST
|
||||
};
|
||||
|
||||
@@ -975,7 +975,7 @@ Tcl_ExecObjCmd(
|
||||
return TCL_OK;
|
||||
}
|
||||
|
||||
TclNewObj(resultPtr);
|
||||
resultPtr = Tcl_NewObj();
|
||||
if (Tcl_GetChannelHandle(chan, TCL_READABLE, NULL) == TCL_OK) {
|
||||
if (Tcl_ReadChars(chan, resultPtr, -1, 0) == TCL_IO_FAILURE) {
|
||||
/*
|
||||
@@ -1363,7 +1363,7 @@ AcceptCallbackProc(
|
||||
Tcl_ListObjAppendElement(NULL, objv[1], Tcl_NewStringObj(
|
||||
Tcl_GetChannelName(chan), -1));
|
||||
Tcl_ListObjAppendElement(NULL, objv[1], Tcl_NewStringObj(address, -1));
|
||||
Tcl_ListObjAppendElement(NULL, objv[1], Tcl_NewWideIntObj(port));
|
||||
Tcl_ListObjAppendElement(NULL, objv[1], Tcl_NewIntObj(port));
|
||||
|
||||
script = Tcl_ConcatObj(2, objv);
|
||||
Tcl_IncrRefCount(script);
|
||||
@@ -1470,7 +1470,7 @@ Tcl_SocketObjCmd(
|
||||
"-async", "-myaddr", "-myport", "-reuseaddr", "-reuseport", "-server",
|
||||
NULL
|
||||
};
|
||||
enum socketOptionsEnum {
|
||||
enum socketOptions {
|
||||
SKT_ASYNC, SKT_MYADDR, SKT_MYPORT, SKT_REUSEADDR, SKT_REUSEPORT,
|
||||
SKT_SERVER
|
||||
};
|
||||
@@ -1495,7 +1495,7 @@ Tcl_SocketObjCmd(
|
||||
TCL_EXACT, &optionIndex) != TCL_OK) {
|
||||
return TCL_ERROR;
|
||||
}
|
||||
switch ((enum socketOptionsEnum) optionIndex) {
|
||||
switch ((enum socketOptions) optionIndex) {
|
||||
case SKT_ASYNC:
|
||||
if (server == 1) {
|
||||
Tcl_SetObjResult(interp, Tcl_NewStringObj(
|
||||
@@ -1806,7 +1806,7 @@ ChanPendingObjCmd(
|
||||
Tcl_Channel chan;
|
||||
int index, mode;
|
||||
static const char *const options[] = {"input", "output", NULL};
|
||||
enum pendingOptionsEnum {PENDING_INPUT, PENDING_OUTPUT};
|
||||
enum options {PENDING_INPUT, PENDING_OUTPUT};
|
||||
|
||||
if (objc != 3) {
|
||||
Tcl_WrongNumArgs(interp, 1, objv, "mode channelId");
|
||||
@@ -1822,19 +1822,19 @@ ChanPendingObjCmd(
|
||||
return TCL_ERROR;
|
||||
}
|
||||
|
||||
switch ((enum pendingOptionsEnum) index) {
|
||||
switch ((enum options) index) {
|
||||
case PENDING_INPUT:
|
||||
if (!(mode & TCL_READABLE)) {
|
||||
Tcl_SetObjResult(interp, Tcl_NewWideIntObj(-1));
|
||||
Tcl_SetObjResult(interp, Tcl_NewIntObj(-1));
|
||||
} else {
|
||||
Tcl_SetObjResult(interp, Tcl_NewWideIntObj(Tcl_InputBuffered(chan)));
|
||||
Tcl_SetObjResult(interp, Tcl_NewIntObj(Tcl_InputBuffered(chan)));
|
||||
}
|
||||
break;
|
||||
case PENDING_OUTPUT:
|
||||
if (!(mode & TCL_WRITABLE)) {
|
||||
Tcl_SetObjResult(interp, Tcl_NewWideIntObj(-1));
|
||||
Tcl_SetObjResult(interp, Tcl_NewIntObj(-1));
|
||||
} else {
|
||||
Tcl_SetObjResult(interp, Tcl_NewWideIntObj(Tcl_OutputBuffered(chan)));
|
||||
Tcl_SetObjResult(interp, Tcl_NewIntObj(Tcl_OutputBuffered(chan)));
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -1954,7 +1954,7 @@ ChanPipeObjCmd(
|
||||
channelNames[0] = Tcl_GetChannelName(rchan);
|
||||
channelNames[1] = Tcl_GetChannelName(wchan);
|
||||
|
||||
TclNewObj(resultPtr);
|
||||
resultPtr = Tcl_NewObj();
|
||||
Tcl_ListObjAppendElement(NULL, resultPtr,
|
||||
Tcl_NewStringObj(channelNames[0], -1));
|
||||
Tcl_ListObjAppendElement(NULL, resultPtr,
|
||||
|
||||
+12
-17
@@ -1365,7 +1365,7 @@ ReflectInput(
|
||||
|
||||
Tcl_Preserve(rcPtr);
|
||||
|
||||
TclNewIntObj(toReadObj, toRead);
|
||||
toReadObj = Tcl_NewIntObj(toRead);
|
||||
Tcl_IncrRefCount(toReadObj);
|
||||
|
||||
if (InvokeTclMethod(rcPtr, METH_READ, toReadObj, NULL, &resObj)!=TCL_OK) {
|
||||
@@ -1591,7 +1591,7 @@ ReflectSeekWide(
|
||||
|
||||
Tcl_Preserve(rcPtr);
|
||||
|
||||
TclNewIntObj(offObj, offset);
|
||||
offObj = Tcl_NewWideIntObj(offset);
|
||||
baseObj = Tcl_NewStringObj(
|
||||
(seekMode == SEEK_SET) ? "start" :
|
||||
(seekMode == SEEK_CUR) ? "current" : "end", -1);
|
||||
@@ -3047,12 +3047,10 @@ ForwardProc(
|
||||
}
|
||||
|
||||
case ForwardedInput: {
|
||||
Tcl_Obj *toReadObj;
|
||||
Tcl_Obj *toReadObj = Tcl_NewIntObj(paramPtr->input.toRead);
|
||||
Tcl_IncrRefCount(toReadObj);
|
||||
|
||||
TclNewIntObj(toReadObj, paramPtr->input.toRead);
|
||||
Tcl_IncrRefCount(toReadObj);
|
||||
|
||||
Tcl_Preserve(rcPtr);
|
||||
Tcl_Preserve(rcPtr);
|
||||
if (InvokeTclMethod(rcPtr, METH_READ, toReadObj, NULL, &resObj)!=TCL_OK){
|
||||
int code = ErrnoReturn(rcPtr, resObj);
|
||||
|
||||
@@ -3127,18 +3125,15 @@ ForwardProc(
|
||||
}
|
||||
|
||||
case ForwardedSeek: {
|
||||
Tcl_Obj *offObj;
|
||||
Tcl_Obj *baseObj;
|
||||
Tcl_Obj *offObj = Tcl_NewWideIntObj(paramPtr->seek.offset);
|
||||
Tcl_Obj *baseObj = Tcl_NewStringObj(
|
||||
(paramPtr->seek.seekMode==SEEK_SET) ? "start" :
|
||||
(paramPtr->seek.seekMode==SEEK_CUR) ? "current" : "end", -1);
|
||||
|
||||
TclNewIntObj(offObj, paramPtr->seek.offset);
|
||||
baseObj = Tcl_NewStringObj(
|
||||
(paramPtr->seek.seekMode==SEEK_SET) ? "start" :
|
||||
(paramPtr->seek.seekMode==SEEK_CUR) ? "current" : "end", -1);
|
||||
Tcl_IncrRefCount(offObj);
|
||||
Tcl_IncrRefCount(baseObj);
|
||||
|
||||
Tcl_IncrRefCount(offObj);
|
||||
Tcl_IncrRefCount(baseObj);
|
||||
|
||||
Tcl_Preserve(rcPtr);
|
||||
Tcl_Preserve(rcPtr);
|
||||
if (InvokeTclMethod(rcPtr, METH_SEEK, offObj, baseObj, &resObj)!=TCL_OK){
|
||||
ForwardSetObjError(paramPtr, resObj);
|
||||
paramPtr->seek.offset = -1;
|
||||
|
||||
@@ -1219,7 +1219,7 @@ ReflectInput(
|
||||
}
|
||||
if (Tcl_IsShared(bufObj)) {
|
||||
Tcl_DecrRefCount(bufObj);
|
||||
TclNewObj(bufObj);
|
||||
bufObj = Tcl_NewObj();
|
||||
Tcl_IncrRefCount(bufObj);
|
||||
}
|
||||
Tcl_SetByteArrayLength(bufObj, 0);
|
||||
|
||||
+27
-28
@@ -1684,7 +1684,7 @@ Tcl_FSEvalFileEx(
|
||||
* Tilde-substitution is performed on this
|
||||
* pathname. */
|
||||
const char *encodingName) /* Either the name of an encoding or NULL to
|
||||
use the utf-8 encoding. */
|
||||
use the system encoding. */
|
||||
{
|
||||
int length, result = TCL_ERROR;
|
||||
Tcl_StatBuf statBuf;
|
||||
@@ -1722,19 +1722,19 @@ Tcl_FSEvalFileEx(
|
||||
|
||||
/*
|
||||
* If the encoding is specified, set the channel to that encoding.
|
||||
* Otherwise use utf-8. If the encoding is unknown report an error.
|
||||
* Otherwise don't touch it, leaving things up to the system encoding. If
|
||||
* the encoding is unknown report an error.
|
||||
*/
|
||||
|
||||
if (encodingName == NULL) {
|
||||
encodingName = "utf-8";
|
||||
}
|
||||
if (Tcl_SetChannelOption(interp, chan, "-encoding", encodingName)
|
||||
!= TCL_OK) {
|
||||
Tcl_Close(interp,chan);
|
||||
return result;
|
||||
if (encodingName != NULL) {
|
||||
if (Tcl_SetChannelOption(interp, chan, "-encoding", encodingName)
|
||||
!= TCL_OK) {
|
||||
Tcl_Close(interp,chan);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
TclNewObj(objPtr);
|
||||
objPtr = Tcl_NewObj();
|
||||
Tcl_IncrRefCount(objPtr);
|
||||
|
||||
/*
|
||||
@@ -1821,7 +1821,7 @@ TclNREvalFile(
|
||||
* evaluate. Tilde-substitution is performed on
|
||||
* this pathname. */
|
||||
const char *encodingName) /* The name of an encoding to use, or NULL to
|
||||
* use the utf-8 encoding. */
|
||||
* use the system encoding. */
|
||||
{
|
||||
Tcl_StatBuf statBuf;
|
||||
Tcl_Obj *oldScriptFile, *objPtr;
|
||||
@@ -1858,19 +1858,19 @@ TclNREvalFile(
|
||||
|
||||
/*
|
||||
* If the encoding is specified, set the channel to that encoding.
|
||||
* Otherwise use utf-8. If the encoding is unknown report an error.
|
||||
* Otherwise don't touch it, leaving things up to the system encoding. If
|
||||
* the encoding is unknown report an error.
|
||||
*/
|
||||
|
||||
if (encodingName == NULL) {
|
||||
encodingName = "utf-8";
|
||||
}
|
||||
if (Tcl_SetChannelOption(interp, chan, "-encoding", encodingName)
|
||||
!= TCL_OK) {
|
||||
Tcl_Close(interp, chan);
|
||||
return TCL_ERROR;
|
||||
if (encodingName != NULL) {
|
||||
if (Tcl_SetChannelOption(interp, chan, "-encoding", encodingName)
|
||||
!= TCL_OK) {
|
||||
Tcl_Close(interp,chan);
|
||||
return TCL_ERROR;
|
||||
}
|
||||
}
|
||||
|
||||
TclNewObj(objPtr);
|
||||
objPtr = Tcl_NewObj();
|
||||
Tcl_IncrRefCount(objPtr);
|
||||
|
||||
/*
|
||||
@@ -2697,7 +2697,7 @@ Tcl_FSGetCwd(
|
||||
* always be in the 'else' branch below which is simpler.
|
||||
*/
|
||||
|
||||
void *cd = (void *) Tcl_FSGetNativePath(norm);
|
||||
ClientData cd = (ClientData) Tcl_FSGetNativePath(norm);
|
||||
|
||||
FsUpdateCwd(norm, TclNativeDupInternalRep(cd));
|
||||
Tcl_DecrRefCount(norm);
|
||||
@@ -3173,7 +3173,7 @@ Tcl_LoadFile(
|
||||
}
|
||||
|
||||
if (fsPtr->loadFileProc != NULL) {
|
||||
retVal = ((Tcl_FSLoadFileProc2 *)(void *)(fsPtr->loadFileProc))
|
||||
int retVal = ((Tcl_FSLoadFileProc2 *)(void *)(fsPtr->loadFileProc))
|
||||
(interp, pathPtr, handlePtr, &unloadProcPtr, flags);
|
||||
|
||||
if (retVal == TCL_OK) {
|
||||
@@ -3765,7 +3765,7 @@ Tcl_Obj *
|
||||
Tcl_FSListVolumes(void)
|
||||
{
|
||||
FilesystemRecord *fsRecPtr;
|
||||
Tcl_Obj *resultPtr;
|
||||
Tcl_Obj *resultPtr = Tcl_NewObj();
|
||||
|
||||
/*
|
||||
* Call each "listVolumes" function of each registered filesystem in
|
||||
@@ -3773,7 +3773,6 @@ Tcl_FSListVolumes(void)
|
||||
* has succeeded.
|
||||
*/
|
||||
|
||||
TclNewObj(resultPtr);
|
||||
fsRecPtr = FsGetFirstFilesystem();
|
||||
Claim();
|
||||
while (fsRecPtr != NULL) {
|
||||
@@ -3833,7 +3832,7 @@ FsListMounts(
|
||||
if (fsRecPtr->fsPtr != &tclNativeFilesystem &&
|
||||
fsRecPtr->fsPtr->matchInDirectoryProc != NULL) {
|
||||
if (resultPtr == NULL) {
|
||||
TclNewObj(resultPtr);
|
||||
resultPtr = Tcl_NewObj();
|
||||
}
|
||||
fsRecPtr->fsPtr->matchInDirectoryProc(NULL, resultPtr, pathPtr,
|
||||
pattern, &mountsOnly);
|
||||
@@ -3904,7 +3903,7 @@ Tcl_FSSplitPath(
|
||||
* For example, 'ftp://' is a valid drive name.
|
||||
*/
|
||||
|
||||
TclNewObj(result);
|
||||
result = Tcl_NewObj();
|
||||
p = Tcl_GetString(pathPtr);
|
||||
Tcl_ListObjAppendElement(NULL, result,
|
||||
Tcl_NewStringObj(p, driveNameLength));
|
||||
@@ -4086,7 +4085,7 @@ TclFSNonnativePathType(
|
||||
if (pathLen < len) {
|
||||
continue;
|
||||
}
|
||||
if (strncmp(strVol, path, len) == 0) {
|
||||
if (strncmp(strVol, path, (size_t) len) == 0) {
|
||||
type = TCL_PATH_ABSOLUTE;
|
||||
if (filesystemPtrPtr != NULL) {
|
||||
*filesystemPtrPtr = fsRecPtr->fsPtr;
|
||||
@@ -4489,7 +4488,7 @@ Tcl_FSGetFileSystemForPath(
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* Start with an up-to-date copy of the filesystem. */
|
||||
/* Start with an up-to-date copy of the master filesystem. */
|
||||
fsRecPtr = FsGetFirstFilesystem();
|
||||
Claim();
|
||||
|
||||
|
||||
@@ -114,7 +114,7 @@ Tcl_GetIndexFromObj(
|
||||
int flags, /* 0 or TCL_EXACT */
|
||||
int *indexPtr) /* Place to store resulting integer index. */
|
||||
{
|
||||
if (!(flags & TCL_INDEX_TEMP_TABLE)) {
|
||||
if (!(flags & INDEX_TEMP_TABLE)) {
|
||||
|
||||
/*
|
||||
* See if there is a valid cached result from a previous lookup (doing the
|
||||
@@ -216,7 +216,7 @@ GetIndexFromObjList(
|
||||
tablePtr[objc] = NULL;
|
||||
|
||||
result = Tcl_GetIndexFromObjStruct(interp, objPtr, tablePtr,
|
||||
sizeof(char *), msg, flags | TCL_INDEX_TEMP_TABLE, indexPtr);
|
||||
sizeof(char *), msg, flags | INDEX_TEMP_TABLE, indexPtr);
|
||||
|
||||
ckfree(tablePtr);
|
||||
|
||||
@@ -280,7 +280,7 @@ Tcl_GetIndexFromObjStruct(
|
||||
* See if there is a valid cached result from a previous lookup.
|
||||
*/
|
||||
|
||||
if (!(flags & TCL_INDEX_TEMP_TABLE)) {
|
||||
if (!(flags & INDEX_TEMP_TABLE)) {
|
||||
irPtr = TclFetchIntRep(objPtr, &indexType);
|
||||
if (irPtr) {
|
||||
indexRep = (IndexRep *)irPtr->twoPtrValue.ptr1;
|
||||
@@ -344,7 +344,7 @@ Tcl_GetIndexFromObjStruct(
|
||||
* operation.
|
||||
*/
|
||||
|
||||
if (!(flags & TCL_INDEX_TEMP_TABLE)) {
|
||||
if (!(flags & INDEX_TEMP_TABLE)) {
|
||||
irPtr = TclFetchIntRep(objPtr, &indexType);
|
||||
if (irPtr) {
|
||||
indexRep = (IndexRep *)irPtr->twoPtrValue.ptr1;
|
||||
@@ -553,7 +553,7 @@ PrefixMatchObjCmd(
|
||||
static const char *const matchOptions[] = {
|
||||
"-error", "-exact", "-message", NULL
|
||||
};
|
||||
enum matchOptionsEnum {
|
||||
enum matchOptions {
|
||||
PRFMATCH_ERROR, PRFMATCH_EXACT, PRFMATCH_MESSAGE
|
||||
};
|
||||
|
||||
@@ -567,7 +567,7 @@ PrefixMatchObjCmd(
|
||||
&index) != TCL_OK) {
|
||||
return TCL_ERROR;
|
||||
}
|
||||
switch ((enum matchOptionsEnum) index) {
|
||||
switch ((enum matchOptions) index) {
|
||||
case PRFMATCH_EXACT:
|
||||
flags |= TCL_EXACT;
|
||||
break;
|
||||
@@ -633,7 +633,7 @@ PrefixMatchObjCmd(
|
||||
}
|
||||
Tcl_ListObjAppendElement(interp, errorPtr,
|
||||
Tcl_NewStringObj("-code", 5));
|
||||
Tcl_ListObjAppendElement(interp, errorPtr, Tcl_NewWideIntObj(result));
|
||||
Tcl_ListObjAppendElement(interp, errorPtr, Tcl_NewIntObj(result));
|
||||
|
||||
return Tcl_SetReturnOptions(interp, errorPtr);
|
||||
}
|
||||
@@ -785,7 +785,7 @@ PrefixLongestObjCmd(
|
||||
* Adjust in case we stopped in the middle of a UTF char.
|
||||
*/
|
||||
|
||||
resultLength = TclUtfPrev(&resultString[i+1],
|
||||
resultLength = Tcl_UtfPrev(&resultString[i+1],
|
||||
resultString) - resultString;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -893,7 +893,7 @@ declare 227 {
|
||||
# Used to be needed for TclOO-extension; unneeded now that TclOO is in the
|
||||
# core and NRE-enabled
|
||||
# declare 228 {
|
||||
# int TclObjInterpProcCore(Tcl_Interp *interp, Tcl_Obj *procNameObj,
|
||||
# int TclObjInterpProcCore(register Tcl_Interp *interp, Tcl_Obj *procNameObj,
|
||||
# int skip, ProcErrorProc *errorProc)
|
||||
# }
|
||||
declare 229 {
|
||||
@@ -990,7 +990,7 @@ declare 249 {
|
||||
}
|
||||
# TIP #285: Script cancellation support.
|
||||
declare 250 {
|
||||
void TclSetChildCancelFlags(Tcl_Interp *interp, int flags, int force)
|
||||
void TclSetSlaveCancelFlags(Tcl_Interp *interp, int flags, int force)
|
||||
}
|
||||
|
||||
# Allow extensions for optimization
|
||||
@@ -1036,11 +1036,6 @@ declare 258 {
|
||||
}
|
||||
|
||||
declare 259 {
|
||||
unsigned char *TclGetBytesFromObj(Tcl_Interp *interp, Tcl_Obj *objPtr,
|
||||
int *lengthPtr)
|
||||
}
|
||||
|
||||
declare 260 {
|
||||
void TclUnusedStubEntry(void)
|
||||
}
|
||||
|
||||
|
||||
+53
-101
@@ -925,12 +925,6 @@ typedef struct VarInHash {
|
||||
*----------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#if defined(__GNUC__) && (__GNUC__ > 2)
|
||||
# define TCLFLEXARRAY 0
|
||||
#else
|
||||
# define TCLFLEXARRAY 1
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Forward declaration to prevent an error when the forward reference to
|
||||
* Command is encountered in the Proc and ImportRef types declared below.
|
||||
@@ -974,7 +968,7 @@ typedef struct CompiledLocal {
|
||||
* is marked by a unique tag during
|
||||
* compilation, and that same tag is used to
|
||||
* find the variable at runtime. */
|
||||
char name[TCLFLEXARRAY]; /* Name of the local variable starts here. If
|
||||
char name[1]; /* Name of the local variable starts here. If
|
||||
* the name is NULL, this will just be '\0'.
|
||||
* The actual size of this field will be large
|
||||
* enough to hold the name. MUST BE THE LAST
|
||||
@@ -1312,7 +1306,7 @@ typedef struct CFWordBC {
|
||||
typedef struct ContLineLoc {
|
||||
int num; /* Number of entries in loc, not counting the
|
||||
* final -1 marker entry. */
|
||||
int loc[TCLFLEXARRAY];/* Table of locations, as character offsets.
|
||||
int loc[1]; /* Table of locations, as character offsets.
|
||||
* The table is allocated as part of the
|
||||
* structure, extending behind the nominal end
|
||||
* of the structure. An entry containing the
|
||||
@@ -1461,7 +1455,7 @@ typedef struct ExecStack {
|
||||
Tcl_Obj **markerPtr;
|
||||
Tcl_Obj **endPtr;
|
||||
Tcl_Obj **tosPtr;
|
||||
Tcl_Obj *stackWords[TCLFLEXARRAY];
|
||||
Tcl_Obj *stackWords[1];
|
||||
} ExecStack;
|
||||
|
||||
/*
|
||||
@@ -1713,18 +1707,18 @@ typedef struct Command {
|
||||
/*
|
||||
* Flag bits for commands.
|
||||
*
|
||||
* CMD_DYING - If 1 the command is in the process of
|
||||
* CMD_IS_DELETED - Means that the command is in the process of
|
||||
* being deleted (its deleteProc is currently
|
||||
* executing). Other attempts to delete the
|
||||
* command should be ignored.
|
||||
* CMD_TRACE_ACTIVE - If 1 the trace processing is currently
|
||||
* CMD_TRACE_ACTIVE - 1 means that trace processing is currently
|
||||
* underway for a rename/delete change. See the
|
||||
* two flags below for which is currently being
|
||||
* processed.
|
||||
* CMD_HAS_EXEC_TRACES - If 1 means that this command has at least one
|
||||
* CMD_HAS_EXEC_TRACES - 1 means that this command has at least one
|
||||
* execution trace (as opposed to simple
|
||||
* delete/rename traces) in its tracePtr list.
|
||||
* CMD_COMPILES_EXPANDED - If 1 this command has a compiler that
|
||||
* CMD_COMPILES_EXPANDED - 1 means that this command has a compiler that
|
||||
* can handle expansion (provided it is not the
|
||||
* first word).
|
||||
* TCL_TRACE_RENAME - A rename trace is in progress. Further
|
||||
@@ -1734,13 +1728,12 @@ typedef struct Command {
|
||||
* (these last two flags are defined in tcl.h)
|
||||
*/
|
||||
|
||||
#define CMD_DYING 0x01
|
||||
#define CMD_IS_DELETED 0x01
|
||||
#define CMD_TRACE_ACTIVE 0x02
|
||||
#define CMD_HAS_EXEC_TRACES 0x04
|
||||
#define CMD_COMPILES_EXPANDED 0x08
|
||||
#define CMD_REDEF_IN_PROGRESS 0x10
|
||||
#define CMD_VIA_RESOLVER 0x20
|
||||
#define CMD_DEAD 0x40
|
||||
|
||||
|
||||
/*
|
||||
@@ -1863,7 +1856,7 @@ typedef struct Interp {
|
||||
* of hidden commands on a per-interp
|
||||
* basis. */
|
||||
void *interpInfo; /* Information used by tclInterp.c to keep
|
||||
* track of parent/child interps on a
|
||||
* track of master/slave interps on a
|
||||
* per-interp basis. */
|
||||
union {
|
||||
void (*optimizer)(void *envPtr);
|
||||
@@ -2153,7 +2146,7 @@ typedef struct Interp {
|
||||
* (c) are accessed very often (e.g., at each command call)
|
||||
*
|
||||
* Note that these are the same for all interps in the same thread. They
|
||||
* just have to be initialised for the thread's parent interp, children
|
||||
* just have to be initialised for the thread's master interp, slaves
|
||||
* inherit the value.
|
||||
*
|
||||
* They are used by the macros defined below.
|
||||
@@ -2529,9 +2522,10 @@ typedef struct List {
|
||||
? ((*(intPtr) = (int)(objPtr)->internalRep.wideValue), TCL_OK) \
|
||||
: Tcl_GetIntFromObj((interp), (objPtr), (intPtr)))
|
||||
#define TclGetIntForIndexM(interp, objPtr, endValue, idxPtr) \
|
||||
((((objPtr)->typePtr == &tclIntType) && ((objPtr)->internalRep.wideValue >= 0) \
|
||||
&& ((Tcl_WideUInt)(objPtr)->internalRep.wideValue <= (Tcl_WideUInt)(endValue + 1))) \
|
||||
? ((*(idxPtr) = (int)(objPtr)->internalRep.wideValue), TCL_OK) \
|
||||
(((objPtr)->typePtr == &tclIntType \
|
||||
&& (objPtr)->internalRep.wideValue <= (Tcl_WideInt)(INT_MAX)) \
|
||||
? ((*(idxPtr) = ((objPtr)->internalRep.wideValue >= 0) \
|
||||
? (int)(objPtr)->internalRep.wideValue : TCL_INDEX_NONE), TCL_OK) \
|
||||
: Tcl_GetIntForIndex((interp), (objPtr), (endValue), (idxPtr)))
|
||||
|
||||
/*
|
||||
@@ -2611,6 +2605,15 @@ typedef struct TclFileAttrProcs {
|
||||
TclSetFileAttrProc *setProc;/* The procedure for setting attrs. */
|
||||
} TclFileAttrProcs;
|
||||
|
||||
/*
|
||||
* Private flag value which controls Tcl_GetIndexFromObj*() routines
|
||||
* to instruct them not to cache lookups because the table will not
|
||||
* live long enough to make it worthwhile. Must not clash with public
|
||||
* flag value TCL_EXACT.
|
||||
*/
|
||||
|
||||
#define INDEX_TEMP_TABLE 2
|
||||
|
||||
/*
|
||||
* Opaque handle used in pipeline routines to encapsulate platform-dependent
|
||||
* state.
|
||||
@@ -2667,20 +2670,20 @@ typedef void (TclInitProcessGlobalValueProc)(char **valuePtr, unsigned int *leng
|
||||
/*
|
||||
* A ProcessGlobalValue struct exists for each internal value in Tcl that is
|
||||
* to be shared among several threads. Each thread sees a (Tcl_Obj) copy of
|
||||
* the value, and the gobal value is kept as a counted string, with epoch and
|
||||
* mutex control. Each ProcessGlobalValue struct should be a static variable in
|
||||
* some file.
|
||||
* the value, and the master is kept as a counted string, with epoch and mutex
|
||||
* control. Each ProcessGlobalValue struct should be a static variable in some
|
||||
* file.
|
||||
*/
|
||||
|
||||
typedef struct ProcessGlobalValue {
|
||||
unsigned int epoch; /* Epoch counter to detect changes in the
|
||||
* global value. */
|
||||
unsigned int numBytes; /* Length of the global string. */
|
||||
char *value; /* The global string value. */
|
||||
Tcl_Encoding encoding; /* system encoding when global string was
|
||||
* master value. */
|
||||
unsigned int numBytes; /* Length of the master string. */
|
||||
char *value; /* The master string value. */
|
||||
Tcl_Encoding encoding; /* system encoding when master string was
|
||||
* initialized. */
|
||||
TclInitProcessGlobalValueProc *proc;
|
||||
/* A procedure to initialize the global string
|
||||
/* A procedure to initialize the master string
|
||||
* copy when a "get" request comes in before
|
||||
* any "set" request has been received. */
|
||||
Tcl_Mutex mutex; /* Enforce orderly access from multiple
|
||||
@@ -2711,8 +2714,6 @@ typedef struct ProcessGlobalValue {
|
||||
/* Reject leading/trailing whitespace. */
|
||||
#define TCL_PARSE_BINARY_ONLY 64
|
||||
/* Parse binary even without prefix. */
|
||||
#define TCL_PARSE_NO_UNDERSCORE 128
|
||||
/* Reject underscore digit separator */
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------------
|
||||
@@ -3025,6 +3026,8 @@ MODULE_SCOPE int TclNREvalFile(Tcl_Interp *interp, Tcl_Obj *pathPtr,
|
||||
MODULE_SCOPE void TclFSUnloadTempFile(Tcl_LoadHandle loadHandle);
|
||||
MODULE_SCOPE int * TclGetAsyncReadyPtr(void);
|
||||
MODULE_SCOPE Tcl_Obj * TclGetBgErrorHandler(Tcl_Interp *interp);
|
||||
MODULE_SCOPE unsigned char * TclGetBytesFromObj(Tcl_Interp *interp,
|
||||
Tcl_Obj *objPtr, int *lengthPtr);
|
||||
MODULE_SCOPE int TclGetChannelFromObj(Tcl_Interp *interp,
|
||||
Tcl_Obj *objPtr, Tcl_Channel *chanPtr,
|
||||
int *modePtr, int flags);
|
||||
@@ -3079,6 +3082,7 @@ MODULE_SCOPE void TclInitNamespaceSubsystem(void);
|
||||
MODULE_SCOPE void TclInitNotifier(void);
|
||||
MODULE_SCOPE void TclInitObjSubsystem(void);
|
||||
MODULE_SCOPE int TclInterpReady(Tcl_Interp *interp);
|
||||
MODULE_SCOPE int TclIsSpaceProc(int byte);
|
||||
MODULE_SCOPE int TclIsDigitProc(int byte);
|
||||
MODULE_SCOPE int TclIsBareword(int byte);
|
||||
MODULE_SCOPE Tcl_Obj * TclJoinPath(int elements, Tcl_Obj * const objv[],
|
||||
@@ -3155,8 +3159,8 @@ MODULE_SCOPE void TclpInitLock(void);
|
||||
MODULE_SCOPE void TclpInitPlatform(void);
|
||||
MODULE_SCOPE void TclpInitUnlock(void);
|
||||
MODULE_SCOPE Tcl_Obj * TclpObjListVolumes(void);
|
||||
MODULE_SCOPE void TclpGlobalLock(void);
|
||||
MODULE_SCOPE void TclpGlobalUnlock(void);
|
||||
MODULE_SCOPE void TclpMasterLock(void);
|
||||
MODULE_SCOPE void TclpMasterUnlock(void);
|
||||
MODULE_SCOPE int TclpMatchFiles(Tcl_Interp *interp, char *separators,
|
||||
Tcl_DString *dirPtr, char *pattern, char *tail);
|
||||
MODULE_SCOPE int TclpObjNormalizePath(Tcl_Interp *interp,
|
||||
@@ -3249,19 +3253,6 @@ MODULE_SCOPE void TclRegisterCommandTypeName(
|
||||
MODULE_SCOPE int TclUtfCmp(const char *cs, const char *ct);
|
||||
MODULE_SCOPE int TclUtfCasecmp(const char *cs, const char *ct);
|
||||
MODULE_SCOPE int TclUtfCount(int ch);
|
||||
#if TCL_UTF_MAX > 3
|
||||
# define TclUtfToUCS4 Tcl_UtfToUniChar
|
||||
# define TclUniCharToUCS4(src, ptr) (*ptr = *(src),1)
|
||||
# define TclUCS4Complete Tcl_UtfCharComplete
|
||||
# define TclChar16Complete(src, length) (((unsigned)((unsigned char)*(src) - 0xF0) < 5) \
|
||||
? ((length) >= 3) : Tcl_UtfCharComplete((src), (length)))
|
||||
#else
|
||||
MODULE_SCOPE int TclUtfToUCS4(const char *src, int *ucs4Ptr);
|
||||
MODULE_SCOPE int TclUniCharToUCS4(const Tcl_UniChar *src, int *ucs4Ptr);
|
||||
# define TclUCS4Complete(src, length) (((unsigned)((unsigned char)*(src) - 0xF0) < 5) \
|
||||
? ((length) >= 4) : Tcl_UtfCharComplete((src), (length)))
|
||||
# define TclChar16Complete Tcl_UtfCharComplete
|
||||
#endif
|
||||
MODULE_SCOPE Tcl_Obj * TclpNativeToNormalized(ClientData clientData);
|
||||
MODULE_SCOPE Tcl_Obj * TclpFilesystemPathType(Tcl_Obj *pathPtr);
|
||||
MODULE_SCOPE int TclpDlopen(Tcl_Interp *interp, Tcl_Obj *pathPtr,
|
||||
@@ -3303,24 +3294,14 @@ MODULE_SCOPE Tcl_WideInt TclpGetMicroseconds(void);
|
||||
MODULE_SCOPE int TclZlibInit(Tcl_Interp *interp);
|
||||
MODULE_SCOPE void * TclpThreadCreateKey(void);
|
||||
MODULE_SCOPE void TclpThreadDeleteKey(void *keyPtr);
|
||||
MODULE_SCOPE void TclpThreadSetGlobalTSD(void *tsdKeyPtr, void *ptr);
|
||||
MODULE_SCOPE void * TclpThreadGetGlobalTSD(void *tsdKeyPtr);
|
||||
MODULE_SCOPE void TclpThreadSetMasterTSD(void *tsdKeyPtr, void *ptr);
|
||||
MODULE_SCOPE void * TclpThreadGetMasterTSD(void *tsdKeyPtr);
|
||||
MODULE_SCOPE void TclErrorStackResetIf(Tcl_Interp *interp,
|
||||
const char *msg, int length);
|
||||
/* Tip 430 */
|
||||
MODULE_SCOPE int TclZipfs_Init(Tcl_Interp *interp);
|
||||
|
||||
|
||||
/*
|
||||
* Many parsing tasks need a common definition of whitespace.
|
||||
* Use this routine and macro to achieve that and place
|
||||
* optimization (fragile on changes) in one place.
|
||||
*/
|
||||
|
||||
MODULE_SCOPE int TclIsSpaceProc(int byte);
|
||||
# define TclIsSpaceProcM(byte) \
|
||||
(((byte) > 0x20) ? 0 : TclIsSpaceProc(byte))
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------
|
||||
* Command procedures in the generic core:
|
||||
@@ -4172,7 +4153,7 @@ MODULE_SCOPE int TclFullFinalizationRequested(void);
|
||||
MODULE_SCOPE Tcl_ObjCmdProc TclEnsembleImplementationCmd;
|
||||
MODULE_SCOPE Tcl_ObjCmdProc TclAliasObjCmd;
|
||||
MODULE_SCOPE Tcl_ObjCmdProc TclLocalAliasObjCmd;
|
||||
MODULE_SCOPE Tcl_ObjCmdProc TclChildObjCmd;
|
||||
MODULE_SCOPE Tcl_ObjCmdProc TclSlaveObjCmd;
|
||||
MODULE_SCOPE Tcl_ObjCmdProc TclInvokeImportedCmd;
|
||||
MODULE_SCOPE Tcl_ObjCmdProc TclOOPublicObjectCmd;
|
||||
MODULE_SCOPE Tcl_ObjCmdProc TclOOPrivateObjectCmd;
|
||||
@@ -4518,15 +4499,12 @@ MODULE_SCOPE void TclDbInitNewObj(Tcl_Obj *objPtr, const char *file,
|
||||
*/
|
||||
|
||||
#define TclInvalidateStringRep(objPtr) \
|
||||
do { \
|
||||
Tcl_Obj *_isobjPtr = (Tcl_Obj *)(objPtr); \
|
||||
if (_isobjPtr->bytes != NULL) { \
|
||||
if (_isobjPtr->bytes != &tclEmptyString) { \
|
||||
ckfree((char *)_isobjPtr->bytes); \
|
||||
} \
|
||||
_isobjPtr->bytes = NULL; \
|
||||
if ((objPtr)->bytes != NULL) { \
|
||||
if ((objPtr)->bytes != &tclEmptyString) { \
|
||||
ckfree((objPtr)->bytes); \
|
||||
} \
|
||||
} while (0)
|
||||
(objPtr)->bytes = NULL; \
|
||||
}
|
||||
|
||||
/*
|
||||
* These form part of the native filesystem support. They are needed here
|
||||
@@ -4553,8 +4531,7 @@ MODULE_SCOPE const TclFileAttrProcs tclpFileAttrProcs[];
|
||||
*----------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#define TclHasStringRep(objPtr) \
|
||||
((objPtr)->bytes != NULL)
|
||||
#define TclHasStringRep(objPtr) ((objPtr)->bytes != NULL)
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------
|
||||
@@ -4666,8 +4643,8 @@ MODULE_SCOPE const TclFileAttrProcs tclpFileAttrProcs[];
|
||||
|
||||
#if TCL_UTF_MAX > 3
|
||||
#define TclUtfToUniChar(str, chPtr) \
|
||||
(((UCHAR(*(str))) < 0x80) ? \
|
||||
((*(chPtr) = UCHAR(*(str))), 1) \
|
||||
((((unsigned char) *(str)) < 0x80) ? \
|
||||
((*(chPtr) = (unsigned char) *(str)), 1) \
|
||||
: Tcl_UtfToUniChar(str, chPtr))
|
||||
#else
|
||||
#define TclUtfToUniChar(str, chPtr) \
|
||||
@@ -4700,11 +4677,6 @@ MODULE_SCOPE const TclFileAttrProcs tclpFileAttrProcs[];
|
||||
(numChars) = _count; \
|
||||
} while (0);
|
||||
|
||||
#define TclUtfPrev(src, start) \
|
||||
(((src) < (start) + 2) ? (start) : \
|
||||
((unsigned char) *((src) - 1)) < 0x80 ? (src) - 1 : \
|
||||
Tcl_UtfPrev(src, start))
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------
|
||||
* Macro that encapsulates the logic that determines when it is safe to
|
||||
@@ -4936,7 +4908,7 @@ MODULE_SCOPE Tcl_PackageInitProc Procbodytest_SafeInit;
|
||||
* Computes number of bytes from beginning of structure to a given field.
|
||||
*/
|
||||
|
||||
#if !defined(TCL_NO_DEPRECATED) && !defined(BUILD_tcl)
|
||||
#ifndef TCL_NO_DEPRECATED
|
||||
# define TclOffset(type, field) ((int) offsetof(type, field))
|
||||
#endif
|
||||
/* Workaround for platforms missing offsetof(), e.g. VC++ 6.0 */
|
||||
@@ -4961,30 +4933,10 @@ MODULE_SCOPE Tcl_PackageInitProc Procbodytest_SafeInit;
|
||||
* the internal stubs, but the core can use the macro instead.
|
||||
*/
|
||||
|
||||
#define TclCleanupCommandMacro(cmdPtr) \
|
||||
do { \
|
||||
if ((cmdPtr)->refCount-- <= 1) { \
|
||||
ckfree(cmdPtr); \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
|
||||
/*
|
||||
* inside this routine crement refCount first incase cmdPtr is replacing itself
|
||||
*/
|
||||
#define TclRoutineAssign(location, cmdPtr) \
|
||||
do { \
|
||||
(cmdPtr)->refCount++; \
|
||||
if ((location) != NULL \
|
||||
&& (location--) <= 1) { \
|
||||
ckfree(((location))); \
|
||||
} \
|
||||
(location) = (cmdPtr); \
|
||||
} while (0)
|
||||
|
||||
|
||||
#define TclRoutineHasName(cmdPtr) \
|
||||
((cmdPtr)->hPtr != NULL)
|
||||
#define TclCleanupCommandMacro(cmdPtr) \
|
||||
if ((cmdPtr)->refCount-- <= 1) { \
|
||||
ckfree(cmdPtr);\
|
||||
}
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------
|
||||
@@ -5062,7 +5014,7 @@ MODULE_SCOPE Tcl_PackageInitProc Procbodytest_SafeInit;
|
||||
Tcl_Obj *_objPtr; \
|
||||
TCL_CT_ASSERT((nbytes)<=sizeof(Tcl_Obj)); \
|
||||
TclNewObj(_objPtr); \
|
||||
*(void **)&memPtr = (void *) _objPtr; \
|
||||
*(void **)memPtr = (void *) _objPtr; \
|
||||
} while (0)
|
||||
|
||||
#define TclSmallFreeEx(interp, memPtr) \
|
||||
|
||||
+6
-17
@@ -623,7 +623,7 @@ EXTERN int TclCopyChannel(Tcl_Interp *interp,
|
||||
EXTERN char * TclDoubleDigits(double dv, int ndigits, int flags,
|
||||
int *decpt, int *signum, char **endPtr);
|
||||
/* 250 */
|
||||
EXTERN void TclSetChildCancelFlags(Tcl_Interp *interp, int flags,
|
||||
EXTERN void TclSetSlaveCancelFlags(Tcl_Interp *interp, int flags,
|
||||
int force);
|
||||
/* 251 */
|
||||
EXTERN int TclRegisterLiteral(void *envPtr, const char *bytes,
|
||||
@@ -659,9 +659,6 @@ EXTERN void TclStaticPackage(Tcl_Interp *interp,
|
||||
EXTERN Tcl_Obj * TclpCreateTemporaryDirectory(Tcl_Obj *dirObj,
|
||||
Tcl_Obj *basenameObj);
|
||||
/* 259 */
|
||||
EXTERN unsigned char * TclGetBytesFromObj(Tcl_Interp *interp,
|
||||
Tcl_Obj *objPtr, int *lengthPtr);
|
||||
/* 260 */
|
||||
EXTERN void TclUnusedStubEntry(void);
|
||||
|
||||
typedef struct TclIntStubs {
|
||||
@@ -918,7 +915,7 @@ typedef struct TclIntStubs {
|
||||
void (*tclResetRewriteEnsemble) (Tcl_Interp *interp, int isRootEnsemble); /* 247 */
|
||||
int (*tclCopyChannel) (Tcl_Interp *interp, Tcl_Channel inChan, Tcl_Channel outChan, Tcl_WideInt toRead, Tcl_Obj *cmdPtr); /* 248 */
|
||||
char * (*tclDoubleDigits) (double dv, int ndigits, int flags, int *decpt, int *signum, char **endPtr); /* 249 */
|
||||
void (*tclSetChildCancelFlags) (Tcl_Interp *interp, int flags, int force); /* 250 */
|
||||
void (*tclSetSlaveCancelFlags) (Tcl_Interp *interp, int flags, int force); /* 250 */
|
||||
int (*tclRegisterLiteral) (void *envPtr, const char *bytes, int length, int flags); /* 251 */
|
||||
Tcl_Obj * (*tclPtrGetVar) (Tcl_Interp *interp, Tcl_Var varPtr, Tcl_Var arrayPtr, Tcl_Obj *part1Ptr, Tcl_Obj *part2Ptr, const int flags); /* 252 */
|
||||
Tcl_Obj * (*tclPtrSetVar) (Tcl_Interp *interp, Tcl_Var varPtr, Tcl_Var arrayPtr, Tcl_Obj *part1Ptr, Tcl_Obj *part2Ptr, Tcl_Obj *newValuePtr, const int flags); /* 253 */
|
||||
@@ -927,8 +924,7 @@ typedef struct TclIntStubs {
|
||||
int (*tclPtrUnsetVar) (Tcl_Interp *interp, Tcl_Var varPtr, Tcl_Var arrayPtr, Tcl_Obj *part1Ptr, Tcl_Obj *part2Ptr, const int flags); /* 256 */
|
||||
void (*tclStaticPackage) (Tcl_Interp *interp, const char *pkgName, Tcl_PackageInitProc *initProc, Tcl_PackageInitProc *safeInitProc); /* 257 */
|
||||
Tcl_Obj * (*tclpCreateTemporaryDirectory) (Tcl_Obj *dirObj, Tcl_Obj *basenameObj); /* 258 */
|
||||
unsigned char * (*tclGetBytesFromObj) (Tcl_Interp *interp, Tcl_Obj *objPtr, int *lengthPtr); /* 259 */
|
||||
void (*tclUnusedStubEntry) (void); /* 260 */
|
||||
void (*tclUnusedStubEntry) (void); /* 259 */
|
||||
} TclIntStubs;
|
||||
|
||||
extern const TclIntStubs *tclIntStubsPtr;
|
||||
@@ -1356,8 +1352,8 @@ extern const TclIntStubs *tclIntStubsPtr;
|
||||
(tclIntStubsPtr->tclCopyChannel) /* 248 */
|
||||
#define TclDoubleDigits \
|
||||
(tclIntStubsPtr->tclDoubleDigits) /* 249 */
|
||||
#define TclSetChildCancelFlags \
|
||||
(tclIntStubsPtr->tclSetChildCancelFlags) /* 250 */
|
||||
#define TclSetSlaveCancelFlags \
|
||||
(tclIntStubsPtr->tclSetSlaveCancelFlags) /* 250 */
|
||||
#define TclRegisterLiteral \
|
||||
(tclIntStubsPtr->tclRegisterLiteral) /* 251 */
|
||||
#define TclPtrGetVar \
|
||||
@@ -1374,10 +1370,8 @@ extern const TclIntStubs *tclIntStubsPtr;
|
||||
(tclIntStubsPtr->tclStaticPackage) /* 257 */
|
||||
#define TclpCreateTemporaryDirectory \
|
||||
(tclIntStubsPtr->tclpCreateTemporaryDirectory) /* 258 */
|
||||
#define TclGetBytesFromObj \
|
||||
(tclIntStubsPtr->tclGetBytesFromObj) /* 259 */
|
||||
#define TclUnusedStubEntry \
|
||||
(tclIntStubsPtr->tclUnusedStubEntry) /* 260 */
|
||||
(tclIntStubsPtr->tclUnusedStubEntry) /* 259 */
|
||||
|
||||
#endif /* defined(USE_TCL_STUBS) */
|
||||
|
||||
@@ -1413,9 +1407,4 @@ extern const TclIntStubs *tclIntStubsPtr;
|
||||
# define Tcl_StaticPackage (tclIntStubsPtr->tclStaticPackage)
|
||||
#endif
|
||||
|
||||
#undef TclGuessPackageName
|
||||
#ifndef TCL_NO_DEPRECATED
|
||||
# define TclGuessPackageName(fileName, pkgName) ((void)fileName,(void)pkgName,0)
|
||||
#endif
|
||||
|
||||
#endif /* _TCLINTDECLS */
|
||||
|
||||
@@ -602,7 +602,7 @@ extern const TclIntPlatStubs *tclIntPlatStubsPtr;
|
||||
# endif /* TCL_NO_DEPRECATED */
|
||||
#else
|
||||
# undef TclpGetPid
|
||||
# define TclpGetPid(pid) ((int)(size_t)(pid))
|
||||
# define TclpGetPid(pid) ((unsigned long) (pid))
|
||||
#endif
|
||||
|
||||
#endif /* _TCLINTPLATDECLS */
|
||||
|
||||
+571
-585
File diff suppressed because it is too large
Load Diff
+19
-19
@@ -911,8 +911,8 @@ LinkTraceProc(
|
||||
return (char *) "wrong size of char* value";
|
||||
}
|
||||
if (linkPtr->flags & LINK_ALLOC_LAST) {
|
||||
memcpy(linkPtr->lastValue.aryPtr, value, valueLength);
|
||||
memcpy(linkPtr->addr, value, valueLength);
|
||||
memcpy(linkPtr->lastValue.aryPtr, value, (size_t) valueLength);
|
||||
memcpy(linkPtr->addr, value, (size_t) valueLength);
|
||||
} else {
|
||||
linkPtr->lastValue.c = '\0';
|
||||
LinkedVar(char) = linkPtr->lastValue.c;
|
||||
@@ -925,8 +925,8 @@ LinkTraceProc(
|
||||
return (char *) "wrong size of binary value";
|
||||
}
|
||||
if (linkPtr->flags & LINK_ALLOC_LAST) {
|
||||
memcpy(linkPtr->lastValue.aryPtr, value, valueLength);
|
||||
memcpy(linkPtr->addr, value, valueLength);
|
||||
memcpy(linkPtr->lastValue.aryPtr, value, (size_t) valueLength);
|
||||
memcpy(linkPtr->addr, value, (size_t) valueLength);
|
||||
} else {
|
||||
linkPtr->lastValue.uc = (unsigned char) *value;
|
||||
LinkedVar(unsigned char) = linkPtr->lastValue.uc;
|
||||
@@ -1296,20 +1296,20 @@ ObjValue(
|
||||
memcpy(linkPtr->lastValue.aryPtr, linkPtr->addr, linkPtr->bytes);
|
||||
objv = (Tcl_Obj **)ckalloc(linkPtr->numElems * sizeof(Tcl_Obj *));
|
||||
for (i=0; i < linkPtr->numElems; i++) {
|
||||
TclNewIntObj(objv[i], linkPtr->lastValue.iPtr[i]);
|
||||
objv[i] = Tcl_NewIntObj(linkPtr->lastValue.iPtr[i]);
|
||||
}
|
||||
resultObj = Tcl_NewListObj(linkPtr->numElems, objv);
|
||||
ckfree(objv);
|
||||
return resultObj;
|
||||
}
|
||||
linkPtr->lastValue.i = LinkedVar(int);
|
||||
return Tcl_NewWideIntObj(linkPtr->lastValue.i);
|
||||
return Tcl_NewIntObj(linkPtr->lastValue.i);
|
||||
case TCL_LINK_WIDE_INT:
|
||||
if (linkPtr->flags & LINK_ALLOC_LAST) {
|
||||
memcpy(linkPtr->lastValue.aryPtr, linkPtr->addr, linkPtr->bytes);
|
||||
objv = (Tcl_Obj **)ckalloc(linkPtr->numElems * sizeof(Tcl_Obj *));
|
||||
for (i=0; i < linkPtr->numElems; i++) {
|
||||
TclNewIntObj(objv[i], linkPtr->lastValue.wPtr[i]);
|
||||
objv[i] = Tcl_NewWideIntObj(linkPtr->lastValue.wPtr[i]);
|
||||
}
|
||||
resultObj = Tcl_NewListObj(linkPtr->numElems, objv);
|
||||
ckfree(objv);
|
||||
@@ -1348,59 +1348,59 @@ ObjValue(
|
||||
memcpy(linkPtr->lastValue.aryPtr, linkPtr->addr, linkPtr->bytes);
|
||||
objv = (Tcl_Obj **)ckalloc(linkPtr->numElems * sizeof(Tcl_Obj *));
|
||||
for (i=0; i < linkPtr->numElems; i++) {
|
||||
TclNewIntObj(objv[i], linkPtr->lastValue.cPtr[i]);
|
||||
objv[i] = Tcl_NewIntObj(linkPtr->lastValue.cPtr[i]);
|
||||
}
|
||||
resultObj = Tcl_NewListObj(linkPtr->numElems, objv);
|
||||
ckfree(objv);
|
||||
return resultObj;
|
||||
}
|
||||
linkPtr->lastValue.c = LinkedVar(char);
|
||||
return Tcl_NewWideIntObj(linkPtr->lastValue.c);
|
||||
return Tcl_NewIntObj(linkPtr->lastValue.c);
|
||||
case TCL_LINK_UCHAR:
|
||||
if (linkPtr->flags & LINK_ALLOC_LAST) {
|
||||
memcpy(linkPtr->lastValue.aryPtr, linkPtr->addr, linkPtr->bytes);
|
||||
objv = (Tcl_Obj **)ckalloc(linkPtr->numElems * sizeof(Tcl_Obj *));
|
||||
for (i=0; i < linkPtr->numElems; i++) {
|
||||
TclNewIntObj(objv[i], linkPtr->lastValue.ucPtr[i]);
|
||||
objv[i] = Tcl_NewIntObj(linkPtr->lastValue.ucPtr[i]);
|
||||
}
|
||||
resultObj = Tcl_NewListObj(linkPtr->numElems, objv);
|
||||
ckfree(objv);
|
||||
return resultObj;
|
||||
}
|
||||
linkPtr->lastValue.uc = LinkedVar(unsigned char);
|
||||
return Tcl_NewWideIntObj(linkPtr->lastValue.uc);
|
||||
return Tcl_NewIntObj(linkPtr->lastValue.uc);
|
||||
case TCL_LINK_SHORT:
|
||||
if (linkPtr->flags & LINK_ALLOC_LAST) {
|
||||
memcpy(linkPtr->lastValue.aryPtr, linkPtr->addr, linkPtr->bytes);
|
||||
objv = (Tcl_Obj **)ckalloc(linkPtr->numElems * sizeof(Tcl_Obj *));
|
||||
for (i=0; i < linkPtr->numElems; i++) {
|
||||
TclNewIntObj(objv[i], linkPtr->lastValue.sPtr[i]);
|
||||
objv[i] = Tcl_NewIntObj(linkPtr->lastValue.sPtr[i]);
|
||||
}
|
||||
resultObj = Tcl_NewListObj(linkPtr->numElems, objv);
|
||||
ckfree(objv);
|
||||
return resultObj;
|
||||
}
|
||||
linkPtr->lastValue.s = LinkedVar(short);
|
||||
return Tcl_NewWideIntObj(linkPtr->lastValue.s);
|
||||
return Tcl_NewIntObj(linkPtr->lastValue.s);
|
||||
case TCL_LINK_USHORT:
|
||||
if (linkPtr->flags & LINK_ALLOC_LAST) {
|
||||
memcpy(linkPtr->lastValue.aryPtr, linkPtr->addr, linkPtr->bytes);
|
||||
objv = (Tcl_Obj **)ckalloc(linkPtr->numElems * sizeof(Tcl_Obj *));
|
||||
for (i=0; i < linkPtr->numElems; i++) {
|
||||
TclNewIntObj(objv[i], linkPtr->lastValue.usPtr[i]);
|
||||
objv[i] = Tcl_NewIntObj(linkPtr->lastValue.usPtr[i]);
|
||||
}
|
||||
resultObj = Tcl_NewListObj(linkPtr->numElems, objv);
|
||||
ckfree(objv);
|
||||
return resultObj;
|
||||
}
|
||||
linkPtr->lastValue.us = LinkedVar(unsigned short);
|
||||
return Tcl_NewWideIntObj(linkPtr->lastValue.us);
|
||||
return Tcl_NewIntObj(linkPtr->lastValue.us);
|
||||
case TCL_LINK_UINT:
|
||||
if (linkPtr->flags & LINK_ALLOC_LAST) {
|
||||
memcpy(linkPtr->lastValue.aryPtr, linkPtr->addr, linkPtr->bytes);
|
||||
objv = (Tcl_Obj **)ckalloc(linkPtr->numElems * sizeof(Tcl_Obj *));
|
||||
for (i=0; i < linkPtr->numElems; i++) {
|
||||
TclNewIntObj(objv[i], linkPtr->lastValue.uiPtr[i]);
|
||||
objv[i] = Tcl_NewWideIntObj(linkPtr->lastValue.uiPtr[i]);
|
||||
}
|
||||
resultObj = Tcl_NewListObj(linkPtr->numElems, objv);
|
||||
ckfree(objv);
|
||||
@@ -1414,7 +1414,7 @@ ObjValue(
|
||||
memcpy(linkPtr->lastValue.aryPtr, linkPtr->addr, linkPtr->bytes);
|
||||
objv = (Tcl_Obj **)ckalloc(linkPtr->numElems * sizeof(Tcl_Obj *));
|
||||
for (i=0; i < linkPtr->numElems; i++) {
|
||||
TclNewIntObj(objv[i], linkPtr->lastValue.lPtr[i]);
|
||||
objv[i] = Tcl_NewWideIntObj(linkPtr->lastValue.lPtr[i]);
|
||||
}
|
||||
resultObj = Tcl_NewListObj(linkPtr->numElems, objv);
|
||||
ckfree(objv);
|
||||
@@ -1427,7 +1427,7 @@ ObjValue(
|
||||
memcpy(linkPtr->lastValue.aryPtr, linkPtr->addr, linkPtr->bytes);
|
||||
objv = (Tcl_Obj **)ckalloc(linkPtr->numElems * sizeof(Tcl_Obj *));
|
||||
for (i=0; i < linkPtr->numElems; i++) {
|
||||
TclNewIntObj(objv[i], linkPtr->lastValue.ulPtr[i]);
|
||||
objv[i] = Tcl_NewWideIntObj(linkPtr->lastValue.ulPtr[i]);
|
||||
}
|
||||
resultObj = Tcl_NewListObj(linkPtr->numElems, objv);
|
||||
ckfree(objv);
|
||||
@@ -1454,7 +1454,7 @@ ObjValue(
|
||||
memcpy(linkPtr->lastValue.aryPtr, linkPtr->addr, linkPtr->bytes);
|
||||
objv = (Tcl_Obj **)ckalloc(linkPtr->numElems * sizeof(Tcl_Obj *));
|
||||
for (i=0; i < linkPtr->numElems; i++) {
|
||||
TclNewIntObj(objv[i], (Tcl_WideInt)
|
||||
objv[i] = Tcl_NewWideIntObj((Tcl_WideInt)
|
||||
linkPtr->lastValue.uwPtr[i]);
|
||||
}
|
||||
resultObj = Tcl_NewListObj(linkPtr->numElems, objv);
|
||||
|
||||
@@ -479,9 +479,7 @@ TclListObjRange(
|
||||
toIdx = listLen-1;
|
||||
}
|
||||
if (fromIdx > toIdx) {
|
||||
Tcl_Obj *obj;
|
||||
TclNewObj(obj);
|
||||
return obj;
|
||||
return Tcl_NewObj();
|
||||
}
|
||||
|
||||
newLen = toIdx - fromIdx + 1;
|
||||
@@ -1093,7 +1091,7 @@ Tcl_ListObjReplace(
|
||||
if ((numAfterLast > 0) && (shift != 0)) {
|
||||
Tcl_Obj **src = elemPtrs + start;
|
||||
|
||||
memmove(src+shift, src, numAfterLast * sizeof(Tcl_Obj*));
|
||||
memmove(src+shift, src, (size_t) numAfterLast * sizeof(Tcl_Obj*));
|
||||
}
|
||||
} else {
|
||||
/*
|
||||
@@ -1265,7 +1263,7 @@ TclLindexList(
|
||||
|
||||
ListGetIntRep(argPtr, listRepPtr);
|
||||
if ((listRepPtr == NULL)
|
||||
&& TclGetIntForIndexM(NULL , argPtr, INT_MAX - 1, &index) == TCL_OK) {
|
||||
&& TclGetIntForIndexM(NULL , argPtr, 0, &index) == TCL_OK) {
|
||||
/*
|
||||
* argPtr designates a single index.
|
||||
*/
|
||||
@@ -1375,13 +1373,13 @@ TclLindexFlat(
|
||||
*/
|
||||
|
||||
while (++i < indexCount) {
|
||||
if (TclGetIntForIndexM(interp, indexArray[i], INT_MAX - 1, &index)
|
||||
if (TclGetIntForIndexM(interp, indexArray[i], -1, &index)
|
||||
!= TCL_OK) {
|
||||
Tcl_DecrRefCount(sublistCopy);
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
TclNewObj(listPtr);
|
||||
listPtr = Tcl_NewObj();
|
||||
} else {
|
||||
/*
|
||||
* Extract the pointer to the appropriate element.
|
||||
@@ -1446,7 +1444,7 @@ TclLsetList(
|
||||
|
||||
ListGetIntRep(indexArgPtr, listRepPtr);
|
||||
if (listRepPtr == NULL
|
||||
&& TclGetIntForIndexM(NULL, indexArgPtr, INT_MAX - 1, &index) == TCL_OK) {
|
||||
&& TclGetIntForIndexM(NULL, indexArgPtr, 0, &index) == TCL_OK) {
|
||||
/*
|
||||
* indexArgPtr designates a single index.
|
||||
*/
|
||||
@@ -1625,7 +1623,7 @@ TclLsetFlat(
|
||||
if (--indexCount) {
|
||||
parentList = subListPtr;
|
||||
if (index == elemCount) {
|
||||
TclNewObj(subListPtr);
|
||||
subListPtr = Tcl_NewObj();
|
||||
} else {
|
||||
subListPtr = elemPtrs[index];
|
||||
}
|
||||
|
||||
@@ -994,8 +994,7 @@ RebuildLiteralTable(
|
||||
}
|
||||
|
||||
tablePtr->numBuckets *= 4;
|
||||
tablePtr->buckets = (LiteralEntry **)ckalloc(
|
||||
tablePtr->numBuckets * sizeof(LiteralEntry*));
|
||||
tablePtr->buckets = (LiteralEntry **)ckalloc(tablePtr->numBuckets * sizeof(LiteralEntry*));
|
||||
for (count=tablePtr->numBuckets, newChainPtr=tablePtr->buckets;
|
||||
count>0 ; count--, newChainPtr++) {
|
||||
*newChainPtr = NULL;
|
||||
|
||||
+72
-55
@@ -115,7 +115,7 @@ static void LoadCleanupProc(ClientData clientData,
|
||||
|
||||
int
|
||||
Tcl_LoadObjCmd(
|
||||
TCL_UNUSED(void *),
|
||||
TCL_UNUSED(ClientData),
|
||||
Tcl_Interp *interp, /* Current interpreter. */
|
||||
int objc, /* Number of arguments. */
|
||||
Tcl_Obj *const objv[]) /* Argument objects. */
|
||||
@@ -137,7 +137,7 @@ Tcl_LoadObjCmd(
|
||||
static const char *const options[] = {
|
||||
"-global", "-lazy", "--", NULL
|
||||
};
|
||||
enum loadOptionsEnum {
|
||||
enum options {
|
||||
LOAD_GLOBAL, LOAD_LAZY, LOAD_LAST
|
||||
};
|
||||
|
||||
@@ -150,9 +150,9 @@ Tcl_LoadObjCmd(
|
||||
return TCL_ERROR;
|
||||
}
|
||||
++objv; --objc;
|
||||
if (LOAD_GLOBAL == (enum loadOptionsEnum) index) {
|
||||
if (LOAD_GLOBAL == (enum options) index) {
|
||||
flags |= TCL_LOAD_GLOBAL;
|
||||
} else if (LOAD_LAZY == (enum loadOptionsEnum) index) {
|
||||
} else if (LOAD_LAZY == (enum options) index) {
|
||||
flags |= TCL_LOAD_LAZY;
|
||||
} else {
|
||||
break;
|
||||
@@ -196,9 +196,9 @@ Tcl_LoadObjCmd(
|
||||
|
||||
target = interp;
|
||||
if (objc == 4) {
|
||||
const char *childIntName = Tcl_GetString(objv[3]);
|
||||
const char *slaveIntName = Tcl_GetString(objv[3]);
|
||||
|
||||
target = Tcl_GetChild(interp, childIntName);
|
||||
target = Tcl_GetSlave(interp, slaveIntName);
|
||||
if (target == NULL) {
|
||||
code = TCL_ERROR;
|
||||
goto done;
|
||||
@@ -302,55 +302,60 @@ Tcl_LoadObjCmd(
|
||||
if (packageName != NULL) {
|
||||
Tcl_DStringAppend(&pkgName, packageName, -1);
|
||||
} else {
|
||||
Tcl_Obj *splitPtr, *pkgGuessPtr;
|
||||
int pElements;
|
||||
const char *pkgGuess;
|
||||
int retc;
|
||||
|
||||
/*
|
||||
* Threading note - this call used to be protected by a mutex.
|
||||
*/
|
||||
|
||||
/*
|
||||
* The platform-specific code couldn't figure out the module
|
||||
* name. Make a guess by taking the last element of the file
|
||||
* name, stripping off any leading "lib", and then using all
|
||||
* of the alphabetic and underline characters that follow
|
||||
* that.
|
||||
*/
|
||||
retc = TclGuessPackageName(fullFileName, &pkgName);
|
||||
if (!retc) {
|
||||
Tcl_Obj *splitPtr, *pkgGuessPtr;
|
||||
int pElements;
|
||||
const char *pkgGuess;
|
||||
|
||||
splitPtr = Tcl_FSSplitPath(objv[1], &pElements);
|
||||
Tcl_ListObjIndex(NULL, splitPtr, pElements -1, &pkgGuessPtr);
|
||||
pkgGuess = Tcl_GetString(pkgGuessPtr);
|
||||
if ((pkgGuess[0] == 'l') && (pkgGuess[1] == 'i')
|
||||
&& (pkgGuess[2] == 'b')) {
|
||||
pkgGuess += 3;
|
||||
}
|
||||
#ifdef __CYGWIN__
|
||||
else if ((pkgGuess[0] == 'c') && (pkgGuess[1] == 'y')
|
||||
&& (pkgGuess[2] == 'g')) {
|
||||
pkgGuess += 3;
|
||||
}
|
||||
#endif /* __CYGWIN__ */
|
||||
for (p = pkgGuess; *p != 0; p += offset) {
|
||||
offset = TclUtfToUniChar(p, &ch);
|
||||
if ((ch > 0x100)
|
||||
|| !(isalpha(UCHAR(ch)) /* INTL: ISO only */
|
||||
|| (UCHAR(ch) == '_'))) {
|
||||
break;
|
||||
/*
|
||||
* The platform-specific code couldn't figure out the module
|
||||
* name. Make a guess by taking the last element of the file
|
||||
* name, stripping off any leading "lib", and then using all
|
||||
* of the alphabetic and underline characters that follow
|
||||
* that.
|
||||
*/
|
||||
|
||||
splitPtr = Tcl_FSSplitPath(objv[1], &pElements);
|
||||
Tcl_ListObjIndex(NULL, splitPtr, pElements -1, &pkgGuessPtr);
|
||||
pkgGuess = Tcl_GetString(pkgGuessPtr);
|
||||
if ((pkgGuess[0] == 'l') && (pkgGuess[1] == 'i')
|
||||
&& (pkgGuess[2] == 'b')) {
|
||||
pkgGuess += 3;
|
||||
}
|
||||
}
|
||||
if (p == pkgGuess) {
|
||||
#ifdef __CYGWIN__
|
||||
if ((pkgGuess[0] == 'c') && (pkgGuess[1] == 'y')
|
||||
&& (pkgGuess[2] == 'g')) {
|
||||
pkgGuess += 3;
|
||||
}
|
||||
#endif /* __CYGWIN__ */
|
||||
for (p = pkgGuess; *p != 0; p += offset) {
|
||||
offset = TclUtfToUniChar(p, &ch);
|
||||
if ((ch > 0x100)
|
||||
|| !(isalpha(UCHAR(ch)) /* INTL: ISO only */
|
||||
|| (UCHAR(ch) == '_'))) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (p == pkgGuess) {
|
||||
Tcl_DecrRefCount(splitPtr);
|
||||
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
|
||||
"couldn't figure out package name for %s",
|
||||
fullFileName));
|
||||
Tcl_SetErrorCode(interp, "TCL", "OPERATION", "LOAD",
|
||||
"WHATPACKAGE", NULL);
|
||||
code = TCL_ERROR;
|
||||
goto done;
|
||||
}
|
||||
Tcl_DStringAppend(&pkgName, pkgGuess, p - pkgGuess);
|
||||
Tcl_DecrRefCount(splitPtr);
|
||||
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
|
||||
"couldn't figure out package name for %s",
|
||||
fullFileName));
|
||||
Tcl_SetErrorCode(interp, "TCL", "OPERATION", "LOAD",
|
||||
"WHATPACKAGE", NULL);
|
||||
code = TCL_ERROR;
|
||||
goto done;
|
||||
}
|
||||
Tcl_DStringAppend(&pkgName, pkgGuess, p - pkgGuess);
|
||||
Tcl_DecrRefCount(splitPtr);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -537,7 +542,7 @@ Tcl_LoadObjCmd(
|
||||
|
||||
int
|
||||
Tcl_UnloadObjCmd(
|
||||
TCL_UNUSED(void *),
|
||||
TCL_UNUSED(ClientData),
|
||||
Tcl_Interp *interp, /* Current interpreter. */
|
||||
int objc, /* Number of arguments. */
|
||||
Tcl_Obj *const objv[]) /* Argument objects. */
|
||||
@@ -554,7 +559,7 @@ Tcl_UnloadObjCmd(
|
||||
static const char *const options[] = {
|
||||
"-nocomplain", "-keeplibrary", "--", NULL
|
||||
};
|
||||
enum unloadOptionsEnum {
|
||||
enum options {
|
||||
UNLOAD_NOCOMPLAIN, UNLOAD_KEEPLIB, UNLOAD_LAST
|
||||
};
|
||||
|
||||
@@ -579,7 +584,7 @@ Tcl_UnloadObjCmd(
|
||||
break;
|
||||
}
|
||||
}
|
||||
switch ((enum unloadOptionsEnum)index) {
|
||||
switch (index) {
|
||||
case UNLOAD_NOCOMPLAIN: /* -nocomplain */
|
||||
complain = 0;
|
||||
break;
|
||||
@@ -627,9 +632,9 @@ Tcl_UnloadObjCmd(
|
||||
|
||||
target = interp;
|
||||
if (objc - i == 3) {
|
||||
const char *childIntName = Tcl_GetString(objv[i + 2]);
|
||||
const char *slaveIntName = Tcl_GetString(objv[i + 2]);
|
||||
|
||||
target = Tcl_GetChild(interp, childIntName);
|
||||
target = Tcl_GetSlave(interp, slaveIntName);
|
||||
if (target == NULL) {
|
||||
return TCL_ERROR;
|
||||
}
|
||||
@@ -1020,7 +1025,7 @@ Tcl_StaticPackage(
|
||||
/*
|
||||
*----------------------------------------------------------------------
|
||||
*
|
||||
* TclGetLoadedPackagesEx --
|
||||
* TclGetLoadedPackages, TclGetLoadedPackagesEx --
|
||||
*
|
||||
* This function returns information about all of the files that are
|
||||
* loaded (either in a particular interpreter, or for all interpreters).
|
||||
@@ -1038,6 +1043,18 @@ Tcl_StaticPackage(
|
||||
*----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
int
|
||||
TclGetLoadedPackages(
|
||||
Tcl_Interp *interp, /* Interpreter in which to return information
|
||||
* or error message. */
|
||||
const char *targetName) /* Name of target interpreter or NULL. If
|
||||
* NULL, return info about all interps;
|
||||
* otherwise, just return info about this
|
||||
* interpreter. */
|
||||
{
|
||||
return TclGetLoadedPackagesEx(interp, targetName, NULL);
|
||||
}
|
||||
|
||||
int
|
||||
TclGetLoadedPackagesEx(
|
||||
Tcl_Interp *interp, /* Interpreter in which to return information
|
||||
@@ -1056,7 +1073,7 @@ TclGetLoadedPackagesEx(
|
||||
Tcl_Obj *resultObj, *pkgDesc[2];
|
||||
|
||||
if (targetName == NULL) {
|
||||
TclNewObj(resultObj);
|
||||
resultObj = Tcl_NewObj();
|
||||
Tcl_MutexLock(&packageMutex);
|
||||
for (pkgPtr = firstPackagePtr; pkgPtr != NULL;
|
||||
pkgPtr = pkgPtr->nextPtr) {
|
||||
@@ -1070,7 +1087,7 @@ TclGetLoadedPackagesEx(
|
||||
return TCL_OK;
|
||||
}
|
||||
|
||||
target = Tcl_GetChild(interp, targetName);
|
||||
target = Tcl_GetSlave(interp, targetName);
|
||||
if (target == NULL) {
|
||||
return TCL_ERROR;
|
||||
}
|
||||
@@ -1102,7 +1119,7 @@ TclGetLoadedPackagesEx(
|
||||
* interpreter.
|
||||
*/
|
||||
|
||||
TclNewObj(resultObj);
|
||||
resultObj = Tcl_NewObj();
|
||||
for (; ipPtr != NULL; ipPtr = ipPtr->nextPtr) {
|
||||
pkgPtr = ipPtr->pkgPtr;
|
||||
pkgDesc[0] = Tcl_NewStringObj(pkgPtr->fileName, -1);
|
||||
|
||||
@@ -53,6 +53,36 @@ TclpDlopen(
|
||||
return TCL_ERROR;
|
||||
}
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------------
|
||||
*
|
||||
* TclGuessPackageName --
|
||||
*
|
||||
* If the "load" command is invoked without providing a package name,
|
||||
* this procedure is invoked to try to figure it out.
|
||||
*
|
||||
* Results:
|
||||
* Always returns 0 to indicate that we couldn't figure out a package
|
||||
* name; generic code will then try to guess the package from the file
|
||||
* name. A return value of 1 would have meant that we figured out the
|
||||
* package name and put it in bufPtr.
|
||||
*
|
||||
* Side effects:
|
||||
* None.
|
||||
*
|
||||
*----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
int
|
||||
TclGuessPackageName(
|
||||
const char *fileName, /* Name of file containing package (already
|
||||
* translated to local form if needed). */
|
||||
Tcl_DString *bufPtr) /* Initialized empty dstring. Append package
|
||||
* name to this if possible. */
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* These functions are fallbacks if we somehow determine that the platform can
|
||||
* do loading from memory but the user wishes to disable it. They just report
|
||||
|
||||
+7
-8
@@ -43,7 +43,7 @@
|
||||
# define _tcscmp strcmp
|
||||
#endif
|
||||
|
||||
static Tcl_Obj *
|
||||
static inline Tcl_Obj *
|
||||
NewNativeObj(
|
||||
TCHAR *string)
|
||||
{
|
||||
@@ -53,7 +53,7 @@ NewNativeObj(
|
||||
Tcl_DStringInit(&ds);
|
||||
Tcl_WCharToUtfDString(string, -1, &ds);
|
||||
#else
|
||||
Tcl_ExternalToUtfDString(NULL, (char *)string, -1, &ds);
|
||||
Tcl_ExternalToUtfDString(NULL, (char *) string, -1, &ds);
|
||||
#endif
|
||||
return TclDStringToObj(&ds);
|
||||
}
|
||||
@@ -307,7 +307,7 @@ Tcl_MainEx(
|
||||
|
||||
is.interp = interp;
|
||||
is.prompt = PROMPT_START;
|
||||
TclNewObj(is.commandPtr);
|
||||
is.commandPtr = Tcl_NewObj();
|
||||
|
||||
/*
|
||||
* If the application has not already set a startup script, parse the
|
||||
@@ -348,7 +348,7 @@ Tcl_MainEx(
|
||||
argc--;
|
||||
argv++;
|
||||
|
||||
Tcl_SetVar2Ex(interp, "argc", NULL, Tcl_NewWideIntObj(argc), TCL_GLOBAL_ONLY);
|
||||
Tcl_SetVar2Ex(interp, "argc", NULL, Tcl_NewIntObj(argc), TCL_GLOBAL_ONLY);
|
||||
|
||||
argvPtr = Tcl_NewListObj(0, NULL);
|
||||
while (argc--) {
|
||||
@@ -362,7 +362,7 @@ Tcl_MainEx(
|
||||
|
||||
is.tty = isatty(0);
|
||||
Tcl_SetVar2Ex(interp, "tcl_interactive", NULL,
|
||||
Tcl_NewWideIntObj(!path && is.tty), TCL_GLOBAL_ONLY);
|
||||
Tcl_NewIntObj(!path && is.tty), TCL_GLOBAL_ONLY);
|
||||
|
||||
/*
|
||||
* Invoke application-specific initialization.
|
||||
@@ -522,7 +522,7 @@ Tcl_MainEx(
|
||||
TCL_EVAL_GLOBAL);
|
||||
is.input = Tcl_GetStdChannel(TCL_STDIN);
|
||||
Tcl_DecrRefCount(is.commandPtr);
|
||||
TclNewObj(is.commandPtr);
|
||||
is.commandPtr = Tcl_NewObj();
|
||||
Tcl_IncrRefCount(is.commandPtr);
|
||||
if (code != TCL_OK) {
|
||||
chan = Tcl_GetStdChannel(TCL_STDERR);
|
||||
@@ -790,8 +790,7 @@ StdinProc(
|
||||
code = Tcl_RecordAndEvalObj(interp, commandPtr, TCL_EVAL_GLOBAL);
|
||||
isPtr->input = chan = Tcl_GetStdChannel(TCL_STDIN);
|
||||
Tcl_DecrRefCount(commandPtr);
|
||||
TclNewObj(commandPtr);
|
||||
isPtr->commandPtr = commandPtr;
|
||||
isPtr->commandPtr = commandPtr = Tcl_NewObj();
|
||||
Tcl_IncrRefCount(commandPtr);
|
||||
if (chan != NULL) {
|
||||
Tcl_CreateChannelHandler(chan, TCL_READABLE, StdinProc, isPtr);
|
||||
|
||||
+20
-24
@@ -1770,8 +1770,6 @@ DoImport(
|
||||
TclInvokeImportedCmd, InvokeImportedNRCmd, dataPtr,
|
||||
DeleteImportedCmd);
|
||||
dataPtr->realCmdPtr = cmdPtr;
|
||||
/* corresponding decrement is in DeleteImportedCmd */
|
||||
cmdPtr->refCount++;
|
||||
dataPtr->selfPtr = (Command *) importedCmd;
|
||||
dataPtr->selfPtr->compileProc = cmdPtr->compileProc;
|
||||
Tcl_DStringFree(&ds);
|
||||
@@ -2079,7 +2077,6 @@ DeleteImportedCmd(
|
||||
prevPtr->nextPtr = refPtr->nextPtr;
|
||||
}
|
||||
ckfree(refPtr);
|
||||
TclCleanupCommandMacro(realCmdPtr);
|
||||
ckfree(dataPtr);
|
||||
return;
|
||||
}
|
||||
@@ -3546,10 +3543,9 @@ NamespaceExportCmd(
|
||||
*/
|
||||
|
||||
if (objc == 1) {
|
||||
Tcl_Obj *listPtr;
|
||||
Tcl_Obj *listPtr = Tcl_NewObj();
|
||||
|
||||
TclNewObj(listPtr);
|
||||
(void)Tcl_AppendExportList(interp, NULL, listPtr);
|
||||
(void) Tcl_AppendExportList(interp, NULL, listPtr);
|
||||
Tcl_SetObjResult(interp, listPtr);
|
||||
return TCL_OK;
|
||||
}
|
||||
@@ -3892,7 +3888,7 @@ NamespaceOriginCmd(
|
||||
int objc, /* Number of arguments. */
|
||||
Tcl_Obj *const objv[]) /* Argument objects. */
|
||||
{
|
||||
Tcl_Command cmd, origCmd;
|
||||
Tcl_Command command, origCommand;
|
||||
Tcl_Obj *resultPtr;
|
||||
|
||||
if (objc != 2) {
|
||||
@@ -3900,29 +3896,30 @@ NamespaceOriginCmd(
|
||||
return TCL_ERROR;
|
||||
}
|
||||
|
||||
cmd = Tcl_GetCommandFromObj(interp, objv[1]);
|
||||
if (cmd == NULL) {
|
||||
goto namespaceOriginError;
|
||||
}
|
||||
origCmd = TclGetOriginalCommand(cmd);
|
||||
if (origCmd == NULL) {
|
||||
origCmd = cmd;
|
||||
}
|
||||
TclNewObj(resultPtr);
|
||||
Tcl_GetCommandFullName(interp, origCmd, resultPtr);
|
||||
if (TclCheckEmptyString(resultPtr) == TCL_EMPTYSTRING_YES ) {
|
||||
Tcl_DecrRefCount(resultPtr);
|
||||
namespaceOriginError:
|
||||
command = Tcl_GetCommandFromObj(interp, objv[1]);
|
||||
if (command == NULL) {
|
||||
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
|
||||
"invalid command name \"%s\"", TclGetString(objv[1])));
|
||||
Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "COMMAND",
|
||||
TclGetString(objv[1]), NULL);
|
||||
return TCL_ERROR;
|
||||
}
|
||||
origCommand = TclGetOriginalCommand(command);
|
||||
TclNewObj(resultPtr);
|
||||
if (origCommand == NULL) {
|
||||
/*
|
||||
* The specified command isn't an imported command. Return the
|
||||
* command's name qualified by the full name of the namespace it was
|
||||
* defined in.
|
||||
*/
|
||||
|
||||
Tcl_GetCommandFullName(interp, command, resultPtr);
|
||||
} else {
|
||||
Tcl_GetCommandFullName(interp, origCommand, resultPtr);
|
||||
}
|
||||
Tcl_SetObjResult(interp, resultPtr);
|
||||
return TCL_OK;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------------
|
||||
@@ -4025,9 +4022,8 @@ NamespacePathCmd(
|
||||
*/
|
||||
|
||||
if (objc == 1) {
|
||||
Tcl_Obj *resultObj;
|
||||
Tcl_Obj *resultObj = Tcl_NewObj();
|
||||
|
||||
TclNewObj(resultObj);
|
||||
for (i=0 ; i<nsPtr->commandPathLength ; i++) {
|
||||
if (nsPtr->commandPathArray[i].nsPtr != NULL) {
|
||||
Tcl_ListObjAppendElement(NULL, resultObj, Tcl_NewStringObj(
|
||||
@@ -5020,7 +5016,7 @@ TclLogCommandInfo(
|
||||
*/
|
||||
|
||||
Tcl_ListObjAppendElement(NULL, iPtr->errorStack, iPtr->upLiteral);
|
||||
Tcl_ListObjAppendElement(NULL, iPtr->errorStack, Tcl_NewWideIntObj(
|
||||
Tcl_ListObjAppendElement(NULL, iPtr->errorStack, Tcl_NewIntObj(
|
||||
iPtr->framePtr->level - iPtr->varFramePtr->level));
|
||||
} else if (iPtr->framePtr != iPtr->rootFramePtr) {
|
||||
/*
|
||||
|
||||
+5
-5
@@ -133,7 +133,7 @@ static const Tcl_MethodType classConstructor = {
|
||||
};
|
||||
|
||||
/*
|
||||
* Scripted parts of TclOO. First, the main script (cannot be outside this
|
||||
* Scripted parts of TclOO. First, the master script (cannot be outside this
|
||||
* file).
|
||||
*/
|
||||
|
||||
@@ -258,7 +258,7 @@ TclOOInit(
|
||||
}
|
||||
|
||||
return Tcl_PkgProvideEx(interp, "TclOO", TCLOO_PATCHLEVEL,
|
||||
(void *) &tclOOStubs);
|
||||
(ClientData) &tclOOStubs);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -566,7 +566,7 @@ DeletedHelpersNamespace(
|
||||
|
||||
static void
|
||||
KillFoundation(
|
||||
TCL_UNUSED(void *),
|
||||
TCL_UNUSED(ClientData),
|
||||
Tcl_Interp *interp) /* The interpreter containing the OO system
|
||||
* foundation. */
|
||||
{
|
||||
@@ -1177,7 +1177,7 @@ ObjectNamespaceDeleted(
|
||||
* freed memory.
|
||||
*/
|
||||
|
||||
if (((Command *) oPtr->command)->flags && CMD_DYING) {
|
||||
if (((Command *) oPtr->command)->flags && CMD_IS_DELETED) {
|
||||
/*
|
||||
* Something has already started the command deletion process. We can
|
||||
* go ahead and clean up the the namespace,
|
||||
@@ -3035,7 +3035,7 @@ TclOOObjectName(
|
||||
if (oPtr->cachedNameObj) {
|
||||
return oPtr->cachedNameObj;
|
||||
}
|
||||
TclNewObj(namePtr);
|
||||
namePtr = Tcl_NewObj();
|
||||
Tcl_GetCommandFullName(interp, oPtr->command, namePtr);
|
||||
Tcl_IncrRefCount(namePtr);
|
||||
oPtr->cachedNameObj = namePtr;
|
||||
|
||||
@@ -831,7 +831,7 @@ TclOO_Object_VarName(
|
||||
* (including traversing variable links), convert back to a name.
|
||||
*/
|
||||
|
||||
TclNewObj(varNamePtr);
|
||||
varNamePtr = Tcl_NewObj();
|
||||
if (aryVar != NULL) {
|
||||
Tcl_GetVariableFullName(interp, (Tcl_Var) aryVar, varNamePtr);
|
||||
|
||||
@@ -1249,7 +1249,7 @@ TclOOSelfObjCmd(
|
||||
}
|
||||
case SELF_CALL:
|
||||
result[0] = TclOORenderCallChain(interp, contextPtr->callPtr);
|
||||
TclNewIntObj(result[1], contextPtr->index);
|
||||
result[1] = Tcl_NewIntObj(contextPtr->index);
|
||||
Tcl_SetObjResult(interp, Tcl_NewListObj(2, result));
|
||||
return TCL_OK;
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user