summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog74
-rw-r--r--compat/tmpnam.c42
-rw-r--r--doc/fcopy.n14
-rw-r--r--doc/interp.n4
-rw-r--r--generic/tcl.h12
-rw-r--r--generic/tclCompCmds.c10
-rw-r--r--generic/tclResult.c4
-rw-r--r--tools/man2html2.tcl289
-rw-r--r--tools/mkdepend.tcl58
-rw-r--r--unix/Makefile.in5
-rwxr-xr-xunix/configure3
-rw-r--r--unix/configure.in4
-rw-r--r--win/tcl.dsp4
13 files changed, 251 insertions, 272 deletions
diff --git a/ChangeLog b/ChangeLog
index d3f2057..06051ff 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,10 +1,44 @@
+2007-10-18 David Gravereaux <davygrvy@pobox.com>
+
+ * tools/mkdepend.tcl: sort the dep list for a more humanly
+ readable output.
+
+2007-10-18 Don Porter <dgp@users.sourceforge.net>
+
+ * generic/tclResult.c (TclMergeReturnOptions): Make sure any -code
+ values get pulled out of the dictionary, even if they are integer
+ valued.
+
+ * generic/tclCompCmds.c (TclCompileReturnCmd): Added code to
+ more optimally compile [return -level 0 $x] to "push $x". [RFE 1794073]
+
+ * compat/tmpnam.c (removed): The routine tmpnam() is no longer
+ * unix/Makefile.in: called by Tcl source code. Remove autogoo
+ * unix/configure.in: the supplied a replacement version on
+ * win/tcl.dsp: systems where the routine was not available.
+ [RFE 1811848].
+
+ * unix/configure: autoconf-2.59
+
+ * generic/tcl.h: Remove TCL_LL_MODIFIER_SIZE. [RFE 1811837]
+
+2007-10-17 David Gravereaux <davygrvy@pobox.com>
+
+ * tools/mkdepend.tcl: Improved defense from malformed object
+ list infile.
+
+2007-10-17 Donal K. Fellows <donal.k.fellows@manchester.ac.uk>
+
+ * tools/man2html2.tcl: Convert .DS/.DE into HTML tables, not
+ preformatted text.
+
2007-10-17 Kevin B. Kenny <kennykb@acm.org>
* generic/tclCompExpr.c: Moved a misplaced declaration that blocked
compilation on VC++.
* generic/tclExecute.c: Silenced several VC++ compiler warnings about
converting 'long' to 'unsigned short'.
-
+
2007-10-16 David Gravereaux <davygrvy@pobox.com>
* win/makefile.vc: removed old dependency cruft that is no longer
@@ -39,17 +73,17 @@
* tests/set.test:
* tests/string.test:
* tests/stringComp.test:
-
+
2007-10-15 David Gravereaux <davygrvy@pobox.com>
- * tools/mkdepend.tcl: Produces usable output. Include path
- * win/makefile.vc: problem fixed. Never fight city hall
- when it comes to levels of quoting issues.
+ * tools/mkdepend.tcl: Produces usable output. Include path problem
+ * win/makefile.vc: fixed. Never fight city hall when it comes to
+ levels of quoting issues.
2007-10-15 Miguel Sofer <msofer@users.sf.net>
- * generic/tclParse.c (Tcl_ParseBraces): fix for possible read
- after the end of buffer, [Bug 1813528] (Joe Mistachkin).
+ * generic/tclParse.c (Tcl_ParseBraces): fix for possible read after
+ the end of buffer. [Bug 1813528] (Joe Mistachkin)
2007-10-14 David Gravereaux <davygrvy@pobox.com>
@@ -60,10 +94,10 @@
* win/makefile.vc: Mine all version information from headers.
* win/rules.vc: Sync tcl and tk and bring extension versions
- * win/nmakehlp.c: closer together. Try and avoid using tclsh
- to do substitutions as we may cross compile.
+ * win/nmakehlp.c: closer together. Try and avoid using tclsh to do
+ substitutions as we may cross compile.
* win/coffbase.txt: Added offsets for snack dlls.
-
+
2007-10-11 David Gravereaux <davygrvy@pobox.com>
* win/makefile.vc: Fixed my bad spelling mistakes from years back.
@@ -73,12 +107,12 @@
* generic/tclCmdMZ.c: Correct [string is (wide)integer] failure
* tests/string.test: to report correct failindex values for
- non-decimal integer strings. [Bug 1805887].
+ non-decimal integer strings. [Bug 1805887]
* compat/strtoll.c (removed): The routines strtoll() and strtoull()
* compat/strtoull.c (removed): are no longer called by the Tcl source
- * generic/tcl.h: code. (Their functionality has been replaced
- * unix/Makefile.in: by TclParseNumber().) Remove outdated comments
+ * generic/tcl.h: code. (Their functionality has been replaced
+ * unix/Makefile.in: by TclParseNumber().) Remove outdated comments
* unix/configure.in: and mountains of configury autogoo that
* unix/tclUnixPort.h: allegedly support the mythical systems where
* win/Makefile.in: these routines might not have been available.
@@ -90,17 +124,17 @@
2007-10-11 Miguel Sofer <msofer@users.sf.net>
- * generic/tclObj.c: remove superfluous #include of tclCompile.h
+ * generic/tclObj.c: remove superfluous #include of tclCompile.h
2007-10-08 George Peter Staplin <georgeps@xmission.com>
- * doc/Hash.3: Correct the valid usage of the flags member for the
- Tcl_HashKeyType. It should be 0 or more of the flags mentioned.
+ * doc/Hash.3: Correct the valid usage of the flags member for the
+ Tcl_HashKeyType. It should be 0 or more of the flags mentioned.
2007-10-02 Jeff Hobbs <jeffh@ActiveState.com>
- * generic/tcl.h (Tcl_DecrRefCount): Update change from 2006-05-29
- to make macro more warning-robust in unbraced if code.
+ * generic/tcl.h (Tcl_DecrRefCount): Update change from 2006-05-29 to
+ make macro more warning-robust in unbraced if code.
2007-10-02 Don Porter <dgp@users.sourceforge.net>
@@ -119,8 +153,8 @@
2007-10-02 Andreas Kupries <andreask@activestate.com>
- * library/tclIndex: Added 'tcl::tm::path' to the tclIndex. This
- fixes [SF Bug 1806422] reported by Don Porter.
+ * library/tclIndex: Added 'tcl::tm::path' to the tclIndex. This fixes
+ [Bug 1806422] reported by Don Porter.
2007-09-25 Donal K. Fellows <donal.k.fellows@manchester.ac.uk>
diff --git a/compat/tmpnam.c b/compat/tmpnam.c
deleted file mode 100644
index 6faf8de..0000000
--- a/compat/tmpnam.c
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Copyright (c) 1988 Regents of the University of California.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms are permitted provided
- * that this notice is preserved and that due credit is given to the
- * University of California at Berkeley. The name of the University may not be
- * used to endorse or promote products derived from this software without
- * specific written prior permission. This software is provided ``as is''
- * without express or implied warranty.
- *
- * RCS: @(#) $Id: tmpnam.c,v 1.3 2007/04/16 13:36:34 dkf Exp $
- */
-
-#include <sys/param.h>
-#include <sys/stat.h>
-#include <sys/file.h>
-#include <stdio.h>
-
-/*
- * Use /tmp instead of /usr/tmp, because L_tmpname is only 14 chars on some
- * machines (like NeXT machines) and /usr/tmp will cause buffer overflows.
- */
-
-#ifdef P_tmpdir
-# undef P_tmpdir
-#endif
-#define P_tmpdir "/tmp"
-
-char *
-tmpnam(
- char *s)
-{
- static char name[50];
- char *mktemp(char *);
-
- if (!s) {
- s = name;
- }
- (void) sprintf(s, "%s/XXXXXX", P_tmpdir);
- return mktemp(s);
-}
diff --git a/doc/fcopy.n b/doc/fcopy.n
index 14f1cf5..1f14ab4 100644
--- a/doc/fcopy.n
+++ b/doc/fcopy.n
@@ -5,7 +5,7 @@
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
-'\" RCS: @(#) $Id: fcopy.n,v 1.9.2.1 2007/07/04 15:13:42 dgp Exp $
+'\" RCS: @(#) $Id: fcopy.n,v 1.9.2.2 2007/10/19 14:30:01 dgp Exp $
'\"
.so man.macros
.TH fcopy n 8.0 Tcl "Tcl Built-In Commands"
@@ -94,18 +94,18 @@ The first example transfers the contents of one channel exactly to
another. Note that when copying one file to another, it is better to
use \fBfile copy\fR which also copies file metadata (e.g. the file
access permissions) where possible.
-.DS
+.CS
fconfigure $in -translation binary
fconfigure $out -translation binary
\fBfcopy\fR $in $out
-.DE
+.CE
.PP
This second example shows how the callback gets
passed the number of bytes transferred.
It also uses vwait to put the application into the event loop.
Of course, this simplified example could be done without the command
callback.
-.DS
+.CS
proc Cleanup {in out bytes {error {}}} {
global total
set total $bytes
@@ -119,11 +119,11 @@ set in [open $file1]
set out [socket $server $port]
\fBfcopy\fR $in $out -command [list Cleanup $in $out]
vwait total
-.DE
+.CE
.PP
The third example copies in chunks and tests for end of file
in the command callback
-.DS
+.CS
proc CopyMore {in out chunk bytes {error {}}} {
global total done
incr total $bytes
@@ -143,7 +143,7 @@ set total 0
\fBfcopy\fR $in $out -size $chunk \\
-command [list CopyMore $in $out $chunk]
vwait done
-.DE
+.CE
.SH "SEE ALSO"
eof(n), fblocked(n), fconfigure(n), file(n)
diff --git a/doc/interp.n b/doc/interp.n
index 4aa75b1..28e032e 100644
--- a/doc/interp.n
+++ b/doc/interp.n
@@ -5,7 +5,7 @@
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
-'\" RCS: @(#) $Id: interp.n,v 1.27.2.1 2007/09/04 17:43:46 dgp Exp $
+'\" RCS: @(#) $Id: interp.n,v 1.27.2.2 2007/10/19 14:30:01 dgp Exp $
'\"
.so man.macros
.TH interp n 7.6 Tcl "Tcl Built-In Commands"
@@ -753,7 +753,7 @@ in the interpreter's global namespace without further substitutions being
performed.
.VE 8.5
.SH CREDITS
-This mechanism is based on the Safe-Tcl prototype implemented
+The safe interpreter mechanism is based on the Safe-Tcl prototype implemented
by Nathaniel Borenstein and Marshall Rose.
.SH EXAMPLES
Creating and using an alias for a command in the current interpreter:
diff --git a/generic/tcl.h b/generic/tcl.h
index af46ad9..8c4bbbb 100644
--- a/generic/tcl.h
+++ b/generic/tcl.h
@@ -13,7 +13,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tcl.h,v 1.231.2.8 2007/10/15 18:38:06 dgp Exp $
+ * RCS: @(#) $Id: tcl.h,v 1.231.2.9 2007/10/19 14:30:01 dgp Exp $
*/
#ifndef _TCL
@@ -350,10 +350,6 @@ typedef long LONG;
* Note on converting between Tcl_WideInt and strings. This implementation (in
* tclObj.c) depends on the function
* sprintf(...,"%" TCL_LL_MODIFIER "d",...).
- * TCL_LL_MODIFIER_SIZE is the length of the
- * modifier string, which is "ll" on most 32-bit Unix systems. It has to be
- * split up like this to allow for the more complex formats sometimes needed
- * (e.g. in the format(n) command.)
*/
#if !defined(TCL_WIDE_INT_TYPE)&&!defined(TCL_WIDE_INT_IS_LONG)
@@ -361,10 +357,8 @@ typedef long LONG;
# define TCL_WIDE_INT_TYPE long long
# if defined(__WIN32__) && !defined(__CYGWIN__)
# define TCL_LL_MODIFIER "I64"
-# define TCL_LL_MODIFIER_SIZE 3
# else
# define TCL_LL_MODIFIER "L"
-# define TCL_LL_MODIFIER_SIZE 1
# endif
typedef struct stat Tcl_StatBuf;
# elif defined(__WIN32__)
@@ -372,7 +366,6 @@ typedef struct stat Tcl_StatBuf;
# ifdef __BORLANDC__
typedef struct stati64 Tcl_StatBuf;
# define TCL_LL_MODIFIER "L"
-# define TCL_LL_MODIFIER_SIZE 1
# else /* __BORLANDC__ */
# if _MSC_VER < 1400 || !defined(_M_IX86)
typedef struct _stati64 Tcl_StatBuf;
@@ -380,7 +373,6 @@ typedef struct _stati64 Tcl_StatBuf;
typedef struct _stat64 Tcl_StatBuf;
# endif /* _MSC_VER < 1400 */
# define TCL_LL_MODIFIER "I64"
-# define TCL_LL_MODIFIER_SIZE 3
# endif /* __BORLANDC__ */
# else /* __WIN32__ */
/*
@@ -415,7 +407,6 @@ typedef struct stat Tcl_StatBuf;
# define Tcl_DoubleAsWide(val) ((long)((double)(val)))
# ifndef TCL_LL_MODIFIER
# define TCL_LL_MODIFIER "l"
-# define TCL_LL_MODIFIER_SIZE 1
# endif /* !TCL_LL_MODIFIER */
#else /* TCL_WIDE_INT_IS_LONG */
/*
@@ -429,7 +420,6 @@ typedef struct stat64 Tcl_StatBuf;
typedef struct stat Tcl_StatBuf;
# endif /* HAVE_STRUCT_STAT64 */
# define TCL_LL_MODIFIER "ll"
-# define TCL_LL_MODIFIER_SIZE 2
# endif /* !TCL_LL_MODIFIER */
# define Tcl_WideAsLong(val) ((long)((Tcl_WideInt)(val)))
# define Tcl_LongAsWide(val) ((Tcl_WideInt)((long)(val)))
diff --git a/generic/tclCompCmds.c b/generic/tclCompCmds.c
index ee5a8cd..6468ea9 100644
--- a/generic/tclCompCmds.c
+++ b/generic/tclCompCmds.c
@@ -12,7 +12,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclCompCmds.c,v 1.109.2.8 2007/10/02 20:11:54 dgp Exp $
+ * RCS: @(#) $Id: tclCompCmds.c,v 1.109.2.9 2007/10/19 14:30:01 dgp Exp $
*/
#include "tclInt.h"
@@ -3088,7 +3088,7 @@ TclCompileReturnCmd(
* General syntax: [return ?-option value ...? ?result?]
* An even number of words means an explicit result argument is present.
*/
- int level, code, objc, status = TCL_OK;
+ int level, code, objc, size, status = TCL_OK;
int numWords = parsePtr->numWords;
int explicitResult = (0 == (numWords % 2));
int numOptionWords = numWords - 1 - explicitResult;
@@ -3208,6 +3208,12 @@ TclCompileReturnCmd(
}
}
+ /* Optimize [return -level 0 $x]. */
+ Tcl_DictObjSize(NULL, returnOpts, &size);
+ if (size == 0 && level == 0 && code == TCL_OK) {
+ return TCL_OK;
+ }
+
/*
* Could not use the optimization, so we push the return options dict, and
* emit the INST_RETURN_IMM instruction with code and level as operands.
diff --git a/generic/tclResult.c b/generic/tclResult.c
index eaaa61d..22e0bd0 100644
--- a/generic/tclResult.c
+++ b/generic/tclResult.c
@@ -8,7 +8,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclResult.c,v 1.36.2.2 2007/09/07 20:20:55 dgp Exp $
+ * RCS: @(#) $Id: tclResult.c,v 1.36.2.3 2007/10/19 14:30:01 dgp Exp $
*/
#include "tclInt.h"
@@ -1352,6 +1352,8 @@ TclMergeReturnOptions(
"continue, or an integer", NULL);
goto error;
}
+ }
+ if (valuePtr != NULL) {
Tcl_DictObjRemove(NULL, returnOpts, keys[KEY_CODE]);
}
diff --git a/tools/man2html2.tcl b/tools/man2html2.tcl
index 14bbab0..d1887b5 100644
--- a/tools/man2html2.tcl
+++ b/tools/man2html2.tcl
@@ -1,31 +1,31 @@
+##############################################################################
# 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.
+# 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.
#
-# $Id: man2html2.tcl,v 1.9 2005/05/10 18:35:25 kennykb Exp $
+# $Id: man2html2.tcl,v 1.9.8.1 2007/10/19 14:30:02 dgp Exp $
#
package require Tcl 8.4
# Global variables used by these scripts:
#
-# NAME_file - array indexed by NAME and containing file names used
-# for hyperlinks.
+# 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.
+# 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 <DT> tag while in a dictionary list <DL>.
+# 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.
+# 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.
#
@@ -33,28 +33,29 @@ package require Tcl 8.4
#
# 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.
+# 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
-
+# 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.
+# 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
+ global fontStart fontEnd curFont inPRE charCnt inTable
nest init
set inPRE 0
+ set inTable 0
set textState 0
set curFont ""
set fontStart(Code) "<B>"
@@ -65,12 +66,12 @@ proc initGlobals {} {
set charCnt 0
setTabs 0.5i
}
-
-
+
+##############################################################################
# beginFont --
#
-# Arranges for future text to use a special font, rather than
-# the default paragraph font.
+# Arranges for future text to use a special font, rather than the default
+# paragraph font.
#
# Arguments:
# font - Name of new font to use.
@@ -86,7 +87,7 @@ proc beginFont font {
set curFont $font
}
-
+##############################################################################
# endFont --
#
# Reverts to the default font for the paragraph type.
@@ -102,67 +103,74 @@ proc endFont {} {
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.
+# 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
+ 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
+ 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 $textState {
- REF {
+ switch -exact -- $textState {
+ REF {
if {$inDT eq ""} {
set string [insertRef $string]
}
}
- SEE {
+ SEE {
global NAME_file
foreach i [split $string] {
- if ![regexp -nocase {^[a-z_]+} [string trim $i] i ] {
+ 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)} ] {
+ 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 {![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--"
@@ -170,13 +178,12 @@ proc insertRef string {
}
return $string
}
-
-
-
+
+##############################################################################
# macro --
#
-# This procedure is invoked to process macro invocations that start
-# with "." (instead of ').
+# This procedure is invoked to process macro invocations that start with "."
+# (instead of ').
#
# Arguments:
# name - The name of the macro (without the ".").
@@ -200,7 +207,7 @@ proc macro {name args} {
}
AS {} ;# next page and previous page
br {
- lineBreak
+ lineBreak
}
BS {}
BE {}
@@ -215,16 +222,16 @@ proc macro {name args} {
set inPRE 1
}
DE {
- global file noFillCount inPRE
- puts $file </PRE></BLOCKQUOTE>
- set inPRE 0
+ global file noFillCount inTable
+ puts $file </TABLE></BLOCKQUOTE>
+ set inTable 0
set noFillCount 0
}
DS {
- global file noFillCount inPRE
- puts -nonewline $file <BLOCKQUOTE><PRE>
+ global file noFillCount inTable
+ puts -nonewline $file {<BLOCKQUOTE><TABLE BORDER="0">}
set noFillCount 10000000
- set inPRE 1
+ set inTable 1
}
fi {
global noFillCount
@@ -245,13 +252,13 @@ proc macro {name args} {
set noFillCount 1000000
}
OP {
- global inDT file inPRE
+ 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>
+ puts -nonewline $file <PRE>
setTabs 4c
text "Command-Line Name:"
tab
@@ -272,8 +279,8 @@ proc macro {name args} {
font B
text [lindex $args 2]
font R
- puts -nonewline $file </PRE>
- set inDT "\n<DD>" ;# next newline writes inDT
+ puts -nonewline $file </PRE>
+ set inDT "\n<DD>" ;# next newline writes inDT
set inPRE 0
newline
}
@@ -283,7 +290,7 @@ proc macro {name args} {
newPara
}
RE {
- nest decr
+ nest decr
}
RS {
nest incr
@@ -375,12 +382,11 @@ proc macro {name 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.
+# This procedure is invoked to handle font changes in the text being output.
#
# Arguments:
# type - Type of font: R, I, B, or S.
@@ -411,13 +417,12 @@ proc font type {
}
}
}
-
-
-
+
+##############################################################################
# formattedText --
#
-# Insert a text string that may also have \fB-style font changes
-# and a few other backslash sequences in it.
+# 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.
@@ -455,13 +460,12 @@ proc formattedText text {
}
}
}
-
-
-
+
+##############################################################################
# dash --
#
-# This procedure is invoked to handle dash characters ("\-" in
-# troff). It outputs a special dash character.
+# This procedure is invoked to handle dash characters ("\-" in troff). It
+# outputs a special dash character.
#
# Arguments:
# None.
@@ -474,18 +478,17 @@ proc dash {} {
incr charCnt
text "-"
}
-
-
+
+##############################################################################
# tab --
#
# This procedure is invoked to handle tabs in the troff input.
-# Right now it does nothing.
#
# Arguments:
# None.
proc tab {} {
- global inPRE charCnt tabString
+ global inPRE charCnt tabString file
# ? charCnt
if {$inPRE == 1} {
set pos [expr $charCnt % [string length $tabString] ]
@@ -496,7 +499,7 @@ proc tab {} {
}
}
-
+##############################################################################
# setTabs --
#
# This procedure handles the ".ta" macro, which sets tab stops.
@@ -552,9 +555,8 @@ proc setTabs {tabList} {
}
# puts "setTabs: --$tabString--"
}
-
-
-
+
+##############################################################################
# lineBreak --
#
# Generates a line break in the HTML output.
@@ -567,23 +569,26 @@ proc lineBreak {} {
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.
+# 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
+ 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 {
@@ -592,9 +597,8 @@ proc newline {} {
}
set charCnt 0
}
-
-
-
+
+##############################################################################
# char --
#
# This procedure is called to handle a special character.
@@ -625,13 +629,12 @@ proc char name {
}
}
}
-
-
+
+##############################################################################
# macro2 --
#
-# This procedure handles macros that are invoked with a leading "'"
-# character instead of space. Right now it just generates an
-# error diagnostic.
+# 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 ".").
@@ -640,16 +643,15 @@ proc char name {
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)
+# style - Type of section (optional)
proc SHmacro {argList {style section}} {
global file noFillCount textState charCnt
@@ -673,7 +675,7 @@ proc SHmacro {argList {style section}} {
# ? args textState
# control what the text proc does with text
-
+
switch $args {
NAME {set textState NAME}
DESCRIPTION {set textState INSERT}
@@ -684,21 +686,20 @@ proc SHmacro {argList {style section}} {
}
set charCnt 0
}
-
-
-
+
+##############################################################################
# IPmacro --
#
-# This procedure is invoked to handle ".IP" macros, which may take any
-# of the following forms:
+# 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".
+# .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.
@@ -728,38 +729,35 @@ proc IPmacro argList {
puts $file "\n<DD>"
return
}
-
-
+
+##############################################################################
# TPmacro --
#
-# This procedure is invoked to handle ".TP" macros, which may take any
-# of the following forms:
+# 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.
+# .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
+ 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:
+# 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
#
@@ -782,38 +780,36 @@ proc THmacro {argList} {
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.
+# 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
+ 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.
+# 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
@@ -863,14 +859,13 @@ proc nest {op {listStart "NEW"} {listItem ""} } {
}
set charCnt 0
}
-
-
-
+
+##############################################################################
# do --
#
-# This is the toplevel procedure that translates a man page
-# to Frame. It runs the man2tcl program to turn the man page
-# into a script, then it evals that script.
+# 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.
@@ -882,7 +877,7 @@ proc do fileName {
puts " Pass 2 -- $fileName"
flush stdout
initGlobals
- if [catch {eval [exec man2tcl [glob $fileName]]} msg] {
+ if {[catch { eval [exec man2tcl [glob $fileName]] } msg]} {
global errorInfo
puts stderr $msg
puts "in"
diff --git a/tools/mkdepend.tcl b/tools/mkdepend.tcl
index 7af6120..5a001a8 100644
--- a/tools/mkdepend.tcl
+++ b/tools/mkdepend.tcl
@@ -27,14 +27,13 @@
# http://web.archive.org/web/20070616205924/http://www.doc.ic.ac.uk/~np2/software/mkdepend.html
#
#==============================================================================
-# RCS: @(#) $Id: mkdepend.tcl,v 1.1.4.3 2007/10/16 03:50:33 dgp Exp $
+# RCS: @(#) $Id: mkdepend.tcl,v 1.1.4.4 2007/10/19 14:30:02 dgp Exp $
#==============================================================================
array set mode_data {}
set mode_data(vc32) {cl -nologo -E}
-set cpp_args ""
-set source_extensions [list .c .cpp .cxx]
+set source_extensions [list .c .cpp .cxx .cc]
set excludes [list]
if [info exists env(INCLUDE)] {
@@ -73,15 +72,14 @@ proc openOutput {file} {
proc closeOutput {} {
global output
- if {[string match stdout $output]} {
+ if {[string match stdout $output] != 0} {
close $output
}
}
# readDepends --
#
-# Read off CCP pipe for #line references. pipe channel
-# is closed when done.
+# Read off CCP pipe for #line references.
#
# Arguments:
# chan The pipe channel we are reading in.
@@ -103,6 +101,7 @@ proc readDepends {chan} {
} else {
# don't include ourselves as a dependency of ourself.
if {![string compare $fname $target]} {continue}
+ # store in an array so multiple occurances are not counted.
set depends($target|$fname) ""
}
}
@@ -245,7 +244,7 @@ proc compressDeps {depends} {
set result [list]
foreach n [array names compressed] {
- lappend result [list $n $compressed($n)]
+ lappend result [list $n [lsort $compressed($n)]]
}
return $result
@@ -295,32 +294,35 @@ proc displayUsage {} {
# None.
proc readInputListFile {objectListFile} {
- global srcFileList srcPathList
+ global srcFileList srcPathList source_extensions
set f [open $objectListFile r]
-
- # this probably isn't bullet-proof.
- set fl [split [read $f]]
+ set fl [read $f]
close $f
+ # fix native path seperator so it isn't treated as an escape.
+ regsub -all {\\} $fl {/} fl
+
+ # Treat the string as a list so filenames between double quotes are
+ # treated as list elements.
foreach fname $fl {
- # compiled .res resource files should be ignored.
+ # Compiled .res resource files should be ignored.
if {[file extension $fname] ne ".obj"} {continue}
- # just filename without path or extension.
+ # Just filename without path or extension because the path is
+ # the build directory, not where the source files are located.
set baseName [file rootname [file tail $fname]]
+ set found 0
foreach path $srcPathList {
- if {[file exist [file join $path ${baseName}.c]]} {
- lappend srcFileList [file join $path ${baseName}.c]
- } elseif {[file exist [file join $path ${baseName}.cpp]]} {
- lappend srcFileList [file join $path ${baseName}.cpp]
- } elseif {[file exist [file join $path ${baseName}.cxx]]} {
- lappend srcFileList [file join $path ${baseName}.cxx]
- } elseif {[file exist [file join $path ${baseName}.cc]]} {
- lappend srcFileList [file join $path ${baseName}.cc]
- } else {
- # ignore it
+ foreach ext $source_extensions {
+ set test [file join $path ${baseName}${ext}]
+ if {[file exist $test]} {
+ lappend srcFileList $test
+ set found 1
+ break
+ }
}
+ if {$found} break
}
}
}
@@ -371,11 +373,11 @@ proc main {} {
openOutput [string range $arg 5 end]
}
@* {
- readInputListFile [string range $arg 1 end]
+ set objfile [string range $arg 1 end]
+ regsub -all {\\} $objfile {/} objfile
+ readInputListFile $objfile
}
- -? -
- -help -
- --help {
+ -? - -help - --help {
displayUsage
exit 1
}
@@ -400,7 +402,7 @@ proc main {} {
if {$status == 1 && [lindex $::errorCode 0] eq "CHILDSTATUS"} {
foreach { - pid code } $::errorCode break
if {$code == 2} {
- # compilation died a cruel death.
+ # preprocessor died a cruel death.
error $result
}
}
diff --git a/unix/Makefile.in b/unix/Makefile.in
index 97fee9b..4d92dab 100644
--- a/unix/Makefile.in
+++ b/unix/Makefile.in
@@ -4,7 +4,7 @@
# "./configure", which is a configuration script generated by the "autoconf"
# program (constructs like "@foo@" will get replaced in the actual Makefile.
#
-# RCS: @(#) $Id: Makefile.in,v 1.207.2.11 2007/10/15 18:38:07 dgp Exp $
+# RCS: @(#) $Id: Makefile.in,v 1.207.2.12 2007/10/19 14:30:02 dgp Exp $
VERSION = @TCL_VERSION@
MAJOR_VERSION = @TCL_MAJOR_VERSION@
@@ -1504,9 +1504,6 @@ strtol.o: $(COMPAT_DIR)/strtol.c
strtoul.o: $(COMPAT_DIR)/strtoul.c
$(CC) -c $(STUB_CC_SWITCHES) $(COMPAT_DIR)/strtoul.c
-tmpnam.o: $(COMPAT_DIR)/tmpnam.c
- $(CC) -c $(STUB_CC_SWITCHES) $(COMPAT_DIR)/tmpnam.c
-
waitpid.o: $(COMPAT_DIR)/waitpid.c
$(CC) -c $(STUB_CC_SWITCHES) $(COMPAT_DIR)/waitpid.c
diff --git a/unix/configure b/unix/configure
index 266c542..ca4a5f7 100755
--- a/unix/configure
+++ b/unix/configure
@@ -9653,8 +9653,7 @@ done
-
-for ac_func in opendir strtol tmpnam waitpid
+for ac_func in opendir strtol waitpid
do
as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
echo "$as_me:$LINENO: checking for $ac_func" >&5
diff --git a/unix/configure.in b/unix/configure.in
index af01767..a93ed61 100644
--- a/unix/configure.in
+++ b/unix/configure.in
@@ -3,7 +3,7 @@ dnl This file is an input file used by the GNU "autoconf" program to
dnl generate the file "configure", which is run during Tcl installation
dnl to configure the system for the local environment.
#
-# RCS: @(#) $Id: configure.in,v 1.157.2.6 2007/10/15 18:38:08 dgp Exp $
+# RCS: @(#) $Id: configure.in,v 1.157.2.7 2007/10/19 14:30:03 dgp Exp $
AC_INIT([tcl],[8.5])
AC_PREREQ(2.59)
@@ -151,7 +151,7 @@ AC_CHECK_FUNCS(getcwd, , [AC_DEFINE(USEGETWD, 1, [Is getcwd Posix-compliant?])])
# Nb: if getcwd uses popen and pwd(1) (like SunOS 4) we should really
# define USEGETWD even if the posix getcwd exists. Add a test ?
-AC_REPLACE_FUNCS(opendir strtol tmpnam waitpid)
+AC_REPLACE_FUNCS(opendir strtol waitpid)
AC_CHECK_FUNC(strerror, , [AC_DEFINE(NO_STRERROR, 1, [Do we have strerror()])])
AC_CHECK_FUNC(getwd, , [AC_DEFINE(NO_GETWD, 1, [Do we have getwd()])])
AC_CHECK_FUNC(wait3, , [AC_DEFINE(NO_WAIT3, 1, [Do we have wait3()])])
diff --git a/win/tcl.dsp b/win/tcl.dsp
index 7f9f06c..b3de0ff 100644
--- a/win/tcl.dsp
+++ b/win/tcl.dsp
@@ -208,10 +208,6 @@ SOURCE=..\compat\tclErrno.h
# End Source File
# Begin Source File
-SOURCE=..\compat\tmpnam.c
-# End Source File
-# Begin Source File
-
SOURCE=..\compat\unistd.h
# End Source File
# Begin Source File