Compare commits

...
59 Commits
Author SHA1 Message Date
jan.nijtmans 188c4f944e contents.htm -> index.html and *.htm -> *.html 2020-11-24 08:24:12 +00:00
jan.nijtmans c15270a797 Fix "make dist" 2020-11-24 07:51:38 +00:00
jan.nijtmans 4a451f540f Generate html documentation in html5 format. Fix some html5 compatibiliy warnings.
Remove old htmlhelp-related parts (since this is obsolete since Vista)
2020-11-20 13:46:59 +00:00
jan.nijtmans b4cc01c658 Merge 8.6 2020-11-20 08:26:02 +00:00
jan.nijtmans ef7a8aec00 Use '&' in stead of 'and' in copyright statements consistantly 2020-11-20 08:24:53 +00:00
jan.nijtmans e8b55fb733 Allow tools/tcltk-man2html.tcl to work with both configure.in and configure.ac: It could be used in extensions which still use an older autoconf 2020-11-19 15:11:04 +00:00
jan.nijtmans 17e7dbc31a Merge-mark 8.5 2020-11-19 15:07:10 +00:00
jan.nijtmans d1dfef4884 Handle github actions test failures. Backported from 8.6 2020-11-19 09:39:20 +00:00
jan.nijtmans 8e1f957a66 More usage of TclUtfToUCS4/TclUniCharToUCS4 in stead of it's UniChar variants: This handles surrogate pairs better. 2020-11-18 13:51:02 +00:00
jan.nijtmans c55eb93bb4 Merge 8.6 2020-11-18 11:03:11 +00:00
jan.nijtmans 26156cc1cc Merge 8.5 2020-11-18 10:59:37 +00:00
jan.nijtmans f7b532246a Enhance misleading test-case utf-6.23 with better diagnostics: Byte 0xE8 is the start of a 3-byte UTF-8 sequence, so Tcl_UtfNext is expected to read next byte and see if it is a continuation byte 2020-11-18 09:49:08 +00:00
jan.nijtmans c4b8fd351a Add github actions build. Use Titlecase in Tcl_StaticPackage 2020-11-18 09:15:31 +00:00
jan.nijtmans a28856a322 Merge 8.6 2020-11-17 14:36:30 +00:00
jan.nijtmans f88225f6fb Extend tcltk-man2html-utils.tcl a little more: Allow original AT&T syntax for more accented characters, and add support for some ligatures. Use this in re_syntax.n 2020-11-17 14:35:42 +00:00
dkf 6098040754 Test fails with Windows in CI, not MSVC 2020-11-17 12:36:59 +00:00
oehhar 48385f8bba Ticket [ac661a684d]: Tcl_NotifyChannel man page: "no writable callback on pending flush" missing 2020-11-17 10:17:21 +00:00
oehhar 32e54c3504 Ticket [ac661a684d]: Tcl_NotifyChannel man page: "no writable callback on pending flush" missing 2020-11-17 10:11:24 +00:00
jan.nijtmans da2c0d731a Merge 8.6 2020-11-17 09:12:55 +00:00
jan.nijtmans 4929dd61e1 Generated html still not 100% correct .... 2020-11-17 09:11:09 +00:00
jan.nijtmans 95fad70001 Merge 8.6 2020-11-17 08:46:06 +00:00
jan.nijtmans ffda48d07b Extend tcltk-man2html-utils.tcl: Add euro-sign too 2020-11-17 08:45:22 +00:00
jan.nijtmans b9fdbb0710 Merge 8.6 2020-11-17 08:41:07 +00:00
jan.nijtmans 969ef21225 Extend tcltk-man2html-utils.tcl, so it can handle the TIP #588 man-page. Also fix 2 (minor) syntax errors in man-pages 2020-11-17 08:39:19 +00:00
oehhar d7092f4a55 Merge documentation changes for http and dict from branch [oehhar-documentation-tickets] 2020-11-16 15:08:17 +00:00
oehhar 0566be32d5 Merge documentation changes for http and dict from branch [oehhar-documentation-tickets] 2020-11-16 15:03:25 +00:00
oehhar 45aa988905 Ticket [361303]: http doc: status values incomplete 2020-11-16 14:37:00 +00:00
oehhar 7fa0505ae8 Ticket [4f511270af7]: http documentation: -query data may be any data 2020-11-16 14:14:36 +00:00
oehhar 413ce795e0 Ticket [93551c1230]: Document that http::geturl processes the event loop without -command 2020-11-16 14:06:50 +00:00
oehhar 71a412b8da Ticket [d8ae5d5f4c]: Documentation of dict filter script: script results, not returns a boolean 2020-11-16 13:55:33 +00:00
jan.nijtmans 32d5f89b18 Merge 8.6 2020-11-16 13:17:35 +00:00
jan.nijtmans 0589f3b799 Fix 2 testcases which failed when compiled with TCL_UTF_MAX>3 2020-11-16 13:12:26 +00:00
jan.nijtmans c13d3b0405 Merge 8.6 2020-11-16 12:55:49 +00:00
jan.nijtmans 0943b71810 Enhance misleading test-case utf-6.23 with better diagnostics: Byte 0xE8 is the start of a 3-byte UTF-8 sequence, so Tcl_UtfNext is expected to read next byte and see if it is a continuation byte.
Comment 4 testcases (utf-6.110/111/114/115) for being misleading too, because they don't even call Tcl_UtfNext().
No change to code, only testcases
2020-11-16 12:48:00 +00:00
jan.nijtmans a3a070b13c TIP #586 implementation: C String Parsing Support for binary scan 2020-11-16 10:53:58 +00:00
dkf dac1c2f4f2 Merge 8.6 2020-11-16 10:06:20 +00:00
dkf 106838de02 Clean up for GitHub Actions as our CI service 2020-11-16 09:26:07 +00:00
dkf ffa8d1d461 Disable test that fails in CI environments 2020-11-16 09:24:33 +00:00
dkf eff08da703 Rethinking how to do a build matrix on several platforms 2020-11-15 15:48:43 +00:00
dkf 807ed7b13c Added MSYS/gcc build for Windows, renamed Linux build step 2020-11-15 09:17:41 +00:00
dkf 3ef704b39c Updated README 2020-11-15 08:38:14 +00:00
dkf 346721f3f0 Fix minor errors 2020-11-15 08:35:49 +00:00
dkf b3e4fc2a04 Fixed some tests, added trial macOS build 2020-11-14 12:25:38 +00:00
dkf a22953bb77 Back to powershell 2020-11-14 09:31:49 +00:00
jan.nijtmans d8f5e027e2 merge-mark 2020-11-13 16:59:36 +00:00
jan.nijtmans 8e61a58c14 Backport [fc1e203728]: backout e56a9f214a. If it was wrong in core-8-branch, it's wrong here too. 2020-11-13 16:55:36 +00:00
culler c41e7ffff5 backout e56a9f214a 2020-11-10 18:47:47 +00:00
culler f809af7e7b Merge 8.6 2020-11-10 17:52:04 +00:00
culler a376924771 Set a default DESTDIR in macosx/GNUmakefile 2020-11-10 17:50:09 +00:00
dkf 20664f1fa1 Cleaning up the actions and trying to make them behave more usefully on Windows. 2020-11-10 09:26:10 +00:00
dkf 44d6e3ab5e merge mark 2020-11-09 09:15:00 +00:00
dkf 33955d6933 Copied build control files for Github Actions from 8.7 2020-11-09 09:13:57 +00:00
dkf f25b288505 Github Actions seem to be working 2020-11-09 09:07:42 +00:00
jan.nijtmans d9737c5991 Merge 8.7 2020-10-30 15:13:12 +00:00
jan.nijtmans fb3868da56 Merge 8.7 2020-10-28 15:10:36 +00:00
oehhar f145d5f091 Corrected doc: modifier C instead A 2020-10-28 06:59:12 +00:00
jan.nijtmans 577981fee9 re-trigger Travis build (and fix some eol-spacing) 2020-10-26 14:45:47 +00:00
oehhar 31145f178e Copied man page and test from Androwish https://www.androwish.org/home/ci/bc8b7e8094b66169 2020-10-26 10:53:29 +00:00
oehhar 861d8f512f TIP586: C String Parsing Support for binary scan 2020-10-25 20:03:10 +00:00
68 changed files with 566 additions and 6522 deletions
-2
View File
@@ -7,7 +7,6 @@ compat/zlib/win64/*.txt
libtommath/*.dsp
libtommath/*.sln
libtommath/*.vcproj
tools/tcl.hpj.in
tools/tcl.wse.in
win/buildall.vc.bat
win/coffbase.txt
@@ -17,4 +16,3 @@ win/rules-ext.vc
win/targets.vc
win/tcl.dsp
win/tcl.dsw
win/tcl.hpj.in
+1 -3
View File
@@ -1,9 +1,7 @@
tools/tcl.hpj.in
tools/tcl.wse.in
win/buildall.vc.bat
win/coffbase.txt
win/makefile.vc
win/rules.vc
win/tcl.dsp
win/tcl.dsw
win/tcl.hpj.in
win/tcl.dsw
+17 -9
View File
@@ -1,37 +1,45 @@
name: Linux Build and Test
on: [push]
jobs:
build:
gcc:
runs-on: ubuntu-latest
strategy:
matrix:
symbols:
- "no"
- "mem"
- "all"
defaults:
run:
shell: bash
working-directory: unix
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Configure
working-directory: unix
- name: Configure (symbols=${{ matrix.symbols }})
run: |
mkdir "${HOME}/install dir"
./configure ${CFGOPT} "--prefix=$HOME/install dir" || (cat config.log && exit 1)
env:
CFGOPT: --enable-symbols=${{ matrix.symbols }}
- name: Prepare
run: touch tclStubInit.c tclOOStubInit.c
working-directory: generic
- 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
+61
View File
@@ -0,0 +1,61 @@
name: macOS Build and Test
on: [push]
jobs:
with-Xcode:
runs-on: macos-latest
defaults:
run:
shell: bash
working-directory: macosx
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Prepare
run: touch tclStubInit.c tclOOStubInit.c
working-directory: generic
- name: Build
run: make all
- name: Run Tests
run: make test styles=develop
env:
ERROR_ON_FAILURES: 1
MAC_CI: 1
Unix-like:
runs-on: macos-latest
strategy:
matrix:
symbols:
- "no"
- "mem"
dtrace:
- "no"
- "yes"
defaults:
run:
shell: bash
working-directory: unix
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Prepare
run: |
touch tclStubInit.c tclOOStubInit.c
mkdir "$HOME/install dir"
working-directory: generic
- name: Configure (symbols=${{ matrix.symbols }} dtrace=${{ matrix.dtrace }})
# Note that macOS is always a 64 bit platform
run: ./configure --enable-64bit ${CFGOPT} "--prefix=$HOME/install dir" || (cat config.log && exit 1)
env:
CFGOPT: --enable-symbols=${{ matrix.symbols }} --enable-dtrace=${{ matrix.dtrace }}
- name: Build
run: |
make all tcltest
- name: Run Tests
run: |
make test
env:
ERROR_ON_FAILURES: 1
MAC_CI: 1
- name: Trial Installation
run: |
make install
-37
View File
@@ -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
+60 -7
View File
@@ -1,22 +1,75 @@
name: Windows Build and Test
on: [push]
jobs:
build:
MSVC:
runs-on: windows-latest
defaults:
run:
shell: powershell
working-directory: win
# Using powershell means we need to explicitly stop on failure
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
&nmake -f makefile.vc all
if ($lastexitcode -ne 0) {
throw "nmake exit code: $lastexitcode"
}
- name: Build Test Harness
working-directory: win
run: |
nmake -f makefile.vc tcltest
&nmake -f makefile.vc tcltest
if ($lastexitcode -ne 0) {
throw "nmake exit code: $lastexitcode"
}
- name: Run Tests
working-directory: win
run: |
nmake -f makefile.vc test
&nmake -f makefile.vc test
if ($lastexitcode -ne 0) {
throw "nmake exit code: $lastexitcode"
}
env:
ERROR_ON_FAILURES: 1
CI_BUILD_WITH_MSVC: 1
MSYS-gcc:
runs-on: windows-latest
defaults:
run:
shell: bash
working-directory: win
strategy:
matrix:
symbols:
- "no"
- "mem"
- "all"
# Using powershell means we need to explicitly stop on failure
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install MSYS2 and Make
run: choco install msys2 make
- name: Prepare
run: |
touch tclStubInit.c tclOOStubInit.c
mkdir "${HOME}/install dir"
working-directory: generic
- name: Configure (symbols=${{ matrix.symbols }})
run: |
./configure ${CFGOPT} "--prefix=$HOME/install dir" || (cat config.log && exit 1)
env:
CFGOPT: --enable-64bit --enable-symbols=${{ matrix.symbols }}
- name: Build
run: make all
- name: Build Test Harness
run: make tcltest
- name: Run Tests
run: make test
env:
ERROR_ON_FAILURES: 1
# If you add builds with Wine, be sure to define the environment variable
# CI_USING_WINE when running them so that broken tests know not to run.
+3
View File
@@ -8,14 +8,17 @@ site](https://sourceforge.net/projects/tcl/files/Tcl/).
8.6.10
[![Build Status](https://github.com/tcltk/tcl/workflows/Linux%20Build%20and%20Test/badge.svg?branch=core-8-6-branch)](https://github.com/tcltk/tcl/actions?query=workflow%3A%22Linux+Build+and+Test%22+branch%3Acore-8-6-branch)
[![Build Status](https://github.com/tcltk/tcl/workflows/Windows%20Build%20and%20Test/badge.svg?branch=core-8-6-branch)](https://github.com/tcltk/tcl/actions?query=workflow%3A%22Windows+Build+and+Test%22+branch%3Acore-8-6-branch)
[![Build Status](https://github.com/tcltk/tcl/workflows/macOS%20Build%20and%20Test/badge.svg?branch=core-8-6-branch)](https://github.com/tcltk/tcl/actions?query=workflow%3A%22macOS+Build+and+Test%22+branch%3Acore-8-6-branch)
<br>
8.7a4
[![Build Status](https://github.com/tcltk/tcl/workflows/Linux%20Build%20and%20Test/badge.svg?branch=core-8-branch)](https://github.com/tcltk/tcl/actions?query=workflow%3A%22Linux+Build+and+Test%22+branch%3Acore-8-branch)
[![Build Status](https://github.com/tcltk/tcl/workflows/Windows%20Build%20and%20Test/badge.svg?branch=core-8-branch)](https://github.com/tcltk/tcl/actions?query=workflow%3A%22Windows+Build+and+Test%22+branch%3Acore-8-branch)
[![Build Status](https://github.com/tcltk/tcl/workflows/macOS%20Build%20and%20Test/badge.svg?branch=core-8-branch)](https://github.com/tcltk/tcl/actions?query=workflow%3A%22macOS+Build+and+Test%22+branch%3Acore-8-branch)
<br>
9.0a2
[![Build Status](https://github.com/tcltk/tcl/workflows/Linux%20Build%20and%20Test/badge.svg?branch=main)](https://github.com/tcltk/tcl/actions?query=workflow%3A%22Linux+Build+and+Test%22+branch%3Amain)
[![Build Status](https://github.com/tcltk/tcl/workflows/Windows%20Build%20and%20Test/badge.svg?branch=main)](https://github.com/tcltk/tcl/actions?query=workflow%3A%22Windows+Build+and+Test%22+branch%3Amain)
[![Build Status](https://github.com/tcltk/tcl/workflows/macOS%20Build%20and%20Test/badge.svg?branch=main)](https://github.com/tcltk/tcl/actions?query=workflow%3A%22macOS+Build+and+Test%22+branch%3Amain)
## Contents
1. [Introduction](#intro)
+2 -1
View File
@@ -259,7 +259,8 @@ outside this range, \fBTcl_SetChannelBufferSize\fR sets the buffer size to
the generic layer that the events specified by \fImask\fR have
occurred on the channel. Channel drivers are responsible for invoking
this function whenever the channel handlers need to be called for the
channel. See \fBWATCHPROC\fR below for more details.
channel (or other pending tasks like a write flush should be performed).
See \fBWATCHPROC\fR below for more details.
.PP
\fBTcl_BadChannelOption\fR is called from driver specific
\fIsetOptionProc\fR or \fIgetOptionProc\fR to generate a complete
+1 -1
View File
@@ -1,5 +1,5 @@
'\"
'\" Copyright (c) 1992-1999 Karl Lehenbauer and Mark Diekhans.
'\" Copyright (c) 1992-1999 Karl Lehenbauer & Mark Diekhans.
'\" Copyright (c) 2000 by Scriptics Corporation.
'\" All rights reserved.
'\"
+1 -1
View File
@@ -1,5 +1,5 @@
'\"
'\" Copyright (c) 1992-1999 Karl Lehenbauer and Mark Diekhans.
'\" Copyright (c) 1992-1999 Karl Lehenbauer & Mark Diekhans.
'\" Copyright (c) 2000 by Scriptics Corporation.
'\" All rights reserved.
'\"
+9
View File
@@ -762,6 +762,15 @@ high-to-low order within each byte. For example,
will return \fB2\fR with \fB01110\fR stored in \fIvar1\fR and
\fB1000011100000101\fR stored in \fIvar2\fR.
.RE
.IP \fBC\fR 5
This form is similar to \fBA\fR, except that it scans the data from start
and terminates at the first null (C string semantics). For example,
.RS
.CS
\fBbinary scan\fR "abc\e000efghi" C* var1
.CE
will return \fB1\fR with \fBabc\fR stored in \fIvar1\fR.
.RE
.IP \fBH\fR 5
The data is turned into a string of \fIcount\fR hexadecimal digits in
high-to-low order represented as a sequence of characters in the set
+1 -1
View File
@@ -61,7 +61,7 @@ of the given patterns (in the style of \fBstring match\fR.)
.
The script rule tests for matching by assigning the key to the
\fIkeyVariable\fR and the value to the \fIvalueVariable\fR, and then evaluating
the given script which should return a boolean value (with the
the given script which should result in a boolean value (with the
key/value pair only being included in the result of the \fBdict
filter\fR when a true value is returned.) Note that the first
argument after the rule selection word is a two-element list. If the
+19 -7
View File
@@ -78,6 +78,9 @@ when the transaction completes. For this to work, the Tcl event loop
must be active. In Tk applications this is always true. For pure-Tcl
applications, the caller can use \fB::http::wait\fR after calling
\fB::http::geturl\fR to start the event loop.
.PP
\fBNote:\fR The event queue is even used without the \fB-command\fR option.
As a side effect, arbitrary commands may be processed while \fBhttp::geturl\fR is running.
.SH COMMANDS
.TP
\fB::http::config\fR ?\fIoptions\fR?
@@ -325,9 +328,11 @@ otherwise complain about HTTP/1.1.
\fB\-query\fR \fIquery\fR
.
This flag causes \fB::http::geturl\fR to do a POST request that passes the
\fIquery\fR to the server. The \fIquery\fR must be an x-url-encoding
formatted query. The \fB::http::formatQuery\fR procedure can be used to
do the formatting.
\fIquery\fR as payload verbatim to the server.
The content format (and encoding) of \fIquery\fR is announced by the header
field \fBcontent-type\fR set by the option \fB-type\fR.
\fIquery\fR is an x-url-encoding formatted query, if used for html forms.
The \fB::http::formatQuery\fR procedure can be used to do the formatting.
.TP
\fB\-queryblocksize\fR \fIsize\fR
.
@@ -551,6 +556,14 @@ is raised, but the status of the transaction will be \fBeof\fR.
.
The error message will also be stored in the \fBerror\fR status
array element, accessible via \fB::http::error\fR.
.TP
\fBtimeout\fR
.
A timeout occurred before the transaction could complete
.TP
\fBreset\fR
.
user-reset
.PP
Another error possibility is that \fB::http::geturl\fR is unable to
write all the post query data to the server before the server
@@ -666,10 +679,9 @@ the post query data to the server.
.TP
\fBstatus\fR
.
Either \fBok\fR, for successful completion, \fBreset\fR for
user-reset, \fBtimeout\fR if a timeout occurred before the transaction
could complete, or \fBerror\fR for an error condition. During the
transaction this value is the empty string.
See description in the chapter \fBERRORS\fR above for a
list and description of \fBstatus\fR.
During the transaction this value is the empty string.
.TP
\fBtotalsize\fR
.
+1 -1
View File
@@ -1,5 +1,5 @@
'\"
'\" Copyright (c) 1992-1999 by Karl Lehenbauer and Mark Diekhans
'\" Copyright (c) 1992-1999 by Karl Lehenbauer & Mark Diekhans
'\" Copyright (c) 2000 by Scriptics Corporation.
'\" All rights reserved.
'\"
+3 -3
View File
@@ -293,12 +293,12 @@ treatment is as if the enclosing delimiters were
.QW \fB[.\fR \&
and
.QW \fB.]\fR .)
For example, if \fBo\fR and \fB\[^o]\fR are the members of an
For example, if \fBo\fR and \fB\(^o\fR are the members of an
equivalence class, then
.QW \fB[[=o=]]\fR ,
.QW \fB[[=\[^o]=]]\fR ,
.QW \fB[[=\(^o=]]\fR ,
and
.QW \fB[o\[^o]]\fR \&
.QW \fB[o\(^o]\fR \&
are all synonymous. An equivalence class may not be an endpoint of a range.
.RS
.PP
-1
View File
@@ -45,7 +45,6 @@ extern "C" {
* macosx/Tcl-Common.xcconfig (not patchlevel) 1 LOC
* win/README (not patchlevel) (sections 0 and 2)
* unix/tcl.spec (1 LOC patch)
* tools/tcl.hpj.in (not patchlevel, for windows installer)
*/
#define TCL_MAJOR_VERSION 8
+12 -3
View File
@@ -1518,7 +1518,8 @@ BinaryScanCmd(
}
switch (cmd) {
case 'a':
case 'A': {
case 'A':
case 'C': {
unsigned char *src;
if (arg >= objc) {
@@ -1540,10 +1541,18 @@ BinaryScanCmd(
size = count;
/*
* Trim trailing nulls and spaces, if necessary.
* Apply C string semantics or trim trailing
* nulls and spaces, if necessary.
*/
if (cmd == 'A') {
if (cmd == 'C') {
for (i = 0; i < size; i++) {
if (src[i] == '\0') {
size = i;
break;
}
}
} else if (cmd == 'A') {
while (size > 0) {
if (src[size - 1] != '\0' && src[size - 1] != ' ') {
break;
+1 -1
View File
@@ -5,7 +5,7 @@
* the time and date facilities of TclX, by Mark Diekhans and Karl
* Lehenbauer.
*
* Copyright 1991-1995 Karl Lehenbauer and Mark Diekhans.
* Copyright (c) 1991-1995 Karl Lehenbauer & Mark Diekhans.
* Copyright (c) 1995 Sun Microsystems, Inc.
* Copyright (c) 2004 by Kevin B. Kenny. All rights reserved.
*
+19 -23
View File
@@ -2500,8 +2500,8 @@ StringStartCmd(
Tcl_Obj *const objv[]) /* Argument objects. */
{
int ch;
const char *p, *string;
int cur, index, length, numChars;
const Tcl_UniChar *p, *string;
int cur, index, length;
Tcl_Obj *obj;
if (objc != 3) {
@@ -2509,32 +2509,30 @@ StringStartCmd(
return TCL_ERROR;
}
string = TclGetStringFromObj(objv[1], &length);
numChars = Tcl_NumUtfChars(string, length);
if (TclGetIntForIndexM(interp, objv[2], numChars-1, &index) != TCL_OK) {
string = Tcl_GetUnicodeFromObj(objv[1], &length);
if (TclGetIntForIndexM(interp, objv[2], length-1, &index) != TCL_OK) {
return TCL_ERROR;
}
string = TclGetStringFromObj(objv[1], &length);
if (index >= numChars) {
index = numChars - 1;
if (index >= length) {
index = length - 1;
}
cur = 0;
if (index > 0) {
p = Tcl_UtfAtIndex(string, index);
p = &string[index];
TclUtfToUCS4(p, &ch);
(void)TclUniCharToUCS4(p, &ch);
for (cur = index; cur >= 0; cur--) {
int delta = 0;
const char *next;
const Tcl_UniChar *next;
if (!Tcl_UniCharIsWordChar(ch)) {
break;
}
next = TclUtfPrev(p, string);
next = TclUCS4Prev(p, string);
do {
next += delta;
delta = TclUtfToUCS4(next, &ch);
delta = TclUniCharToUCS4(next, &ch);
} while (next + delta < p);
p = next;
}
@@ -2572,8 +2570,8 @@ StringEndCmd(
Tcl_Obj *const objv[]) /* Argument objects. */
{
int ch;
const char *p, *end, *string;
int cur, index, length, numChars;
const Tcl_UniChar *p, *end, *string;
int cur, index, length;
Tcl_Obj *obj;
if (objc != 3) {
@@ -2581,20 +2579,18 @@ StringEndCmd(
return TCL_ERROR;
}
string = TclGetStringFromObj(objv[1], &length);
numChars = Tcl_NumUtfChars(string, length);
if (TclGetIntForIndexM(interp, objv[2], numChars-1, &index) != TCL_OK) {
string = Tcl_GetUnicodeFromObj(objv[1], &length);
if (TclGetIntForIndexM(interp, objv[2], length-1, &index) != TCL_OK) {
return TCL_ERROR;
}
string = TclGetStringFromObj(objv[1], &length);
if (index < 0) {
index = 0;
}
if (index < numChars) {
p = Tcl_UtfAtIndex(string, index);
if (index < length) {
p = &string[index];
end = string+length;
for (cur = index; p < end; cur++) {
p += TclUtfToUCS4(p, &ch);
p += TclUniCharToUCS4(p, &ch);
if (!Tcl_UniCharIsWordChar(ch)) {
break;
}
@@ -2603,7 +2599,7 @@ StringEndCmd(
cur++;
}
} else {
cur = numChars;
cur = length;
}
TclNewIntObj(obj, cur);
Tcl_SetObjResult(interp, obj);
+5 -5
View File
@@ -1928,7 +1928,7 @@ ParseLexeme(
{
const char *end;
int scanned, size;
Tcl_UniChar ch = 0;
int ch;
Tcl_Obj *literal = NULL;
unsigned char byte;
@@ -2145,14 +2145,14 @@ ParseLexeme(
*/
if (!TclIsBareword(*start) || *start == '_') {
if (Tcl_UtfCharComplete(start, numBytes)) {
scanned = TclUtfToUniChar(start, &ch);
if (TclUCS4Complete(start, numBytes)) {
scanned = TclUtfToUCS4(start, &ch);
} else {
char utfBytes[4];
char utfBytes[8];
memcpy(utfBytes, start, numBytes);
utfBytes[numBytes] = '\0';
scanned = TclUtfToUniChar(utfBytes, &ch);
scanned = TclUtfToUCS4(utfBytes, &ch);
}
*lexemePtr = INVALID;
Tcl_DecrRefCount(literal);
+1 -1
View File
@@ -76,7 +76,7 @@
* This file is generated from a yacc grammar defined in the file
* tclGetDate.y. It should not be edited directly.
*
* Copyright (c) 1992-1995 Karl Lehenbauer and Mark Diekhans.
* Copyright (c) 1992-1995 Karl Lehenbauer & Mark Diekhans.
* Copyright (c) 1995-1997 Sun Microsystems, Inc.
*
* See the file "license.terms" for information on usage and redistribution of
+2 -2
View File
@@ -7,7 +7,7 @@
* only used when doing free-form date parsing, an ill-defined process
* anyway.
*
* Copyright (c) 1992-1995 Karl Lehenbauer and Mark Diekhans.
* Copyright (c) 1992-1995 Karl Lehenbauer & Mark Diekhans.
* Copyright (c) 1995-1997 Sun Microsystems, Inc.
*
* See the file "license.terms" for information on usage and redistribution of
@@ -27,7 +27,7 @@
* This file is generated from a yacc grammar defined in the file
* tclGetDate.y. It should not be edited directly.
*
* Copyright (c) 1992-1995 Karl Lehenbauer and Mark Diekhans.
* Copyright (c) 1992-1995 Karl Lehenbauer & Mark Diekhans.
* Copyright (c) 1995-1997 Sun Microsystems, Inc.
*
* See the file "license.terms" for information on usage and redistribution of
+4 -2
View File
@@ -3252,12 +3252,14 @@ MODULE_SCOPE int TclUtfCount(int ch);
#if TCL_UTF_MAX > 3
# define TclUtfToUCS4 Tcl_UtfToUniChar
# define TclUniCharToUCS4(src, ptr) (*ptr = *(src),1)
# define TclUCS4Prev(src, ptr) (((src) > (ptr)) ? ((src) - 1) : (src))
# 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);
MODULE_SCOPE int TclUtfToUCS4(const char *, int *);
MODULE_SCOPE int TclUniCharToUCS4(const Tcl_UniChar *, int *);
MODULE_SCOPE const Tcl_UniChar *TclUCS4Prev(const Tcl_UniChar *, const Tcl_UniChar *);
# define TclUCS4Complete(src, length) (((unsigned)((unsigned char)*(src) - 0xF0) < 5) \
? ((length) >= 4) : Tcl_UtfCharComplete((src), (length)))
# define TclChar16Complete Tcl_UtfCharComplete
+5 -5
View File
@@ -789,7 +789,7 @@ TclParseBackslash(
* written. At most 4 bytes will be written there. */
{
const char *p = src+1;
Tcl_UniChar unichar = 0;
int unichar;
int result;
int count;
char buf[4] = "";
@@ -935,14 +935,14 @@ TclParseBackslash(
* #217987] test subst-3.2
*/
if (Tcl_UtfCharComplete(p, numBytes - 1)) {
count = TclUtfToUniChar(p, &unichar) + 1; /* +1 for '\' */
if (TclUCS4Complete(p, numBytes - 1)) {
count = TclUtfToUCS4(p, &unichar) + 1; /* +1 for '\' */
} else {
char utfBytes[4];
char utfBytes[8];
memcpy(utfBytes, p, numBytes - 1);
utfBytes[numBytes - 1] = '\0';
count = TclUtfToUniChar(utfBytes, &unichar) + 1;
count = TclUtfToUCS4(utfBytes, &unichar) + 1;
}
result = unichar;
break;
+4 -2
View File
@@ -6914,8 +6914,10 @@ TestUtfNextCmd(
/* Run Tcl_UtfNext with many more possible bytes at src[end], all should give the same result */
result = Tcl_UtfNext(buffer + 1);
if (first != result) {
first = buffer;
break;
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
"Tcl_UtfNext is not supposed to read src[end]\n"
"Different result when src[end] is %#x", UCHAR(p[-1])));
return TCL_ERROR;
}
}
+14 -1
View File
@@ -2629,12 +2629,25 @@ TclUniCharToUCS4(
* by the Tcl_UniChar string. */
{
if (((src[0] & 0xFC00) == 0xD800) && ((src[1] & 0xFC00) == 0xDC00)) {
*ucs4Ptr = (((src[0] & 0x3FF) << 10) | (src[01] & 0x3FF)) + 0x10000;
*ucs4Ptr = (((src[0] & 0x3FF) << 10) | (src[1] & 0x3FF)) + 0x10000;
return 2;
}
*ucs4Ptr = src[0];
return 1;
}
const Tcl_UniChar *TclUCS4Prev(const Tcl_UniChar *src, const Tcl_UniChar *ptr) {
if (src <= ptr + 1) {
return ptr;
}
if (((src[-1] & 0xFC00) == 0xDC00) && ((src[-2] & 0xFC00) == 0xD800)) {
return src - 2;
}
return src - 1;
}
#endif
/*
-17
View File
@@ -770,15 +770,8 @@
F96D442908F272B8004A47F5 /* loadICU.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = loadICU.tcl; sourceTree = "<group>"; };
F96D442A08F272B8004A47F5 /* Makefile.in */ = {isa = PBXFileReference; explicitFileType = sourcecode.make; fileEncoding = 4; path = Makefile.in; sourceTree = "<group>"; };
F96D442B08F272B8004A47F5 /* makeTestCases.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = makeTestCases.tcl; sourceTree = "<group>"; };
F96D442C08F272B8004A47F5 /* man2help.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = man2help.tcl; sourceTree = "<group>"; };
F96D442D08F272B8004A47F5 /* man2help2.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = man2help2.tcl; sourceTree = "<group>"; };
F96D442E08F272B8004A47F5 /* man2html.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = man2html.tcl; sourceTree = "<group>"; };
F96D442F08F272B8004A47F5 /* man2html1.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = man2html1.tcl; sourceTree = "<group>"; };
F96D443008F272B8004A47F5 /* man2html2.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = man2html2.tcl; sourceTree = "<group>"; };
F96D443108F272B8004A47F5 /* man2tcl.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = man2tcl.c; sourceTree = "<group>"; };
F96D443208F272B8004A47F5 /* README */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = README; sourceTree = "<group>"; };
F96D443308F272B8004A47F5 /* regexpTestLib.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = regexpTestLib.tcl; sourceTree = "<group>"; };
F96D443508F272B8004A47F5 /* tcl.hpj.in */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = tcl.hpj.in; sourceTree = "<group>"; };
F96D443908F272B9004A47F5 /* tcltk-man2html.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = "tcltk-man2html.tcl"; sourceTree = "<group>"; };
F96D443A08F272B9004A47F5 /* tclZIC.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = tclZIC.tcl; sourceTree = "<group>"; };
F96D443B08F272B9004A47F5 /* uniClass.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = uniClass.tcl; sourceTree = "<group>"; };
@@ -838,7 +831,6 @@
F96D447D08F272BA004A47F5 /* stub16.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = stub16.c; sourceTree = "<group>"; };
F96D447E08F272BA004A47F5 /* tcl.dsp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = tcl.dsp; sourceTree = "<group>"; };
F96D447F08F272BA004A47F5 /* tcl.dsw */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = tcl.dsw; sourceTree = "<group>"; };
F96D448008F272BA004A47F5 /* tcl.hpj.in */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = tcl.hpj.in; sourceTree = "<group>"; };
F96D448108F272BA004A47F5 /* tcl.m4 */ = {isa = PBXFileReference; explicitFileType = text.script.sh; fileEncoding = 4; path = tcl.m4; sourceTree = "<group>"; };
F96D448208F272BA004A47F5 /* tcl.rc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = tcl.rc; sourceTree = "<group>"; };
F96D448308F272BA004A47F5 /* tclAppInit.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclAppInit.c; sourceTree = "<group>"; };
@@ -1659,17 +1651,9 @@
F96D442708F272B8004A47F5 /* index.tcl */,
F96D442808F272B8004A47F5 /* installData.tcl */,
F96D442908F272B8004A47F5 /* loadICU.tcl */,
F96D442A08F272B8004A47F5 /* Makefile.in */,
F96D442B08F272B8004A47F5 /* makeTestCases.tcl */,
F96D442C08F272B8004A47F5 /* man2help.tcl */,
F96D442D08F272B8004A47F5 /* man2help2.tcl */,
F96D442E08F272B8004A47F5 /* man2html.tcl */,
F96D442F08F272B8004A47F5 /* man2html1.tcl */,
F96D443008F272B8004A47F5 /* man2html2.tcl */,
F96D443108F272B8004A47F5 /* man2tcl.c */,
F96D443208F272B8004A47F5 /* README */,
F96D443308F272B8004A47F5 /* regexpTestLib.tcl */,
F96D443508F272B8004A47F5 /* tcl.hpj.in */,
F96D443908F272B9004A47F5 /* tcltk-man2html.tcl */,
F96D443A08F272B9004A47F5 /* tclZIC.tcl */,
F92D7F100DE777240033A13A /* tsdPerf.tcl */,
@@ -1754,7 +1738,6 @@
F96D447D08F272BA004A47F5 /* stub16.c */,
F96D447E08F272BA004A47F5 /* tcl.dsp */,
F96D447F08F272BA004A47F5 /* tcl.dsw */,
F96D448008F272BA004A47F5 /* tcl.hpj.in */,
F96D448108F272BA004A47F5 /* tcl.m4 */,
F96D448208F272BA004A47F5 /* tcl.rc */,
F96D448308F272BA004A47F5 /* tclAppInit.c */,
-19
View File
@@ -770,15 +770,8 @@
F96D442908F272B8004A47F5 /* loadICU.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = loadICU.tcl; sourceTree = "<group>"; };
F96D442A08F272B8004A47F5 /* Makefile.in */ = {isa = PBXFileReference; explicitFileType = sourcecode.make; fileEncoding = 4; path = Makefile.in; sourceTree = "<group>"; };
F96D442B08F272B8004A47F5 /* makeTestCases.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = makeTestCases.tcl; sourceTree = "<group>"; };
F96D442C08F272B8004A47F5 /* man2help.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = man2help.tcl; sourceTree = "<group>"; };
F96D442D08F272B8004A47F5 /* man2help2.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = man2help2.tcl; sourceTree = "<group>"; };
F96D442E08F272B8004A47F5 /* man2html.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = man2html.tcl; sourceTree = "<group>"; };
F96D442F08F272B8004A47F5 /* man2html1.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = man2html1.tcl; sourceTree = "<group>"; };
F96D443008F272B8004A47F5 /* man2html2.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = man2html2.tcl; sourceTree = "<group>"; };
F96D443108F272B8004A47F5 /* man2tcl.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = man2tcl.c; sourceTree = "<group>"; };
F96D443208F272B8004A47F5 /* README */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = README; sourceTree = "<group>"; };
F96D443308F272B8004A47F5 /* regexpTestLib.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = regexpTestLib.tcl; sourceTree = "<group>"; };
F96D443508F272B8004A47F5 /* tcl.hpj.in */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = tcl.hpj.in; sourceTree = "<group>"; };
F96D443908F272B9004A47F5 /* tcltk-man2html.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = "tcltk-man2html.tcl"; sourceTree = "<group>"; };
F96D443A08F272B9004A47F5 /* tclZIC.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = tclZIC.tcl; sourceTree = "<group>"; };
F96D443B08F272B9004A47F5 /* uniClass.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = uniClass.tcl; sourceTree = "<group>"; };
@@ -838,7 +831,6 @@
F96D447D08F272BA004A47F5 /* stub16.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = stub16.c; sourceTree = "<group>"; };
F96D447E08F272BA004A47F5 /* tcl.dsp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = tcl.dsp; sourceTree = "<group>"; };
F96D447F08F272BA004A47F5 /* tcl.dsw */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = tcl.dsw; sourceTree = "<group>"; };
F96D448008F272BA004A47F5 /* tcl.hpj.in */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = tcl.hpj.in; sourceTree = "<group>"; };
F96D448108F272BA004A47F5 /* tcl.m4 */ = {isa = PBXFileReference; explicitFileType = text.script.sh; fileEncoding = 4; path = tcl.m4; sourceTree = "<group>"; };
F96D448208F272BA004A47F5 /* tcl.rc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = tcl.rc; sourceTree = "<group>"; };
F96D448308F272BA004A47F5 /* tclAppInit.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclAppInit.c; sourceTree = "<group>"; };
@@ -1653,23 +1645,13 @@
isa = PBXGroup;
children = (
F96D43D108F272B8004A47F5 /* checkLibraryDoc.tcl */,
F96D43D208F272B8004A47F5 /* configure */,
F96D43D308F272B8004A47F5 /* configure.ac */,
F96D442508F272B8004A47F5 /* genStubs.tcl */,
F96D442708F272B8004A47F5 /* index.tcl */,
F96D442808F272B8004A47F5 /* installData.tcl */,
F96D442908F272B8004A47F5 /* loadICU.tcl */,
F96D442A08F272B8004A47F5 /* Makefile.in */,
F96D442B08F272B8004A47F5 /* makeTestCases.tcl */,
F96D442C08F272B8004A47F5 /* man2help.tcl */,
F96D442D08F272B8004A47F5 /* man2help2.tcl */,
F96D442E08F272B8004A47F5 /* man2html.tcl */,
F96D442F08F272B8004A47F5 /* man2html1.tcl */,
F96D443008F272B8004A47F5 /* man2html2.tcl */,
F96D443108F272B8004A47F5 /* man2tcl.c */,
F96D443208F272B8004A47F5 /* README */,
F96D443308F272B8004A47F5 /* regexpTestLib.tcl */,
F96D443508F272B8004A47F5 /* tcl.hpj.in */,
F96D443908F272B9004A47F5 /* tcltk-man2html.tcl */,
F96D443A08F272B9004A47F5 /* tclZIC.tcl */,
F92D7F100DE777240033A13A /* tsdPerf.tcl */,
@@ -1754,7 +1736,6 @@
F96D447D08F272BA004A47F5 /* stub16.c */,
F96D447E08F272BA004A47F5 /* tcl.dsp */,
F96D447F08F272BA004A47F5 /* tcl.dsw */,
F96D448008F272BA004A47F5 /* tcl.hpj.in */,
F96D448108F272BA004A47F5 /* tcl.m4 */,
F96D448208F272BA004A47F5 /* tcl.rc */,
F96D448308F272BA004A47F5 /* tclAppInit.c */,
+1 -1
View File
@@ -20,7 +20,7 @@ if {"::tcltest" ni [namespace children]} {
catch [list package require -exact Tcltest [info patchlevel]]
testConstraint testasync [llength [info commands testasync]]
testConstraint knownMsvcBug [expr {![info exists ::env(TRAVIS_OS_NAME)] || ![string match windows $::env(TRAVIS_OS_NAME)]}]
testConstraint knownMsvcBug [expr {![info exists ::env(CI_BUILD_WITH_MSVC)]}]
proc async1 {result code} {
global aresult acode
+10 -1
View File
@@ -759,7 +759,16 @@ test binary-21.12 {Tcl_BinaryObjCmd: scan} -setup {
} -body {
list [binary scan "abc def \x00ghi " A* arg1] $arg1
} -result [list 1 "abc def \x00ghi"]
test binary-21.13 {Tcl_BinaryObjCmd: scan} -setup {
unset -nocomplain arg1
} -body {
list [binary scan "abc def \x00 " C* arg1] $arg1
} -result {1 {abc def }}
test binary-21.12 {Tcl_BinaryObjCmd: scan} -setup {
unset -nocomplain arg1
} -body {
list [binary scan "abc def \x00ghi" C* arg1] $arg1
} -result {1 {abc def }}
test binary-22.1 {Tcl_BinaryObjCmd: scan} -returnCodes error -body {
binary scan abc b
} -result {not enough arguments for all format specifiers}
+4 -3
View File
@@ -47,7 +47,8 @@ namespace eval ::tcl::test::io {
testConstraint testchannelevent [llength [info commands testchannelevent]]
testConstraint testmainthread [llength [info commands testmainthread]]
testConstraint testservicemode [llength [info commands testservicemode]]
testConstraint knownMsvcBug [expr {![info exists ::env(TRAVIS_OS_NAME)] || ![string match windows $::env(TRAVIS_OS_NAME)]}]
testConstraint notWinCI [expr {
$::tcl_platform(platform) ne "windows" || ![info exists ::env(CI)]}]
testConstraint notOSX [expr {$::tcl_platform(os) ne "Darwin"}]
# You need a *very* special environment to do some tests. In particular,
@@ -1886,7 +1887,7 @@ test chan-io-20.3 {Tcl_CreateChannel: initial settings} -constraints {unix} -bod
} -result {{{} {}} {auto lf}}
test chan-io-20.5 {Tcl_CreateChannel: install channel in empty slot} -setup {
set path(stdout) [makeFile {} stdout]
} -constraints {stdio knownMsvcBug} -body {
} -constraints {stdio notWinCI} -body {
set f [open $path(script) w]
chan puts -nonewline $f {
chan close stdout
@@ -2796,7 +2797,7 @@ test chan-io-29.34 {Tcl_Chan Close, async flush on chan close, using sockets} -s
chan puts $s $l
}
}
} -constraints {socket tempNotMac fileevent knownMsvcBug} -body {
} -constraints {socket tempNotMac fileevent notWinCI} -body {
proc accept {s a p} {
variable x
chan event $s readable [namespace code [list readit $s]]
+1 -1
View File
@@ -30,7 +30,7 @@ testConstraint linkDirectory [expr {
($::tcl_platform(osVersion) >= 5.0
&& [lindex [file system [temporaryDirectory]] 1] eq "NTFS")
}]
testConstraint notWine [expr {$::tcl_platform(platform) ne "windows" || ![info exists ::env(TRAVIS_OS_NAME)] || ![string match linux $::env(TRAVIS_OS_NAME)]}]
testConstraint notWine [expr {![info exists ::env(CI_USING_WINE)]}]
global env
set cmdAHwd [pwd]
+5 -2
View File
@@ -26,7 +26,8 @@ package require tcltests
# All tests require the "exec" command.
# Skip them if exec is not defined.
testConstraint exec [llength [info commands exec]]
testConstraint noosx [expr {![info exists ::env(TRAVIS_OSX_IMAGE)] || ![string match xcode* $::env(TRAVIS_OSX_IMAGE)]}]
# Some skips when running in a macOS CI environment
testConstraint noosxCI [expr {![info exists ::env(MAC_CI)]}]
unset -nocomplain path
@@ -673,7 +674,9 @@ test exec-18.2 {exec cat deals with weird file names} -body {
# Note that this test cannot be adapted to work on Windows; that platform has
# no kernel support for an analog of O_APPEND. OTOH, that means we can assume
# that there is a POSIX shell...
test exec-19.1 {exec >> uses O_APPEND} -constraints {exec unix notValgrind noosx} -setup {
#
# This test also fails in some cases when building with macOS
test exec-19.1 {exec >> uses O_APPEND} -constraints {exec unix notValgrind noosxCI} -setup {
set tmpfile [makeFile {0} tmpfile.exec-19.1]
} -body {
# Note that we have to allow for the current contents of the temporary
+5 -2
View File
@@ -41,7 +41,7 @@ if {[testConstraint win]} {
testConstraint reg 1
}
}
testConstraint notWine [expr {$::tcl_platform(platform) ne "windows" || ![info exists ::env(TRAVIS_OS_NAME)] || ![string match linux $::env(TRAVIS_OS_NAME)]}]
testConstraint notCI [expr {![info exists ::env(CI)] || !$::env(CI)}]
set tmpspace /tmp;# default value
# Find a group that exists on this Unix system, or else skip tests that
@@ -79,6 +79,7 @@ testConstraint darwin9 [expr {
&& [package vsatisfies 1.$::tcl_platform(osVersion) 1.9]
}]
testConstraint notDarwin9 [expr {![testConstraint darwin9]}]
testConstraint notContinuousIntegration [expr {![info exists ::env(CI)]}]
testConstraint fileSharing 0
testConstraint notFileSharing 1
@@ -2581,7 +2582,9 @@ test fCmd-30.2 {file readable on 'NTUSER.DAT'} -constraints {win notWine} -body
&& [file exists $env(USERPROFILE)/NTUSER.DAT]
&& [file readable $env(USERPROFILE)/NTUSER.DAT]}
} -result {1}
test fCmd-30.3 {file readable on 'pagefile.sys'} -constraints {win notWine} -body {
# At least one CI environment (GitHub Actions) is set up with the page file in
# an unusual location; skip the test if that is so.
test fCmd-30.3 {file readable on 'pagefile.sys'} -constraints {win notCI} -body {
set r {}
if {[info exists env(SystemDrive)]} {
set path $env(SystemDrive)/pagefile.sys
+1 -1
View File
@@ -31,7 +31,7 @@ if {[testConstraint win]} {
testConstraint symbolicLinkFile 0
testConstraint sharedCdrive [expr {![catch {cd //[info hostname]/c}]}]
}
testConstraint notWine [expr {$::tcl_platform(platform) ne "windows" || ![info exists ::env(TRAVIS_OS_NAME)] || ![string match linux $::env(TRAVIS_OS_NAME)]}]
testConstraint notWine [expr {![info exists ::env(CI_USING_WINE)]}]
# This match compares the first two words of the result. If the wanted result
# is "equal", then this is successful if the words are equal. If the wanted
# result is "not equal", then this is successful if the words are different.
+5 -3
View File
@@ -37,7 +37,9 @@ catch {
testConstraint testfilesystem [llength [info commands ::testfilesystem]]
testConstraint testsetplatform [llength [info commands ::testsetplatform]]
testConstraint testsimplefilesystem [llength [info commands ::testsimplefilesystem]]
testConstraint knownMsvcBug [expr {![info exists ::env(TRAVIS_OS_NAME)] || ![string match windows $::env(TRAVIS_OS_NAME)]}]
# Some things fail under all Continuous Integration systems for subtle reasons
# such as CI often running with elevated privileges in a container.
testConstraint notInCIenv [expr {![info exists ::env(CI)]}]
cd [tcltest::temporaryDirectory]
makeFile "test file" gorp.file
@@ -316,7 +318,7 @@ test filesystem-1.37 {file normalisation with '/./'} -body {
} -match regexp -result {^(?:[^/]|/(?:[^/]|$))+$}
test filesystem-1.38 {file normalisation with volume relative} -setup {
set dir [pwd]
} -constraints {win moreThanOneDrive knownMsvcBug} -body {
} -constraints {win moreThanOneDrive notInCIenv} -body {
set path "[string range [lindex $drives 0] 0 1]foo"
cd [lindex $drives 1]
file norm $path
@@ -565,7 +567,7 @@ test filesystem-7.1.1 {load from vfs} -setup {
cd [file dirname $::ddelib]
testsimplefilesystem 1
# This loads dde via a complex copy-to-temp operation
load simplefs:/[file tail $::ddelib] dde
load simplefs:/[file tail $::ddelib] Dde
testsimplefilesystem 0
return ok
# The real result of this test is what happens when Tcl exits.
+4 -1
View File
@@ -20,7 +20,10 @@ testConstraint longIs32bit [expr {$tcl_platform(wordSize) == 4}]
testConstraint longIs64bit [expr {$tcl_platform(wordSize) == 8}]
testConstraint wideIs64bit [expr {wide(0x8000000000000000) < 0}]
testConstraint pointerIs64bit [expr {$tcl_platform(pointerSize) >= 8}]
testConstraint knownMsvcBug [expr {![info exists ::env(TRAVIS_OS_NAME)] || ![string match windows $::env(TRAVIS_OS_NAME)]}]
# MSVC uses a broken libc that gets sprintf("%g") wrong. This is a pain
# particularly in Continuous Integration, and there isn't anything much we can
# do about it.
testConstraint knownMsvcBug [expr {![info exists ::env(CI_BUILD_WITH_MSVC)]}]
test format-1.1 {integer formatting} {
format "%*d %d %d %d" 6 34 16923 -12 -1
+2 -5
View File
@@ -16,11 +16,8 @@ if {"::tcltest" ni [namespace children]} {
::tcltest::loadTestedCommands
testConstraint notOSXtravis [apply {{} {
upvar 1 env(TRAVIS_OSX_IMAGE) travis
return [expr {![info exists travis] || ![string match xcode* $travis]}]
}}]
testConstraint sqlite3 [expr {[testConstraint notOSXtravis] && ![catch {
testConstraint notMacCI [expr {![info exists ::env(MAC_CI)]}]
testConstraint sqlite3 [expr {[testConstraint notMacCI] && ![catch {
package require sqlite3
}]}]
testConstraint cookiejar [expr {[testConstraint sqlite3] && ![catch {
+7 -4
View File
@@ -43,7 +43,10 @@ testConstraint testchannelevent [llength [info commands testchannelevent]]
testConstraint testmainthread [llength [info commands testmainthread]]
testConstraint testobj [llength [info commands testobj]]
testConstraint testservicemode [llength [info commands testservicemode]]
testConstraint knownMsvcBug [expr {![info exists ::env(TRAVIS_OS_NAME)] || ![string match windows $::env(TRAVIS_OS_NAME)]}]
# Some things fail under Windows in Continuous Integration systems for subtle
# reasons such as CI often running with elevated privileges in a container.
testConstraint notWinCI [expr {
$::tcl_platform(platform) ne "windows" || ![info exists ::env(CI)]}]
testConstraint notOSX [expr {$::tcl_platform(os) ne "Darwin"}]
# You need a *very* special environment to do some tests. In
@@ -2230,7 +2233,7 @@ test io-27.5 {FlushChannel, implicit flush when buffer fills and on close} \
set path(pipe) [makeFile {} pipe]
set path(output) [makeFile {} output]
test io-27.6 {FlushChannel, async flushing, async close} \
{stdio asyncPipeClose knownMsvcBug} {
{stdio asyncPipeClose notWinCI} {
# This test may fail on old Unix systems (seen on IRIX64 6.5) with
# obsolete gettimeofday() calls. See Tcl Bugs 3530533, 1942197.
file delete $path(pipe)
@@ -2834,7 +2837,7 @@ test io-29.31 {Tcl_WriteChars, background flush} stdio {
set result
} ok
test io-29.32 {Tcl_WriteChars, background flush to slow reader} \
{stdio asyncPipeClose knownMsvcBug} {
{stdio asyncPipeClose notWinCI} {
# This test may fail on old Unix systems (seen on IRIX64 6.5) with
# obsolete gettimeofday() calls. See Tcl Bugs 3530533, 1942197.
file delete $path(pipe)
@@ -8132,7 +8135,7 @@ test io-53.17 {[7c187a3773] MBWrite: proper inQueueTail handling} -setup {
removeFile out
} -result {line 100 line}
test io-54.1 {Recursive channel events} {socket fileevent knownMsvcBug} {
test io-54.1 {Recursive channel events} {socket fileevent notWinCI} {
# This test checks to see if file events are delivered during recursive
# event loops when there is buffered data on the channel.
+1 -1
View File
@@ -24,7 +24,7 @@ if {[testConstraint win]} {
testConstraint reg 1
}
}
testConstraint notWine [expr {$::tcl_platform(platform) ne "windows" || ![info exists ::env(TRAVIS_OS_NAME)] || ![string match linux $::env(TRAVIS_OS_NAME)]}]
testConstraint notWine [expr {![info exists ::env(CI_USING_WINE)]}]
# determine the current locale
testConstraint english [expr {
+8 -4
View File
@@ -69,15 +69,19 @@ if {"::tcltest" ni [namespace children]} {
catch [list package require -exact Tcltest [info patchlevel]]
::tcltest::loadTestedCommands
if {[info exists ::env(TRAVIS_OSX_IMAGE)] && [string match xcode* $::env(TRAVIS_OSX_IMAGE)]} {
# A bad interaction between socket creation, macOS, and unattended CI
# environments make this whole file impractical to run; too many weird hangs.
if {[info exists ::env(MAC_CI)]} {
return
}
testConstraint notWine [expr {$::tcl_platform(platform) ne "windows" || ![info exists ::env(TRAVIS_OS_NAME)] || ![string match linux $::env(TRAVIS_OS_NAME)]}]
testConstraint notWine [expr {![info exists ::env(CI_USING_WINE)]}]
# Some tests require the Thread package or exec command
testConstraint thread [expr {0 == [catch {package require Thread 2.7-}]}]
testConstraint exec [llength [info commands exec]]
testConstraint knownMsvcBug [expr {![info exists ::env(TRAVIS_OS_NAME)] || ![string match windows $::env(TRAVIS_OS_NAME)]}]
testConstraint knownMsvcBug [expr {![info exists ::env(CI_BUILD_WITH_MSVC)]}]
testConstraint notWinCI [expr {
$tcl_platform(platform) ne "windows" || ![info exists ::env(CI)]}]
# Produce a random port number in the Dynamic/Private range
# from 49152 through 65535.
@@ -2390,7 +2394,7 @@ test socket-14.10.1 {pending [socket -async] and nonblocking [puts], server is I
removeFile script
} -result {{} ok}
test socket-14.11.0 {pending [socket -async] and nonblocking [puts], no listener, no flush} \
-constraints {socket knownMsvcBug} \
-constraints {socket notWinCI} \
-body {
set sock [socket -async localhost [randport]]
fconfigure $sock -blocking 0
+6 -6
View File
@@ -253,8 +253,8 @@ test utf-6.22 {Tcl_UtfNext} {testutfnext testbytestring} {
testutfnext [testbytestring \xD0\xF8]
} 1
test utf-6.23 {Tcl_UtfNext} {testutfnext testbytestring} {
testutfnext [testbytestring \xE8]
} -1
testutfnext [testbytestring \xE8\x00]
} 1
test utf-6.24 {Tcl_UtfNext} {testutfnext testbytestring} {
testutfnext [testbytestring \xE8]G
} 1
@@ -277,8 +277,8 @@ test utf-6.30.0 {Tcl_UtfNext} {testutfnext testbytestring ucs2_utf16} {
testutfnext [testbytestring \xF2]
} 1
test utf-6.30.1 {Tcl_UtfNext} {testutfnext testbytestring ucs4} {
testutfnext [testbytestring \xF2]
} -1
testutfnext [testbytestring \xF2\x00]
} 1
test utf-6.31 {Tcl_UtfNext} {testutfnext testbytestring} {
testutfnext [testbytestring \xF2]G
} 1
@@ -286,8 +286,8 @@ test utf-6.32.0 {Tcl_UtfNext} {testutfnext testbytestring ucs2_utf16} {
testutfnext [testbytestring \xF2\xA0]
} 1
test utf-6.32.1 {Tcl_UtfNext} {testutfnext testbytestring ucs4} {
testutfnext [testbytestring \xF2\xA0]
} -1
testutfnext [testbytestring \xF2\xA0\x00]
} 1
test utf-6.33 {Tcl_UtfNext} {testutfnext testbytestring} {
testutfnext [testbytestring \xF2\xD0]
} 1
+1 -1
View File
@@ -24,7 +24,7 @@ if {[testConstraint win]} {
testConstraint dde 1
}
}
testConstraint notWine [expr {$::tcl_platform(platform) ne "windows" || ![info exists ::env(TRAVIS_OS_NAME)] || ![string match linux $::env(TRAVIS_OS_NAME)]}]
testConstraint notWine [expr {![info exists ::env(CI_USING_WINE)]}]
# -------------------------------------------------------------------------
+22 -20
View File
@@ -28,8 +28,10 @@ testConstraint testchmod [llength [info commands testchmod]]
testConstraint cdrom 0
testConstraint exdev 0
testConstraint longFileNames 0
testConstraint knownMsvcBug [expr {![info exists ::env(TRAVIS_OS_NAME)] || ![string match windows $::env(TRAVIS_OS_NAME)]}]
testConstraint notWine [expr {$::tcl_platform(platform) ne "windows" || ![info exists ::env(TRAVIS_OS_NAME)] || ![string match linux $::env(TRAVIS_OS_NAME)]}]
# Some things fail under all Continuous Integration systems for subtle reasons
# such as CI often running with elevated privileges in a container.
testConstraint notInCIenv [expr {![info exists ::env(CI)]}]
testConstraint knownMsvcBug [expr {![info exists ::env(CI_BUILD_WITH_MSVC)]}]
proc createfile {file {string a}} {
set f [open $file w]
@@ -133,25 +135,25 @@ test winFCmd-1.1 {TclpRenameFile: errno: EACCES} -body {
} -constraints {win cdrom testfile} -returnCodes error -result EACCES
test winFCmd-1.2 {TclpRenameFile: errno: EEXIST} -setup {
cleanup
} -constraints {win testfile notWine} -body {
} -constraints {win testfile notInCIenv} -body {
file mkdir td1/td2/td3
file mkdir td2
testfile mv td2 td1/td2
} -returnCodes error -result EEXIST
test winFCmd-1.3 {TclpRenameFile: errno: EINVAL} -setup {
cleanup
} -constraints {win testfile notWine} -body {
} -constraints {win testfile notInCIenv} -body {
testfile mv / td1
} -returnCodes error -result EINVAL
test winFCmd-1.4 {TclpRenameFile: errno: EINVAL} -setup {
cleanup
} -constraints {win testfile notWine} -body {
} -constraints {win testfile notInCIenv} -body {
file mkdir td1
testfile mv td1 td1/td2
} -returnCodes error -result EINVAL
test winFCmd-1.5 {TclpRenameFile: errno: EISDIR} -setup {
cleanup
} -constraints {win testfile notWine} -body {
} -constraints {win testfile notInCIenv} -body {
file mkdir td1
createfile tf1
testfile mv tf1 td1
@@ -256,7 +258,7 @@ test winFCmd-1.22 {TclpRenameFile: long dst} -setup {
} -returnCodes error -result ENAMETOOLONG
test winFCmd-1.23 {TclpRenameFile: move dir into self} -setup {
cleanup
} -constraints {win testfile notWine} -body {
} -constraints {win testfile notInCIenv} -body {
file mkdir td1
testfile mv [pwd]/td1 td1/td2
} -returnCodes error -result EINVAL
@@ -301,21 +303,21 @@ test winFCmd-1.29 {TclpRenameFile: src is dir} -setup {
} -returnCodes error -result ENOTDIR
test winFCmd-1.30 {TclpRenameFile: dst is dir} -setup {
cleanup
} -constraints {win testfile notWine} -body {
} -constraints {win testfile notInCIenv} -body {
file mkdir td1
file mkdir td2/td2
testfile mv td1 td2
} -returnCodes error -result EEXIST
test winFCmd-1.31 {TclpRenameFile: TclpRemoveDirectory fails} -setup {
cleanup
} -constraints {win testfile notWine} -body {
} -constraints {win testfile notInCIenv} -body {
file mkdir td1
file mkdir td2/td2
testfile mv td1 td2
} -returnCodes error -result EEXIST
test winFCmd-1.32 {TclpRenameFile: TclpRemoveDirectory succeeds} -setup {
cleanup
} -constraints {win testfile notWine} -body {
} -constraints {win testfile notInCIenv} -body {
file mkdir td1/td2
file mkdir td2
testfile mv td1 td2
@@ -344,7 +346,7 @@ test winFCmd-1.34 {TclpRenameFile: src is dir, dst is not} -setup {
} -returnCodes error -result ENOTDIR
test winFCmd-1.35 {TclpRenameFile: src is not dir, dst is} -setup {
cleanup
} -constraints {win testfile notWine} -body {
} -constraints {win testfile notInCIenv} -body {
file mkdir td1
createfile tf1
testfile mv tf1 td1
@@ -395,7 +397,7 @@ proc MakeFiles {dirname} {
test winFCmd-1.38 {TclpRenameFile: check rename of conflicting inodes} -setup {
cleanup
} -constraints {win winNonZeroInodes knownMsvcBug notWine} -body {
} -constraints {win winNonZeroInodes knownMsvcBug notInCIenv} -body {
file mkdir td1
foreach {a b} [MakeFiles td1] break
file rename -force $a $b
@@ -640,7 +642,7 @@ test winFCmd-5.1 {TclpCopyDirectory: calls TraverseWinTree} -setup {
test winFCmd-6.1 {TclpRemoveDirectory: errno: EACCES} -setup {
cleanup
} -constraints {winVista testfile testchmod knownMsvcBug notWine} -body {
} -constraints {winVista testfile testchmod knownMsvcBug notInCIenv} -body {
file mkdir td1
testchmod 0 td1
testfile rmdir td1
@@ -694,7 +696,7 @@ test winFCmd-6.8 {TclpRemoveDirectory: RemoveDirectory fails} -setup {
} -result {1 {tf1 ENOTDIR}}
test winFCmd-6.9 {TclpRemoveDirectory: errno == EACCES} -setup {
cleanup
} -constraints {winVista testfile testchmod knownMsvcBug notWine} -body {
} -constraints {winVista testfile testchmod knownMsvcBug notInCIenv} -body {
file mkdir td1
testchmod 0 td1
testfile rmdir td1
@@ -705,14 +707,14 @@ test winFCmd-6.9 {TclpRemoveDirectory: errno == EACCES} -setup {
} -result {td1 EACCES}
test winFCmd-6.11 {TclpRemoveDirectory: attr == -1} -setup {
cleanup
} -constraints {win testfile notWine} -body {
} -constraints {win testfile notInCIenv} -body {
testfile rmdir /
# WinXP returns EEXIST, WinNT seems to return EACCES. No policy
# decision has been made as to which is correct.
} -returnCodes error -match regexp -result {^/ E(ACCES|EXIST)$}
test winFCmd-6.13 {TclpRemoveDirectory: write-protected} -setup {
cleanup
} -constraints {winVista testfile testchmod knownMsvcBug notWine} -body {
} -constraints {winVista testfile testchmod knownMsvcBug notInCIenv} -body {
file mkdir td1
testchmod 0 td1
testfile rmdir td1
@@ -941,7 +943,7 @@ test winFCmd-9.1 {TraversalDelete: DOTREE_F} -setup {
} -result {}
test winFCmd-9.3 {TraversalDelete: DOTREE_PRED} -setup {
cleanup
} -constraints {winVista testfile testchmod knownMsvcBug notWine} -body {
} -constraints {winVista testfile testchmod knownMsvcBug notInCIenv} -body {
file mkdir td1/td2
testchmod 0 td1
testfile rmdir -force td1
@@ -1130,7 +1132,7 @@ test winFCmd-15.2 {SetWinFileAttributes - archive} -constraints {win} -setup {
} -cleanup {
cleanup
} -result {{} 1}
test winFCmd-15.3 {SetWinFileAttributes - archive} -constraints {win notWine} -setup {
test winFCmd-15.3 {SetWinFileAttributes - archive} -constraints {win notInCIenv} -setup {
cleanup
} -body {
createfile td1 {}
@@ -1138,7 +1140,7 @@ test winFCmd-15.3 {SetWinFileAttributes - archive} -constraints {win notWine} -s
} -cleanup {
cleanup
} -result {{} 0}
test winFCmd-15.4 {SetWinFileAttributes - hidden} -constraints {win notWine} -setup {
test winFCmd-15.4 {SetWinFileAttributes - hidden} -constraints {win notInCIenv} -setup {
cleanup
} -body {
createfile td1 {}
@@ -1171,7 +1173,7 @@ test winFCmd-15.7 {SetWinFileAttributes - readonly} -setup {
} -cleanup {
cleanup
} -result {{} 0}
test winFCmd-15.8 {SetWinFileAttributes - system} -constraints {win notWine} -setup {
test winFCmd-15.8 {SetWinFileAttributes - system} -constraints {win notInCIenv} -setup {
cleanup
} -body {
createfile td1 {}
+1 -1
View File
@@ -24,7 +24,7 @@ testConstraint notNTFS 0
if {[testConstraint testvolumetype]} {
testConstraint notNTFS [expr {[testvolumetype] eq "NTFS"}]
}
testConstraint notWine [expr {$::tcl_platform(platform) ne "windows" || ![info exists ::env(TRAVIS_OS_NAME)] || ![string match linux $::env(TRAVIS_OS_NAME)]}]
testConstraint notWine [expr {![info exists ::env(CI_USING_WINE)]}]
test winFile-1.1 {TclpGetUserHome} -constraints {win} -body {
glob ~nosuchuser
+1 -1
View File
@@ -28,7 +28,7 @@ set org_pwd [pwd]
set bindir [file join $org_pwd [file dirname [info nameofexecutable]]]
set cat32 [file join $bindir cat32.exe]
testConstraint notWine [expr {$::tcl_platform(platform) ne "windows" || ![info exists ::env(TRAVIS_OS_NAME)] || ![string match linux $::env(TRAVIS_OS_NAME)]}]
testConstraint notWine [expr {![info exists ::env(CI_USING_WINE)]}]
# several test-cases here expect current directory == [temporaryDirectory]:
+4 -2
View File
@@ -19,7 +19,9 @@ if {"::tcltest" ni [namespace children]} {
catch [list package require -exact Tcltest [info patchlevel]]
testConstraint testwinclock [llength [info commands testwinclock]]
testConstraint knownMsvcBug [expr {![info exists ::env(TRAVIS_OS_NAME)] || ![string match windows $::env(TRAVIS_OS_NAME)]}]
# Some things fail under all Continuous Integration systems for subtle reasons
# such as CI often running with elevated privileges in a container.
testConstraint notInCIenv [expr {![info exists ::env(CI)]}]
# The next two tests will crash on Windows if the check for negative
# clock values is not done properly.
@@ -41,7 +43,7 @@ test winTime-1.2 {TclpGetDate} {win} {
# with the Windows clock. 30 sec really isn't enough,
# but how much time does a tester have patience for?
test winTime-2.1 {Synchronization of Tcl and Windows clocks} {testwinclock knownMsvcBug} {
test winTime-2.1 {Synchronization of Tcl and Windows clocks} {testwinclock notInCIenv} {
# May fail due to OS/hardware discrepancies. See:
# http://support.microsoft.com/default.aspx?scid=kb;en-us;274323
set failed {}
-67
View File
@@ -1,67 +0,0 @@
# This makefile is used to convert Tcl manual pages into various
# alternate formats:
#
# Windows help file: 1. Build the winhelp target on Unix
# 2. Build the helpfile target on Windows
#
# HTML: 1. Build the html target on Unix
TCL = tcl@TCL_VERSION@
TK = tk@TCL_VERSION@
VER = @TCL_WIN_VERSION@
TCL_BIN_DIR = @TCL_BIN_DIR@
TCL_SOURCE = @TCL_SRC_DIR@
TK_SOURCE = $(TCL_SOURCE)/../$(TK)
PRO_SOURCE = $(TCL_SOURCE)/../pro
ITCL_SOURCE = $(TCL_SOURCE)/../itcl3.1.0
TCL_DOCS = $(TCL_SOURCE)/doc/*.[13n]
TK_DOCS = $(TK_SOURCE)/doc/*.[13n]
PRO_DOCS = \
$(PRO_SOURCE)/doc/man/procheck.1 \
$(PRO_SOURCE)/doc/man/prodebug.1 \
$(PRO_SOURCE)/doc/man/prodebug.n \
$(PRO_SOURCE)/doc/man/prolicense.1
ITCL_DOCS = \
$(ITCL_SOURCE)/itcl/doc/*.[13n] \
$(ITCL_SOURCE)/itk/doc/*.[13n]
# $(ITCL_SOURCE)/iwidgets3.0.0/doc/*.[13n]
COREDOCS = $(TCL_DOCS) $(TK_DOCS)
#PRODOCS = $(COREDOCS) $(PRO_DOCS) $(ITCL_DOCS)
PRODOCS = $(COREDOCS) $(PRO_DOCS)
TCLSH = $(TCL_BIN_DIR)/tclsh
CC = @CC@
#
# Targets
#
all: core
pro:
$(MAKE) DOCS="$(PRODOCS)" VER="" rtf
core:
$(MAKE) DOCS="$(COREDOCS)" rtf
rtf: $(TCL_SOURCE)/tools/man2help.tcl man2tcl $(DOCS)
LD_LIBRARY_PATH=$(TCL_BIN_DIR) \
TCL_LIBRARY=$(TCL_SOURCE)/library \
$(TCLSH) $(TCL_SOURCE)/tools/man2help.tcl tcl "$(VER)" $(DOCS)
winhelp: tcl.rtf
man2tcl: $(TCL_SOURCE)/tools/man2tcl.c
$(CC) $(CFLAGS) -o man2tcl $(TCL_SOURCE)/tools/man2tcl.c
clean:
-rm -f man2tcl *.o *.cnt *.rtf
helpfile:
hcw /c /e tcl.hpj
-2869
View File
File diff suppressed because it is too large Load Diff
-35
View File
@@ -1,35 +0,0 @@
dnl This file is an input file used by the GNU "autoconf" program to
dnl generate the file "configure", which is run to configure the
dnl Makefile in this directory.
AC_INIT(man2tcl.c)
AC_PREREQ(2.69)
# Recover information that Tcl computed with its configure script.
#--------------------------------------------------------------------
# See if there was a command-line option for where Tcl is; if
# not, assume that its top-level directory is a sibling of ours.
#--------------------------------------------------------------------
DEF_VER=8.7
AC_ARG_WITH(tcl, [ --with-tcl=DIR use Tcl $DEF_VER binaries from DIR], TCL_BIN_DIR=$withval, TCL_BIN_DIR=`cd ../../tcl$DEF_VER$TCL_PATCH_LEVEL/unix; pwd`)
if test ! -d $TCL_BIN_DIR; then
AC_MSG_ERROR(Tcl directory $TCL_BIN_DIR doesn't exist)
fi
if test ! -f $TCL_BIN_DIR/tclConfig.sh; then
AC_MSG_ERROR(There's no tclConfig.sh in $TCL_BIN_DIR; perhaps you didn't specify the Tcl *build* directory (not the toplevel Tcl directory) or you forgot to configure Tcl?)
fi
. $TCL_BIN_DIR/tclConfig.sh
TCL_WIN_VERSION=$TCL_MAJOR_VERSION$TCL_MINOR_VERSION
AC_SUBST(TCL_WIN_VERSION)
CC=$TCL_CC
AC_SUBST(CC)
AC_SUBST(TCL_VERSION)
AC_SUBST(TCL_PATCH_LEVEL)
AC_SUBST(TCL_SRC_DIR)
AC_SUBST(TCL_BIN_DIR)
AC_OUTPUT(Makefile tcl.hpj)
-80
View File
@@ -1,80 +0,0 @@
## Super aggressive EOL-fixer!
##
## Will even understand screwed up ones like CRCRLF.
## (found in bad CVS repositories, caused by spacey developers
## abusing CVS)
##
## davygrvy@pobox.com 3:41 PM 10/12/2001
##
package provide EOL-fix 1.1
namespace eval ::EOL {
variable outMode crlf
}
proc EOL::fix {filename {newfilename {}}} {
variable outMode
if {![file exists $filename]} {
return
}
puts "EOL Fixing: $filename"
file rename ${filename} ${filename}.o
set fhnd [open ${filename}.o r]
if {$newfilename ne ""} {
set newfhnd [open ${newfilename} w]
} else {
set newfhnd [open ${filename} w]
}
fconfigure $newfhnd -translation [list auto $outMode]
seek $fhnd 0 end
set theEnd [tell $fhnd]
seek $fhnd 0 start
fconfigure $fhnd -translation binary -buffersize $theEnd
set rawFile [read $fhnd $theEnd]
close $fhnd
regsub -all {(\r)|(\r){1,2}(\n)} $rawFile "\n" rawFile
set lineList [split $rawFile \n]
foreach line $lineList {
puts $newfhnd $line
}
close $newfhnd
file delete ${filename}.o
}
proc EOL::fixall {args} {
if {[llength $args] == 0} {
puts stderr "no files to fix"
exit 1
} else {
set cmd [lreplace $args -1 -1 glob -nocomplain]
}
foreach f [eval $cmd] {
if {[file isfile $f]} {fix $f}
}
}
if {$tcl_interactive == 0 && $argc > 0} {
if {[string index [lindex $argv 0] 0] eq "-"} {
switch -- [lindex $argv 0] {
-cr {set ::EOL::outMode cr}
-crlf {set ::EOL::outMode crlf}
-lf {set ::EOL::outMode lf}
default {puts stderr "improper mode switch"; exit 1}
}
set argv [lrange $argv 1 end]
}
eval EOL::fixall $argv
} else {
return
}
-141
View File
@@ -1,141 +0,0 @@
# man2help.tcl --
#
# This file defines procedures that work in conjunction with the
# man2tcl program to generate a Windows help file from Tcl manual
# entries.
#
# Copyright (c) 1996 by Sun Microsystems, Inc.
#
# PASS 1
#
set man2tclprog [file join [file dirname [info script]] \
man2tcl[file extension [info nameofexecutable]]]
proc generateContents {basename version files} {
global curID topics
set curID 0
foreach f $files {
puts "Pass 1 -- $f"
flush stdout
doFile $f
}
set fd [open [file join [file dirname [info script]] $basename$version.cnt] w]
fconfigure $fd -translation crlf
puts $fd ":Base $basename$version.hlp"
foreach package [getPackages] {
foreach section [getSections $package] {
if {![info exists lastSection]} {
set lastSection {}
}
if {[string compare $lastSection $section]} {
puts $fd "1 $section"
}
set lastSection $section
set lastTopic {}
foreach topic [getTopics $package $section] {
if {[string compare $lastTopic $topic]} {
set id $topics($package,$section,$topic)
puts $fd "2 $topic=$id"
set lastTopic $topic
}
}
}
}
close $fd
}
#
# PASS 2
#
proc generateHelp {basename files} {
global curID topics keywords file id_keywords
set curID 0
foreach key [array names keywords] {
foreach id $keywords($key) {
lappend id_keywords($id) $key
}
}
set file [open [file join [file dirname [info script]] $basename.rtf] w]
fconfigure $file -translation crlf
puts $file "\{\\rtf1\\ansi \\deff0\\deflang1033\{\\fonttbl\{\\f0\\froman\\fcharset0\\fprq2 Times New Roman\;\}\{\\f1\\fmodern\\fcharset0\\fprq1 Courier New\;\}\}"
foreach f $files {
puts "Pass 2 -- $f"
flush stdout
initGlobals
doFile $f
pageBreak
}
puts $file "\}"
close $file
}
# doFile --
#
# Given a file as argument, translate the file to a tcl script and
# evaluate it.
#
# Arguments:
# file - Name of file to translate.
proc doFile {file} {
global man2tclprog
if {[catch {eval [exec $man2tclprog [glob $file]]} msg]} {
global errorInfo
puts stderr $msg
puts "in"
puts $errorInfo
exit 1
}
}
# doDir --
#
# Given a directory as argument, translate all the man pages in
# that directory.
#
# Arguments:
# dir - Name of the directory.
proc doDir dir {
puts "Generating man pages for $dir..."
foreach f [lsort [glob -directory $dir "*.\[13n\]"]] {
doFile $f
}
}
# process command line arguments
if {$argc < 3} {
puts stderr "usage: $argv0 \[options\] projectName version manFiles..."
exit 1
}
set arg 0
if {![string compare [lindex $argv $arg] "-bitmap"]} {
set bitmap [lindex $argv [incr arg]]
incr arg
}
set baseName [lindex $argv $arg]
set version [lindex $argv [incr arg]]
set files {}
foreach i [lrange $argv [incr arg] end] {
set i [file join $i]
if {[file isdir $i]} {
foreach f [lsort [glob -directory $i "*.\[13n\]"]] {
lappend files $f
}
} elseif {[file exists $i]} {
lappend files $i
}
}
source [file join [file dirname [info script]] index.tcl]
generateContents $baseName $version $files
source [file join [file dirname [info script]] man2help2.tcl]
generateHelp $baseName $files
-1033
View File
File diff suppressed because it is too large Load Diff
-185
View File
@@ -1,185 +0,0 @@
#!/bin/sh
# \
exec tclsh "$0" ${1+"$@"}
# man2html.tcl --
#
# This file contains procedures that work in conjunction with the
# man2tcl program to generate a HTML files from Tcl manual entries.
#
# Copyright (c) 1996 by Sun Microsystems, Inc.
# sarray -
#
# Save an array to a file so that it can be sourced.
#
# Arguments:
# file - Name of the output file
# args - Name of the arrays to save
#
proc sarray {file args} {
set file [open $file w]
foreach a $args {
upvar $a array
if {![array exists array]} {
puts "sarray: \"$a\" isn't an array"
break
}
foreach name [lsort [array names array]] {
regsub -all " " $name "\\ " name1
puts $file "set ${a}($name1) \{$array($name)\}"
}
}
close $file
}
# footer --
#
# Builds footer info for HTML pages
#
# Arguments:
# packages - List of packages to link to.
proc footer {packages} {
lappend f "<HR>"
set h {[}
foreach package $packages {
lappend h "<A HREF=\"../$package/contents.html\">$package</A>"
lappend h "|"
}
lappend f [join [lreplace $h end end {]} ] " "]
lappend f "<HR>"
lappend f "<PRE>Copyright &#169; 1989-1994 The Regents of the University of California."
lappend f "Copyright &#169; 1994-1996 Sun Microsystems, Inc."
lappend f "</PRE>"
return [join $f "\n"]
}
# doDir --
#
# Given a directory as argument, translate all the man pages in
# that directory.
#
# Arguments:
# dir - Name of the directory.
proc doDir dir {
foreach f [lsort [glob -directory $dir "*.\[13n\]"]] {
do $f ;# defined in man2html1.tcl & man2html2.tcl
}
}
# main --
#
# Main code for converting Tcl manual pages to HTML.
#
# Arguments:
# argv - List of arguments to this script.
proc main {argv} {
global html_dir
# Global vars used in man2html1.tcl and man2html2.tcl
global NAME_file KEY_file lib state curFile file inDT textState nestStk
global curFont fontStart fontEnd noFillCount footer
if {[llength $argv] < 2} {
puts stderr "usage: $::argv0 html_dir tcl_dir packages..."
puts stderr "usage: $::argv0 -clean html_dir"
exit 1
}
if {[lindex $argv 0] eq "-clean"} {
set html_dir [lindex $argv 1]
puts -nonewline "recursively remove: $html_dir? "
flush stdout
if {[gets stdin] eq "y"} {
puts "removing: $html_dir"
file delete -force $html_dir
}
exit 0
}
set html_dir [lindex $argv 0]
set tcl_dir [lindex $argv 1]
set packages [lrange $argv 2 end]
set homeDir [file dirname [info script]]
#### need to add glob capability to packages ####
# make sure there are doc directories for each package
foreach i $packages {
if {![file exists $tcl_dir/$i/doc]} {
puts stderr "Error: doc directory for package $i is missing"
exit 1
}
if {![file isdirectory $tcl_dir/$i/doc]} {
puts stderr "Error: $tcl_dir/$i/doc is not a directory"
exit 1
}
}
# we want to start with a clean sheet
if {[file exists $html_dir]} {
puts stderr "Error: HTML directory already exists"
exit 1
} else {
file mkdir $html_dir
}
set footer [footer $packages]
# make the hyperlink arrays and contents.html for all packages
foreach package $packages {
file mkdir $html_dir/$package
# build hyperlink database arrays: NAME_file and KEY_file
#
puts "\nScanning man pages in $tcl_dir/$package/doc..."
uplevel \#0 [list source $homeDir/man2html1.tcl]
doDir $tcl_dir/$package/doc
# clean up the NAME_file and KEY_file database arrays
#
catch {unset KEY_file()}
foreach name [lsort [array names NAME_file]] {
set file_name $NAME_file($name)
if {[llength $file_name] > 1} {
set file_name [lsort $file_name]
puts "Warning: '$name' multiply defined in: $file_name;\
using last"
set NAME_file($name) [lindex $file_name end]
}
}
# sarray $html_dir/$package/xref.tcl NAME_file KEY_file
# build the contents file from NAME_file
#
puts "\nGenerating contents.html for $package"
doContents $html_dir/$package/contents.html $lib ;# defined in man2html1.tcl
# now translate the man pages to HTML pages
#
uplevel \#0 [list source $homeDir/man2html2.tcl]
puts "\nBuilding html pages from man pages in $tcl_dir/$package/doc..."
doDir $tcl_dir/$package/doc
unset NAME_file
}
}
if [catch { main $argv } result] {
global errorInfo
puts stderr $result
puts stderr "in"
puts stderr $errorInfo
}
-258
View File
@@ -1,258 +0,0 @@
# man2html1.tcl --
#
# This file defines procedures that are used during the first pass of the
# man page to html conversion process. It is sourced by h.tcl.
#
# Copyright (c) 1996 by Sun Microsystems, Inc.
# Global variables used by these scripts:
#
# state - state variable that controls action of text proc.
#
# curFile - tail of current man page.
#
# file - file pointer; for both xref.tcl and contents.html
#
# NAME_file - array indexed by NAME and containing file names used
# for hyperlinks.
#
# KEY_file - array indexed by KEYWORD and containing file names used
# for hyperlinks.
#
# lib - contains package name. Used to label section in contents.html
#
# inDT - in dictionary term.
# text --
#
# This procedure adds entries to the hypertext arrays NAME_file
# and KEY_file.
#
# DT: might do this: if first word of $dt matches $name and [llength $name==1]
# and [llength $dt > 1], then add to NAME_file.
#
# Arguments:
# string - Text to index.
proc text string {
global state curFile NAME_file KEY_file inDT
switch $state {
NAME {
foreach i [split $string ","] {
lappend NAME_file([string trim $i]) $curFile
}
}
KEY {
foreach i [split $string ","] {
lappend KEY_file([string trim $i]) $curFile
}
}
DT -
OFF -
DASH {}
default {
puts stderr "text: unknown state: $state"
}
}
}
# macro --
#
# This procedure is invoked to process macro invocations that start
# with "." (instead of ').
#
# Arguments:
# name - The name of the macro (without the ".").
# args - Any additional arguments to the macro.
proc macro {name args} {
switch $name {
SH - SS {
global state
switch $args {
NAME {
if {$state eq "INIT"} {
set state NAME
}
}
DESCRIPTION {set state DT}
INTRODUCTION {set state DT}
KEYWORDS {set state KEY}
default {set state OFF}
}
}
TP {
global inDT
set inDT 1
}
TH {
global lib state inDT
set inDT 0
set state INIT
if {[llength $args] != 5} {
set args [join $args " "]
puts stderr "Bad .TH macro: .$name $args"
}
set lib [lindex $args 3] ;# Tcl or Tk
}
}
}
# dash --
#
# This procedure is invoked to handle dash characters ("\-" in
# troff). It only function in pass1 is to terminate the NAME state.
#
# Arguments:
# None.
proc dash {} {
global state
if {$state eq "NAME"} {
set state DASH
}
}
# newline --
#
# This procedure is invoked to handle newlines in the troff input.
# It's only purpose is to terminate a DT (dictionary term).
#
# Arguments:
# None.
proc newline {} {
global inDT
set inDT 0
}
# initGlobals, tab, font, char, macro2 --
#
# These procedures do nothing during the first pass.
#
# Arguments:
# None.
proc initGlobals {} {}
proc tab {} {}
proc font type {}
proc char name {}
proc macro2 {name args} {}
# doListing --
#
# Writes an ls like list to a file. Searches NAME_file for entries
# that match the input pattern.
#
# Arguments:
# file - Output file pointer.
# pattern - glob style match pattern
proc doListing {file pattern} {
global NAME_file
set max_len 0
foreach name [lsort [array names NAME_file]] {
set ref $NAME_file($name)
if [string match $pattern $ref] {
lappend type $name
if {[string length $name] > $max_len} {
set max_len [string length $name]
}
}
}
if [catch {llength $type} ] {
puts stderr " doListing: no names matched pattern ($pattern)"
return
}
incr max_len
set ncols [expr {90/$max_len}]
set nrows [expr {int(ceil([llength $type] / double($ncols)))} ]
# ? max_len ncols nrows
set index 0
foreach f $type {
lappend row([expr {$index % $nrows}]) $f
incr index
}
puts -nonewline $file "<PRE>"
for {set i 0} {$i<$nrows} {incr i} {
foreach name $row($i) {
set str [format "%-*s" $max_len $name]
regsub $name $str "<A HREF=\"$NAME_file($name).html\">$name</A>" str
puts -nonewline $file $str
}
puts $file {}
}
puts $file "</PRE>"
}
# doContents --
#
# Generates a HTML contents file using the NAME_file array
# as its input database.
#
# Arguments:
# file - name of the contents file.
# packageName - string used in the title and sub-heads of the HTML
# page. Normally name of the package without version
# numbers.
proc doContents {file packageName} {
global footer
set file [open $file w]
puts $file "<HTML><HEAD><TITLE>$packageName Manual</TITLE></HEAD><BODY>"
puts $file "<H3>$packageName</H3>"
doListing $file "*.1"
puts $file "<HR><H3>$packageName Commands</H3>"
doListing $file "*.n"
puts $file "<HR><H3>$packageName Library</H3>"
doListing $file "*.3"
puts $file $footer
puts $file "</BODY></HTML>"
close $file
}
# do --
#
# This is the toplevel procedure that searches a man page
# for hypertext links. It builds a data base consisting of
# two arrays: NAME_file and KEY file. It runs the man2tcl
# program to turn the man page into a script, then it evals
# that script.
#
# Arguments:
# fileName - Name of the file to scan.
proc do fileName {
global curFile
set curFile [file tail $fileName]
set file stdout
puts " Pass 1 -- $fileName"
flush stdout
if [catch {eval [exec man2tcl [glob $fileName]]} msg] {
global errorInfo
puts stderr $msg
puts "in"
puts $errorInfo
exit 1
}
}
-927
View File
@@ -1,927 +0,0 @@
##############################################################################
# man2html2.tcl --
#
# This file defines procedures that are used during the second pass of the man
# page to html conversion process. It is sourced by man2html.tcl.
#
# Copyright (c) 1996 by Sun Microsystems, Inc.
# Global variables used by these scripts:
#
# NAME_file - array indexed by NAME and containing file names used for
# hyperlinks.
#
# textState - state variable defining action of 'text' proc.
#
# nestStk - stack oriented list containing currently active HTML tags (UL,
# OL, DL). Local to 'nest' proc.
#
# inDT - set by 'TPmacro', cleared by 'newline'. Used to insert the
# tag while in a dictionary list <DL>.
#
# curFont - Name of special font that is currently in use. Null means the
# default paragraph font is being used.
#
# file - Where to output the generated HTML.
#
# fontStart - Array to map font names to starting sequences.
#
# fontEnd - Array to map font names to ending sequences.
#
# noFillCount - Non-zero means don't fill the next $noFillCount lines: force a
# line break at each newline. Zero means filling is enabled, so
# don't output line breaks for each newline.
#
# footer - info inserted at bottom of each page. Normally read from the
# xref.tcl file
##############################################################################
# initGlobals --
#
# This procedure is invoked to set the initial values of all of the global
# variables, before processing a man page.
#
# Arguments:
# None.
proc initGlobals {} {
global file noFillCount textState
global fontStart fontEnd curFont inPRE charCnt inTable
nest init
set inPRE 0
set inTable 0
set textState 0
set curFont ""
set fontStart(Code) "<B>"
set fontStart(Emphasis) "<I>"
set fontEnd(Code) "</B>"
set fontEnd(Emphasis) "</I>"
set noFillCount 0
set charCnt 0
setTabs 0.5i
}
##############################################################################
# beginFont --
#
# Arranges for future text to use a special font, rather than the default
# paragraph font.
#
# Arguments:
# font - Name of new font to use.
proc beginFont font {
global curFont file fontStart
if {$curFont eq $font} {
return
}
endFont
puts -nonewline $file $fontStart($font)
set curFont $font
}
##############################################################################
# endFont --
#
# Reverts to the default font for the paragraph type.
#
# Arguments:
# None.
proc endFont {} {
global curFont file fontEnd
if {$curFont ne ""} {
puts -nonewline $file $fontEnd($curFont)
set curFont ""
}
}
##############################################################################
# text --
#
# This procedure adds text to the current paragraph. If this is the first text
# in the paragraph then header information for the paragraph is output before
# the text.
#
# Arguments:
# string - Text to output in the paragraph.
proc text string {
global file textState inDT charCnt inTable
set pos [string first "\t" $string]
if {$pos >= 0} {
text [string range $string 0 [expr {$pos-1}]]
tab
text [string range $string [expr {$pos+1}] end]
return
}
if {$inTable} {
if {$inTable == 1} {
puts -nonewline $file <TR>
set inTable 2
}
puts -nonewline $file <TD>
}
incr charCnt [string length $string]
regsub -all {&} $string {\&amp;} string
regsub -all {<} $string {\&lt;} string
regsub -all {>} $string {\&gt;} string
regsub -all \" $string {\&quot;} string
switch -exact -- $textState {
REF {
if {$inDT eq ""} {
set string [insertRef $string]
}
}
SEE {
global NAME_file
foreach i [split $string] {
if {![regexp -nocase {^[a-z_]+} [string trim $i] i]} {
# puts "Warning: $i in SEE ALSO not found"
continue
}
if {![catch { set ref $NAME_file($i) }]} {
regsub $i $string "<A HREF=\"$ref.html\">$i</A>" string
}
}
}
}
puts -nonewline $file "$string"
if {$inTable} {
puts -nonewline $file </TD>
}
}
##############################################################################
# insertRef --
#
# Arguments:
# string - Text to output in the paragraph.
proc insertRef string {
global NAME_file self
set path {}
if {![catch { set ref $NAME_file([string trim $string]) }]} {
if {"$ref.html" ne $self} {
set string "<A HREF=\"${path}$ref.html\">$string</A>"
# puts "insertRef: $self $ref.html ---$string--"
}
}
return $string
}
##############################################################################
# macro --
#
# This procedure is invoked to process macro invocations that start with "."
# (instead of ').
#
# Arguments:
# name - The name of the macro (without the ".").
# args - Any additional arguments to the macro.
proc macro {name args} {
switch $name {
AP {
if {[llength $args] != 3} {
puts stderr "Bad .AP macro: .$name [join $args " "]"
}
setTabs {1.25i 2.5i 3.75i}
TPmacro {}
font B
text "[lindex $args 0] "
font I
text "[lindex $args 1]"
font R
text " ([lindex $args 2])"
newline
}
AS {} ;# next page and previous page
br {
lineBreak
}
BS {}
BE {}
CE {
global file noFillCount inPRE
puts $file </PRE></BLOCKQUOTE>
set inPRE 0
}
CS { ;# code section
global file noFillCount inPRE
puts -nonewline $file <BLOCKQUOTE><PRE>
set inPRE 1
}
DE {
global file noFillCount inTable
puts $file </TABLE></BLOCKQUOTE>
set inTable 0
set noFillCount 0
}
DS {
global file noFillCount inTable
puts -nonewline $file {<BLOCKQUOTE><TABLE BORDER="0">}
set noFillCount 10000000
set inTable 1
}
fi {
global noFillCount
set noFillCount 0
}
IP {
IPmacro $args
}
LP {
nest decr
nest incr
newPara
}
ne {
}
nf {
global noFillCount
set noFillCount 1000000
}
OP {
global inDT file inPRE
if {[llength $args] != 3} {
puts stderr "Bad .OP macro: .$name [join $args " "]"
}
nest para DL DT
set inPRE 1
puts -nonewline $file <PRE>
setTabs 4c
text "Command-Line Name:"
tab
font B
set x [lindex $args 0]
regsub -all {\\-} $x - x
text $x
newline
font R
text "Database Name:"
tab
font B
text [lindex $args 1]
newline
font R
text "Database Class:"
tab
font B
text [lindex $args 2]
font R
puts -nonewline $file </PRE>
set inDT "\n<DD>" ;# next newline writes inDT
set inPRE 0
newline
}
PP {
nest decr
nest incr
newPara
}
RE {
nest decr
}
RS {
nest incr
}
SE {
global noFillCount textState inPRE file
font R
puts -nonewline $file </PRE>
set inPRE 0
set noFillCount 0
nest reset
newPara
text "See the "
font B
set temp $textState
set textState REF
if {[llength $args] > 0} {
text [lindex $args 0]
} else {
text options
}
set textState $temp
font R
text " manual entry for detailed descriptions of the above options."
}
SH {
SHmacro $args
}
SS {
SHmacro $args subsection
}
SO {
global noFillCount inPRE file
SHmacro "STANDARD OPTIONS"
setTabs {4c 8c 12c}
set noFillCount 1000000
puts -nonewline $file <PRE>
set inPRE 1
font B
}
so {
if {$args ne "man.macros"} {
puts stderr "Unknown macro: .$name [join $args " "]"
}
}
sp { ;# needs work
if {$args eq ""} {
set count 1
} else {
set count [lindex $args 0]
}
while {$count > 0} {
lineBreak
incr count -1
}
}
ta {
setTabs $args
}
TH {
THmacro $args
}
TP {
TPmacro $args
}
UL { ;# underline
global file
puts -nonewline $file "<B><U>"
text [lindex $args 0]
puts -nonewline $file "</U></B>"
if {[llength $args] == 2} {
text [lindex $args 1]
}
}
VE {
# global file
# puts -nonewline $file "</FONT>"
}
VS {
# global file
# if {[llength $args] > 0} {
# puts -nonewline $file "<BR>"
# }
# puts -nonewline $file "<FONT COLOR=\"GREEN\">"
}
QW {
puts -nonewline $file "&\#147;"
text [lindex $args 0]
puts -nonewline $file "&\#148;"
if {[llength $args] > 1} {
text [lindex $args 1]
}
}
PQ {
puts -nonewline $file "(&\#147;"
if {[lindex $args 0] eq {\N'34'}} {
puts -nonewline $file \"
} else {
text [lindex $args 0]
}
puts -nonewline $file "&\#148;"
if {[llength $args] > 1} {
text [lindex $args 1]
}
puts -nonewline $file ")"
if {[llength $args] > 2} {
text [lindex $args 2]
}
}
QR {
puts -nonewline $file "&\#147;"
text [lindex $args 0]
puts -nonewline $file "&\#148;&\#150;&\#147;"
text [lindex $args 1]
puts -nonewline $file "&\#148;"
if {[llength $args] > 2} {
text [lindex $args 2]
}
}
MT {
puts -nonewline $file "&\#147;&\#148;"
}
default {
puts stderr "Unknown macro: .$name [join $args " "]"
}
}
# global nestStk; puts "$name [format "%-20s" $args] $nestStk"
# flush stdout; flush stderr
}
##############################################################################
# font --
#
# This procedure is invoked to handle font changes in the text being output.
#
# Arguments:
# type - Type of font: R, I, B, or S.
proc font type {
global textState
switch $type {
P -
R {
endFont
if {$textState eq "REF"} {
set textState INSERT
}
}
B {
beginFont Code
if {$textState eq "INSERT"} {
set textState REF
}
}
I {
beginFont Emphasis
}
S {
}
default {
puts stderr "Unknown font: $type"
}
}
}
##############################################################################
# formattedText --
#
# Insert a text string that may also have \fB-style font changes and a few
# other backslash sequences in it.
#
# Arguments:
# text - Text to insert.
proc formattedText text {
# puts "formattedText: $text"
while {$text ne ""} {
set index [string first \\ $text]
if {$index < 0} {
text $text
return
}
text [string range $text 0 [expr {$index-1}]]
set c [string index $text [expr {$index+1}]]
switch -- $c {
f {
font [string index $text [expr {$index+2}]]
set text [string range $text [expr {$index+3}] end]
}
e {
text \\
set text [string range $text [expr {$index+2}] end]
}
- {
dash
set text [string range $text [expr {$index+2}] end]
}
| {
set text [string range $text [expr {$index+2}] end]
}
default {
puts stderr "Unknown sequence: \\$c"
set text [string range $text [expr {$index+2}] end]
}
}
}
}
##############################################################################
# dash --
#
# This procedure is invoked to handle dash characters ("\-" in troff). It
# outputs a special dash character.
#
# Arguments:
# None.
proc dash {} {
global textState charCnt
if {$textState eq "NAME"} {
set textState 0
}
incr charCnt
text "-"
}
##############################################################################
# tab --
#
# This procedure is invoked to handle tabs in the troff input.
#
# Arguments:
# None.
proc tab {} {
global inPRE charCnt tabString file
# ? charCnt
if {$inPRE == 1} {
set pos [expr {$charCnt % [string length $tabString]}]
set spaces [string first "1" [string range $tabString $pos end] ]
text [format "%*s" [incr spaces] " "]
} else {
# puts "tab: found tab outside of <PRE> block"
}
}
##############################################################################
# setTabs --
#
# This procedure handles the ".ta" macro, which sets tab stops.
#
# Arguments:
# tabList - List of tab stops, each consisting of a number
# followed by "i" (inch) or "c" (cm).
proc setTabs {tabList} {
global file breakPending tabString
# puts "setTabs: --$tabList--"
set last 0
set tabString {}
set charsPerInch 14.
set numTabs [llength $tabList]
foreach arg $tabList {
if {[string match +* $arg]} {
set relative 1
set arg [string range $arg 1 end]
} else {
set relative 0
}
# Always operate in relative mode for "measurement" mode
if {[regexp {^\\w'(.*)'u$} $arg content]} {
set distance [string length $content]
} else {
if {[scan $arg "%f%s" distance units] != 2} {
puts stderr "bad distance \"$arg\""
return 0
}
switch -- $units {
c {
set distance [expr {$distance * $charsPerInch / 2.54}]
}
i {
set distance [expr {$distance * $charsPerInch}]
}
default {
puts stderr "bad units in distance \"$arg\""
continue
}
}
}
# ? distance
if {$relative} {
append tabString [format "%*s1" [expr {round($distance-1)}] " "]
set last [expr {$last + $distance}]
} else {
append tabString [format "%*s1" [expr {round($distance-$last-1)}] " "]
set last $distance
}
}
# puts "setTabs: --$tabString--"
}
##############################################################################
# lineBreak --
#
# Generates a line break in the HTML output.
#
# Arguments:
# None.
proc lineBreak {} {
global file inPRE
puts $file "<BR>"
}
##############################################################################
# newline --
#
# This procedure is invoked to handle newlines in the troff input. It outputs
# either a space character or a newline character, depending on fill mode.
#
# Arguments:
# None.
proc newline {} {
global noFillCount file inDT inPRE charCnt inTable
if {$inDT ne ""} {
puts $file "\n$inDT"
set inDT {}
} elseif {$inTable} {
if {$inTable > 1} {
puts $file </tr>
set inTable 1
}
} elseif {$noFillCount == 0 || $inPRE == 1} {
puts $file {}
} else {
lineBreak
incr noFillCount -1
}
set charCnt 0
}
##############################################################################
# char --
#
# This procedure is called to handle a special character.
#
# Arguments:
# name - Special character named in troff \x or \(xx construct.
proc char name {
global file charCnt
incr charCnt
# puts "char: $name"
switch -exact $name {
\\0 { ;# \0
puts -nonewline $file " "
}
\\\\ { ;# \
puts -nonewline $file "\\"
}
\\(+- { ;# +/-
puts -nonewline $file "&#177;"
}
\\% {} ;# \%
\\| { ;# \|
}
default {
puts stderr "Unknown character: $name"
}
}
}
##############################################################################
# macro2 --
#
# This procedure handles macros that are invoked with a leading "'" character
# instead of space. Right now it just generates an error diagnostic.
#
# Arguments:
# name - The name of the macro (without the ".").
# args - Any additional arguments to the macro.
proc macro2 {name args} {
puts stderr "Unknown macro: '$name [join $args " "]"
}
##############################################################################
# SHmacro --
#
# Subsection head; handles the .SH and .SS macros.
#
# Arguments:
# name - Section name.
# style - Type of section (optional)
proc SHmacro {argList {style section}} {
global file noFillCount textState charCnt
set args [join $argList " "]
if {[llength $argList] < 1} {
puts stderr "Bad .SH macro: .$name $args"
}
set noFillCount 0
nest reset
set tag H3
if {$style eq "subsection"} {
set tag H4
}
puts -nonewline $file "<$tag>"
text $args
puts $file "</$tag>"
# ? args textState
# control what the text proc does with text
switch $args {
NAME {set textState NAME}
DESCRIPTION {set textState INSERT}
INTRODUCTION {set textState INSERT}
"WIDGET-SPECIFIC OPTIONS" {set textState INSERT}
"SEE ALSO" {set textState SEE}
KEYWORDS {set textState 0}
}
set charCnt 0
}
##############################################################################
# IPmacro --
#
# This procedure is invoked to handle ".IP" macros, which may take any of the
# following forms:
#
# .IP [1] Translate to a "1Step" paragraph.
# .IP [x] (x > 1) Translate to a "Step" paragraph.
# .IP Translate to a "Bullet" paragraph.
# .IP \(bu Translate to a "Bullet" paragraph.
# .IP text count Translate to a FirstBody paragraph with
# special indent and tab stop based on "count",
# and tab after "text".
#
# Arguments:
# argList - List of arguments to the .IP macro.
#
# HTML limitations: 'count' in '.IP text count' is ignored.
proc IPmacro argList {
global file
setTabs 0.5i
set length [llength $argList]
if {$length == 0} {
nest para UL LI
return
}
# Special case for alternative mechanism for declaring bullets
if {[lindex $argList 0] eq "\\(bu"} {
nest para UL LI
return
}
if {[regexp {^\[\d+\]$} [lindex $argList 0]]} {
nest para OL LI
return
}
nest para DL DT
formattedText [lindex $argList 0]
puts $file "\n<DD>"
return
}
##############################################################################
# TPmacro --
#
# This procedure is invoked to handle ".TP" macros, which may take any of the
# following forms:
#
# .TP x Translate to an indented paragraph with the specified indent
# (in 100 twip units).
# .TP Translate to an indented paragraph with default indent.
#
# Arguments:
# argList - List of arguments to the .IP macro.
#
# HTML limitations: 'x' in '.TP x' is ignored.
proc TPmacro {argList} {
global inDT
nest para DL DT
set inDT "\n<DD>" ;# next newline writes inDT
setTabs 0.5i
}
##############################################################################
# THmacro --
#
# This procedure handles the .TH macro. It generates the non-scrolling header
# section for a given man page, and enters information into the table of
# contents. The .TH macro has the following form:
#
# .TH name section date footer header
#
# Arguments:
# argList - List of arguments to the .TH macro.
proc THmacro {argList} {
global file
if {[llength $argList] != 5} {
set args [join $argList " "]
puts stderr "Bad .TH macro: .$name $args"
}
set name [lindex $argList 0] ;# Tcl_UpVar
set page [lindex $argList 1] ;# 3
set vers [lindex $argList 2] ;# 7.4
set lib [lindex $argList 3] ;# Tcl
set pname [lindex $argList 4] ;# {Tcl Library Procedures}
puts -nonewline $file "<HTML><HEAD><TITLE>"
text "$lib - $name ($page)"
puts $file "</TITLE></HEAD><BODY>\n"
puts -nonewline $file "<H1><CENTER>"
text $pname
puts $file "</CENTER></H1>\n"
}
##############################################################################
# newPara --
#
# This procedure sets the left and hanging indents for a line. Indents are
# specified in units of inches or centimeters, and are relative to the current
# nesting level and left margin.
#
# Arguments:
# None
proc newPara {} {
global file nestStk
if {[lindex $nestStk end] ne "NEW"} {
nest decr
}
puts -nonewline $file "<P>"
}
##############################################################################
# nest --
#
# This procedure takes care of inserting the tags associated with the IP, TP,
# RS, RE, LP and PP macros. Only 'nest para' takes arguments.
#
# Arguments:
# op - operation: para, incr, decr, reset, init
# listStart - begin list tag: OL, UL, DL.
# listItem - item tag: LI, LI, DT.
proc nest {op {listStart "NEW"} {listItem ""} } {
global file nestStk inDT charCnt
# puts "nest: $op $listStart $listItem"
switch $op {
para {
set top [lindex $nestStk end]
if {$top eq "NEW"} {
set nestStk [lreplace $nestStk end end $listStart]
puts $file "<$listStart>"
} elseif {$top ne $listStart} {
puts stderr "nest para: bad stack"
exit 1
}
puts $file "\n<$listItem>"
set charCnt 0
}
incr {
lappend nestStk NEW
}
decr {
if {[llength $nestStk] == 0} {
puts stderr "nest error: nest length is zero"
set nestStk NEW
}
set tag [lindex $nestStk end]
if {$tag ne "NEW"} {
puts $file "</$tag>"
}
set nestStk [lreplace $nestStk end end]
}
reset {
while {[llength $nestStk] > 0} {
nest decr
}
set nestStk NEW
}
init {
set nestStk NEW
set inDT {}
}
}
set charCnt 0
}
##############################################################################
# do --
#
# This is the toplevel procedure that translates a man page to HTML. It runs
# the man2tcl program to turn the man page into a script, then it evals that
# script.
#
# Arguments:
# fileName - Name of the file to translate.
proc do fileName {
global file self html_dir package footer
set self "[file tail $fileName].html"
set file [open "$html_dir/$package/$self" w]
puts " Pass 2 -- $fileName"
flush stdout
initGlobals
if {[catch { eval [exec man2tcl [glob $fileName]] } msg]} {
global errorInfo
puts stderr $msg
puts "in"
puts stderr $errorInfo
exit 1
}
nest reset
puts $file $footer
puts $file "</BODY></HTML>"
close $file
}
-424
View File
@@ -1,424 +0,0 @@
/*
* man2tcl.c --
*
* This file contains a program that turns a man page of the form used
* for Tcl and Tk into a Tcl script that invokes a Tcl command for each
* construct in the man page. The script can then be eval'ed to translate
* the manual entry into some other format such as MIF or HTML.
*
* Usage:
*
* man2tcl ?fileName?
*
* Copyright (c) 1995 Sun Microsystems, Inc.
*
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*/
static char sccsid[] = "@(#) man2tcl.c 1.3 95/08/12 17:34:08";
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <errno.h>
/*
* Imported things that aren't defined in header files:
*/
/*
* Some <errno.h> define errno to be something complex and thread-aware; in
* that case we definitely do not want to declare errno ourselves!
*/
#ifndef errno
extern int errno;
#endif
/*
* Current line number, used for error messages.
*/
static int lineNumber;
/*
* The variable below is set to 1 if an error occurs anywhere while reading in
* the file.
*/
static int status;
/*
* The variable below is set to 1 if output should be generated. If it's 0, it
* means we're doing a pre-pass to make sure that the file can be properly
* parsed.
*/
static int writeOutput;
#define PRINT(args) if (writeOutput) { printf args; }
#define PRINTC(chr) if (writeOutput) { putc((chr), stdout); }
/*
* Prototypes for functions defined in this file:
*/
static void DoMacro(char *line);
static void DoText(char *line);
static void QuoteText(char *string, int count);
/*
*----------------------------------------------------------------------
*
* main --
*
* This function is the main program, which does all of the work of the
* program.
*
* Results:
* None: exits with a 0 return status to indicate success, or 1 to
* indicate that there were problems in the translation.
*
* Side effects:
* A Tcl script is output to standard output. Error messages may be
* output on standard error.
*
*----------------------------------------------------------------------
*/
int
main(
int argc, /* Number of command-line arguments. */
char **argv) /* Values of command-line arguments. */
{
FILE *f;
#define MAX_LINE_SIZE 4000
char line[MAX_LINE_SIZE];
char *p;
/*
* Find the file to read, and open it if it isn't stdin.
*/
if (argc == 1) {
f = stdin;
} else if (argc == 2) {
f = fopen(argv[1], "r");
if (f == NULL) {
fprintf(stderr, "Couldn't read \"%s\": %s\n", argv[1],
strerror(errno));
exit(1);
}
} else {
fprintf(stderr, "Usage: %s ?fileName?\n", argv[0]);
}
/*
* Make two passes over the file. In the first pass, just check to make
* sure we can handle everything. If there are problems, generate output
* and stop. If everything is OK, make a second pass to actually generate
* output.
*/
for (writeOutput = 0; writeOutput < 2; writeOutput++) {
lineNumber = 0;
status = 0;
while (fgets(line, MAX_LINE_SIZE, f) != NULL) {
for (p = line; *p != 0; p++) {
if (*p == '\n') {
*p = 0;
break;
}
}
lineNumber++;
if (((line[0] == '.') || (line[0] == '\'')) && (line[1] == '\\') && (line[2] == '\"')) {
/*
* This line is a comment. Ignore it.
*/
continue;
}
if (strlen(line) >= MAX_LINE_SIZE -1) {
fprintf(stderr, "Too long line. Max is %d chars.\n",
MAX_LINE_SIZE - 1);
exit(1);
}
if ((line[0] == '.') || (line[0] == '\'')) {
/*
* This line is a macro invocation.
*/
DoMacro(line);
} else {
/*
* This line is text, possibly with formatting characters
* embedded in it.
*/
DoText(line);
}
}
if (status != 0) {
break;
}
fseek(f, 0, SEEK_SET);
}
exit(status);
}
/*
*----------------------------------------------------------------------
*
* DoMacro --
*
* This function is called to handle a macro invocation. It parses the
* arguments to the macro and generates a Tcl command to handle the
* invocation.
*
* Results:
* None.
*
* Side effects:
* A Tcl command is written to stdout.
*
*----------------------------------------------------------------------
*/
static void
DoMacro(
char *line) /* The line of text that contains the macro
* invocation. */
{
char *p, *end;
int quote;
/*
* If there is no macro name, then just skip the whole line.
*/
if ((line[1] == 0) || (isspace(line[1]))) {
return;
}
PRINT(("macro"));
if (*line != '.') {
PRINT(("2"));
}
/*
* Parse the arguments to the macro (including the name), in order.
*/
p = line+1;
while (1) {
PRINTC(' ');
if (*p == '"') {
/*
* The argument is delimited by quotes.
*/
for (end = p+1; *end != '"'; end++) {
if (*end == 0) {
fprintf(stderr,
"Unclosed quote in macro call on line %d.\n",
lineNumber);
status = 1;
break;
}
}
QuoteText(p+1, (end-(p+1)));
} else {
quote = 0;
for (end = p+1; (*end != 0) && (quote || !isspace(*end)); end++) {
if (*end == '\'') {
quote = !quote;
}
}
QuoteText(p, end-p);
}
if (*end == 0) {
break;
}
p = end+1;
while (isspace(*p)) {
/*
* Skip empty space before next argument.
*/
p++;
}
if (*p == 0) {
break;
}
}
PRINTC('\n');
}
/*
*----------------------------------------------------------------------
*
* DoText --
*
* This function is called to handle a line of troff text. It parses the
* text, generating Tcl commands for text and for formatting stuff such
* as font changes.
*
* Results:
* None.
*
* Side effects:
* Tcl commands are written to stdout.
*
*----------------------------------------------------------------------
*/
static void
DoText(
char *line) /* The line of text. */
{
char *p, *end;
/*
* Divide the line up into pieces consisting of backslash sequences, tabs,
* and other text.
*/
p = line;
while (*p != 0) {
if (*p == '\t') {
PRINT(("tab\n"));
p++;
} else if (*p != '\\') {
/*
* Ordinary text.
*/
for (end = p+1; (*end != '\\') && (*end != 0); end++) {
/* Empty loop body. */
}
PRINT(("text "));
QuoteText(p, end-p);
PRINTC('\n');
p = end;
} else {
/*
* A backslash sequence. There are particular ones that we
* understand; output an error message for anything else and just
* ignore the backslash.
*/
p++;
if (*p == 'f') {
/*
* Font change.
*/
PRINT(("font %c\n", p[1]));
p += 2;
} else if (*p == '-') {
PRINT(("dash\n"));
p++;
} else if (*p == 'e') {
PRINT(("text \\\\\n"));
p++;
} else if (*p == '.') {
PRINT(("text .\n"));
p++;
} else if (*p == '&') {
p++;
} else if (*p == '0') {
PRINT(("text { }\n"));
p++;
} else if (*p == '(') {
if ((p[1] == 0) || (p[2] == 0)) {
fprintf(stderr, "Bad \\( sequence on line %d.\n",
lineNumber);
status = 1;
} else {
PRINT(("char {\\(%c%c}\n", p[1], p[2]));
p += 3;
}
} else if (*p == 'N' && *(p+1) == '\'') {
int ch;
p += 2;
sscanf(p,"%d",&ch);
PRINT(("text \\u%04x\n", ch));
while(*p&&*p!='\'') p++;
p++;
} else if (*p != 0) {
PRINT(("char {\\%c}\n", *p));
p++;
}
}
}
PRINT(("newline\n"));
}
/*
*----------------------------------------------------------------------
*
* QuoteText --
*
* Copy the "string" argument to stdout, adding quote characters around
* any special Tcl characters so that they'll just be treated as ordinary
* text.
*
* Results:
* None.
*
* Side effects:
* Text is written to stdout.
*
*----------------------------------------------------------------------
*/
static void
QuoteText(
char *string, /* The line of text. */
int count) /* Number of characters to write from
* string. */
{
if (count == 0) {
PRINT(("{}"));
return;
}
for ( ; count > 0; string++, count--) {
switch (*string) {
case '\\':
if (*(string+1) == 'N' && *(string+2) == '\'') {
int ch;
string += 3;
count -= 3;
sscanf(string,"%d",&ch);
PRINT(("\\u%04x", ch));
while(count>0&&*string!='\'') {string++;count--;}
continue;
} else if (*(string+1) == '0') {
PRINT(("\\ "));
string++;
count--;
continue;
}
case '$': case '[': case '{': case ' ': case ';':
case '"': case '\t':
PRINTC('\\');
default:
PRINTC(*string);
}
}
}
/*
* Local Variables:
* mode: c
* c-basic-offset: 4
* fill-column: 78
* End:
*/
-59
View File
@@ -1,59 +0,0 @@
#! /bin/sh
#
# Transform text (.ps, .tcl,...) into a C string
#
# 1997/10 -- dl
#
# restart with tclsh \
exec tclsh "$0" ${1+"$@"}
# Max string length
# (some C compiler have a 2048 chars limits (so 2047 real chars with
# the tariling 0) so we use 2000 to make the count nice)
set MAX 2000
if {$argc} {
puts stderr "Usage: [file tail [info script]] < text > text.c"
exit 1
}
set r [read stdin]
proc translate {what} {
regsub -all {\\} $what {\\\\} what
regsub -all {"} $what {\\"} what
regsub -all "\n" $what "\\\\n\\\\\n" what;
return $what;
}
set lg [string length $r]
if {$lg<$MAX} {
puts "/*
* Single part writeable string generated by str2c
*/
static char data\[\]=\"[translate $r]\";"
} else {
puts "/*
* Multi parts read only string generated by str2c
*/
static const char * const data\[\]= {"
set n 1
for {set i 0} {$i<$lg} {incr i $MAX} {
set part [string range $r $i [expr {$i+$MAX-1}]]
set len [string length $part];
puts "\t/* Start of part $n ($len characters) */"
puts "\t\"[translate $part]\","
puts "\t/* End of part $n */\n"
incr n
}
puts "\tNULL\t/* End of data marker */\n};"
puts "\n/* use for instance with:
const char * const *chunk;
for (chunk=data; *chunk; chunk++) {
Tcl_AppendResult(interp, *chunk, (char *) NULL);
}
*/"
}
-19
View File
@@ -1,19 +0,0 @@
; This file is maintained by HCW. Do not modify this file directly.
[OPTIONS]
HCW=0
LCID=0x409 0x0 0x0 ;English (United States)
REPORT=Yes
TITLE=Tcl/Tk Reference Manual
CNT=tcl87.cnt
COPYRIGHT=Copyright © 2000 Ajuba Solutions
HLP=tcl87.hlp
[FILES]
tcl.rtf
[WINDOWS]
main="Tcl/Tk Reference Manual",,0
[CONFIG]
BrowseButtons()
+187 -142
View File
@@ -43,14 +43,14 @@ proc indexfile {} {
if {[info exists ::TARGET] && $::TARGET eq "devsite"} {
return "index.tml"
} else {
return "contents.htm"
return "index.html"
}
}
proc copyright {copyright {level {}}} {
# We don't actually generate a separate copyright page anymore
#set page "${level}copyright.htm"
#return "<A HREF=\"$page\">Copyright</A> &#169; [htmlize-text [lrange $copyright 2 end]]"
#set page "${level}copyright.html"
#return "<a href=\"$page\">Copyright</a> &copy; [htmlize-text [lrange $copyright 2 end]]"
# obfuscate any email addresses that may appear in name
set who [string map {@ (at)} [lrange $copyright 2 end]]
return "Copyright &copy; [htmlize-text $who]"
@@ -61,7 +61,7 @@ proc copyout {copyrights {level {}}} {
set out "<div class=\"copy\">"
foreach c $copyrights {
if {$count > 0} {
append out <BR>
append out <br>
}
append out "[copyright $c $level]\n"
incr count
@@ -74,21 +74,17 @@ proc CSS {{level ""}} {
return "<link rel=\"stylesheet\" href=\"${level}$::CSSFILE\" type=\"text/css\" media=\"all\">\n"
}
proc DOCTYPE {} {
return "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">"
}
proc htmlhead {title header args} {
set level ""
if {[lindex $args end] eq "../[indexfile]"} {
# XXX hack - assume same level for CSS file
set level "../"
}
set out "[DOCTYPE]\n<HTML>\n<HEAD><TITLE>$title</TITLE>\n[CSS $level]</HEAD>\n"
set out "<!DOCTYPE html>\n<html lang=\"en\">\n<head><meta charset=\"utf-8\"><title>$title</title>\n[CSS $level]</head>\n"
foreach {uptitle url} $args {
set header "<a href=\"$url\">$uptitle</a> <small>&gt;</small> $header"
}
append out "<BODY><H2>$header</H2>"
append out "<body><h2>$header</h2>"
global manual
if {[info exists manual(subheader)]} {
set subs {}
@@ -96,10 +92,10 @@ proc htmlhead {title header args} {
if {$name eq $title} {
lappend subs $name
} else {
lappend subs "<A HREF=\"${level}$subdir/[indexfile]\">$name</A>"
lappend subs "<a href=\"${level}$subdir/[indexfile]\">$name</a>"
}
}
append out "\n<H3>[join $subs { | }]</H3>"
append out "\n<h3>[join $subs { | }]</h3>"
}
return $out
}
@@ -116,6 +112,10 @@ proc parse-directive {line codename restname} {
return [regexp {^(\.[.a-zA-Z0-9]*) *(.*)} $line all code rest]
}
proc nospace-text {text} {
return [regsub -all " " $text _]
}
proc htmlize-text {text {charmap {}}} {
# contains some extras for use in nroff->html processing
# build on the list passed in, if any
@@ -130,8 +130,8 @@ proc htmlize-text {text {charmap {}}} {
\" {&quot;} \
{<} {&lt;} \
{>} {&gt;} \
\u201c "&#8220;" \
\u201d "&#8221;"
\u201c "&ldquo;" \
\u201d "&rdquo;"
return [string map $charmap $text]
}
@@ -144,25 +144,70 @@ proc process-text {text} {
{\&} "\t" \
{\%} {} \
"\\\n" "\n" \
{\(+-} "&#177;" \
{\(r!} "&iexcl;" \
{\(ct} "&cent;" \
{\(Po} "&pound;" \
{\(Cs} "&curren;" \
{\(Ye} "&yen;" \
{\(bb} "&brvbar;" \
{\(sc} "&sect;" \
{\(ad} "&die;" \
{\(co} "&copy;" \
{\(em} "&#8212;" \
{\(en} "&#8211;" \
{\(fm} "&#8242;" \
{\(mc} "&#181;" \
{\(mu} "&#215;" \
{\(mi} "&#8722;" \
{\(->} "<font size=\"+1\">&#8594;</font>" \
{\(Of} "&ordf;" \
{\(Fo} "&laquo;" \
{\(no} "&not;" \
{\(rg} "&reg;" \
{\(a-} "&macr;" \
{\(de} "&deg;" \
{\(+-} "&plusmn;" \
{\(S2} "&sup2;" \
{\(S3} "&sup3;" \
{\(aa} "&acute;" \
{\(mc} "&micro;" \
{\(ps} "&para;" \
{\(pc} "&middot;" \
{\(ac} "&cedil;" \
{\(S1} "&sup1;" \
{\(Om} "&ordm;" \
{\(Fc} "&raquo;" \
{\(14} "&frac14;" \
{\(12} "&frac12;" \
{\(34} "&frac34;" \
{\(r?} "&iquest;" \
{\(AE} "&AElig;" \
{\(-D} "&ETH;" \
{\(mu} "&times;" \
{\(TP} "&THORN;" \
{\(ss} "&szlig;" \
{\(ae} "&aelig;" \
{\(Sd} "&eth;" \
{\(di} "&divide;" \
{\(Tp} "&thorn;" \
{\(em} "&mdash;" \
{\(en} "&ndash;" \
{\(bu} "&bull;" \
{\(fm} "&prime;" \
{\(mi} "&minus;" \
{\(.i} "&imath;" \
{\(.j} "&jmath;" \
{\(Fn} "&fnof;" \
{\(OE} "&OElig;" \
{\(oe} "&oelig;" \
{\(IJ} "&IJlig;" \
{\(ij} "&ijlig;" \
{\(<-} "<font size=\"+1\">&larr;</font>" \
{\(->} "<font size=\"+1\">&rarr;</font>" \
{\(eu} "&euro;" \
{\fP} {\fR} \
{\.} . \
{\(bu} "&#8226;" \
]
# This might make a few invalid mappings, but we don't use them
foreach c {a e i o u y A E I O U Y} {
foreach c {a c e g i l n o s t u y z A C E G I L N O S T U Y Z} {
foreach {prefix suffix} {
o ring / slash : uml ' acute ^ circ ` grave
o ring / slash : uml ' acute ^ circ ` grave ~ tilde , cedil v caron
} {
lappend charmap "\\\[${prefix}${c}\]" "&${c}${suffix};"
lappend charmap "\\(${prefix}${c}" "&${c}${suffix};"
}
}
lappend charmap {\-\|\-} -- ; # two hyphens
@@ -174,19 +219,19 @@ proc process-text {text} {
while {[string first "\\" $text] >= 0} {
# C R
if {[regsub {^([^\\]*)\\fC([^\\]*)\\fR(.*)$} $text \
{\1<TT>\2</TT>\3} text]} continue
{\1<tt>\2</tt>\3} text]} continue
# B R
if {[regsub {^([^\\]*)\\fB([^\\]*)\\fR(.*)$} $text \
{\1<B>\2</B>\3} text]} continue
{\1<b>\2</b>\3} text]} continue
# B I
if {[regsub {^([^\\]*)\\fB([^\\]*)\\fI(.*)$} $text \
{\1<B>\2</B>\\fI\3} text]} continue
{\1<b>\2</b>\\fI\3} text]} continue
# I R
if {[regsub {^([^\\]*)\\fI([^\\]*)\\fR(.*)$} $text \
{\1<I>\2</I>\3} text]} continue
{\1<i>\2</i>\3} text]} continue
# I B
if {[regsub {^([^\\]*)\\fI([^\\]*)\\fB(.*)$} $text \
{\1<I>\2</I>\\fB\3} text]} continue
{\1<i>\2</i>\\fB\3} text]} continue
# B B, I I, R R
if {
[regsub {^([^\\]*)\\fB([^\\]*)\\fB(.*)$} $text \
@@ -326,8 +371,8 @@ proc long-toc {text} {
set manual($manual(name)-id-$text) $here
set there L[incr manual(long-toc-n)]
lappend manual(section-toc) \
"<DD><A HREF=\"$manual(name).htm#$here\" NAME=\"$there\">$text</A>"
return "<A NAME=\"$here\">$text</A>"
"<dd><a href=\"$manual(name).html#$here\" name=\"[nospace-text $there]\" id=\"[nospace-text $there]\">$text</a>"
return "<a name=\"[nospace-text $here]\" id=\"[nospace-text $here]\">$text</a>"
}
proc option-toc {name class switch} {
@@ -352,24 +397,24 @@ proc option-toc {name class switch} {
set here M$first
set there L[incr manual(long-toc-n)]
set manual(standard-option-$manual(name)-$first) \
"<A HREF=\"$manual(name).htm#$here\">$switch, $name, $class</A>"
"<a href=\"$manual(name).html#$here\">$switch, $name, $class</a>"
lappend manual(section-toc) \
"<DD><A HREF=\"$manual(name).htm#$here\" NAME=\"$there\">$switch, $name, $class</A>"
return "<A NAME=\"$here\">$switch</A>"
"<dd><a href=\"$manual(name).html#$here\" name=\"[nospace-text $there]\" id=\"[nospace-text $there]\">$switch, $name, $class</a>"
return "<a name=\"[nospace-text $here]\" id=\"[nospace-text $here]\">$switch</a>"
}
proc std-option-toc {name page} {
global manual
if {[info exists manual(standard-option-$page-$name)]} {
lappend manual(section-toc) <DD>$manual(standard-option-$page-$name)
lappend manual(section-toc) <dd>$manual(standard-option-$page-$name)
return $manual(standard-option-$page-$name)
}
manerror "missing reference to \"$name\" in $page.n"
set here M[incr manual(section-toc-n)]
set there L[incr manual(long-toc-n)]
set other M$name
lappend manual(section-toc) "<DD><A HREF=\"$page.htm#$other\">$name</A>"
return "<A HREF=\"$page.htm#$other\">$name</A>"
lappend manual(section-toc) "<dd><a href=\"$page.html#$other\">$name</a>"
return "<a href=\"$page.html#$other\">$name</a>"
}
##
@@ -378,8 +423,8 @@ proc std-option-toc {name page} {
##
proc output-widget-options {rest} {
global manual
man-puts <DL>
lappend manual(section-toc) <DL>
man-puts <dl>
lappend manual(section-toc) <dl>
backup-text 1
set para {}
while {[next-op-is .OP rest]} {
@@ -410,11 +455,11 @@ proc output-widget-options {rest} {
if {![regexp {^(<.>)([\w]*)(</.>)$} $class all oclass class cclass]} {
error "not Class: $class"
}
man-puts "$para<DT>Command-Line Name: $oswitch[option-toc $name $class $switch]$cswitch"
man-puts "<DT>Database Name: $oname$name$cname"
man-puts "<DT>Database Class: $oclass$class$cclass"
man-puts <DD>[next-text]
set para <P>
man-puts "$para<dt>Command-Line Name: $oswitch[option-toc $name $class $switch]$cswitch"
man-puts "<dt>Database Name: $oname$name$cname"
man-puts "<dt>Database Class: $oclass$class$cclass"
man-puts <dd>[next-text]
set para <p>
if {[next-op-is .RS rest]} {
while {[more-text]} {
@@ -440,8 +485,8 @@ proc output-widget-options {rest} {
}
}
}
man-puts </DL>
lappend manual(section-toc) </DL>
man-puts </dl>
lappend manual(section-toc) </dl>
}
##
@@ -452,18 +497,18 @@ proc output-RS-list {} {
if {[next-op-is .IP rest]} {
output-IP-list .RS .IP $rest
if {[match-text .RE .sp .RS @rest .IP @rest2]} {
man-puts <P>$rest
man-puts <p>$rest
output-IP-list .RS .IP $rest2
}
if {[match-text .RE .sp .RS @rest .RE]} {
man-puts <P>$rest
man-puts <p>$rest
return
}
if {[next-op-is .RE rest]} {
return
}
}
man-puts <DL><DD>
man-puts <dl><dd>
while {[more-text]} {
set line [next-text]
if {[is-a-directive $line]} {
@@ -485,7 +530,7 @@ proc output-RS-list {} {
man-puts $line
}
}
man-puts </DL>
man-puts </dl>
}
##
@@ -496,13 +541,13 @@ proc output-IP-list {context code rest} {
global manual
if {![string length $rest]} {
# blank label, plain indent, no contents entry
man-puts <DL><DD>
man-puts <dl><dd>
while {[more-text]} {
set line [next-text]
if {[is-a-directive $line]} {
split-directive $line code rest
if {$code eq ".IP" && $rest eq {}} {
man-puts "<P>"
man-puts "<p>"
continue
}
if {$code in {.br .DS .RS}} {
@@ -515,21 +560,21 @@ proc output-IP-list {context code rest} {
man-puts $line
}
}
man-puts </DL>
man-puts </dl>
} else {
# labelled list, make contents
if {$context ne ".SH" && $context ne ".SS"} {
man-puts <P>
man-puts <p>
}
set dl "<DL class=\"[string tolower $manual(section)]\">"
set enddl "</DL>"
set dl "<dl class=\"[string tolower $manual(section)]\">"
set enddl "</dl>"
if {$code eq ".IP"} {
if {[regexp {^\[[\da-f]+\]|\(?[\da-f]+\)$} $rest]} {
set dl "<OL class=\"[string tolower $manual(section)]\">"
set enddl "</OL>"
set dl "<ol class=\"[string tolower $manual(section)]\">"
set enddl "</ol>"
} elseif {"&#8226;" eq $rest} {
set dl "<UL class=\"[string tolower $manual(section)]\">"
set enddl "</UL>"
set dl "<ul class=\"[string tolower $manual(section)]\">"
set enddl "</ul>"
}
}
man-puts $dl
@@ -548,15 +593,15 @@ proc output-IP-list {context code rest} {
continue
}
if {$manual(section) eq "ARGUMENTS"} {
man-puts "$para<DT>$rest<DD>"
man-puts "$para<dt>$rest<dd>"
} elseif {[regexp {^\[([\da-f]+)\]$} $rest -> value]} {
man-puts "$para<LI value=\"$value\">"
man-puts "$para<li value=\"$value\">"
} elseif {[regexp {^\(?([\da-f]+)\)$} $rest -> value]} {
man-puts "$para<LI value=\"$value\">"
man-puts "$para<li value=\"$value\">"
} elseif {"&#8226;" eq $rest} {
man-puts "$para<LI>"
man-puts "$para<li>"
} else {
man-puts "$para<DT>[long-toc $rest]<DD>"
man-puts "$para<dt>[long-toc $rest]<dd>"
}
}
.sp - .br - .DS - .CS {
@@ -582,18 +627,18 @@ proc output-IP-list {context code rest} {
.PP {
if {[match-text @rest1 .br @rest2 .RS]} {
# yet another nroff kludge as above
man-puts "$para<DT>[long-toc $rest1]"
man-puts "<DT>[long-toc $rest2]<DD>"
man-puts "$para<dt>[long-toc $rest1]"
man-puts "<dt>[long-toc $rest2]<dd>"
incr accept_RE 1
} elseif {[match-text @rest .RE]} {
# gad, this is getting ridiculous
if {!$accept_RE} {
man-puts "$enddl<P>$rest$dl"
man-puts "$enddl<p>$rest$dl"
backup-text 1
set para {}
break
}
man-puts "<P>$rest"
man-puts "<p>$rest"
incr accept_RE -1
} elseif {$accept_RE} {
output-directive $line
@@ -617,7 +662,7 @@ proc output-IP-list {context code rest} {
} else {
man-puts $line
}
set para <P>
set para <p>
}
man-puts "$para$enddl"
lappend manual(section-toc) $enddl
@@ -640,7 +685,7 @@ proc output-name {line} {
# output line to manual page untouched
man-puts "$head &mdash; $tail"
# output line to long table of contents
lappend manual(section-toc) "<DL><DD>$head &mdash; $tail</DD></DL>"
lappend manual(section-toc) "<dl><dd>$head &mdash; $tail</dd></dl>"
# separate out the names for future reference
foreach name [split $head ,] {
set name [string trim $name]
@@ -650,7 +695,7 @@ proc output-name {line} {
lappend manual(wing-toc) $name
lappend manual(name-$name) $manual(wing-file)/$manual(name)
}
set manual(tooltip-$manual(wing-file)/$manual(name).htm) $line
set manual(tooltip-$manual(wing-file)/$manual(name).html) $line
}
##
@@ -675,7 +720,7 @@ proc cross-reference {ref} {
[regexp {^[A-Z0-9 ?!]+$} $ref]
&& [info exists manual($manname-id-$ref)]
} {
return "<A HREF=\"#$manual($manname-id-$ref)\">$ref</A>"
return "<a href=\"#$manual($manname-id-$ref)\">$ref</a>"
} else {
set lref [string tolower $ref]
##
@@ -697,7 +742,7 @@ proc cross-reference {ref} {
(![info exists exclude_refs_map($mantail)] ||
$manual(name-$name) ni $exclude_refs_map($mantail))
} {
return "<A HREF=\"../$manual(name-$name).htm\">$ref</A>"
return "<a href=\"../$manual(name-$name).html\">$ref</a>"
}
}
if {$lref in {end}} {
@@ -722,17 +767,17 @@ proc cross-reference {ref} {
if {$tcl_i >= 0 && $manual(wing-file) eq "TclCmd"
|| $manual(wing-file) eq "TclLib"} {
set tcl_ref [lindex $manref $tcl_i]
return "<A HREF=\"../$tcl_ref.htm\">$ref</A>"
return "<a href=\"../$tcl_ref.html\">$ref</a>"
}
set tk_i [lsearch -glob $manref *TkCmd*]
if {$tk_i >= 0 && $manual(wing-file) eq "TkCmd"
|| $manual(wing-file) eq "TkLib"} {
set tk_ref [lindex $manref $tk_i]
return "<A HREF=\"../$tk_ref.htm\">$ref</A>"
return "<a href=\"../$tk_ref.html\">$ref</a>"
}
if {$lref eq "exit" && $mantail eq "tclsh.1" && $tcl_i >= 0} {
set tcl_ref [lindex $manref $tcl_i]
return "<A HREF=\"../$tcl_ref.htm\">$ref</A>"
return "<a href=\"../$tcl_ref.html\">$ref</a>"
}
puts stderr "multiple cross reference to $ref in $manref from $manual(wing-file)/$mantail"
return $ref
@@ -759,7 +804,7 @@ proc cross-reference {ref} {
##
## return the cross reference
##
return "<A HREF=\"../$manref.htm\">$ref</A>"
return "<a href=\"../$manref.html\">$ref</a>"
}
##
@@ -782,7 +827,7 @@ proc insert-cross-references {text} {
##
## we identify cross references by:
## ``quotation''
## <B>emboldening</B>
## <b>emboldening</b>
## Tcl_ prefix
## Tk_ prefix
## [a-zA-Z0-9]+ manual entry
@@ -793,9 +838,9 @@ proc insert-cross-references {text} {
##
unset -nocomplain offsets
foreach {name pattern} {
anchor {<A } end-anchor {</A>}
anchor {<a } end-anchor {</a>}
quote {``} end-quote {''}
bold {<B>} end-bold {</B>}
bold {<b>} end-bold {</b>}
c.tcl {Tcl_}
c.tk {Tk_}
c.ttk {Ttk_}
@@ -876,8 +921,8 @@ proc insert-cross-references {text} {
[expr {$offset(end-bold)-1}]]
set text [string range $text[set text ""] \
[expr {$offset(end-bold)+4}] end]
regsub {http://[\w/.-]+} $body {<A HREF="&">&</A>} body
append result <B> [cross-reference $body] </B>
regsub {http://[\w/.-]+} $body {<a href="&">&</a>} body
append result <b> [cross-reference $body] </b>
continue
}
anchor {
@@ -914,7 +959,7 @@ proc insert-cross-references {text} {
append result [string range $text 0 [expr {$off-1}]]
regexp -indices -start $off {http://[\w/.-]+} $text range
set url [string range $text {*}$range]
append result "<A HREF=\"[string trimright $url .]\">$url</A>"
append result "<a href=\"[string trimright $url .]\">$url</a>"
set text [string range $text[set text ""] \
[expr {[lindex $range 1]+1}] end]
continue
@@ -935,7 +980,7 @@ proc output-directive {line} {
split-directive $line code rest
switch -exact -- $code {
.BS - .BE {
# man-puts <HR>
# man-puts <hr>
}
.SH - .SS {
# drain any open lists
@@ -945,9 +990,9 @@ proc output-directive {line} {
set manual($manual(name)-$manual(section)) {}
lappend manual(has-$manual(section)) $manual(name)
if {$code ne ".SS"} {
man-puts "<H3>[long-toc $manual(section)]</H3>"
man-puts "<h3>[long-toc $manual(section)]</h3>"
} else {
man-puts "<H4>[long-toc $manual(section)]</H4>"
man-puts "<h4>[long-toc $manual(section)]</h4>"
}
# some sections can simply free wheel their way through the text
# some sections can be processed in their own loops
@@ -967,7 +1012,7 @@ proc output-directive {line} {
}
}
H:SYNOPSIS {
lappend manual(section-toc) <DL>
lappend manual(section-toc) <dl>
while {1} {
if {
[next-op-is .nf rest]
@@ -986,7 +1031,7 @@ proc output-directive {line} {
break
}
if {[next-op-is .sp rest]} {
#man-puts <P>
#man-puts <p>
continue
}
set more [next-text]
@@ -999,15 +1044,15 @@ proc output-directive {line} {
regexp {^(\s*)(.*)} $more -> spaces more
set spaces [string map {" " "&nbsp;"} $spaces]
if {[string length $spaces]} {
set spaces <TT>$spaces</TT>
set spaces <tt>$spaces</tt>
}
man-puts $spaces$more<BR>
man-puts $spaces$more<br>
if {$manual(wing-file) in {TclLib TkLib}} {
lappend manual(section-toc) <DD>$more
lappend manual(section-toc) <dd>$more
}
}
}
lappend manual(section-toc) </DL>
lappend manual(section-toc) </dl>
return
}
{H:SEE ALSO} {
@@ -1025,11 +1070,11 @@ proc output-directive {line} {
set nmore {}
foreach cr [split $more ,] {
set cr [string trim $cr]
if {![regexp {^<B>.*</B>$} $cr]} {
set cr <B>$cr</B>
if {![regexp {^<b>.*</b>$} $cr]} {
set cr <b>$cr</b>
}
if {[regexp {^<B>(.*)\([13n]\)</B>$} $cr all name]} {
set cr <B>$name</B>
if {[regexp {^<b>(.*)\([13n]\)</b>$} $cr all name]} {
set cr <b>$name</b>
}
lappend nmore $cr
}
@@ -1053,9 +1098,9 @@ proc output-directive {line} {
foreach key [split $more ,] {
set key [string trim $key]
lappend manual(keyword-$key) [list $manual(name) \
$manual(wing-file)/$manual(name).htm]
$manual(wing-file)/$manual(name).html]
set initial [string toupper [string index $key 0]]
lappend keys "<A href=\"../Keywords/$initial.htm\#$key\">$key</A>"
lappend keys "<a href=\"../Keywords/$initial.html\#$key\">$key</a>"
}
man-puts [join $keys {, }]
}
@@ -1087,14 +1132,14 @@ proc output-directive {line} {
}
}
output-directive {.SH STANDARD OPTIONS}
man-puts <DL>
lappend manual(section-toc) <DL>
man-puts <dl>
lappend manual(section-toc) <dl>
foreach optionpair [lsort -dictionary -index 0 $optslist] {
lassign $optionpair option targetPage
man-puts "<DT><B>[std-option-toc $option $targetPage]</B>"
man-puts "<dt><b>[std-option-toc $option $targetPage]</b>"
}
man-puts </DL>
lappend manual(section-toc) </DL>
man-puts </dl>
lappend manual(section-toc) </dl>
}
.OP {
output-widget-options $rest
@@ -1105,14 +1150,14 @@ proc output-directive {line} {
return
}
.PP - .sp {
man-puts <P>
man-puts <p>
}
.RS {
output-RS-list
return
}
.br {
man-puts <BR>
man-puts <br>
return
}
.DS {
@@ -1123,9 +1168,9 @@ proc output-directive {line} {
set td "<td><p class=\"tablecell\">"
set bodyText [string map [list \n <tr>$td \t $td] \n$stuff]
man-puts "<dl><dd><table border=\"0\">$bodyText</table></dl>"
#man-puts <PRE>$stuff</PRE>
#man-puts <pre>$stuff</pre>
} elseif {[match-text .fi @ul1 @ul2 .nf @stuff .DE]} {
man-puts "<PRE>[lindex $ul1 1][lindex $ul2 1]\n$stuff</PRE>"
man-puts "<pre>[lindex $ul1 1][lindex $ul2 1]\n$stuff</pre>"
} else {
manerror "unexpected .DS format:\n[expand-next-text 2]"
}
@@ -1136,7 +1181,7 @@ proc output-directive {line} {
# ???
}
if {[match-text @stuff .CE]} {
man-puts <PRE>$stuff</PRE>
man-puts <pre>$stuff</pre>
} else {
manerror "unexpected .CS format:\n[expand-next-text 2]"
}
@@ -1145,54 +1190,54 @@ proc output-directive {line} {
.nf {
if {[match-text @more .fi]} {
foreach more [split $more \n] {
man-puts $more<BR>
man-puts $more<br>
}
} elseif {[match-text .RS @more .RE .fi]} {
man-puts <DL><DD>
man-puts <dl><dd>
foreach more [split $more \n] {
man-puts $more<BR>
man-puts $more<br>
}
man-puts </DL>
man-puts </dl>
} elseif {[match-text .RS @more .RS @more2 .RE .RE .fi]} {
man-puts <DL><DD>
man-puts <dl><dd>
foreach more [split $more \n] {
man-puts $more<BR>
man-puts $more<br>
}
man-puts <DL><DD>
man-puts <dl><dd>
foreach more2 [split $more2 \n] {
man-puts $more2<BR>
man-puts $more2<br>
}
man-puts </DL></DL>
man-puts </dl></dl>
} elseif {[match-text .RS @more .RS @more2 .RE @more3 .RE .fi]} {
man-puts <DL><DD>
man-puts <dl><dd>
foreach more [split $more \n] {
man-puts $more<BR>
man-puts $more<br>
}
man-puts <DL><DD>
man-puts <dl><dd>
foreach more2 [split $more2 \n] {
man-puts $more2<BR>
man-puts $more2<br>
}
man-puts </DL><DD>
man-puts </dl><dd>
foreach more3 [split $more3 \n] {
man-puts $more3<BR>
man-puts $more3<br>
}
man-puts </DL>
man-puts </dl>
} elseif {[match-text .sp .RS @more .RS @more2 .sp .RE .RE .fi]} {
man-puts <P><DL><DD>
man-puts <p><dl><dd>
foreach more [split $more \n] {
man-puts $more<BR>
man-puts $more<br>
}
man-puts <DL><DD>
man-puts <dl><dd>
foreach more2 [split $more2 \n] {
man-puts $more2<BR>
man-puts $more2<br>
}
man-puts </DL></DL><P>
man-puts </dl></dl><p>
} elseif {[match-text .RS .sp @more .sp .RE .fi]} {
man-puts <P><DL><DD>
man-puts <p><dl><dd>
foreach more [split $more \n] {
man-puts $more<BR>
man-puts $more<br>
}
man-puts </DL><P>
man-puts </dl><p>
} else {
manerror "ignoring $line"
}
@@ -1272,9 +1317,9 @@ proc make-manpage-section {outputDir sectionDescriptor} {
puts stderr "scanning section $manual(wing-name)"
# put the entry for this section into the short table of contents
if {[regexp {^(.+), version (.+)$} $manual(wing-name) -> name version]} {
puts $manual(short-toc-fp) "<DT><A HREF=\"$manual(wing-file)/[indexfile]\" TITLE=\"version $version\">$name</A></DT><DD>$manual(wing-description)</DD>"
puts $manual(short-toc-fp) "<dt><a href=\"$manual(wing-file)/[indexfile]\" title=\"version $version\">$name</a></dt><dd>$manual(wing-description)</dd>"
} else {
puts $manual(short-toc-fp) "<DT><A HREF=\"$manual(wing-file)/[indexfile]\">$manual(wing-name)</A></DT><DD>$manual(wing-description)</DD>"
puts $manual(short-toc-fp) "<dt><a href=\"$manual(wing-file)/[indexfile]\">$manual(wing-name)</a></dt><dd>$manual(wing-description)</dd>"
}
# initialize the wing table of contents
puts $manual(wing-toc-fp) [htmlhead $manual(wing-name) \
@@ -1560,7 +1605,7 @@ proc make-manpage-section {outputDir sectionDescriptor} {
# make the long table of contents for this page
#
set manual(toc-$manual(wing-file)-$manual(name)) \
[concat <DL> $manual(section-toc) </DL>]
[concat <dl> $manual(section-toc) </dl>]
}
if {!$verbose} {
puts stderr ""
@@ -1590,15 +1635,15 @@ proc make-manpage-section {outputDir sectionDescriptor} {
set tail [lindex $tail [expr {[llength $tail]-1}]]
}
set tail [file tail $tail]
if {[info exists manual(tooltip-$manual(wing-file)/$tail.htm)]} {
set tooltip $manual(tooltip-$manual(wing-file)/$tail.htm)
if {[info exists manual(tooltip-$manual(wing-file)/$tail.html)]} {
set tooltip $manual(tooltip-$manual(wing-file)/$tail.html)
set tooltip [string map {[ {\[} ] {\]} $ {\$} \\ \\\\} $tooltip]
regsub {^[^-]+-\s*(.)} $tooltip {[string totitle \1]} tooltip
append rows([expr {$n%$nrows}]) \
"<td> <a href=\"$tail.htm\" title=\"[subst $tooltip]\">$name</a> </td>"
"<td> <a href=\"$tail.html\" title=\"[subst $tooltip]\">$name</a> </td>"
} else {
append rows([expr {$n%$nrows}]) \
"<td> <a href=\"$tail.htm\">$name</a> </td>"
"<td> <a href=\"$tail.html\">$name</a> </td>"
}
incr n
}
@@ -1612,7 +1657,7 @@ proc make-manpage-section {outputDir sectionDescriptor} {
# insert wing copyrights
#
puts $manual(wing-toc-fp) [copyout $manual(wing-copyrights) "../"]
puts $manual(wing-toc-fp) "</BODY></HTML>"
puts $manual(wing-toc-fp) "</body></html>"
close $manual(wing-toc-fp)
set manual(merge-copyrights) \
[merge-copyrights $manual(merge-copyrights) $manual(wing-copyrights)]
Executable → Regular
+35 -31
View File
@@ -4,7 +4,7 @@ if {[catch {package require Tcl 8.6-} msg]} {
puts stderr "ERROR: $msg"
puts stderr "If running this script from 'make html', set the\
NATIVE_TCLSH environment\nvariable to point to an installed\
tclsh8.7 (or the equivalent tclsh87.exe\non Windows)."
tclsh8.6 (or the equivalent tclsh86.exe\non Windows)."
exit 1
}
@@ -240,7 +240,7 @@ proc css-style args {
append style $tokens " \{" $body "\}\n"
}
proc css-stylesheet {} {
set hBd "1px dotted #11577b"
set hBd "1px dotted #11577B"
css-style body div p th td li dd ul ol dl dt blockquote {
font-family: Verdana, sans-serif;
@@ -249,7 +249,7 @@ proc css-stylesheet {} {
font-family: 'Courier New', Courier, monospace;
}
css-style pre {
background-color: #f6fcec;
background-color: #F6FCEC;
border-top: 1px solid #6A6A6A;
border-bottom: 1px solid #6A6A6A;
padding: 1em;
@@ -269,20 +269,20 @@ proc css-stylesheet {} {
}
css-style h1 {
font-size: 18px;
color: #11577b;
color: #11577B;
border-bottom: $hBd;
margin-top: 0px;
}
css-style h2 {
font-size: 14px;
color: #11577b;
background-color: #c5dce8;
color: #11577B;
background-color: #C5DCE8;
padding-left: 1em;
border: 1px solid #6A6A6A;
}
css-style h3 h4 {
color: #1674A4;
background-color: #e8f2f6;
background-color: #E8F2F6;
border-bottom: $hBd;
border-top: $hBd;
}
@@ -296,16 +296,16 @@ proc css-stylesheet {} {
width: 20em;
float: left;
padding: 2px;
border-top: 1px solid #999;
border-top: 1px solid #999999;
}
css-style ".keylist dt" { font-weight: bold; }
css-style ".keylist dd" ".arguments dd" {
margin-left: 20em;
padding: 2px;
border-top: 1px solid #999;
border-top: 1px solid #999999;
}
css-style .copy {
background-color: #f6fcfc;
background-color: #F6FCFC;
white-space: pre;
font-size: 80%;
border-top: 1px solid #6A6A6A;
@@ -334,7 +334,7 @@ proc make-man-pages {html args} {
set manual(short-toc-n) 1
set manual(short-toc-fp) [open $html/[indexfile] w]
puts $manual(short-toc-fp) [htmlhead $overall_title $overall_title]
puts $manual(short-toc-fp) "<DL class=\"keylist\">"
puts $manual(short-toc-fp) "<dl class=\"keylist\">"
set manual(merge-copyrights) {}
foreach arg $args {
@@ -378,13 +378,13 @@ proc make-man-pages {html args} {
foreach a $letters {
set keys [array names manual "keyword-\[[string totitle $a$a]\]*"]
if {[llength $keys]} {
lappend keyheader "<A HREF=\"$a.htm\">$a</A>"
lappend keyheader "<a href=\"$a.html\">$a</a>"
} else {
# No keywords for this letter
lappend keyheader $a
}
}
set keyheader <H3>[join $keyheader " |\n"]</H3>
set keyheader <h3>[join $keyheader " |\n"]</h3>
puts $keyfp $keyheader
foreach a $letters {
set keys [array names manual "keyword-\[[string totitle $a$a]\]*"]
@@ -392,16 +392,16 @@ proc make-man-pages {html args} {
continue
}
# Per-keyword page
set afp [open $html/Keywords/$a.htm w]
set afp [open $html/Keywords/$a.html w]
puts $afp [htmlhead "$tcltkdesc Keywords - $a" \
"$tcltkdesc Keywords - $a" \
$overall_title "../[indexfile]"]
puts $afp $keyheader
puts $afp "<DL class=\"keylist\">"
puts $afp "<dl class=\"keylist\">"
foreach k [lsort -dictionary $keys] {
set k [string range $k 8 end]
puts $afp "<DT><A NAME=\"$k\">$k</A></DT>"
puts $afp "<DD>"
puts $afp "<dt><a name=\"[nospace-text $k]\" id=\"[nospace-text $k]\">$k</a></dt>"
puts $afp "<dd>"
set refs {}
foreach man $manual(keyword-$k) {
set name [lindex $man 0]
@@ -411,32 +411,32 @@ proc make-man-pages {html args} {
if {[string match {*[<>""]*} $tooltip]} {
manerror "bad tooltip for $file: \"$tooltip\""
}
lappend refs "<A HREF=\"../$file\" TITLE=\"$tooltip\">$name</A>"
lappend refs "<a href=\"../$file\" title=\"$tooltip\">$name</a>"
} else {
lappend refs "<A HREF=\"../$file\">$name</A>"
lappend refs "<a href=\"../$file\">$name</a>"
}
}
puts $afp "[join $refs {, }]</DD>"
puts $afp "[join $refs {, }]</dd>"
}
puts $afp "</DL>"
puts $afp "</dl>"
# insert merged copyrights
puts $afp [copyout $manual(merge-copyrights)]
puts $afp "</BODY></HTML>"
puts $afp "</body></html>"
close $afp
}
# insert merged copyrights
puts $keyfp [copyout $manual(merge-copyrights)]
puts $keyfp "</BODY></HTML>"
puts $keyfp "</body></html>"
close $keyfp
##
## finish off short table of contents
##
puts $manual(short-toc-fp) "<DT><A HREF=\"Keywords/[indexfile]\">Keywords</A><DD>The keywords from the $tcltkdesc man pages."
puts $manual(short-toc-fp) "</DL>"
puts $manual(short-toc-fp) "<dt><a href=\"Keywords/[indexfile]\">Keywords</a><dd>The keywords from the $tcltkdesc man pages."
puts $manual(short-toc-fp) "</dl>"
# insert merged copyrights
puts $manual(short-toc-fp) [copyout $manual(merge-copyrights)]
puts $manual(short-toc-fp) "</BODY></HTML>"
puts $manual(short-toc-fp) "</body></html>"
close $manual(short-toc-fp)
##
@@ -468,7 +468,7 @@ proc make-man-pages {html args} {
} else {
puts -nonewline stderr .
}
set outfd [open $html/$manual(wing-file)/$manual(name).htm w]
set outfd [open $html/$manual(wing-file)/$manual(name).html w]
puts $outfd [htmlhead "$manual($manual(wing-file)-$manual(name)-title)" \
$manual(name) $wing_name "[indexfile]" \
$overall_title "../[indexfile]"]
@@ -486,7 +486,7 @@ proc make-man-pages {html args} {
foreach item $text {
puts $outfd [insert-cross-references $item]
}
puts $outfd "</BODY></HTML>"
puts $outfd "</body></html>"
} on error msg {
if {$verbose} {
puts stderr $msg
@@ -741,7 +741,11 @@ try {
# ... but try to extract (name, version) from subdir contents
try {
set f [open [file join $pkgsDir $dir configure.ac]]
try {
set f [open [file join $pkgsDir $dir configure.in]]
} trap {POSIX ENOENT} {} {
set f [open [file join $pkgsDir $dir configure.ac]]
}
foreach line [split [read $f] \n] {
if {2 == [scan $line \
{ AC_INIT ( [%[^]]] , [%[^]]] ) } n v]} {
@@ -801,9 +805,9 @@ try {
[list $tcltkdir/{$appdir}/doc/*.1 "$tcltkdesc Applications" UserCmd \
"The interpreters which implement $cmdesc."] \
[plus-base $build_tcl $tcldir doc/*.n {Tcl Commands} TclCmd \
"The commands which the <B>tclsh</B> interpreter implements."] \
"The commands which the <b>tclsh</b> interpreter implements."] \
[plus-base $build_tk $tkdir doc/*.n {Tk Commands} TkCmd \
"The additional commands which the <B>wish</B> interpreter implements."] \
"The additional commands which the <b>wish</b> interpreter implements."] \
{*}[plus-pkgs n {*}$packageBuildList] \
[plus-base $build_tcl $tcldir doc/*.3 {Tcl C API} TclLib \
"The C functions which a Tcl extended C program may use."] \
+3 -6
View File
@@ -2301,7 +2301,6 @@ dist: $(UNIX_DIR)/configure $(UNIX_DIR)/tclConfig.h.in $(UNIX_DIR)/tcl.pc.in gen
$(DISTDIR)/win
cp -p $(TOP_DIR)/win/*.bat $(DISTDIR)/win
cp -p $(TOP_DIR)/win/*.vc $(DISTDIR)/win
cp -p $(TOP_DIR)/win/tcl.hpj.in $(DISTDIR)/win
cp -p $(TOP_DIR)/win/tcl.ds* $(DISTDIR)/win
cp -p $(TOP_DIR)/win/README $(DISTDIR)/win
cp -p $(TOP_DIR)/license.terms $(DISTDIR)/win
@@ -2323,11 +2322,9 @@ dist: $(UNIX_DIR)/configure $(UNIX_DIR)/tclConfig.h.in $(UNIX_DIR)/tcl.pc.in gen
cp -p $(UNIX_DIR)/dltest/*.c $(UNIX_DIR)/dltest/Makefile.in \
$(UNIX_DIR)/dltest/README $(DISTDIR)/unix/dltest
@mkdir $(DISTDIR)/tools
cp -p $(TOOL_DIR)/Makefile.in $(TOOL_DIR)/README \
$(TOOL_DIR)/configure $(TOOL_DIR)/configure.ac \
$(TOOL_DIR)/*.tcl $(TOOL_DIR)/man2tcl.c \
$(TOOL_DIR)/*.bmp $(TOOL_DIR)/tcl.hpj.in \
$(DISTDIR)/tools
cp -p $(TOOL_DIR)/README $(TOOL_DIR)/*.c $(TOOL_DIR)/*.svg \
$(TOOL_DIR)/*.tcl $(TOOL_DIR)/*.bmp \
$(TOOL_DIR)/valgrind_suppress $(DISTDIR)/tools
@mkdir $(DISTDIR)/libtommath
cp -p $(TOMMATH_SRCS) $(TOMMATH_DIR)/*.h $(DISTDIR)/libtommath
@mkdir $(DISTDIR)/pkgs
+2 -3
View File
@@ -169,7 +169,6 @@ STATIC_LIBRARIES = $(TCL_LIB_FILE)
TCLSH = tclsh$(VER)${EXESUFFIX}
WINE = @WINE@
CAT32 = cat32$(EXEEXT)
MAN2TCL = man2tcl$(EXEEXT)
# For cross-compiled builds, TCL_EXE is the name of a tclsh executable that is
# available *BEFORE* running make for the first time. Certain build targets
@@ -981,7 +980,7 @@ Makefile: $(SRC_DIR)/Makefile.in
./config.status
cleanhelp:
$(RM) *.hlp *.cnt *.GID *.rtf man2tcl.exe
$(RM) *.hlp *.cnt *.GID
clean: cleanhelp clean-packages
$(RM) *.lib *.a *.exp *.dll *.$(RES) *.${OBJEXT} *~ \#* TAGS a.out
@@ -993,7 +992,7 @@ clean: cleanhelp clean-packages
distclean: distclean-packages clean
$(RM) Makefile config.status config.cache config.log tclConfig.sh \
tcl.hpj config.status.lineno tclsh.exe.manifest
config.status.lineno tclsh.exe.manifest
#
# Bundled package targets
+1 -2
View File
@@ -5445,7 +5445,7 @@ TCL_WIN_VERSION="$TCL_VERSION.$TCL_RELEASE_LEVEL.`echo $TCL_PATCH_LEVEL | tr -d
ac_config_files="$ac_config_files Makefile tclConfig.sh tcl.hpj tclsh.exe.manifest"
ac_config_files="$ac_config_files Makefile tclConfig.sh tclsh.exe.manifest"
cat >confcache <<\_ACEOF
# This file is a shell script that caches the results of configure
@@ -6154,7 +6154,6 @@ do
case $ac_config_target in
"Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
"tclConfig.sh") CONFIG_FILES="$CONFIG_FILES tclConfig.sh" ;;
"tcl.hpj") CONFIG_FILES="$CONFIG_FILES tcl.hpj" ;;
"tclsh.exe.manifest") CONFIG_FILES="$CONFIG_FILES tclsh.exe.manifest" ;;
*) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
+1 -1
View File
@@ -509,7 +509,7 @@ AC_SUBST(RC_DEFINE)
AC_SUBST(RC_DEFINES)
AC_SUBST(RES)
AC_OUTPUT(Makefile tclConfig.sh tcl.hpj tclsh.exe.manifest)
AC_OUTPUT(Makefile tclConfig.sh tclsh.exe.manifest)
dnl Local Variables:
dnl mode: autoconf;
+2 -2
View File
@@ -469,8 +469,8 @@ test: test-core test-pkgs
test-core: setup $(TCLTEST) dlls
set TCL_LIBRARY=$(ROOT:\=/)/library
$(DEBUGGER) $(TCLTEST) "$(ROOT:\=/)/tests/all.tcl" $(TESTFLAGS) -loadfile <<
package ifneeded dde 1.4.3 [list load "$(TCLDDELIB:\=/)" dde]
package ifneeded registry 1.3.5 [list load "$(TCLREGLIB:\=/)" registry]
package ifneeded dde 1.4.3 [list load "$(TCLDDELIB:\=/)" Dde]
package ifneeded registry 1.3.5 [list load "$(TCLREGLIB:\=/)" Registry]
<<
runtest: setup $(TCLTEST) dlls
-4
View File
@@ -1444,10 +1444,6 @@ SOURCE=.\rules.vc
# End Source File
# Begin Source File
SOURCE=.\tcl.hpj.in
# End Source File
# Begin Source File
SOURCE=.\tcl.m4
# End Source File
# Begin Source File
-19
View File
@@ -1,19 +0,0 @@
; This file is maintained by HCW. Do not modify this file directly.
[OPTIONS]
HCW=0
LCID=0x409 0x0 0x0 ;English (United States)
REPORT=Yes
TITLE=Tcl/Tk Reference Manual
CNT=tcl87.cnt
COPYRIGHT=Copyright © 2000 Ajuba Solutions
HLP=tcl87.hlp
[FILES]
tcl.rtf
[WINDOWS]
main="Tcl/Tk Reference Manual",,0
[CONFIG]
BrowseButtons()