Index: doc/3DBorder.3
===================================================================
RCS file: /cvsroot/tktoolkit/tk/doc/3DBorder.3,v
retrieving revision 1.3
diff -u -r1.3 3DBorder.3
--- doc/3DBorder.3	16 Apr 1999 01:51:07 -0000	1.3
+++ doc/3DBorder.3	2 Aug 2002 22:15:30 -0000
@@ -48,7 +48,7 @@
 void
 \fBTk_SetBackgroundFromBorder(\fItkwin, border\fB)\fR
 .sp
-char *
+CONST char *
 \fBTk_NameOf3DBorder(\fIborder\fB)\fR
 .sp
 XColor *
Index: doc/BindTable.3
===================================================================
RCS file: /cvsroot/tktoolkit/tk/doc/BindTable.3,v
retrieving revision 1.2
diff -u -r1.2 BindTable.3
--- doc/BindTable.3	14 Sep 1998 18:22:45 -0000	1.2
+++ doc/BindTable.3	2 Aug 2002 22:15:30 -0000
@@ -27,7 +27,7 @@
 int
 \fBTk_DeleteBinding(\fIinterp, bindingTable, object, eventString\fB)\fR
 .sp
-char *
+CONST char *
 \fBTk_GetBinding(\fIinterp, bindingTable, object, eventString\fB)\fR
 .sp
 \fBTk_GetAllBindings(\fIinterp, bindingTable, object\fB)\fR
@@ -45,7 +45,7 @@
 call to \fBTk_CreateBindingTable\fR.
 .AP ClientData object in
 Identifies object with which binding is associated.
-.AP char *eventString in
+.AP "CONST char" *eventString in
 String describing event sequence.
 .AP char *script in
 Tcl script to invoke when binding triggers.
Index: doc/ConfigWidg.3
===================================================================
RCS file: /cvsroot/tktoolkit/tk/doc/ConfigWidg.3,v
retrieving revision 1.7
diff -u -r1.7 ConfigWidg.3
--- doc/ConfigWidg.3	21 Nov 2000 16:35:27 -0000	1.7
+++ doc/ConfigWidg.3	2 Aug 2002 22:15:31 -0000
@@ -40,7 +40,7 @@
 widget.
 .AP int argc in
 Number of arguments in \fIargv\fR.
-.AP char **argv in
+.AP "CONST char" **argv in
 Command-line options for configuring widget.
 .AP char *widgRec in/out
 Points to widget record structure.  Fields in this structure get
@@ -55,7 +55,7 @@
 The name of the type of a widget record.
 .AP "field name" field in
 The name of a field in records of type \fItype\fR.
-.AP char *argvName in
+.AP "CONST char" *argvName in
 The name used on Tcl command lines to refer to a particular option
 (e.g. when creating a widget or invoking the \fBconfigure\fR widget
 command).  If non-NULL, then information is returned only for this
Index: doc/CrtImgType.3
===================================================================
RCS file: /cvsroot/tktoolkit/tk/doc/CrtImgType.3,v
retrieving revision 1.5
diff -u -r1.5 CrtImgType.3
--- doc/CrtImgType.3	25 Jul 2000 21:14:34 -0000	1.5
+++ doc/CrtImgType.3	2 Aug 2002 22:15:31 -0000
@@ -31,7 +31,7 @@
 pointer to this structure is retained by the image code.
 .AP Tcl_Interp *interp in
 Interpreter in which image was created.
-.AP char *name in
+.AP "CONST char" *name in
 Name of existing image.
 .AP Tk_ImageType **typePtrPtr out
 Points to word in which to store a pointer to type information for
Index: doc/CrtWindow.3
===================================================================
RCS file: /cvsroot/tktoolkit/tk/doc/CrtWindow.3,v
retrieving revision 1.5
diff -u -r1.5 CrtWindow.3
--- doc/CrtWindow.3	5 Oct 2000 18:31:24 -0000	1.5
+++ doc/CrtWindow.3	2 Aug 2002 22:15:31 -0000
@@ -36,10 +36,10 @@
 .AP Tk_Window parent in
 Token for the window that is to serve as the logical parent of
 the new window.
-.AP char *name in
+.AP "CONST char" *name in
 Name to use for this window.  Must be unique among all children of
 the same \fIparent\fR.
-.AP char *topLevScreen in
+.AP "CONST char" *topLevScreen in
 Has same format as \fIscreenName\fR.  If NULL, then new window is
 created as an internal window.  If non-NULL, new window is created as
 a top-level window on screen \fItopLevScreen\fR.  If \fItopLevScreen\fR
@@ -47,7 +47,7 @@
 window is created as top-level window of \fIparent\fR's screen.
 .AP Tk_Window tkwin in
 Token for window.
-.AP char *pathName in
+.AP "CONST char" *pathName in
 Name of new window, specified as path name within application
 (e.g. \fB.a.b.c\fR).
 .BE
Index: doc/DeleteImg.3
===================================================================
RCS file: /cvsroot/tktoolkit/tk/doc/DeleteImg.3,v
retrieving revision 1.2
diff -u -r1.2 DeleteImg.3
--- doc/DeleteImg.3	14 Sep 1998 18:22:47 -0000	1.2
+++ doc/DeleteImg.3	2 Aug 2002 22:15:31 -0000
@@ -20,7 +20,7 @@
 .AS Tcl_Interp *interp
 .AP Tcl_Interp *interp in
 Interpreter for which the image was created.
-.AP char *name in
+.AP "CONST char" *name in
 Name of the image.
 .BE
 
Index: doc/FindPhoto.3
===================================================================
RCS file: /cvsroot/tktoolkit/tk/doc/FindPhoto.3,v
retrieving revision 1.5
diff -u -r1.5 FindPhoto.3
--- doc/FindPhoto.3	14 Jun 2002 14:07:50 -0000	1.5
+++ doc/FindPhoto.3	2 Aug 2002 22:15:31 -0000
@@ -53,7 +53,7 @@
 .VS
 Interpreter in which image was created.
 .VE
-.AP char *imageName in
+.AP "CONST char" *imageName in
 Name of the photo image.
 .AP Tk_PhotoHandle handle in
 Opaque handle identifying the photo image to be affected.
Index: doc/GetAnchor.3
===================================================================
RCS file: /cvsroot/tktoolkit/tk/doc/GetAnchor.3,v
retrieving revision 1.3
diff -u -r1.3 GetAnchor.3
--- doc/GetAnchor.3	16 Apr 1999 01:51:08 -0000	1.3
+++ doc/GetAnchor.3	2 Aug 2002 22:15:31 -0000
@@ -24,7 +24,7 @@
 int
 \fBTk_GetAnchor(\fIinterp, string, anchorPtr\fB)\fR
 .sp
-char *
+CONST char *
 \fBTk_NameOfAnchor(\fIanchor\fB)\fR
 .SH ARGUMENTS
 .AS "Tk_Anchor" *anchorPtr
@@ -35,7 +35,7 @@
 String value contains name of anchor point: \fBn\fR, \fBne\fR,
 \fBe\fR, \fBse\fR, \fBs\fR, \fBsw\fR, \fBw\fR, \fBnw\fR, or \fBcenter\fR;
 internal rep will be modified to cache corresponding Tk_Anchor.
-.AP char *string in
+.AP "CONST char" *string in
 Same as \fIobjPtr\fR except description of anchor point is passed as
 a string.
 .VE
Index: doc/GetBitmap.3
===================================================================
RCS file: /cvsroot/tktoolkit/tk/doc/GetBitmap.3,v
retrieving revision 1.3
diff -u -r1.3 GetBitmap.3
--- doc/GetBitmap.3	16 Apr 1999 01:51:08 -0000	1.3
+++ doc/GetBitmap.3	2 Aug 2002 22:15:31 -0000
@@ -30,7 +30,7 @@
 int
 \fBTk_DefineBitmap(\fIinterp, name, source, width, height\fB)\fR
 .sp
-char *
+CONST char *
 \fBTk_NameOfBitmap(\fIdisplay, bitmap\fB)\fR
 .sp
 \fBTk_SizeOfBitmap(\fIdisplay, bitmap, widthPtr, heightPtr\fB)\fR
@@ -57,7 +57,7 @@
 .VE
 .AP "CONST char" *name in
 Name for new bitmap to be defined.
-.AP char *source in
+.AP "CONST char" *source in
 Data for bitmap, in standard bitmap format.
 Must be stored in static memory whose value will never change.
 .AP "int" width in
Index: doc/GetCapStyl.3
===================================================================
RCS file: /cvsroot/tktoolkit/tk/doc/GetCapStyl.3,v
retrieving revision 1.2
diff -u -r1.2 GetCapStyl.3
--- doc/GetCapStyl.3	14 Sep 1998 18:22:48 -0000	1.2
+++ doc/GetCapStyl.3	2 Aug 2002 22:15:31 -0000
@@ -19,13 +19,13 @@
 int
 \fBTk_GetCapStyle(\fIinterp, string, capPtr\fB)\fR
 .sp
-char *
+CONST char *
 \fBTk_NameOfCapStyle(\fIcap\fB)\fR
 .SH ARGUMENTS
 .AS "Tcl_Interp" *capPtr
 .AP Tcl_Interp *interp in
 Interpreter to use for error reporting.
-.AP char *string in
+.AP "CONST char" *string in
 String containing name of cap style: one of ```butt'', ``projecting'',
 or ``round''.
 .AP int *capPtr out
Index: doc/GetClrmap.3
===================================================================
RCS file: /cvsroot/tktoolkit/tk/doc/GetClrmap.3,v
retrieving revision 1.2
diff -u -r1.2 GetClrmap.3
--- doc/GetClrmap.3	14 Sep 1998 18:22:48 -0000	1.2
+++ doc/GetClrmap.3	2 Aug 2002 22:15:31 -0000
@@ -26,7 +26,7 @@
 Interpreter to use for error reporting.
 .AP Tk_Window tkwin in
 Token for window in which colormap will be used.
-.AP char *string in
+.AP "CONST char" *string in
 Selects a colormap:  either \fBnew\fR or the name of a window
 with the same screen and visual as \fItkwin\fR.
 .AP Display *display in
Index: doc/GetColor.3
===================================================================
RCS file: /cvsroot/tktoolkit/tk/doc/GetColor.3,v
retrieving revision 1.3
diff -u -r1.3 GetColor.3
--- doc/GetColor.3	16 Apr 1999 01:51:08 -0000	1.3
+++ doc/GetColor.3	2 Aug 2002 22:15:31 -0000
@@ -30,7 +30,7 @@
 XColor *
 \fBTk_GetColorByValue(\fItkwin, prefPtr\fB)\fR
 .sp
-char *
+CONST char *
 \fBTk_NameOfColor(\fIcolorPtr\fB)\fR
 .sp
 GC
Index: doc/GetCursor.3
===================================================================
RCS file: /cvsroot/tktoolkit/tk/doc/GetCursor.3,v
retrieving revision 1.4
diff -u -r1.4 GetCursor.3
--- doc/GetCursor.3	16 Dec 1999 21:57:11 -0000	1.4
+++ doc/GetCursor.3	2 Aug 2002 22:15:31 -0000
@@ -30,7 +30,7 @@
 Tk_Cursor
 \fBTk_GetCursorFromData(\fIinterp, tkwin, source, mask, width, height, xHot, yHot, fg, bg\fB)\fR
 .sp
-char *
+CONST char *
 \fBTk_NameOfCursor(\fIdisplay, cursor\fB)\fR
 .sp
 .VS 8.1
@@ -52,9 +52,9 @@
 Same as \fIobjPtr\fR except description of cursor is passed as a string and
 resulting Tk_Cursor isn't cached.
 .VE
-.AP char *source in
+.AP "CONST char" *source in
 Data for cursor cursor, in standard cursor format.
-.AP char *mask in
+.AP "CONST char" *mask in
 Data for mask cursor, in standard cursor format.
 .AP "int" width in
 Width of \fIsource\fR and \fImask\fR.
Index: doc/GetFont.3
===================================================================
RCS file: /cvsroot/tktoolkit/tk/doc/GetFont.3,v
retrieving revision 1.4
diff -u -r1.4 GetFont.3
--- doc/GetFont.3	25 Jul 2000 21:14:34 -0000	1.4
+++ doc/GetFont.3	2 Aug 2002 22:15:31 -0000
@@ -27,7 +27,7 @@
 \fBTk_GetFontFromObj(\fItkwin, objPtr\fB)\fR
 .VE
 .sp
-char *
+CONST char *
 \fBTk_NameOfFont(\fItkfont\fB)\fR
 .sp
 .VS 8.1
Index: doc/GetImage.3
===================================================================
RCS file: /cvsroot/tktoolkit/tk/doc/GetImage.3,v
retrieving revision 1.4
diff -u -r1.4 GetImage.3
--- doc/GetImage.3	21 Apr 1999 21:53:22 -0000	1.4
+++ doc/GetImage.3	2 Aug 2002 22:15:31 -0000
@@ -30,7 +30,7 @@
 Place to leave error message.
 .AP Tk_Window tkwin in
 Window in which image will be used.
-.AP char *name in
+.AP "CONST char" *name in
 Name of image.
 .AP Tk_ImageChangedProc *changeProc in
 Procedure for Tk to invoke whenever image content or size changes.
Index: doc/GetJoinStl.3
===================================================================
RCS file: /cvsroot/tktoolkit/tk/doc/GetJoinStl.3,v
retrieving revision 1.2
diff -u -r1.2 GetJoinStl.3
--- doc/GetJoinStl.3	14 Sep 1998 18:22:49 -0000	1.2
+++ doc/GetJoinStl.3	2 Aug 2002 22:15:31 -0000
@@ -19,13 +19,13 @@
 int
 \fBTk_GetJoinStyle(\fIinterp, string, joinPtr\fB)\fR
 .sp
-char *
+CONST char *
 \fBTk_NameOfJoinStyle(\fIjoin\fB)\fR
 .SH ARGUMENTS
 .AS "Tcl_Interp" *joinPtr
 .AP Tcl_Interp *interp in
 Interpreter to use for error reporting.
-.AP char *string in
+.AP "CONST char" *string in
 String containing name of join style: one of ``bevel'', ``miter'',
 or ``round''.
 .AP int *joinPtr out
Index: doc/GetJustify.3
===================================================================
RCS file: /cvsroot/tktoolkit/tk/doc/GetJustify.3,v
retrieving revision 1.3
diff -u -r1.3 GetJustify.3
--- doc/GetJustify.3	16 Apr 1999 01:51:08 -0000	1.3
+++ doc/GetJustify.3	2 Aug 2002 22:15:31 -0000
@@ -23,7 +23,7 @@
 int
 \fBTk_GetJustify(\fIinterp, string, justifyPtr\fB)\fR
 .sp
-char *
+CONST char *
 \fBTk_NameOfJustify(\fIjustify\fB)\fR
 .SH ARGUMENTS
 .AS "Tk_Justify" *justifyPtr
@@ -34,7 +34,7 @@
 String value contains name of justification style (\fBleft\fR, \fBright\fR, or
 \fBcenter\fR).  The
 internal rep will be modified to cache corresponding justify value.
-.AP char *string in
+.AP "CONST char" *string in
 Same as \fIobjPtr\fR except description of justification style is passed as
 a string.
 .VE
Index: doc/GetOption.3
===================================================================
RCS file: /cvsroot/tktoolkit/tk/doc/GetOption.3,v
retrieving revision 1.2
diff -u -r1.2 GetOption.3
--- doc/GetOption.3	14 Sep 1998 18:22:50 -0000	1.2
+++ doc/GetOption.3	2 Aug 2002 22:15:31 -0000
@@ -22,9 +22,9 @@
 .AS Tk_Window *class
 .AP Tk_Window tkwin in
 Token for window.
-.AP char *name in
+.AP "CONST char" *name in
 Name of desired option.
-.AP char *class in
+.AP "CONST char" *class in
 Class of desired option.  Null means there is no class for
 this option;  do lookup based on name only.
 .BE
Index: doc/GetRelief.3
===================================================================
RCS file: /cvsroot/tktoolkit/tk/doc/GetRelief.3,v
retrieving revision 1.3
diff -u -r1.3 GetRelief.3
--- doc/GetRelief.3	16 Apr 1999 01:51:08 -0000	1.3
+++ doc/GetRelief.3	2 Aug 2002 22:15:31 -0000
@@ -24,7 +24,7 @@
 int
 \fBTk_GetRelief(\fIinterp, name, reliefPtr\fB)\fR
 .sp
-char *
+CONST char *
 \fBTk_NameOfRelief(\fIrelief\fB)\fR
 .SH ARGUMENTS
 .AS "Tcl_Interp" *reliefPtr
@@ -42,6 +42,8 @@
 .AP int *reliefPtr out
 Pointer to location in which to store relief value corresponding to
 \fIobjPtr\fR or \fIname\fR.
+.AP "CONST char" *name
+Name of the relief.
 .AP int relief in
 Relief value (one of TK_RELIEF_FLAT, TK_RELIEF_RAISED, TK_RELIEF_SUNKEN,
 TK_RELIEF_GROOVE, TK_RELIEF_SOLID, or TK_RELIEF_RIDGE).
Index: doc/GetScroll.3
===================================================================
RCS file: /cvsroot/tktoolkit/tk/doc/GetScroll.3,v
retrieving revision 1.4
diff -u -r1.4 GetScroll.3
--- doc/GetScroll.3	25 Apr 2000 22:06:31 -0000	1.4
+++ doc/GetScroll.3	2 Aug 2002 22:15:31 -0000
@@ -27,7 +27,7 @@
 Interpreter to use for error reporting.
 .AP int argc in
 Number of strings in \fIargv\fR array.
-.AP char *argv[] in
+.AP "CONST char" *argv[] in
 Argument strings.  These represent the entire widget command, of
 which the first word is typically the widget name and the second
 word is typically \fBxview\fR or \fByview\fR.
Index: doc/GetVisual.3
===================================================================
RCS file: /cvsroot/tktoolkit/tk/doc/GetVisual.3,v
retrieving revision 1.2
diff -u -r1.2 GetVisual.3
--- doc/GetVisual.3	14 Sep 1998 18:22:51 -0000	1.2
+++ doc/GetVisual.3	2 Aug 2002 22:15:31 -0000
@@ -24,7 +24,7 @@
 Interpreter to use for error reporting.
 .AP Tk_Window tkwin in
 Token for window in which the visual will be used.
-.AP char *string in
+.AP "CONST char" *string in
 String that identifies the desired visual.  See below for
 valid formats.
 .AP int *depthPtr out
Index: doc/InternAtom.3
===================================================================
RCS file: /cvsroot/tktoolkit/tk/doc/InternAtom.3,v
retrieving revision 1.2
diff -u -r1.2 InternAtom.3
--- doc/InternAtom.3	14 Sep 1998 18:22:52 -0000	1.2
+++ doc/InternAtom.3	2 Aug 2002 22:15:31 -0000
@@ -19,13 +19,13 @@
 Atom
 \fBTk_InternAtom(\fItkwin, name\fR)
 .sp
-char *
+CONST char *
 \fBTk_GetAtomName(\fItkwin, atom\fR)
 .SH ARGUMENTS
 .AS Tk_Window parent
 .AP Tk_Window tkwin in
 Token for window.  Used to map atom or name relative to a particular display.
-.AP char *name in
+.AP "CONST char" *name in
 String name for which atom is desired.
 .AP Atom atom in
 Atom for which corresponding string name is desired.
Index: doc/NameOfImg.3
===================================================================
RCS file: /cvsroot/tktoolkit/tk/doc/NameOfImg.3,v
retrieving revision 1.2
diff -u -r1.2 NameOfImg.3
--- doc/NameOfImg.3	14 Sep 1998 18:22:53 -0000	1.2
+++ doc/NameOfImg.3	2 Aug 2002 22:15:31 -0000
@@ -15,7 +15,7 @@
 .nf
 \fB#include <tk.h>\fR
 .sp
-char *
+CONST char *
 \fBTk_NameOfImage\fR(\fItypePtr\fR)
 .SH ARGUMENTS
 .AS Tk_ImageMaster *masterPtr
Index: doc/SetAppName.3
===================================================================
RCS file: /cvsroot/tktoolkit/tk/doc/SetAppName.3,v
retrieving revision 1.2
diff -u -r1.2 SetAppName.3
--- doc/SetAppName.3	14 Sep 1998 18:22:53 -0000	1.2
+++ doc/SetAppName.3	2 Aug 2002 22:15:31 -0000
@@ -16,14 +16,14 @@
 .nf
 \fB#include <tk.h>\fR
 .sp
-char *
+CONST char *
 \fBTk_SetAppName\fR(\fItkwin, name\fR)
 .SH ARGUMENTS
 .AS Tk_Window parent
 .AP Tk_Window tkwin in
 Token for window in application.  Used only to select a particular
 application.
-.AP char *name in
+.AP "CONST char" *name in
 Name under which to register the application.
 .BE
 
Index: doc/WindowId.3
===================================================================
RCS file: /cvsroot/tktoolkit/tk/doc/WindowId.3,v
retrieving revision 1.6
diff -u -r1.6 WindowId.3
--- doc/WindowId.3	26 Sep 2001 20:25:17 -0000	1.6
+++ doc/WindowId.3	2 Aug 2002 22:15:31 -0000
@@ -25,7 +25,7 @@
 Display *
 \fBTk_Display\fR(\fItkwin\fR)
 .sp
-char *
+CONST char *
 \fBTk_DisplayName\fR(\fItkwin\fR)
 .sp
 int
Index: generic/tk.decls
===================================================================
RCS file: /cvsroot/tktoolkit/tk/generic/tk.decls,v
retrieving revision 1.22
diff -u -r1.22 tk.decls
--- generic/tk.decls	18 Jun 2002 23:51:46 -0000	1.22
+++ generic/tk.decls	2 Aug 2002 22:15:31 -0000
@@ -121,7 +121,7 @@
 
 declare 18 generic {
     int Tk_CanvasTagsParseProc (ClientData clientData, Tcl_Interp *interp,
-	    Tk_Window tkwin, char *value, char *widgRec, int offset)
+	    Tk_Window tkwin, CONST char *value, char *widgRec, int offset)
 }
 
 declare 19 generic {
@@ -164,19 +164,19 @@
 declare 27 generic {
     int Tk_ConfigureInfo (Tcl_Interp *interp,
 	    Tk_Window tkwin, Tk_ConfigSpec *specs,
-	    char *widgRec, char *argvName, int flags)
+	    char *widgRec, CONST char *argvName, int flags)
 }
 
 declare 28 generic {
     int Tk_ConfigureValue (Tcl_Interp *interp,
 	    Tk_Window tkwin, Tk_ConfigSpec *specs,
-	    char *widgRec, char *argvName, int flags)
+	    char *widgRec, CONST char *argvName, int flags)
 }
 
 declare 29 generic {
     int Tk_ConfigureWidget (Tcl_Interp *interp,
 	    Tk_Window tkwin, Tk_ConfigSpec *specs,
-	    int argc, char **argv, char *widgRec,
+	    int argc, CONST84 char **argv, char *widgRec,
 	    int flags)
 }
 
@@ -199,7 +199,7 @@
 declare 33 generic {
     unsigned long Tk_CreateBinding (Tcl_Interp *interp,
 	    Tk_BindingTable bindingTable, ClientData object,
-	    char *eventStr, char *command, int append)
+	    CONST char *eventStr, CONST char *command, int append)
 }
 
 declare 34 generic {
@@ -243,17 +243,17 @@
 
 declare 42 generic {
     Tk_Window Tk_CreateWindow (Tcl_Interp *interp,
-	    Tk_Window parent, char *name, char *screenName)
+	    Tk_Window parent, CONST char *name, CONST char *screenName)
 }
 
 declare 43 generic {
     Tk_Window Tk_CreateWindowFromPath (Tcl_Interp *interp, Tk_Window tkwin,
-	    char *pathName, char *screenName)
+	    CONST char *pathName, CONST char *screenName)
 }
 
 declare 44 generic {
-    int Tk_DefineBitmap (Tcl_Interp *interp, CONST char *name, char *source,
-	    int width, int height)
+    int Tk_DefineBitmap (Tcl_Interp *interp, CONST char *name,
+	    CONST char *source, int width, int height)
 }
 
 declare 45 generic {
@@ -267,7 +267,7 @@
 declare 47 generic {
     int Tk_DeleteBinding (Tcl_Interp *interp,
 	    Tk_BindingTable bindingTable, ClientData object,
-	    char *eventStr)
+	    CONST char *eventStr)
 }
 
 declare 48 generic {
@@ -289,7 +289,7 @@
 }
 
 declare 52 generic {
-    void Tk_DeleteImage (Tcl_Interp *interp, char *name)
+    void Tk_DeleteImage (Tcl_Interp *interp, CONST char *name)
 }
 
 declare 53 generic {
@@ -301,7 +301,7 @@
 }
 
 declare 55 generic {
-    char * Tk_DisplayName (Tk_Window tkwin)
+    CONST84_RETURN char * Tk_DisplayName (Tk_Window tkwin)
 }
 
 declare 56 generic {
@@ -352,7 +352,7 @@
 }
 
 declare 64 generic {
-    Tk_PhotoHandle Tk_FindPhoto (Tcl_Interp *interp, char *imageName)
+    Tk_PhotoHandle Tk_FindPhoto (Tcl_Interp *interp, CONST char *imageName)
 }
 
 declare 65 generic {
@@ -428,17 +428,17 @@
 
 declare 82 generic {
     int Tk_GetAnchor (Tcl_Interp *interp,
-	    char *str, Tk_Anchor *anchorPtr)
+	    CONST char *str, Tk_Anchor *anchorPtr)
 }
 
 declare 83 generic {
-    char * Tk_GetAtomName (Tk_Window tkwin, Atom atom)
+    CONST84_RETURN char * Tk_GetAtomName (Tk_Window tkwin, Atom atom)
 }
 
 declare 84 generic {
-    char * Tk_GetBinding (Tcl_Interp *interp,
+    CONST84_RETURN char * Tk_GetBinding (Tcl_Interp *interp,
 	    Tk_BindingTable bindingTable, ClientData object,
-	    char *eventStr)
+	    CONST char *eventStr)
 }
 
 declare 85 generic {
@@ -447,11 +447,11 @@
 
 declare 86 generic {
     Pixmap Tk_GetBitmapFromData (Tcl_Interp *interp,
-	    Tk_Window tkwin, char *source, int width, int height)
+	    Tk_Window tkwin, CONST char *source, int width, int height)
 }
 
 declare 87 generic {
-    int Tk_GetCapStyle (Tcl_Interp *interp, char *str, int *capPtr)
+    int Tk_GetCapStyle (Tcl_Interp *interp, CONST char *str, int *capPtr)
 }
 
 declare 88 generic {
@@ -463,7 +463,8 @@
 }
 
 declare 90 generic {
-    Colormap Tk_GetColormap (Tcl_Interp *interp, Tk_Window tkwin, char *str)
+    Colormap Tk_GetColormap (Tcl_Interp *interp, Tk_Window tkwin,
+	    CONST char *str)
 }
 
 declare 91 generic {
@@ -473,7 +474,7 @@
 
 declare 92 generic {
     Tk_Cursor Tk_GetCursorFromData (Tcl_Interp *interp,
-	    Tk_Window tkwin, char *source, char *mask,
+	    Tk_Window tkwin, CONST char *source, CONST char *mask,
 	    int width, int height, int xHot, int yHot,
 	    Tk_Uid fg, Tk_Uid bg)
 }
@@ -496,13 +497,13 @@
 }
 
 declare 97 generic {
-    Tk_Image Tk_GetImage (Tcl_Interp *interp, Tk_Window tkwin, char *name,
+    Tk_Image Tk_GetImage (Tcl_Interp *interp, Tk_Window tkwin, CONST char *name,
 	    Tk_ImageChangedProc *changeProc, ClientData clientData)
 }
 
 declare 98 generic {
     ClientData Tk_GetImageMasterData (Tcl_Interp *interp,
-	    char *name, Tk_ImageType **typePtrPtr)
+	    CONST char *name, Tk_ImageType **typePtrPtr)
 }
 
 declare 99 generic {
@@ -510,12 +511,12 @@
 }
 
 declare 100 generic {
-    int Tk_GetJoinStyle (Tcl_Interp *interp, char *str, int *joinPtr)
+    int Tk_GetJoinStyle (Tcl_Interp *interp, CONST char *str, int *joinPtr)
 }
 
 declare 101 generic {
     int Tk_GetJustify (Tcl_Interp *interp,
-	    char *str, Tk_Justify *justifyPtr)
+	    CONST char *str, Tk_Justify *justifyPtr)
 }
 
 declare 102 generic {
@@ -523,7 +524,8 @@
 }
 
 declare 103 generic {
-    Tk_Uid Tk_GetOption (Tk_Window tkwin, char *name, char *className)
+    Tk_Uid Tk_GetOption (Tk_Window tkwin, CONST char *name, 
+	    CONST char *className)
 }
 
 declare 104 generic {
@@ -537,7 +539,7 @@
 }
 
 declare 106 generic {
-    int Tk_GetRelief (Tcl_Interp *interp, char *name, int *reliefPtr)
+    int Tk_GetRelief (Tcl_Interp *interp, CONST char *name, int *reliefPtr)
 }
 
 declare 107 generic {
@@ -546,7 +548,7 @@
 
 declare 108 generic {
     int Tk_GetScrollInfo (Tcl_Interp *interp,
-	    int argc, char **argv, double *dblPtr, int *intPtr)
+	    int argc, CONST84 char **argv, double *dblPtr, int *intPtr)
 }
 
 declare 109 generic {
@@ -566,7 +568,7 @@
 
 declare 112 generic {
     Visual * Tk_GetVisual (Tcl_Interp *interp,
-	    Tk_Window tkwin, char *str, int *depthPtr,
+	    Tk_Window tkwin, CONST char *str, int *depthPtr,
 	    Colormap *colormapPtr)
 }
 
@@ -597,7 +599,7 @@
 }
 
 declare 119 generic {
-    Atom Tk_InternAtom (Tk_Window tkwin, char *name)
+    Atom Tk_InternAtom (Tk_Window tkwin, CONST char *name)
 }
 
 declare 120 generic {
@@ -647,47 +649,47 @@
 }
 
 declare 130 generic {
-    char * Tk_NameOf3DBorder (Tk_3DBorder border)
+    CONST84_RETURN char * Tk_NameOf3DBorder (Tk_3DBorder border)
 }
 
 declare 131 generic {
-    char * Tk_NameOfAnchor (Tk_Anchor anchor)
+    CONST84_RETURN char * Tk_NameOfAnchor (Tk_Anchor anchor)
 }
 
 declare 132 generic {
-    char * Tk_NameOfBitmap (Display *display, Pixmap bitmap)
+    CONST84_RETURN char * Tk_NameOfBitmap (Display *display, Pixmap bitmap)
 }
 
 declare 133 generic {
-    char * Tk_NameOfCapStyle (int cap)
+    CONST84_RETURN char * Tk_NameOfCapStyle (int cap)
 }
 
 declare 134 generic {
-    char * Tk_NameOfColor (XColor *colorPtr)
+    CONST84_RETURN char * Tk_NameOfColor (XColor *colorPtr)
 }
 
 declare 135 generic {
-    char * Tk_NameOfCursor (Display *display, Tk_Cursor cursor)
+    CONST84_RETURN char * Tk_NameOfCursor (Display *display, Tk_Cursor cursor)
 }
 
 declare 136 generic {
-    char * Tk_NameOfFont (Tk_Font font)
+    CONST84_RETURN char * Tk_NameOfFont (Tk_Font font)
 }
 
 declare 137 generic {
-    char * Tk_NameOfImage (Tk_ImageMaster imageMaster)
+    CONST84_RETURN char * Tk_NameOfImage (Tk_ImageMaster imageMaster)
 }
 
 declare 138 generic {
-    char * Tk_NameOfJoinStyle (int join)
+    CONST84_RETURN char * Tk_NameOfJoinStyle (int join)
 }
 
 declare 139 generic {
-    char * Tk_NameOfJustify (Tk_Justify justify)
+    CONST84_RETURN char * Tk_NameOfJustify (Tk_Justify justify)
 }
 
 declare 140 generic {
-    char * Tk_NameOfRelief (int relief)
+    CONST84_RETURN char * Tk_NameOfRelief (int relief)
 }
 
 declare 141 generic {
@@ -780,7 +782,7 @@
 }
 
 declare 160 generic {
-    char * Tk_SetAppName (Tk_Window tkwin, char *name)
+    CONST char * Tk_SetAppName (Tk_Window tkwin, CONST char *name)
 }
 
 declare 161 generic {
@@ -788,7 +790,7 @@
 }
 
 declare 162 generic {
-    void Tk_SetClass (Tk_Window tkwin, char *className)
+    void Tk_SetClass (Tk_Window tkwin, CONST char *className)
 }
 
 declare 163 generic {
@@ -1139,7 +1141,7 @@
 #
 declare 241 generic {
     Tk_Window Tk_CreateAnonymousWindow (Tcl_Interp *interp,
-	    Tk_Window parent, char *screenName)
+	    Tk_Window parent, CONST char *screenName)
 }
 declare 242 generic {
     void Tk_SetClassProcs (Tk_Window tkwin,
@@ -1181,17 +1183,18 @@
 
 # Style engine
 declare 249 generic {
-    Tk_StyleEngine Tk_RegisterStyleEngine (char *name, Tk_StyleEngine parent)
+    Tk_StyleEngine Tk_RegisterStyleEngine (CONST char *name,
+	    Tk_StyleEngine parent)
 }
 declare 250 generic {
-    Tk_StyleEngine Tk_GetStyleEngine (char *name)
+    Tk_StyleEngine Tk_GetStyleEngine (CONST char *name)
 }
 declare 251 generic {
     int Tk_RegisterStyledElement (Tk_StyleEngine engine,
 	    Tk_ElementSpec *templatePtr)
 }
 declare 252 generic {
-    int Tk_GetElementId (char *name)
+    int Tk_GetElementId (CONST char *name)
 }
 declare 253 generic {
     Tk_Style Tk_CreateStyle (CONST char *name, Tk_StyleEngine engine,
Index: generic/tk.h
===================================================================
RCS file: /cvsroot/tktoolkit/tk/generic/tk.h,v
retrieving revision 1.65
diff -u -r1.65 tk.h
--- generic/tk.h	14 Jul 2002 17:29:57 -0000	1.65
+++ generic/tk.h	2 Aug 2002 22:15:31 -0000
@@ -124,7 +124,7 @@
  * Additional types exported to clients.
  */
 
-typedef char *Tk_Uid;
+typedef CONST char *Tk_Uid;
 
 /*
  * The enum below defines the valid types for Tk configuration options
@@ -322,7 +322,7 @@
 #ifndef __NO_OLD_CONFIG
 
 typedef int (Tk_OptionParseProc) _ANSI_ARGS_((ClientData clientData,
-	Tcl_Interp *interp, Tk_Window tkwin, char *value, char *widgRec,
+	Tcl_Interp *interp, Tk_Window tkwin, CONST84 char *value, char *widgRec,
 	int offset));
 typedef char *(Tk_OptionPrintProc) _ANSI_ARGS_((ClientData clientData,
 	Tk_Window tkwin, char *widgRec, int offset,
@@ -353,9 +353,9 @@
 				 * table must have type TK_CONFIG_END. */
     char *argvName;		/* Switch used to specify option in argv.
 				 * NULL means this spec is part of a group. */
-    char *dbName;		/* Name for option in option database. */
-    char *dbClass;		/* Class for option in database. */
-    char *defValue;		/* Default value for option if not
+    Tk_Uid dbName;		/* Name for option in option database. */
+    Tk_Uid dbClass;		/* Class for option in database. */
+    Tk_Uid defValue;		/* Default value for option if not
 				 * specified in command line or database. */
     int offset;			/* Where in widget record to store value;
 				 * use Tk_Offset macro to generate values
Index: generic/tk3d.c
===================================================================
RCS file: /cvsroot/tktoolkit/tk/generic/tk3d.c,v
retrieving revision 1.12
diff -u -r1.12 tk3d.c
--- generic/tk3d.c	17 Jan 2002 05:13:11 -0000	1.12
+++ generic/tk3d.c	2 Aug 2002 22:15:31 -0000
@@ -186,7 +186,7 @@
     Tcl_Interp *interp;		/* Place to store an error message. */
     Tk_Window tkwin;		/* Token for window in which border will
 				 * be drawn. */
-    char *colorName;		/* String giving name of color
+    Tk_Uid colorName;		/* String giving name of color
 				 * for window background. */
 {
     Tcl_HashEntry *hashPtr;
@@ -324,7 +324,7 @@
  *--------------------------------------------------------------
  */
 
-char *
+CONST char *
 Tk_NameOf3DBorder(border)
     Tk_3DBorder border;		/* Token for border. */
 {
@@ -652,7 +652,7 @@
 int
 Tk_GetRelief(interp, name, reliefPtr)
     Tcl_Interp *interp;		/* For error messages. */
-    char *name;			/* Name of a relief type. */
+    CONST char *name;		/* Name of a relief type. */
     int *reliefPtr;		/* Where to store converted relief. */
 {
     char c;
@@ -703,7 +703,7 @@
  *--------------------------------------------------------------
  */
 
-char *
+CONST char *
 Tk_NameOfRelief(relief)
     int relief;		/* One of TK_RELIEF_FLAT, TK_RELIEF_RAISED,
 			 * or TK_RELIEF_SUNKEN. */
Index: generic/tkAtom.c
===================================================================
RCS file: /cvsroot/tktoolkit/tk/generic/tkAtom.c,v
retrieving revision 1.2
diff -u -r1.2 tkAtom.c
--- generic/tkAtom.c	14 Sep 1998 18:23:03 -0000	1.2
+++ generic/tkAtom.c	2 Aug 2002 22:15:31 -0000
@@ -80,7 +80,7 @@
 Tk_InternAtom(tkwin, name)
     Tk_Window tkwin;		/* Window token;  map name to atom
 				 * for this window's display. */
-    char *name;			/* Name to turn into atom. */
+    CONST char *name;		/* Name to turn into atom. */
 {
     register TkDisplay *dispPtr;
     register Tcl_HashEntry *hPtr;
@@ -127,7 +127,7 @@
  *--------------------------------------------------------------
  */
 
-char *
+CONST char *
 Tk_GetAtomName(tkwin, atom)
     Tk_Window tkwin;		/* Window token;  map atom to name
 				 * relative to this window's
@@ -168,7 +168,7 @@
 		&new);
 	Tcl_SetHashValue(hPtr, name);
     }
-    return (char *) Tcl_GetHashValue(hPtr);
+    return Tcl_GetHashValue(hPtr);
 }
 
 /*
Index: generic/tkBind.c
===================================================================
RCS file: /cvsroot/tktoolkit/tk/generic/tkBind.c,v
retrieving revision 1.25
diff -u -r1.25 tkBind.c
--- generic/tkBind.c	19 Jun 2002 19:37:53 -0000	1.25
+++ generic/tkBind.c	2 Aug 2002 22:15:32 -0000
@@ -676,13 +676,13 @@
 static void		DeleteVirtualEventTable _ANSI_ARGS_((
 			    VirtualEventTable *vetPtr));
 static void		ExpandPercents _ANSI_ARGS_((TkWindow *winPtr,
-			    char *before, XEvent *eventPtr, KeySym keySym,
+			    CONST char *before, XEvent *eventPtr, KeySym keySym,
 			    Tcl_DString *dsPtr));
 static void		FreeTclBinding _ANSI_ARGS_((ClientData clientData));
 static PatSeq *		FindSequence _ANSI_ARGS_((Tcl_Interp *interp,
 			    Tcl_HashTable *patternTablePtr, ClientData object,
-			    char *eventString, int create, int allowVirtual,
-			    unsigned long *maskPtr));
+			    CONST char *eventString, int create,
+			    int allowVirtual, unsigned long *maskPtr));
 static void		GetAllVirtualEvents _ANSI_ARGS_((Tcl_Interp *interp,
 			    VirtualEventTable *vetPtr));
 static char *		GetField _ANSI_ARGS_((char *p, char *copy, int size));
@@ -705,7 +705,7 @@
 			    Tk_Window main, Tcl_Obj *objPtr,
 			    Tk_Window *tkwinPtr));
 static int		ParseEventDescription _ANSI_ARGS_((Tcl_Interp *interp,
-			    char **eventStringPtr, Pattern *patPtr,
+			    CONST char **eventStringPtr, Pattern *patPtr,
 			    unsigned long *eventMaskPtr));
 static void		DoWarp _ANSI_ARGS_((ClientData clientData));
 
@@ -972,9 +972,9 @@
 				/* Table in which to create binding. */
     ClientData object;		/* Token for object with which binding is
 				 * associated. */
-    char *eventString;		/* String describing event sequence that
+    CONST char *eventString;	/* String describing event sequence that
 				 * triggers binding. */
-    char *command;		/* Contains Tcl command to execute when
+    CONST char *command;	/* Contains Tcl command to execute when
 				 * binding triggers. */
     int append;			/* 0 means replace any existing binding for
 				 * eventString; 1 means append to that
@@ -1076,7 +1076,7 @@
 				/* Table in which to create binding. */
     ClientData object;		/* Token for object with which binding is
 				 * associated. */
-    char *eventString;		/* String describing event sequence that
+    CONST char *eventString;	/* String describing event sequence that
 				 * triggers binding. */
     TkBindEvalProc *eventProc;	/* Procedure to invoke when binding
 				 * triggers.  Must not be NULL. */
@@ -1154,7 +1154,7 @@
     Tk_BindingTable bindingTable;	/* Table in which to delete binding. */
     ClientData object;			/* Token for object with which binding
 					 * is associated. */
-    char *eventString;			/* String describing event sequence
+    CONST char *eventString;		/* String describing event sequence
 					 * that triggers binding. */
 {
     BindingTable *bindPtr = (BindingTable *) bindingTable;
@@ -1243,14 +1243,14 @@
  *--------------------------------------------------------------
  */
 
-char *
+CONST char *
 Tk_GetBinding(interp, bindingTable, object, eventString)
     Tcl_Interp *interp;			/* Interpreter for error reporting. */
     Tk_BindingTable bindingTable;	/* Table in which to look for
 					 * binding. */
     ClientData object;			/* Token for object with which binding
 					 * is associated. */
-    char *eventString;			/* String describing event sequence
+    CONST char *eventString;		/* String describing event sequence
 					 * that triggers binding. */
 {
     BindingTable *bindPtr = (BindingTable *) bindingTable;
@@ -1263,7 +1263,7 @@
 	return NULL;
     }
     if (psPtr->eventProc == EvalTclBinding) {
-	return (char *) psPtr->clientData;
+	return (CONST char *) psPtr->clientData;
     }
     return "";
 }
@@ -2306,7 +2306,7 @@
 ExpandPercents(winPtr, before, eventPtr, keySym, dsPtr)
     TkWindow *winPtr;		/* Window where event occurred:  needed to
 				 * get input context. */
-    char *before;		/* Command containing percent expressions
+    CONST char *before;		/* Command containing percent expressions
 				 * to be replaced. */
     XEvent *eventPtr;		/* X event containing information to be
 				 * used in % replacements. */
@@ -2319,7 +2319,7 @@
 				 * list element. */
     int number, flags, length;
 #define NUM_SIZE 40
-    char *string;
+    CONST char *string;
     Tcl_DString buf;
     char numStorage[NUM_SIZE+1];
 
@@ -3279,7 +3279,8 @@
     Tcl_Obj *CONST objv[];	/* Argument objects. */
 {
     XEvent event;    
-    char *name, *p, *windowName;
+    CONST char *p;
+    char *name, *windowName;
     int count, flags, synch, i, number, warp;
     Tcl_QueuePosition pos;
     Pattern pat;
@@ -3951,7 +3952,7 @@
     ClientData object;		/* For binding table, token for object with
 				 * which binding is associated.
 				 * For virtual event table, NULL. */
-    char *eventString;		/* String description of pattern to
+    CONST char *eventString;	/* String description of pattern to
 				 * match on.  See user documentation
 				 * for details. */
     int create;			/* 0 means don't create the entry if
@@ -3967,7 +3968,7 @@
 
     Pattern pats[EVENT_BUFFER_SIZE];
     int numPats, virtualFound;
-    char *p;
+    CONST char *p;
     Pattern *patPtr;
     PatSeq *psPtr;
     Tcl_HashEntry *hPtr;
@@ -4122,7 +4123,7 @@
 ParseEventDescription(interp, eventStringPtr, patPtr,
 	eventMaskPtr)
     Tcl_Interp *interp;		/* For error messages. */
-    char **eventStringPtr;	/* On input, holds a pointer to start of
+    CONST char **eventStringPtr;/* On input, holds a pointer to start of
 				 * event string.  On exit, gets pointer to
 				 * rest of string after parsed event. */
     Pattern *patPtr;		/* Filled with the pattern parsed from the
@@ -4136,8 +4137,10 @@
 #define FIELD_SIZE 48
     char field[FIELD_SIZE];
     Tcl_HashEntry *hPtr;
+    Tcl_DString copy;
 
-    p = *eventStringPtr;
+    Tcl_DStringInit(&copy);
+    p = Tcl_DStringAppend(&copy, *eventStringPtr, -1);
 
     patPtr->eventType = -1;
     patPtr->needMods = 0;
@@ -4166,7 +4169,8 @@
 		
 		sprintf(buf, "bad ASCII character 0x%x", (unsigned char) *p);
 		Tcl_SetResult(interp, buf, TCL_VOLATILE);
-		return 0;
+		count = 0;
+		goto done;
 	    }
 	}
 	p++;
@@ -4207,12 +4211,14 @@
 	if (p == field) {
 	    Tcl_SetResult(interp, "virtual event \"<<>>\" is badly formed",
 		    TCL_STATIC);
-	    return 0;
+	    count = 0;
+	    goto done;
 	}	    
 	if ((p == NULL) || (p[1] != '>')) {
 	    Tcl_SetResult(interp, "missing \">\" in virtual binding",
 		    TCL_STATIC);
-	    return 0;
+	    count = 0;
+	    goto done;
 	}
 	*p = '\0';
 	patPtr->eventType = VirtualEvent;
@@ -4275,7 +4281,8 @@
 	    } else if ((eventFlags & BUTTON) == 0) {
 		Tcl_AppendResult(interp, "specified button \"", field,
 			"\" for non-button event", (char *) NULL);
-		return 0;
+		count = 0;
+		goto done;
 	    }
 	    patPtr->detail.button = (*field - '0');
 	} else {
@@ -4284,7 +4291,8 @@
 	    if (patPtr->detail.keySym == NoSymbol) {
 		Tcl_AppendResult(interp, "bad event type or keysym \"",
 			field, "\"", (char *) NULL);
-		return 0;
+		count = 0;
+		goto done;
 	    }
 	    if (eventFlags == 0) {
 		patPtr->eventType = KeyPress;
@@ -4292,13 +4300,15 @@
 	    } else if ((eventFlags & KEY) == 0) {
 		Tcl_AppendResult(interp, "specified keysym \"", field,
 			"\" for non-key event", (char *) NULL);
-		return 0;
+		count = 0;
+		goto done;
 	    }
 	}
     } else if (eventFlags == 0) {
 	Tcl_SetResult(interp, "no event type or button # or keysym",
 		TCL_STATIC);
-	return 0;
+	count = 0;
+	goto done;
     }
 
     while ((*p == '-') || isspace(UCHAR(*p))) {
@@ -4311,17 +4321,21 @@
 		Tcl_SetResult(interp,
 			"extra characters after detail in binding",
 			TCL_STATIC);
-		return 0;
+		count = 0;
+		goto done;
 	    }
 	}
 	Tcl_SetResult(interp, "missing \">\" in binding", TCL_STATIC);
-	return 0;
+	count = 0;
+	goto done;
     }
     p++;
 
 end:
-    *eventStringPtr = p;
+    *eventStringPtr += (p - Tcl_DStringValue(&copy));
     *eventMaskPtr |= eventMask;
+done:
+    Tcl_DStringFree(&copy);
     return count;
 }
 
Index: generic/tkBitmap.c
===================================================================
RCS file: /cvsroot/tktoolkit/tk/generic/tkBitmap.c,v
retrieving revision 1.9
diff -u -r1.9 tkBitmap.c
--- generic/tkBitmap.c	15 Aug 2001 15:44:36 -0000	1.9
+++ generic/tkBitmap.c	2 Aug 2002 22:15:32 -0000
@@ -87,7 +87,7 @@
  */
 
 typedef struct {
-    char *source;		/* Bitmap bits. */
+    CONST char *source;		/* Bitmap bits. */
     int width, height;		/* Dimensions of bitmap. */
 } DataKey;
 
@@ -468,7 +468,7 @@
     Tcl_Interp *interp;		/* Interpreter to use for error reporting. */
     CONST char *name;		/* Name to use for bitmap.  Must not already
 				 * be defined as a bitmap. */
-    char *source;		/* Address of bits for bitmap. */
+    CONST char *source;		/* Address of bits for bitmap. */
     int width;			/* Width of bitmap. */
     int height;			/* Height of bitmap. */
 {
@@ -523,7 +523,7 @@
  *--------------------------------------------------------------
  */
 
-char *
+CONST char *
 Tk_NameOfBitmap(display, bitmap)
     Display *display;			/* Display for which bitmap was
 					 * allocated. */
@@ -809,7 +809,7 @@
 Tk_GetBitmapFromData(interp, tkwin, source, width, height)
     Tcl_Interp *interp;		/* Interpreter to use for error reporting. */
     Tk_Window tkwin;		/* Window in which bitmap will be used. */
-    char *source;		/* Bitmap data for bitmap shape. */
+    CONST char *source;		/* Bitmap data for bitmap shape. */
     int width, height;		/* Dimensions of bitmap. */
 {
     DataKey nameKey;
Index: generic/tkButton.c
===================================================================
RCS file: /cvsroot/tktoolkit/tk/generic/tkButton.c,v
retrieving revision 1.18
diff -u -r1.18 tkButton.c
--- generic/tkButton.c	17 Jun 2002 10:54:29 -0000	1.18
+++ generic/tkButton.c	2 Aug 2002 22:15:32 -0000
@@ -524,11 +524,11 @@
 			    ClientData clientData, int x, int y, int width,
 			    int height, int imgWidth, int imgHeight));
 static char *		ButtonTextVarProc _ANSI_ARGS_((ClientData clientData,
-			    Tcl_Interp *interp, char *name1, CONST char *name2,
-			    int flags));
+			    Tcl_Interp *interp, CONST char *name1,
+			    CONST char *name2, int flags));
 static char *		ButtonVarProc _ANSI_ARGS_((ClientData clientData,
-			    Tcl_Interp *interp, char *name1, CONST char *name2,
-			    int flags));
+			    Tcl_Interp *interp, CONST char *name1,
+			    CONST char *name2, int flags));
 static int		ButtonWidgetObjCmd _ANSI_ARGS_((ClientData clientData,
 			    Tcl_Interp *interp, int objc,
 			    Tcl_Obj *CONST objv[]));
@@ -1552,7 +1552,7 @@
 ButtonVarProc(clientData, interp, name1, name2, flags)
     ClientData clientData;	/* Information about button. */
     Tcl_Interp *interp;		/* Interpreter containing variable. */
-    char *name1;		/* Name of variable. */
+    CONST char *name1;		/* Name of variable. */
     CONST char *name2;		/* Second part of variable name. */
     int flags;			/* Information about what happened. */
 {
@@ -1631,7 +1631,7 @@
 ButtonTextVarProc(clientData, interp, name1, name2, flags)
     ClientData clientData;	/* Information about button. */
     Tcl_Interp *interp;		/* Interpreter containing variable. */
-    char *name1;		/* Not used. */
+    CONST char *name1;		/* Not used. */
     CONST char *name2;		/* Not used. */
     int flags;			/* Information about what happened. */
 {
Index: generic/tkCanvArc.c
===================================================================
RCS file: /cvsroot/tktoolkit/tk/generic/tkCanvArc.c,v
retrieving revision 1.9
diff -u -r1.9 tkCanvArc.c
--- generic/tkCanvArc.c	3 Jul 2001 06:03:44 -0000	1.9
+++ generic/tkCanvArc.c	2 Aug 2002 22:15:32 -0000
@@ -467,8 +467,8 @@
     Tk_State state;
 
     tkwin = Tk_CanvasTkwin(canvas);
-    if (Tk_ConfigureWidget(interp, tkwin, configSpecs, objc, (char **) objv,
-	    (char *) arcPtr, flags|TK_CONFIG_OBJS) != TCL_OK) {
+    if (TCL_OK != Tk_ConfigureWidget(interp, tkwin, configSpecs, objc,
+	    (CONST char **) objv, (char *) arcPtr, flags|TK_CONFIG_OBJS)) {
 	return TCL_ERROR;
     }
 
Index: generic/tkCanvBmap.c
===================================================================
RCS file: /cvsroot/tktoolkit/tk/generic/tkCanvBmap.c,v
retrieving revision 1.5
diff -u -r1.5 tkCanvBmap.c
--- generic/tkCanvBmap.c	3 Jul 2001 06:03:44 -0000	1.5
+++ generic/tkCanvBmap.c	2 Aug 2002 22:15:32 -0000
@@ -336,8 +336,8 @@
     Tk_State state;
 
     tkwin = Tk_CanvasTkwin(canvas);
-    if (Tk_ConfigureWidget(interp, tkwin, configSpecs, objc, (char **) objv,
-	    (char *) bmapPtr, flags|TK_CONFIG_OBJS) != TCL_OK) {
+    if (TCL_OK != Tk_ConfigureWidget(interp, tkwin, configSpecs, objc,
+	    (CONST char **) objv, (char *) bmapPtr, flags|TK_CONFIG_OBJS)) {
 	return TCL_ERROR;
     }
 
Index: generic/tkCanvImg.c
===================================================================
RCS file: /cvsroot/tktoolkit/tk/generic/tkCanvImg.c,v
retrieving revision 1.4
diff -u -r1.4 tkCanvImg.c
--- generic/tkCanvImg.c	14 Dec 1999 06:52:25 -0000	1.4
+++ generic/tkCanvImg.c	2 Aug 2002 22:15:32 -0000
@@ -319,8 +319,8 @@
     Tk_Image image;
 
     tkwin = Tk_CanvasTkwin(canvas);
-    if (Tk_ConfigureWidget(interp, tkwin, configSpecs, argc, (char **) argv,
-	    (char *) imgPtr, flags|TK_CONFIG_OBJS) != TCL_OK) {
+    if (TCL_OK != Tk_ConfigureWidget(interp, tkwin, configSpecs, argc,
+	    (CONST char **) argv, (char *) imgPtr, flags|TK_CONFIG_OBJS)) {
 	return TCL_ERROR;
     }
 
Index: generic/tkCanvLine.c
===================================================================
RCS file: /cvsroot/tktoolkit/tk/generic/tkCanvLine.c,v
retrieving revision 1.10
diff -u -r1.10 tkCanvLine.c
--- generic/tkCanvLine.c	25 Jan 2002 21:09:36 -0000	1.10
+++ generic/tkCanvLine.c	2 Aug 2002 22:15:32 -0000
@@ -496,8 +496,8 @@
     Tk_State state;
 
     tkwin = Tk_CanvasTkwin(canvas);
-    if (Tk_ConfigureWidget(interp, tkwin, configSpecs, objc, (char **) objv,
-	    (char *) linePtr, flags|TK_CONFIG_OBJS) != TCL_OK) {
+    if (TCL_OK != Tk_ConfigureWidget(interp, tkwin, configSpecs, objc,
+	    (CONST char **) objv, (char *) linePtr, flags|TK_CONFIG_OBJS)) {
 	return TCL_ERROR;
     }
 
Index: generic/tkCanvPoly.c
===================================================================
RCS file: /cvsroot/tktoolkit/tk/generic/tkCanvPoly.c,v
retrieving revision 1.8
diff -u -r1.8 tkCanvPoly.c
--- generic/tkCanvPoly.c	4 Jul 2001 00:40:11 -0000	1.8
+++ generic/tkCanvPoly.c	2 Aug 2002 22:15:32 -0000
@@ -451,8 +451,8 @@
     Tk_State state;
 
     tkwin = Tk_CanvasTkwin(canvas);
-    if (Tk_ConfigureWidget(interp, tkwin, configSpecs, objc, (char **) objv,
-	    (char *) polyPtr, flags|TK_CONFIG_OBJS) != TCL_OK) {
+    if (TCL_OK != Tk_ConfigureWidget(interp, tkwin, configSpecs, objc,
+	    (CONST char **) objv, (char *) polyPtr, flags|TK_CONFIG_OBJS)) {
 	return TCL_ERROR;
     }
 
Index: generic/tkCanvPs.c
===================================================================
RCS file: /cvsroot/tktoolkit/tk/generic/tkCanvPs.c,v
retrieving revision 1.9
diff -u -r1.9 tkCanvPs.c
--- generic/tkCanvPs.c	25 Jun 2002 16:27:43 -0000	1.9
+++ generic/tkCanvPs.c	2 Aug 2002 22:15:33 -0000
@@ -146,7 +146,7 @@
     TkCanvas *canvasPtr;		/* Information about canvas widget. */
     Tcl_Interp *interp;			/* Current interpreter. */
     int argc;				/* Number of arguments. */
-    char **argv;			/* Argument strings.  Caller has
+    CONST char **argv;			/* Argument strings.  Caller has
 					 * already parsed this command enough
 					 * to know that argv[1] is
 					 * "postscript". */
@@ -739,7 +739,7 @@
 	int argc;
 	double size;
 	CONST char **argv;
-	char *name;
+	CONST char *name;
 
 	name = Tk_NameOfFont(tkfont);
 	list = Tcl_GetVar2(interp, psInfoPtr->fontVar, name, 0);
Index: generic/tkCanvText.c
===================================================================
RCS file: /cvsroot/tktoolkit/tk/generic/tkCanvText.c,v
retrieving revision 1.13
diff -u -r1.13 tkCanvText.c
--- generic/tkCanvText.c	26 May 2002 09:09:19 -0000	1.13
+++ generic/tkCanvText.c	2 Aug 2002 22:15:33 -0000
@@ -407,8 +407,8 @@
     Tk_State state;
 
     tkwin = Tk_CanvasTkwin(canvas);
-    if (Tk_ConfigureWidget(interp, tkwin, configSpecs, objc, (char **) objv,
-	    (char *) textPtr, flags|TK_CONFIG_OBJS) != TCL_OK) {
+    if (TCL_OK != Tk_ConfigureWidget(interp, tkwin, configSpecs, objc,
+	    (CONST char **) objv, (char *) textPtr, flags|TK_CONFIG_OBJS)) {
 	return TCL_ERROR;
     }
 
Index: generic/tkCanvUtil.c
===================================================================
RCS file: /cvsroot/tktoolkit/tk/generic/tkCanvUtil.c,v
retrieving revision 1.6
diff -u -r1.6 tkCanvUtil.c
--- generic/tkCanvUtil.c	25 Jan 2002 21:09:36 -0000	1.6
+++ generic/tkCanvUtil.c	2 Aug 2002 22:15:33 -0000
@@ -369,7 +369,7 @@
     ClientData clientData;		/* Not used.*/
     Tcl_Interp *interp;			/* Used for reporting errors. */
     Tk_Window tkwin;			/* Window containing canvas widget. */
-    char *value;			/* Value of option (list of tag
+    CONST char *value;			/* Value of option (list of tag
 					 * names). */
     char *widgRec;			/* Pointer to record for item. */
     int offset;				/* Offset into item (ignored). */
Index: generic/tkCanvWind.c
===================================================================
RCS file: /cvsroot/tktoolkit/tk/generic/tkCanvWind.c,v
retrieving revision 1.6
diff -u -r1.6 tkCanvWind.c
--- generic/tkCanvWind.c	14 Jun 2002 22:25:12 -0000	1.6
+++ generic/tkCanvWind.c	2 Aug 2002 22:15:33 -0000
@@ -329,8 +329,8 @@
 
     oldWindow = winItemPtr->tkwin;
     canvasTkwin = Tk_CanvasTkwin(canvas);
-    if (Tk_ConfigureWidget(interp, canvasTkwin, configSpecs, objc, (char **) objv,
-	    (char *) winItemPtr, flags|TK_CONFIG_OBJS) != TCL_OK) {
+    if (TCL_OK != Tk_ConfigureWidget(interp, canvasTkwin, configSpecs, objc,
+	    (CONST char **) objv, (char *) winItemPtr, flags|TK_CONFIG_OBJS)) {
 	return TCL_ERROR;
     }
 
Index: generic/tkCanvas.c
===================================================================
RCS file: /cvsroot/tktoolkit/tk/generic/tkCanvas.c,v
retrieving revision 1.19
diff -u -r1.19 tkCanvas.c
--- generic/tkCanvas.c	24 Jul 2002 19:41:38 -0000	1.19
+++ generic/tkCanvas.c	2 Aug 2002 22:15:33 -0000
@@ -291,7 +291,7 @@
 			    TkCanvas *canvasPtr, Tcl_Obj *CONST *argv, Tk_Uid uid,
 			    int enclosed));
 static double		GridAlign _ANSI_ARGS_((double coord, double spacing));
-static char**		GetStringsFromObjs _ANSI_ARGS_((int argc,
+static CONST char**	GetStringsFromObjs _ANSI_ARGS_((int argc,
 			    Tcl_Obj *CONST *objv));
 static void		InitCanvas _ANSI_ARGS_((void));
 #ifdef USE_OLD_TAG_SEARCH
@@ -770,7 +770,7 @@
 		goto done;
 	    }
 	} else if (argc == 4) {
-	    char *command;
+	    CONST char *command;
     
 	    command = Tk_GetBinding(interp, canvasPtr->bindingTable,
 		    object, Tcl_GetStringFromObj(argv[3], NULL));
@@ -791,7 +791,7 @@
 		    Tcl_ResetResult(interp);
 		}
 	    } else {
-		Tcl_SetResult(interp, command, TCL_STATIC);
+		Tcl_SetResult(interp, (char *) command, TCL_STATIC);
 	    }
 	} else {
 	    Tk_GetAllBindings(interp, canvasPtr->bindingTable, object);
@@ -900,7 +900,7 @@
 		result = (*itemPtr->typePtr->coordProc)(interp,
 			(Tk_Canvas) canvasPtr, itemPtr, argc-3, argv+3);
 	      } else {
-		char **args = GetStringsFromObjs(argc-3, argv+3);
+		CONST char **args = GetStringsFromObjs(argc-3, argv+3);
 		result = (*itemPtr->typePtr->coordProc)(interp,
 			(Tk_Canvas) canvasPtr, itemPtr, argc-3, (Tcl_Obj **) args);
 		if (args) ckfree((char *) args);
@@ -959,7 +959,7 @@
 	  result = (*typePtr->createProc)(interp, (Tk_Canvas) canvasPtr,
 		itemPtr, argc-3, argv+3);
 	} else {
-	  char **args = GetStringsFromObjs(argc-3, argv+3);
+	  CONST char **args = GetStringsFromObjs(argc-3, argv+3);
 	  result = (*typePtr->createProc)(interp, (Tk_Canvas) canvasPtr,
 		itemPtr, argc-3, (Tcl_Obj **) args);
 	  if (args) ckfree((char *) args);
@@ -1437,7 +1437,7 @@
 			(Tk_Canvas) canvasPtr, itemPtr, argc-3, argv+3,
 			TK_CONFIG_ARGV_ONLY);
 		} else {
-		char **args = GetStringsFromObjs(argc-3, argv+3);
+		CONST char **args = GetStringsFromObjs(argc-3, argv+3);
 		result = (*itemPtr->typePtr->configProc)(interp,
 			(Tk_Canvas) canvasPtr, itemPtr, argc-3, (Tcl_Obj **) args,
 			TK_CONFIG_ARGV_ONLY);
@@ -1526,7 +1526,7 @@
 	break;
       }
       case CANV_POSTSCRIPT: {
-	char **args = GetStringsFromObjs(argc, argv);
+	CONST char **args = GetStringsFromObjs(argc, argv);
 	result = TkCanvPostscriptCmd(canvasPtr, interp, argc, args);
 	if (args) ckfree((char *) args);
 	break;
@@ -1819,7 +1819,7 @@
 		    - canvasPtr->inset, canvasPtr->scrollX1,
 		    canvasPtr->scrollX2));
 	} else {
-	    char **args = GetStringsFromObjs(argc, argv);
+	    CONST char **args = GetStringsFromObjs(argc, argv);
 	    type = Tk_GetScrollInfo(interp, argc, args, &fraction, &count);
 	    if (args) ckfree((char *) args);
 	    switch (type) {
@@ -1863,7 +1863,7 @@
 		    - canvasPtr->inset, canvasPtr->scrollY1,
 		    canvasPtr->scrollY2));
 	} else {
-	    char **args = GetStringsFromObjs(argc, argv);
+	    CONST char **args = GetStringsFromObjs(argc, argv);
 	    type = Tk_GetScrollInfo(interp, argc, args, &fraction, &count);
 	    if (args) ckfree((char *) args);
 	    switch (type) {
@@ -2008,7 +2008,8 @@
     GC new;
 
     if (Tk_ConfigureWidget(interp, canvasPtr->tkwin, configSpecs,
-	    argc, (char **) argv, (char *) canvasPtr, flags|TK_CONFIG_OBJS) != TCL_OK) {
+	    argc, (CONST char **) argv, (char *) canvasPtr,
+	    flags|TK_CONFIG_OBJS) != TCL_OK) {
 	return TCL_ERROR;
     }
 
@@ -5485,17 +5486,17 @@
  *----------------------------------------------------------------------
  */
 /* ARGSUSED */
-static char **
+static CONST char **
 GetStringsFromObjs(argc, objv)
     int argc;
     Tcl_Obj *CONST objv[];
 {
     register int i;
-    char **argv;
+    CONST char **argv;
     if (argc <= 0) {
 	return NULL;
     }
-    argv = (char **) ckalloc((argc+1) * sizeof(char *));
+    argv = (CONST char **) ckalloc((argc+1) * sizeof(char *));
     for (i = 0; i < argc; i++) {
 	argv[i]=Tcl_GetStringFromObj(objv[i], (int *) NULL);
     }
Index: generic/tkCanvas.h
===================================================================
RCS file: /cvsroot/tktoolkit/tk/generic/tkCanvas.h,v
retrieving revision 1.4
diff -u -r1.4 tkCanvas.h
--- generic/tkCanvas.h	14 Dec 1999 06:52:27 -0000	1.4
+++ generic/tkCanvas.h	2 Aug 2002 22:15:33 -0000
@@ -293,7 +293,7 @@
  */
 
 extern int		TkCanvPostscriptCmd _ANSI_ARGS_((TkCanvas *canvasPtr,
-			    Tcl_Interp *interp, int argc, char **argv));
+			    Tcl_Interp *interp, int argc, CONST char **argv));
 
 /*
  * The following definition is shared between tkCanvPs.c and tkCanvImg.c, 
Index: generic/tkClipboard.c
===================================================================
RCS file: /cvsroot/tktoolkit/tk/generic/tkClipboard.c,v
retrieving revision 1.11
diff -u -r1.11 tkClipboard.c
--- generic/tkClipboard.c	19 Jun 2002 20:40:55 -0000	1.11
+++ generic/tkClipboard.c	2 Aug 2002 22:15:33 -0000
@@ -141,7 +141,7 @@
 {
     TkDisplay *dispPtr = (TkDisplay *) clientData;
     size_t length;
-    char *p;
+    CONST char *p;
 
     p = dispPtr->clipboardAppPtr->winPtr->nameUid;
     length = strlen(p);
Index: generic/tkCmds.c
===================================================================
RCS file: /cvsroot/tktoolkit/tk/generic/tkCmds.c,v
retrieving revision 1.28
diff -u -r1.28 tkCmds.c
--- generic/tkCmds.c	17 Jun 2002 20:09:01 -0000	1.28
+++ generic/tkCmds.c	2 Aug 2002 22:15:34 -0000
@@ -32,8 +32,8 @@
 
 static TkWindow *	GetToplevel _ANSI_ARGS_((Tk_Window tkwin));
 static char *		WaitVariableProc _ANSI_ARGS_((ClientData clientData,
-			    Tcl_Interp *interp, char *name1, CONST char *name2,
-			    int flags));
+			    Tcl_Interp *interp, CONST char *name1,
+			    CONST char *name2, int flags));
 static void		WaitVisibilityProc _ANSI_ARGS_((ClientData clientData,
 			    XEvent *eventPtr));
 static void		WaitWindowProc _ANSI_ARGS_((ClientData clientData,
@@ -193,7 +193,7 @@
 	    return TCL_ERROR;
 	}
     } else if (objc == 3) {
-	char *command;
+	CONST char *command;
 
 	command = Tk_GetBinding(interp, winPtr->mainPtr->bindingTable,
 		object, Tcl_GetString(objv[2]));
@@ -201,7 +201,7 @@
 	    Tcl_ResetResult(interp);
 	    return TCL_OK;
 	}
-	Tcl_SetResult(interp, command, TCL_STATIC);
+	Tcl_SetResult(interp, (char *) command, TCL_STATIC);
     } else {
 	Tk_GetAllBindings(interp, winPtr->mainPtr->bindingTable, object);
     }
@@ -939,7 +939,7 @@
 WaitVariableProc(clientData, interp, name1, name2, flags)
     ClientData clientData;	/* Pointer to integer to set to 1. */
     Tcl_Interp *interp;		/* Interpreter containing variable. */
-    char *name1;		/* Name of variable. */
+    CONST char *name1;		/* Name of variable. */
     CONST char *name2;		/* Second part of variable name. */
     int flags;			/* Information about what happened. */
 {
@@ -1410,7 +1410,7 @@
 	    break;
 	}
 	case WIN_ATOMNAME: {
-	    char *name;
+	    CONST char *name;
 	    long id;
 	    
 	    skip = TkGetDisplayOf(interp, objc - 2, objv + 2, &tkwin);
@@ -1966,7 +1966,7 @@
     ClientData clientData;	/* Dummy. */
     Tcl_Interp *interp;		/* Current interpreter. */
     int argc;			/* Number of arguments. */
-    char **argv;		/* Argument strings. */
+    CONST char **argv;		/* Argument strings. */
 {
     Tcl_AppendResult(interp, "can't invoke \"", argv[0],
 	    "\" command:  application has been destroyed", (char *) NULL);
Index: generic/tkColor.c
===================================================================
RCS file: /cvsroot/tktoolkit/tk/generic/tkColor.c,v
retrieving revision 1.8
diff -u -r1.8 tkColor.c
--- generic/tkColor.c	15 Aug 2001 15:44:36 -0000	1.8
+++ generic/tkColor.c	2 Aug 2002 22:15:34 -0000
@@ -187,7 +187,7 @@
     Tcl_Interp *interp;		/* Place to leave error message if
 				 * color can't be found. */
     Tk_Window tkwin;		/* Window in which color will be used. */
-    char *name;			/* Name of color to be allocated (in form
+    Tk_Uid name;		/* Name of color to be allocated (in form
 				 * suitable for passing to XParseColor). */
 {
     Tcl_HashEntry *nameHashPtr;
@@ -363,7 +363,7 @@
  *--------------------------------------------------------------
  */
 
-char *
+CONST char *
 Tk_NameOfColor(colorPtr)
     XColor *colorPtr;		/* Color whose name is desired. */
 {
Index: generic/tkConfig.c
===================================================================
RCS file: /cvsroot/tktoolkit/tk/generic/tkConfig.c,v
retrieving revision 1.17
diff -u -r1.17 tkConfig.c
--- generic/tkConfig.c	18 Jun 2002 23:51:46 -0000	1.17
+++ generic/tkConfig.c	2 Aug 2002 22:15:34 -0000
@@ -465,7 +465,7 @@
     OptionTable *tablePtr = (OptionTable *) optionTable;
     Option *optionPtr;
     int count;
-    char *value;
+    Tk_Uid value;
     Tcl_Obj *valuePtr;
     enum {
 	OPTION_DATABASE, SYSTEM_DEFAULT, TABLE_DEFAULT
Index: generic/tkConsole.c
===================================================================
RCS file: /cvsroot/tktoolkit/tk/generic/tkConsole.c,v
retrieving revision 1.17
diff -u -r1.17 tkConsole.c
--- generic/tkConsole.c	12 Apr 2002 06:51:50 -0000	1.17
+++ generic/tkConsole.c	2 Aug 2002 22:15:34 -0000
@@ -48,12 +48,12 @@
  */
  
 static int	ConsoleCmd _ANSI_ARGS_((ClientData clientData,
-		    Tcl_Interp *interp, int argc, char **argv));
+		    Tcl_Interp *interp, int argc, CONST char **argv));
 static void	ConsoleDeleteProc _ANSI_ARGS_((ClientData clientData));
 static void	ConsoleEventProc _ANSI_ARGS_((ClientData clientData,
 		    XEvent *eventPtr));
 static int	InterpreterCmd _ANSI_ARGS_((ClientData clientData,
-		    Tcl_Interp *interp, int argc, char **argv));
+		    Tcl_Interp *interp, int argc, CONST char **argv));
 
 static int	ConsoleInput _ANSI_ARGS_((ClientData instanceData,
 		    char *buf, int toRead, int *errorCode));
@@ -560,7 +560,7 @@
     ClientData clientData;		/* Not used. */
     Tcl_Interp *interp;			/* Current interpreter. */
     int argc;				/* Number of arguments. */
-    char **argv;			/* Argument strings. */
+    CONST char **argv;			/* Argument strings. */
 {
     ConsoleInfo *info = (ConsoleInfo *) clientData;
     char c;
@@ -637,7 +637,7 @@
     ClientData clientData;		/* Not used. */
     Tcl_Interp *interp;			/* Current interpreter. */
     int argc;				/* Number of arguments. */
-    char **argv;			/* Argument strings. */
+    CONST char **argv;			/* Argument strings. */
 {
     ConsoleInfo *info = (ConsoleInfo *) clientData;
     char c;
Index: generic/tkCursor.c
===================================================================
RCS file: /cvsroot/tktoolkit/tk/generic/tkCursor.c,v
retrieving revision 1.8
diff -u -r1.8 tkCursor.c
--- generic/tkCursor.c	23 Oct 2001 08:40:47 -0000	1.8
+++ generic/tkCursor.c	2 Aug 2002 22:15:34 -0000
@@ -26,8 +26,8 @@
  */
 
 typedef struct {
-    char *source;		/* Cursor bits. */
-    char *mask;			/* Mask bits. */
+    CONST char *source;		/* Cursor bits. */
+    CONST char *mask;		/* Mask bits. */
     int width, height;		/* Dimensions of cursor (and data
 				 * and mask). */
     int xHot, yHot;		/* Location of cursor hot-spot. */
@@ -45,7 +45,7 @@
 static void		FreeCursor _ANSI_ARGS_((TkCursor *cursorPtr));
 static void		FreeCursorObjProc _ANSI_ARGS_((Tcl_Obj *objPtr));
 static TkCursor *	GetCursor _ANSI_ARGS_((Tcl_Interp *interp,
-			    Tk_Window tkwin, char *name));
+			    Tk_Window tkwin, CONST char *name));
 static TkCursor *	GetCursorFromObj _ANSI_ARGS_((Tk_Window tkwin,
 			    Tcl_Obj *objPtr));
 static void		InitCursorObj _ANSI_ARGS_((Tcl_Obj *objPtr));
@@ -189,7 +189,7 @@
 Tk_GetCursor(interp, tkwin, string)
     Tcl_Interp *interp;		/* Interpreter to use for error reporting. */
     Tk_Window tkwin;		/* Window in which cursor will be used. */
-    char *string;		/* Description of cursor.  See manual entry
+    Tk_Uid string;		/* Description of cursor.  See manual entry
 				 * for details on legal syntax. */
 {
     TkCursor *cursorPtr = GetCursor(interp, tkwin, string);
@@ -230,7 +230,7 @@
 GetCursor(interp, tkwin, string)
     Tcl_Interp *interp;		/* Interpreter to use for error reporting. */
     Tk_Window tkwin;		/* Window in which cursor will be used. */
-    char *string;		/* Description of cursor.  See manual entry
+    CONST char *string;		/* Description of cursor.  See manual entry
 				 * for details on legal syntax. */
 {
     Tcl_HashEntry *nameHashPtr;
@@ -318,8 +318,8 @@
 	xHot, yHot, fg, bg)
     Tcl_Interp *interp;		/* Interpreter to use for error reporting. */
     Tk_Window tkwin;		/* Window in which cursor will be used. */
-    char *source;		/* Bitmap data for cursor shape. */
-    char *mask;			/* Bitmap data for cursor mask. */
+    CONST char *source;		/* Bitmap data for cursor shape. */
+    CONST char *mask;		/* Bitmap data for cursor mask. */
     int width, height;		/* Dimensions of cursor. */
     int xHot, yHot;		/* Location of hot-spot in cursor. */
     Tk_Uid fg;			/* Foreground color for cursor. */
@@ -418,7 +418,7 @@
  *--------------------------------------------------------------
  */
 
-char *
+CONST char *
 Tk_NameOfCursor(display, cursor)
     Display *display;		/* Display for which cursor was allocated. */
     Tk_Cursor cursor;		/* Identifier for cursor whose name is
Index: generic/tkEntry.c
===================================================================
RCS file: /cvsroot/tktoolkit/tk/generic/tkEntry.c,v
retrieving revision 1.30
diff -u -r1.30 tkEntry.c
--- generic/tkEntry.c	25 Jul 2002 21:19:01 -0000	1.30
+++ generic/tkEntry.c	2 Aug 2002 22:15:35 -0000
@@ -696,8 +696,8 @@
 static void		EntrySelectTo _ANSI_ARGS_((
 			    Entry *entryPtr, int index));
 static char *		EntryTextVarProc _ANSI_ARGS_((ClientData clientData,
-			    Tcl_Interp *interp, char *name1, CONST char *name2,
-			    int flags));
+			    Tcl_Interp *interp, CONST char *name1,
+			    CONST char *name2, int flags));
 static void		EntryUpdateScrollbar _ANSI_ARGS_((Entry *entryPtr));
 static int		EntryValidate _ANSI_ARGS_((Entry *entryPtr,
 			    char *cmd));
@@ -3288,7 +3288,7 @@
 EntryTextVarProc(clientData, interp, name1, name2, flags)
     ClientData clientData;	/* Information about button. */
     Tcl_Interp *interp;		/* Interpreter containing variable. */
-    char *name1;		/* Not used. */
+    CONST char *name1;		/* Not used. */
     CONST char *name2;		/* Not used. */
     int flags;			/* Information about what happened. */
 {
Index: generic/tkFont.c
===================================================================
RCS file: /cvsroot/tktoolkit/tk/generic/tkFont.c,v
retrieving revision 1.18
diff -u -r1.18 tkFont.c
--- generic/tkFont.c	17 Jul 2002 14:37:55 -0000	1.18
+++ generic/tkFont.c	2 Aug 2002 22:15:35 -0000
@@ -1279,7 +1279,7 @@
  *---------------------------------------------------------------------------
  */
 
-char *
+CONST char *
 Tk_NameOfFont(tkfont)
     Tk_Font tkfont;		/* Font whose name is desired. */
 {
@@ -1550,7 +1550,7 @@
 				 * corresponds to tkfont will be appended. */
 {
     TkFont *fontPtr;
-    char *family, *weightString, *slantString;
+    Tk_Uid family, weightString, slantString;
     char *src, *dest;
     int upper, len;
 
@@ -2993,7 +2993,7 @@
 					 * returned for all options. */
 {
     int i, index, start, end;
-    char *str;
+    CONST char *str;
     Tcl_Obj *optionPtr, *valuePtr, *resultPtr;
 
     resultPtr = Tcl_GetObjResult(interp);
Index: generic/tkFrame.c
===================================================================
RCS file: /cvsroot/tktoolkit/tk/generic/tkFrame.c,v
retrieving revision 1.12
diff -u -r1.12 tkFrame.c
--- generic/tkFrame.c	19 Feb 2002 16:30:26 -0000	1.12
+++ generic/tkFrame.c	2 Aug 2002 22:15:35 -0000
@@ -484,7 +484,7 @@
     Frame *framePtr;
     Tk_OptionTable optionTable;
     Tk_Window new;
-    char *className, *screenName, *visualName, *colormapName, *arg, *useOption;
+    CONST char *className, *screenName, *visualName, *colormapName, *arg, *useOption;
     int i, c, depth;
     size_t length;
     unsigned int mask;
Index: generic/tkGet.c
===================================================================
RCS file: /cvsroot/tktoolkit/tk/generic/tkGet.c,v
retrieving revision 1.9
diff -u -r1.9 tkGet.c
--- generic/tkGet.c	12 Apr 2002 07:44:45 -0000	1.9
+++ generic/tkGet.c	2 Aug 2002 22:15:35 -0000
@@ -107,7 +107,7 @@
 int
 Tk_GetAnchor(interp, string, anchorPtr)
     Tcl_Interp *interp;		/* Use this for error reporting. */
-    char *string;		/* String describing a direction. */
+    CONST char *string;		/* String describing a direction. */
     Tk_Anchor *anchorPtr;	/* Where to store Tk_Anchor corresponding
 				 * to string. */
 {
@@ -181,7 +181,7 @@
  *--------------------------------------------------------------
  */
 
-char *
+CONST char *
 Tk_NameOfAnchor(anchor)
     Tk_Anchor anchor;		/* Anchor for which identifying string
 				 * is desired. */
@@ -223,7 +223,7 @@
 int
 Tk_GetJoinStyle(interp, string, joinPtr)
     Tcl_Interp *interp;		/* Use this for error reporting. */
-    char *string;		/* String describing a justification style. */
+    CONST char *string;		/* String describing a justification style. */
     int *joinPtr;		/* Where to store join style corresponding
 				 * to string. */
 {
@@ -269,7 +269,7 @@
  *--------------------------------------------------------------
  */
 
-char *
+CONST char *
 Tk_NameOfJoinStyle(join)
     int join;			/* Join style for which identifying string
 				 * is desired. */
@@ -305,7 +305,7 @@
 int
 Tk_GetCapStyle(interp, string, capPtr)
     Tcl_Interp *interp;		/* Use this for error reporting. */
-    char *string;		/* String describing a justification style. */
+    CONST char *string;		/* String describing a justification style. */
     int *capPtr;		/* Where to store cap style corresponding
 				 * to string. */
 {
@@ -351,7 +351,7 @@
  *--------------------------------------------------------------
  */
 
-char *
+CONST char *
 Tk_NameOfCapStyle(cap)
     int cap;			/* Cap style for which identifying string
 				 * is desired. */
@@ -424,7 +424,7 @@
 int
 Tk_GetJustify(interp, string, justifyPtr)
     Tcl_Interp *interp;		/* Use this for error reporting. */
-    char *string;		/* String describing a justification style. */
+    CONST char *string;		/* String describing a justification style. */
     Tk_Justify *justifyPtr;	/* Where to store Tk_Justify corresponding
 				 * to string. */
 {
@@ -470,7 +470,7 @@
  *--------------------------------------------------------------
  */
 
-char *
+CONST char *
 Tk_NameOfJustify(justify)
     Tk_Justify justify;		/* Justification style for which
 				 * identifying string is desired. */
Index: generic/tkGrid.c
===================================================================
RCS file: /cvsroot/tktoolkit/tk/generic/tkGrid.c,v
retrieving revision 1.23
diff -u -r1.23 tkGrid.c
--- generic/tkGrid.c	22 Jun 2002 09:15:51 -0000	1.23
+++ generic/tkGrid.c	2 Aug 2002 22:15:35 -0000
@@ -900,7 +900,7 @@
 	
 	if (objc == 4) {
 	    int minsize = 0, pad = 0, weight = 0;
-	    char *uniform = NULL;
+	    Tk_Uid uniform = NULL;
 	    Tcl_Obj *res = Tcl_NewListObj(0, NULL);
 	 
 	    if (ok == TCL_OK) {
@@ -968,7 +968,7 @@
 	    }
 	    else if (index == ROWCOL_UNIFORM) {
 		if (objc == 5) {
-		    char *value;
+		    Tk_Uid value;
 		    value = (ok == TCL_OK) ? slotPtr[slot].uniform : "";
 		    if (value == NULL) {
 			value = "";
Index: generic/tkImage.c
===================================================================
RCS file: /cvsroot/tktoolkit/tk/generic/tkImage.c,v
retrieving revision 1.16
diff -u -r1.16 tkImage.c
--- generic/tkImage.c	18 Jun 2002 01:00:59 -0000	1.16
+++ generic/tkImage.c	2 Aug 2002 22:15:35 -0000
@@ -506,7 +506,7 @@
  *----------------------------------------------------------------------
  */
 
-char *
+CONST char *
 Tk_NameOfImage(imageMaster)
     Tk_ImageMaster imageMaster;		/* Token for image. */
 {
@@ -544,7 +544,7 @@
 				 * can't be found. */
     Tk_Window tkwin;		/* Token for window in which image will
 				 * be used. */
-    char *name;			/* Name of desired image. */
+    CONST char *name;		/* Name of desired image. */
     Tk_ImageChangedProc *changeProc;
 				/* Procedure to invoke when redisplay is
 				 * needed because image's pixels or size
@@ -853,7 +853,7 @@
 Tk_DeleteImage(interp, name)
     Tcl_Interp *interp;		/* Interpreter in which the image was
 				 * created. */
-    char *name;			/* Name of image. */
+    CONST char *name;		/* Name of image. */
 {
     Tcl_HashEntry *hPtr;
     TkWindow *winPtr;
@@ -1004,7 +1004,7 @@
 Tk_GetImageMasterData(interp, name, typePtrPtr)
     Tcl_Interp *interp;		/* Interpreter in which the image was
 				 * created. */
-    char *name;			/* Name of image. */
+    CONST char *name;		/* Name of image. */
     Tk_ImageType **typePtrPtr;	/* Points to location to fill in with
 				 * pointer to type information for image. */
 {
Index: generic/tkImgBmap.c
===================================================================
RCS file: /cvsroot/tktoolkit/tk/generic/tkImgBmap.c,v
retrieving revision 1.14
diff -u -r1.14 tkImgBmap.c
--- generic/tkImgBmap.c	25 Jan 2002 21:09:37 -0000	1.14
+++ generic/tkImgBmap.c	2 Aug 2002 22:15:36 -0000
@@ -254,7 +254,7 @@
     BitmapInstance *instancePtr;
     int maskWidth, maskHeight, dummy1, dummy2;
 
-    char **argv = (char **) ckalloc((objc+1) * sizeof(char *));
+    CONST char **argv = (CONST char **) ckalloc((objc+1) * sizeof(char *));
     for (dummy1 = 0; dummy1 < objc; dummy1++) {
 	argv[dummy1]=Tcl_GetString(objv[dummy1]);
     }
Index: generic/tkImgPhoto.c
===================================================================
RCS file: /cvsroot/tktoolkit/tk/generic/tkImgPhoto.c,v
retrieving revision 1.33
diff -u -r1.33 tkImgPhoto.c
--- generic/tkImgPhoto.c	11 Jul 2002 13:01:30 -0000	1.33
+++ generic/tkImgPhoto.c	2 Aug 2002 22:15:36 -0000
@@ -400,7 +400,7 @@
 			    Tk_PhotoImageBlock *blockPtr,
 			    struct SubcommandOptions *optPtr));
 static int		IsValidPalette _ANSI_ARGS_((PhotoInstance *instancePtr,
-			    char *palette));
+			    CONST char *palette));
 static int		CountBits _ANSI_ARGS_((pixel mask));
 static void		GetColorTable _ANSI_ARGS_((PhotoInstance *instancePtr));
 static void		FreeColorTable _ANSI_ARGS_((ColorTable *colorPtr,
@@ -1824,7 +1824,7 @@
 				 * such as TK_CONFIG_ARGV_ONLY. */
 {
     PhotoInstance *instancePtr;
-    char *oldFileString, *oldPaletteString;
+    CONST char *oldFileString, *oldPaletteString;
     Tcl_Obj *oldData, *data = NULL, *oldFormat, *format = NULL;
     int length, i, j;
     double oldGamma;
@@ -1832,11 +1832,11 @@
     Tcl_Channel chan;
     Tk_PhotoImageFormat *imageFormat;
     int imageWidth, imageHeight;
-    char **args;
+    CONST char **args;
     int oldformat;
     Tcl_Obj *tempdata, *tempformat;
 
-    args = (char **) ckalloc((objc + 1) * sizeof(char *));
+    args = (CONST char **) ckalloc((objc + 1) * sizeof(char *));
     for (i = 0, j = 0; i < objc; i++,j++) {
 	args[j] = Tcl_GetStringFromObj(objv[i], &length);
 	if ((length > 1) && (args[j][0] == '-')) {
@@ -2940,7 +2940,7 @@
 IsValidPalette(instancePtr, palette)
     PhotoInstance *instancePtr;		/* Instance to which the palette
 					 * specification is to be applied. */
-    char *palette;			/* Palette specification string. */
+    CONST char *palette;		/* Palette specification string. */
 {
     int nRed, nGreen, nBlue, mono, numColors;
     char *endp;
@@ -3926,7 +3926,7 @@
 Tk_FindPhoto(interp, imageName)
     Tcl_Interp *interp;		/* Interpreter (application) in which image
 				 * exists. */
-    char *imageName;		/* Name of the desired photo image. */
+    CONST char *imageName;	/* Name of the desired photo image. */
 {
     ClientData clientData;
     Tk_ImageType *typePtr;
Index: generic/tkInt.decls
===================================================================
RCS file: /cvsroot/tktoolkit/tk/generic/tkInt.decls,v
retrieving revision 1.28
diff -u -r1.28 tkInt.decls
--- generic/tkInt.decls	18 Jun 2002 23:51:46 -0000	1.28
+++ generic/tkInt.decls	2 Aug 2002 22:15:36 -0000
@@ -73,14 +73,14 @@
 declare 11 generic {
     unsigned long TkCreateBindingProcedure (Tcl_Interp *interp, \
 	    Tk_BindingTable bindingTable, \
-	    ClientData object, char *eventString, \
+	    ClientData object, CONST char *eventString, \
 	    TkBindEvalProc *evalProc, TkBindFreeProc *freeProc, \
 	    ClientData clientData)
 }
 
 declare 12 generic {
     TkCursor * TkCreateCursorFromData (Tk_Window tkwin, \
-	    char *source, char *mask, int width, int height, \
+	    CONST char *source, CONST char *mask, int width, int height, \
 	    int xHot, int yHot, XColor fg, XColor bg)
 }
 
@@ -92,7 +92,7 @@
 
 declare 14 generic {
     Tk_Window TkCreateMainWindow (Tcl_Interp *interp, \
-	    char *screenName, char *baseName)
+	    CONST char *screenName, char *baseName)
 }
 
 declare 15 generic {
@@ -178,7 +178,7 @@
 }
 
 declare 33 generic {
-    CONST char * TkGetDefaultScreenName (Tcl_Interp *interp, \
+    CONST84_RETURN char * TkGetDefaultScreenName (Tcl_Interp *interp, \
 	    CONST char *screenName)
 }
 
@@ -358,7 +358,7 @@
 }
 
 declare 75 generic {
-    int TkpUseWindow (Tcl_Interp *interp, Tk_Window tkwin, char *string)
+    int TkpUseWindow (Tcl_Interp *interp, Tk_Window tkwin, CONST char *string)
 }
 
 declare 76 generic {
@@ -520,7 +520,7 @@
 
 declare 111 generic {
     Tcl_Obj * TkpGetSystemDefault (Tk_Window tkwin, \
-	    char *dbName, char *className)
+	    CONST char *dbName, CONST char *className)
 }
 
 declare 112 generic {
@@ -866,7 +866,7 @@
 
 declare 32 win {
     Tcl_Obj * TkWinGetMenuSystemDefault (Tk_Window tkwin, \
-	    char *dbName, char *className)
+	    CONST char *dbName, CONST char *className)
 }
 
 declare 33 win {
Index: generic/tkInt.h
===================================================================
RCS file: /cvsroot/tktoolkit/tk/generic/tkInt.h,v
retrieving revision 1.52
diff -u -r1.52 tkInt.h
--- generic/tkInt.h	25 Jul 2002 21:35:22 -0000	1.52
+++ generic/tkInt.h	2 Aug 2002 22:15:36 -0000
@@ -643,7 +643,7 @@
  */
 
 typedef struct {
-    char *source;		/* Bits for bitmap. */
+    CONST char *source;		/* Bits for bitmap. */
     int width, height;		/* Dimensions of bitmap. */
     int native;			/* 0 means generic (X style) bitmap,
     				 * 1 means native style bitmap. */
@@ -1051,12 +1051,12 @@
 			    Tcl_Interp *interp, int objc, 
                             Tcl_Obj *CONST objv[]));
 EXTERN int		Tk_ScrollbarCmd _ANSI_ARGS_((ClientData clientData,
-			    Tcl_Interp *interp, int argc, char **argv));
+			    Tcl_Interp *interp, int argc, CONST char **argv));
 EXTERN int		Tk_SelectionObjCmd _ANSI_ARGS_((ClientData clientData,
 			    Tcl_Interp *interp, int objc,
 			    Tcl_Obj *CONST objv[]));
 EXTERN int		Tk_SendCmd _ANSI_ARGS_((ClientData clientData,
-			    Tcl_Interp *interp, int argc, char **argv));
+			    Tcl_Interp *interp, int argc, CONST char **argv));
 EXTERN int		Tk_SendObjCmd _ANSI_ARGS_((ClientData clientData,
 			    Tcl_Interp *interp, int objc, 
 			    Tcl_Obj *CONST objv[]));
@@ -1064,7 +1064,7 @@
 			    Tcl_Interp *interp, int objc, 
                             Tcl_Obj *CONST objv[]));
 EXTERN int		Tk_TextCmd _ANSI_ARGS_((ClientData clientData,
-			    Tcl_Interp *interp, int argc, char **argv));
+			    Tcl_Interp *interp, int argc, CONST char **argv));
 EXTERN int		Tk_TkObjCmd _ANSI_ARGS_((ClientData clientData,
 			    Tcl_Interp *interp, int objc,
 			    Tcl_Obj *CONST objv[]));
@@ -1093,10 +1093,10 @@
 
 EXTERN int		TkCreateMenuCmd _ANSI_ARGS_((Tcl_Interp *interp));
 EXTERN int		TkDeadAppCmd _ANSI_ARGS_((ClientData clientData,
-			    Tcl_Interp *interp, int argc, char **argv));
+			    Tcl_Interp *interp, int argc, CONST char **argv));
 
 EXTERN int		TkpTestembedCmd _ANSI_ARGS_((ClientData clientData,
-			    Tcl_Interp *interp, int argc, char **argv));
+			    Tcl_Interp *interp, int argc, CONST char **argv));
 EXTERN int		TkCanvasGetCoordObj _ANSI_ARGS_((Tcl_Interp *interp,
 			    Tk_Canvas canvas, Tcl_Obj *obj,
 			    double *doublePtr));
Index: generic/tkListbox.c
===================================================================
RCS file: /cvsroot/tktoolkit/tk/generic/tkListbox.c,v
retrieving revision 1.27
diff -u -r1.27 tkListbox.c
--- generic/tkListbox.c	21 Jun 2002 02:38:54 -0000	1.27
+++ generic/tkListbox.c	2 Aug 2002 22:15:37 -0000
@@ -442,8 +442,8 @@
 static int		NearestListboxElement _ANSI_ARGS_((Listbox *listPtr,
 			    int y));
 static char *		ListboxListVarProc _ANSI_ARGS_ ((ClientData clientData,
-	                    Tcl_Interp *interp, char *name1, CONST char *name2,
- 	                    int flags));
+	                    Tcl_Interp *interp, CONST char *name1,
+			    CONST char *name2, int flags));
 static void		MigrateHashEntries _ANSI_ARGS_ ((Tcl_HashTable *table,
 			    int first, int last, int offset));
 /*
@@ -3303,7 +3303,7 @@
 ListboxListVarProc(clientData, interp, name1, name2, flags)
     ClientData clientData;      /* Information about button. */
     Tcl_Interp *interp;         /* Interpreter containing variable. */
-    char *name1;                /* Not used. */
+    CONST char *name1;          /* Not used. */
     CONST char *name2;          /* Not used. */
     int flags;                  /* Information about what happened. */
 {
Index: generic/tkMenu.c
===================================================================
RCS file: /cvsroot/tktoolkit/tk/generic/tkMenu.c,v
retrieving revision 1.18
diff -u -r1.18 tkMenu.c
--- generic/tkMenu.c	12 Apr 2002 07:28:06 -0000	1.18
+++ generic/tkMenu.c	2 Aug 2002 22:15:37 -0000
@@ -360,8 +360,8 @@
 static TkMenuEntry *	MenuNewEntry _ANSI_ARGS_((TkMenu *menuPtr, int index,
 			    int type));
 static char *		MenuVarProc _ANSI_ARGS_((ClientData clientData,
-			    Tcl_Interp *interp, char *name1, CONST char *name2,
-			    int flags));
+			    Tcl_Interp *interp, CONST char *name1,
+			    CONST char *name2, int flags));
 static int		MenuWidgetObjCmd _ANSI_ARGS_((ClientData clientData,
 			    Tcl_Interp *interp, int objc, 
 			    Tcl_Obj *CONST objv[]));
@@ -2468,7 +2468,7 @@
 MenuVarProc(clientData, interp, name1, name2, flags)
     ClientData clientData;	/* Information about menu entry. */
     Tcl_Interp *interp;		/* Interpreter containing variable. */
-    char *name1;		/* First part of variable's name. */
+    CONST char *name1;		/* First part of variable's name. */
     CONST char *name2;		/* Second part of variable's name. */
     int flags;			/* Describes what just happened. */
 {
Index: generic/tkMenubutton.c
===================================================================
RCS file: /cvsroot/tktoolkit/tk/generic/tkMenubutton.c,v
retrieving revision 1.11
diff -u -r1.11 tkMenubutton.c
--- generic/tkMenubutton.c	20 Mar 2002 22:55:16 -0000	1.11
+++ generic/tkMenubutton.c	2 Aug 2002 22:15:37 -0000
@@ -176,7 +176,7 @@
 			    int imgHeight));
 static char *		MenuButtonTextVarProc _ANSI_ARGS_((
 			    ClientData clientData, Tcl_Interp *interp,
-			    char *name1, CONST char *name2, int flags));
+			    CONST char *name1, CONST char *name2, int flags));
 static int		MenuButtonWidgetObjCmd _ANSI_ARGS_((
                             ClientData clientData, Tcl_Interp *interp, 
 			    int objc, Tcl_Obj *CONST objv[]));
@@ -867,7 +867,7 @@
 MenuButtonTextVarProc(clientData, interp, name1, name2, flags)
     ClientData clientData;	/* Information about button. */
     Tcl_Interp *interp;		/* Interpreter containing variable. */
-    char *name1;		/* Name of variable. */
+    CONST char *name1;		/* Name of variable. */
     CONST char *name2;		/* Second part of variable name. */
     int flags;			/* Information about what happened. */
 {
Index: generic/tkMessage.c
===================================================================
RCS file: /cvsroot/tktoolkit/tk/generic/tkMessage.c,v
retrieving revision 1.13
diff -u -r1.13 tkMessage.c
--- generic/tkMessage.c	20 Mar 2002 22:55:16 -0000	1.13
+++ generic/tkMessage.c	2 Aug 2002 22:15:37 -0000
@@ -176,8 +176,8 @@
 static void		MessageEventProc _ANSI_ARGS_((ClientData clientData,
 			    XEvent *eventPtr));
 static char *		MessageTextVarProc _ANSI_ARGS_((ClientData clientData,
-			    Tcl_Interp *interp, char *name1, CONST char *name2,
-			    int flags));
+			    Tcl_Interp *interp, CONST char *name1,
+			    CONST char *name2, int flags));
 static int		MessageWidgetObjCmd _ANSI_ARGS_((ClientData clientData,
 			    Tcl_Interp *interp, int objc,
 	                    Tcl_Obj *CONST objv[]));
@@ -847,7 +847,7 @@
 MessageTextVarProc(clientData, interp, name1, name2, flags)
     ClientData clientData;	/* Information about message. */
     Tcl_Interp *interp;		/* Interpreter containing variable. */
-    char *name1;		/* Name of variable. */
+    CONST char *name1;		/* Name of variable. */
     CONST char *name2;		/* Second part of variable name. */
     int flags;			/* Information about what happened. */
 {
Index: generic/tkOldConfig.c
===================================================================
RCS file: /cvsroot/tktoolkit/tk/generic/tkOldConfig.c,v
retrieving revision 1.11
diff -u -r1.11 tkOldConfig.c
--- generic/tkOldConfig.c	20 Mar 2002 02:59:30 -0000	1.11
+++ generic/tkOldConfig.c	2 Aug 2002 22:15:37 -0000
@@ -36,12 +36,12 @@
 			    Tk_Window tkwin, Tk_ConfigSpec *specPtr,
 			    Tk_Uid value, int valueIsUid, char *widgRec));
 static Tk_ConfigSpec *	FindConfigSpec _ANSI_ARGS_((Tcl_Interp *interp,
-			    Tk_ConfigSpec *specs, char *argvName,
+			    Tk_ConfigSpec *specs, CONST char *argvName,
 			    int needFlags, int hateFlags));
 static char *		FormatConfigInfo _ANSI_ARGS_((Tcl_Interp *interp,
 			    Tk_Window tkwin, Tk_ConfigSpec *specPtr,
 			    char *widgRec));
-static char *		FormatConfigValue _ANSI_ARGS_((Tcl_Interp *interp,
+static CONST char *	FormatConfigValue _ANSI_ARGS_((Tcl_Interp *interp,
 			    Tk_Window tkwin, Tk_ConfigSpec *specPtr,
 			    char *widgRec, char *buffer,
 			    Tcl_FreeProc **freeProcPtr));
@@ -74,7 +74,7 @@
 				 * set up X resources). */
     Tk_ConfigSpec *specs;	/* Describes legal options. */
     int argc;			/* Number of elements in argv. */
-    char **argv;		/* Command-line options. */
+    CONST char **argv;		/* Command-line options. */
     char *widgRec;		/* Record whose fields are to be
 				 * modified.  Values must be properly
 				 * initialized. */
@@ -134,7 +134,7 @@
      */
 
     for ( ; argc > 0; argc -= 2, argv += 2) {
-	char *arg;
+	CONST char *arg;
 
 	if (flags & TK_CONFIG_OBJS) {
 	    arg = Tcl_GetStringFromObj((Tcl_Obj *) *argv, NULL);
@@ -255,7 +255,7 @@
     Tcl_Interp *interp;		/* Used for reporting errors. */
     Tk_ConfigSpec *specs;	/* Pointer to table of configuration
 				 * specifications for a widget. */
-    char *argvName;		/* Name (suitable for use in a "config"
+    CONST char *argvName;	/* Name (suitable for use in a "config"
 				 * command) identifying particular option. */
     int needFlags;		/* Flags that must be present in matching
 				 * entry. */
@@ -351,7 +351,7 @@
     Tk_Window tkwin;		/* Window containing widget (needed to
 				 * set up X resources). */
     Tk_ConfigSpec *specPtr;	/* Specifier to apply. */
-    char *value;		/* Value to use to fill in widgRec. */
+    Tk_Uid value;		/* Value to use to fill in widgRec. */
     int valueIsUid;		/* Non-zero means value is a Tk_Uid;
 				 * zero means it's an ordinary string. */
     char *widgRec;		/* Record whose fields are to be
@@ -618,7 +618,7 @@
     Tk_ConfigSpec *specs;	/* Describes legal options. */
     char *widgRec;		/* Record whose fields contain current
 				 * values for options. */
-    char *argvName;		/* If non-NULL, indicates a single option
+    CONST char *argvName;	/* If non-NULL, indicates a single option
 				 * whose info is to be returned.  Otherwise
 				 * info is returned for all options. */
     int flags;			/* Used to specify additional flags
@@ -766,7 +766,7 @@
  *----------------------------------------------------------------------
  */
 
-static char *
+static CONST char *
 FormatConfigValue(interp, tkwin, specPtr, widgRec, buffer, freeProcPtr)
     Tcl_Interp *interp;		/* Interpreter for use in real conversions. */
     Tk_Window tkwin;		/* Window corresponding to widget. */
@@ -780,7 +780,7 @@
 				 * of procedure to free the result, or NULL
 				 * if result is static. */
 {
-    char *ptr, *result;
+    CONST char *ptr, *result;
 
     *freeProcPtr = NULL;
     ptr = widgRec + specPtr->offset;
@@ -920,7 +920,7 @@
     Tk_ConfigSpec *specs;	/* Describes legal options. */
     char *widgRec;		/* Record whose fields contain current
 				 * values for options. */
-    char *argvName;		/* Gives the command-line name for the
+    CONST char *argvName;	/* Gives the command-line name for the
 				 * option whose value is to be returned. */
     int flags;			/* Used to specify additional flags
 				 * that must be present in config specs
@@ -928,6 +928,9 @@
 {
     Tk_ConfigSpec *specPtr;
     int needFlags, hateFlags;
+    Tcl_FreeProc *freeProc;
+    CONST char *result;
+    char buffer[200];
 
     needFlags = flags & ~(TK_CONFIG_USER_BIT - 1);
     if (Tk_Depth(tkwin) <= 1) {
@@ -939,13 +942,14 @@
     if (specPtr == NULL) {
 	return TCL_ERROR;
     }
-    interp->result = FormatConfigValue(interp, tkwin, specPtr, widgRec,
-	    interp->result, &interp->freeProc);
-    /*
-     * Don't let the interp->result be NULL.
-     */
-    if (interp->result == NULL) {
-	interp->result = "";
+    result = FormatConfigValue(interp, tkwin, specPtr, widgRec, buffer, &freeProc);
+    Tcl_SetResult(interp, (char *) result, TCL_VOLATILE);
+    if (freeProc != NULL) {
+	if ((freeProc == TCL_DYNAMIC) || (freeProc == (Tcl_FreeProc *) free)) {
+	    ckfree((char *)result);
+	} else {
+	    (*freeProc)((char *)result);
+	}
     }
     return TCL_OK;
 }
Index: generic/tkOption.c
===================================================================
RCS file: /cvsroot/tktoolkit/tk/generic/tkOption.c,v
retrieving revision 1.14
diff -u -r1.14 tkOption.c
--- generic/tkOption.c	19 Jun 2002 19:37:54 -0000	1.14
+++ generic/tkOption.c	2 Aug 2002 22:15:37 -0000
@@ -422,8 +422,8 @@
 Tk_GetOption(tkwin, name, className)
     Tk_Window tkwin;		/* Token for window that option is
 				 * associated with. */
-    char *name;			/* Name of option. */
-    char *className;		/* Class of option.  NULL means there
+    CONST char *name;		/* Name of option. */
+    CONST char *className;	/* Class of option.  NULL means there
 				 * is no class for this option:  just
 				 * check for name. */
 {
@@ -713,7 +713,7 @@
 	    value = Tk_GetOption(window, Tcl_GetString(objv[3]),
 		    Tcl_GetString(objv[4]));
 	    if (value != NULL) {
-		Tcl_SetResult(interp, value, TCL_STATIC);
+		Tcl_SetResult(interp, (char *)value, TCL_STATIC);
 	    }
 	    break;
 	}
Index: generic/tkRectOval.c
===================================================================
RCS file: /cvsroot/tktoolkit/tk/generic/tkRectOval.c,v
retrieving revision 1.8
diff -u -r1.8 tkRectOval.c
--- generic/tkRectOval.c	3 Jul 2001 06:03:44 -0000	1.8
+++ generic/tkRectOval.c	2 Aug 2002 22:15:37 -0000
@@ -423,8 +423,8 @@
 
     tkwin = Tk_CanvasTkwin(canvas);
 
-    if (Tk_ConfigureWidget(interp, tkwin, configSpecs, objc, (char **) objv,
-	    (char *) rectOvalPtr, flags|TK_CONFIG_OBJS) != TCL_OK) {
+    if (TCL_OK != Tk_ConfigureWidget(interp, tkwin, configSpecs, objc,
+	    (CONST char **) objv, (char *) rectOvalPtr, flags|TK_CONFIG_OBJS)) {
 	return TCL_ERROR;
     }
     state = itemPtr->state;
Index: generic/tkScale.c
===================================================================
RCS file: /cvsroot/tktoolkit/tk/generic/tkScale.c,v
retrieving revision 1.16
diff -u -r1.16 tkScale.c
--- generic/tkScale.c	20 Mar 2002 22:55:16 -0000	1.16
+++ generic/tkScale.c	2 Aug 2002 22:15:37 -0000
@@ -171,8 +171,8 @@
 static void		ScaleEventProc _ANSI_ARGS_((ClientData clientData,
 			    XEvent *eventPtr));
 static char *		ScaleVarProc _ANSI_ARGS_((ClientData clientData,
-			    Tcl_Interp *interp, char *name1, CONST char *name2,
-			    int flags));
+			    Tcl_Interp *interp, CONST char *name1,
+			    CONST char *name2, int flags));
 static int		ScaleWidgetObjCmd _ANSI_ARGS_((ClientData clientData,
 			    Tcl_Interp *interp, int objc, 
 			    Tcl_Obj *CONST objv[]));
@@ -1185,7 +1185,7 @@
 ScaleVarProc(clientData, interp, name1, name2, flags)
     ClientData clientData;	/* Information about button. */
     Tcl_Interp *interp;		/* Interpreter containing variable. */
-    char *name1;		/* Name of variable. */
+    CONST char *name1;		/* Name of variable. */
     CONST char *name2;		/* Second part of variable name. */
     int flags;			/* Information about what happened. */
 {
Index: generic/tkScrollbar.c
===================================================================
RCS file: /cvsroot/tktoolkit/tk/generic/tkScrollbar.c,v
retrieving revision 1.5
diff -u -r1.5 tkScrollbar.c
--- generic/tkScrollbar.c	22 Nov 2000 01:49:38 -0000	1.5
+++ generic/tkScrollbar.c	2 Aug 2002 22:15:37 -0000
@@ -102,12 +102,12 @@
  */
 
 static int		ConfigureScrollbar _ANSI_ARGS_((Tcl_Interp *interp,
-			    TkScrollbar *scrollPtr, int argc, char **argv,
+			    TkScrollbar *scrollPtr, int argc, CONST char **argv,
 			    int flags));
 static void		ScrollbarCmdDeletedProc _ANSI_ARGS_((
 			    ClientData clientData));
 static int		ScrollbarWidgetCmd _ANSI_ARGS_((ClientData clientData,
-			    Tcl_Interp *, int argc, char **argv));
+			    Tcl_Interp *, int argc, CONST char **argv));
 
 /*
  *--------------------------------------------------------------
@@ -133,7 +133,7 @@
 				 * interpreter. */
     Tcl_Interp *interp;		/* Current interpreter. */
     int argc;			/* Number of arguments. */
-    char **argv;		/* Argument strings. */
+    CONST char **argv;		/* Argument strings. */
 {
     Tk_Window tkwin = (Tk_Window) clientData;
     register TkScrollbar *scrollPtr;
@@ -231,7 +231,7 @@
 					 * widget. */
     Tcl_Interp *interp;			/* Current interpreter. */
     int argc;				/* Number of arguments. */
-    char **argv;			/* Argument strings. */
+    CONST char **argv;			/* Argument strings. */
 {
     register TkScrollbar *scrollPtr = (TkScrollbar *) clientData;
     int result = TCL_OK;
@@ -538,7 +538,7 @@
 					 * may not already have values for
 					 * some fields. */
     int argc;				/* Number of valid entries in argv. */
-    char **argv;			/* Arguments. */
+    CONST char **argv;			/* Arguments. */
     int flags;				/* Flags to pass to
 					 * Tk_ConfigureWidget. */
 {
Index: generic/tkSelect.c
===================================================================
RCS file: /cvsroot/tktoolkit/tk/generic/tkSelect.c,v
retrieving revision 1.10
diff -u -r1.10 tkSelect.c
--- generic/tkSelect.c	17 Jan 2002 05:13:11 -0000	1.10
+++ generic/tkSelect.c	2 Aug 2002 22:15:37 -0000
@@ -1488,7 +1488,7 @@
 
     if (target == dispPtr->targetsAtom) {
 	register TkSelHandler *selPtr;
-	char *atomString;
+	CONST char *atomString;
 	int length, atomLength;
 
 	if (maxBytes < 50) {
@@ -1517,7 +1517,7 @@
 
     if (target == dispPtr->applicationAtom) {
 	int length;
-	char *name = winPtr->mainPtr->winPtr->nameUid;
+	Tk_Uid name = winPtr->mainPtr->winPtr->nameUid;
 
 	length = strlen(name);
 	if (maxBytes <= length) {
Index: generic/tkStyle.c
===================================================================
RCS file: /cvsroot/tktoolkit/tk/generic/tkStyle.c,v
retrieving revision 1.2
diff -u -r1.2 tkStyle.c
--- generic/tkStyle.c	26 Jun 2002 22:53:13 -0000	1.2
+++ generic/tkStyle.c	2 Aug 2002 22:15:38 -0000
@@ -128,7 +128,8 @@
  */
 
 /* TODO: sort alpha. */
-static int		CreateElement _ANSI_ARGS_((char *name, int create));
+static int		CreateElement _ANSI_ARGS_((CONST char *name,
+			    int create));
 static void		DupStyleObjProc _ANSI_ARGS_((Tcl_Obj *srcObjPtr,
 			    Tcl_Obj *dupObjPtr));
 static void		FreeElement _ANSI_ARGS_((Element *elementPtr));
@@ -316,7 +317,7 @@
 
 Tk_StyleEngine
 Tk_RegisterStyleEngine(name, parent)
-    char *name;			/* Name of the engine to create. NULL or empty
+    CONST char *name;		/* Name of the engine to create. NULL or empty
 				 * means the default system engine. */
     Tk_StyleEngine parent;	/* The engine's parent. NULL means the default 
 				 * system engine. */
@@ -467,7 +468,7 @@
 
 Tk_StyleEngine
 Tk_GetStyleEngine(name)
-    char *name;			/* Name of the engine to retrieve. NULL or
+    CONST char *name;		/* Name of the engine to retrieve. NULL or
 				 * empty means the default system engine. */
 {
     ThreadSpecificData *tsdPtr = (ThreadSpecificData *) 
@@ -615,7 +616,7 @@
 
 static int
 CreateElement(name, create)
-    char *name;		/* Name of the element. */
+    CONST char *name;	/* Name of the element. */
     int create;		/* Boolean, whether the element is being created 
 			 * explicitly (being registered) or implicitly (by a 
 			 * derived element). */
@@ -702,7 +703,7 @@
 
 int
 Tk_GetElementId(name)
-    char *name;		/* Name of the element. */
+    CONST char *name;		/* Name of the element. */
 {
     ThreadSpecificData *tsdPtr = (ThreadSpecificData *) 
             Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
Index: generic/tkTest.c
===================================================================
RCS file: /cvsroot/tktoolkit/tk/generic/tkTest.c,v
retrieving revision 1.18
diff -u -r1.18 tkTest.c
--- generic/tkTest.c	15 Jul 2002 16:56:32 -0000	1.18
+++ generic/tkTest.c	2 Aug 2002 22:15:38 -0000
@@ -157,9 +157,9 @@
 static void		CBindingFreeProc _ANSI_ARGS_((ClientData clientData));
 int			Tktest_Init _ANSI_ARGS_((Tcl_Interp *interp));
 static int		ImageCmd _ANSI_ARGS_((ClientData dummy,
-			    Tcl_Interp *interp, int argc, char **argv));
+			    Tcl_Interp *interp, int argc, CONST char **argv));
 static int		TestcbindCmd _ANSI_ARGS_((ClientData dummy,
-			    Tcl_Interp *interp, int argc, char **argv));
+			    Tcl_Interp *interp, int argc, CONST char **argv));
 static int		TestbitmapObjCmd _ANSI_ARGS_((ClientData dummy,
 			    Tcl_Interp *interp, int objc,
 			    Tcl_Obj * CONST objv[]));
@@ -173,17 +173,17 @@
 			    Tcl_Interp *interp, int objc,
 			    Tcl_Obj * CONST objv[]));
 static int		TestdeleteappsCmd _ANSI_ARGS_((ClientData dummy,
-			    Tcl_Interp *interp, int argc, char **argv));
+			    Tcl_Interp *interp, int argc, CONST char **argv));
 static int		TestfontObjCmd _ANSI_ARGS_((ClientData dummy,
 			    Tcl_Interp *interp, int objc,
 			    Tcl_Obj *CONST objv[]));
 static int		TestmakeexistCmd _ANSI_ARGS_((ClientData dummy,
-			    Tcl_Interp *interp, int argc, char **argv));
+			    Tcl_Interp *interp, int argc, CONST char **argv));
 static int		TestmenubarCmd _ANSI_ARGS_((ClientData dummy,
-			    Tcl_Interp *interp, int argc, char **argv));
+			    Tcl_Interp *interp, int argc, CONST char **argv));
 #if defined(__WIN32__) || defined(MAC_TCL)
 static int		TestmetricsCmd _ANSI_ARGS_((ClientData dummy,
-			    Tcl_Interp *interp, int argc, char **argv));
+			    Tcl_Interp *interp, int argc, CONST char **argv));
 #endif
 static int		TestobjconfigObjCmd _ANSI_ARGS_((ClientData dummy,
 			    Tcl_Interp *interp, int objc,
@@ -200,14 +200,14 @@
 static void	CustomOptionFree _ANSI_ARGS_((ClientData clientData,
 			Tk_Window tkwin, char *internalPtr));
 static int		TestpropCmd _ANSI_ARGS_((ClientData dummy,
-			    Tcl_Interp *interp, int argc, char **argv));
+			    Tcl_Interp *interp, int argc, CONST char **argv));
 static int		TestsendCmd _ANSI_ARGS_((ClientData dummy,
-			    Tcl_Interp *interp, int argc, char **argv));
+			    Tcl_Interp *interp, int argc, CONST char **argv));
 static int		TesttextCmd _ANSI_ARGS_((ClientData dummy,
-			    Tcl_Interp *interp, int argc, char **argv));
+			    Tcl_Interp *interp, int argc, CONST char **argv));
 #if !(defined(__WIN32__) || defined(MAC_TCL))
 static int		TestwrapperCmd _ANSI_ARGS_((ClientData dummy,
-			    Tcl_Interp *interp, int argc, char **argv));
+			    Tcl_Interp *interp, int argc, CONST char **argv));
 #endif
 static void		TrivialCmdDeletedProc _ANSI_ARGS_((
 			    ClientData clientData));
@@ -340,7 +340,7 @@
     ClientData clientData;		/* Main window for application. */
     Tcl_Interp *interp;			/* Current interpreter. */
     int argc;				/* Number of arguments. */
-    char **argv;			/* Argument strings. */
+    CONST char **argv;			/* Argument strings. */
 {
     TkWindow *winPtr;
     Tk_Window tkwin;
@@ -589,7 +589,7 @@
     ClientData clientData;		/* Main window for application. */
     Tcl_Interp *interp;			/* Current interpreter. */
     int argc;				/* Number of arguments. */
-    char **argv;			/* Argument strings. */
+    CONST char **argv;			/* Argument strings. */
 {
     NewApp *nextPtr;
 
@@ -1700,7 +1700,7 @@
     ClientData clientData;		/* Main window for application. */
     Tcl_Interp *interp;			/* Current interpreter. */
     int argc;				/* Number of arguments. */
-    char **argv;			/* Argument strings. */
+    CONST char **argv;			/* Argument strings. */
 {
     TImageMaster *timPtr = (TImageMaster *) clientData;
     int x, y, width, height;
@@ -1923,7 +1923,7 @@
     ClientData clientData;		/* Main window for application. */
     Tcl_Interp *interp;			/* Current interpreter. */
     int argc;				/* Number of arguments. */
-    char **argv;			/* Argument strings. */
+    CONST char **argv;			/* Argument strings. */
 {
     Tk_Window mainWin = (Tk_Window) clientData;
     int i;
@@ -1964,7 +1964,7 @@
     ClientData clientData;		/* Main window for application. */
     Tcl_Interp *interp;			/* Current interpreter. */
     int argc;				/* Number of arguments. */
-    char **argv;			/* Argument strings. */
+    CONST char **argv;			/* Argument strings. */
 {
 #ifdef __UNIX__
     Tk_Window mainWin = (Tk_Window) clientData;
@@ -2032,7 +2032,7 @@
     ClientData clientData;		/* Main window for application. */
     Tcl_Interp *interp;			/* Current interpreter. */
     int argc;				/* Number of arguments. */
-    char **argv;			/* Argument strings. */
+    CONST char **argv;			/* Argument strings. */
 {
     char buf[TCL_INTEGER_SPACE];
 
@@ -2062,7 +2062,7 @@
     ClientData clientData;		/* Main window for application. */
     Tcl_Interp *interp;			/* Current interpreter. */
     int argc;				/* Number of arguments. */
-    char **argv;			/* Argument strings. */
+    CONST char **argv;			/* Argument strings. */
 {
     Tk_Window tkwin = (Tk_Window) clientData;
     TkWindow *winPtr;
@@ -2117,7 +2117,7 @@
     ClientData clientData;		/* Main window for application. */
     Tcl_Interp *interp;			/* Current interpreter. */
     int argc;				/* Number of arguments. */
-    char **argv;			/* Argument strings. */
+    CONST char **argv;			/* Argument strings. */
 {
     Tk_Window mainWin = (Tk_Window) clientData;
     int result, actualFormat;
@@ -2196,7 +2196,7 @@
     ClientData clientData;		/* Main window for application. */
     Tcl_Interp *interp;			/* Current interpreter. */
     int argc;				/* Number of arguments. */
-    char **argv;			/* Argument strings. */
+    CONST char **argv;			/* Argument strings. */
 {
     TkWindow *winPtr = (TkWindow *) clientData;
 
@@ -2254,14 +2254,21 @@
 	    if (argv[4][0] == 0) {
 		XDeleteProperty(winPtr->dispPtr->display, w, propName);
 	    } else {
-		for (p = argv[4]; *p != 0; p++) {
+		Tcl_DString tmp;
+
+		Tcl_DStringInit(&tmp);
+		for (p = Tcl_DStringAppend(&tmp, argv[4], strlen(argv[4]));
+			*p != 0; p++) {
 		    if (*p == '\n') {
 			*p = 0;
 		    }
 		}
+
 		XChangeProperty(winPtr->dispPtr->display,
 			w, propName, XA_STRING, 8, PropModeReplace,
-			(unsigned char *) argv[4], p-argv[4]);
+			(unsigned char *) Tcl_DStringValue(&tmp),
+			p-Tcl_DStringValue(&tmp));
+		Tcl_DStringFree(&tmp);
 	    }
 	}
     } else if (strcmp(argv[1], "serial") == 0) {
@@ -2301,7 +2308,7 @@
     ClientData clientData;		/* Main window for application. */
     Tcl_Interp *interp;			/* Current interpreter. */
     int argc;				/* Number of arguments. */
-    char **argv;			/* Argument strings. */
+    CONST char **argv;			/* Argument strings. */
 {
     TkText *textPtr;
     size_t len;
@@ -2382,7 +2389,7 @@
     ClientData clientData;		/* Main window for application. */
     Tcl_Interp *interp;			/* Current interpreter. */
     int argc;				/* Number of arguments. */
-    char **argv;			/* Argument strings. */
+    CONST char **argv;			/* Argument strings. */
 {
     TkWindow *winPtr, *wrapperPtr;
     Tk_Window tkwin;
Index: generic/tkText.c
===================================================================
RCS file: /cvsroot/tktoolkit/tk/generic/tkText.c,v
retrieving revision 1.29
diff -u -r1.29 tkText.c
--- generic/tkText.c	24 Jul 2002 18:31:10 -0000	1.29
+++ generic/tkText.c	2 Aug 2002 22:15:38 -0000
@@ -163,8 +163,8 @@
  */
 
 static int		WrapModeParseProc _ANSI_ARGS_((ClientData clientData,
-			    Tcl_Interp *interp, Tk_Window tkwin, char *value,
-			    char *widgRec, int offset));
+			    Tcl_Interp *interp, Tk_Window tkwin,
+			    CONST char *value, char *widgRec, int offset));
 static char *		WrapModePrintProc _ANSI_ARGS_((ClientData clientData,
 			    Tk_Window tkwin, char *widgRec, int offset,
 			    Tcl_FreeProc **freeProcPtr));
@@ -198,7 +198,7 @@
     ClientData clientData;		/* some flags.*/
     Tcl_Interp *interp;			/* Used for reporting errors. */
     Tk_Window tkwin;			/* Window containing canvas widget. */
-    char *value;			/* Value of option (list of tag
+    CONST char *value;			/* Value of option (list of tag
 					 * names). */
     char *widgRec;			/* Pointer to record for item. */
     int offset;				/* Offset into item. */
@@ -285,13 +285,14 @@
  */
 
 static int		ConfigureText _ANSI_ARGS_((Tcl_Interp *interp,
-			    TkText *textPtr, int argc, char **argv, int flags));
+			    TkText *textPtr, int argc, CONST char **argv,
+			    int flags));
 static int		DeleteChars _ANSI_ARGS_((TkText *textPtr,
-			    char *index1String, char *index2String,
+			    CONST char *index1String, CONST char *index2String,
 			    TkTextIndex *indexPtr1, TkTextIndex *indexPtr2));
 static void		DestroyText _ANSI_ARGS_((char *memPtr));
 static void		InsertChars _ANSI_ARGS_((TkText *textPtr,
-			    TkTextIndex *indexPtr, char *string));
+			    TkTextIndex *indexPtr, CONST char *string));
 static void		TextBlinkProc _ANSI_ARGS_((ClientData clientData));
 static void		TextCmdDeletedProc _ANSI_ARGS_((
 			    ClientData clientData));
@@ -302,21 +303,22 @@
 static int		TextIndexSortProc _ANSI_ARGS_((CONST VOID *first,
 			    CONST VOID *second));
 static int		TextSearchCmd _ANSI_ARGS_((TkText *textPtr,
-			    Tcl_Interp *interp, int argc, char **argv));
+			    Tcl_Interp *interp, int argc, CONST char **argv));
 static int		TextEditCmd _ANSI_ARGS_((TkText *textPtr,
-			    Tcl_Interp *interp, int argc, char **argv));
+			    Tcl_Interp *interp, int argc, CONST char **argv));
 static int		TextWidgetCmd _ANSI_ARGS_((ClientData clientData,
-			    Tcl_Interp *interp, int argc, char **argv));
+			    Tcl_Interp *interp, int argc, CONST char **argv));
 static void		TextWorldChanged _ANSI_ARGS_((
 			    ClientData instanceData));
 static int		TextDumpCmd _ANSI_ARGS_((TkText *textPtr,
-			    Tcl_Interp *interp, int argc, char **argv));
+			    Tcl_Interp *interp, int argc, CONST char **argv));
 static void		DumpLine _ANSI_ARGS_((Tcl_Interp *interp, 
 			    TkText *textPtr, int what, TkTextLine *linePtr,
-			    int start, int end, int lineno, char *command));
+			    int start, int end, int lineno,
+			    CONST char *command));
 static int		DumpSegment _ANSI_ARGS_((Tcl_Interp *interp, char *key,
-			    char *value, char * command, TkTextIndex *index,
-			    int what));
+			    char *value, CONST char * command,
+			    TkTextIndex *index, int what));
 static int		TextEditUndo _ANSI_ARGS_((TkText *textPtr));
 static int		TextEditRedo _ANSI_ARGS_((TkText *textPtr));
 static void		TextGetText _ANSI_ARGS_((TkTextIndex * index1,
@@ -357,7 +359,7 @@
 				 * interpreter. */
     Tcl_Interp *interp;		/* Current interpreter. */
     int argc;			/* Number of arguments. */
-    char **argv;		/* Argument strings. */
+    CONST char **argv;		/* Argument strings. */
 {
     Tk_Window tkwin = (Tk_Window) clientData;
     Tk_Window new;
@@ -471,7 +473,7 @@
     ClientData clientData;	/* Information about text widget. */
     Tcl_Interp *interp;		/* Current interpreter. */
     int argc;			/* Number of arguments. */
-    char **argv;		/* Argument strings. */
+    CONST char **argv;		/* Argument strings. */
 {
     register TkText *textPtr = (TkText *) clientData;
     int c, result = TCL_OK;
@@ -519,7 +521,7 @@
     } else if ((c == 'c') && (strncmp(argv[1], "compare", length) == 0)
 	    && (length >= 3)) {
 	int relation, value;
-	char *p;
+	CONST char *p;
 
 	if (argc != 5) {
 	    Tcl_AppendResult(interp, "wrong # args: should be \"",
@@ -607,7 +609,7 @@
 		 * Simple case requires no predetermination of indices.
 		 */
 		result = DeleteChars(textPtr, argv[2],
-			(argc == 4) ? argv[3] : (char *) NULL, NULL, NULL);
+			(argc == 4) ? argv[3] : NULL, NULL, NULL);
 	    } else {
 		/*
 		 * Multi-index pair case requires that we prevalidate the
@@ -1022,7 +1024,7 @@
     register TkText *textPtr;	/* Information about widget;  may or may
 				 * not already have values for some fields. */
     int argc;			/* Number of valid entries in argv. */
-    char **argv;		/* Arguments. */
+    CONST char **argv;		/* Arguments. */
     int flags;			/* Flags to pass to Tk_ConfigureWidget. */
 {
     int oldExport = textPtr->exportSelection;
@@ -1358,7 +1360,7 @@
     TkText *textPtr;		/* Overall information about text widget. */
     TkTextIndex *indexPtr;	/* Where to insert new characters.  May be
 				 * modified and/or invalidated. */
-    char *string;		/* Null-terminated string containing new
+    CONST char *string;		/* Null-terminated string containing new
 				 * information to add to text. */
 {
     int lineIndex, resetView, offset;
@@ -1488,9 +1490,9 @@
 static int
 DeleteChars(textPtr, index1String, index2String, indexPtr1, indexPtr2)
     TkText *textPtr;		/* Overall information about text widget. */
-    char *index1String;		/* String describing location of first
+    CONST char *index1String;	/* String describing location of first
 				 * character to delete. */
-    char *index2String;		/* String describing location of last
+    CONST char *index2String;	/* String describing location of last
 				 * character to delete.  NULL means just
 				 * delete the one character given by
 				 * index1String. */
@@ -1971,14 +1973,14 @@
     TkText *textPtr;		/* Information about text widget. */
     Tcl_Interp *interp;		/* Current interpreter. */
     int argc;			/* Number of arguments. */
-    char **argv;		/* Argument strings. */
+    CONST char **argv;		/* Argument strings. */
 {
     int backwards, exact, searchElide, c, i, argsLeft, noCase, leftToScan;
     size_t length;
     int numLines, startingLine, startingByte, lineNum, firstByte, lastByte;
     int code, matchLength, matchByte, passes, stopLine, searchWholeText;
     int patLength;
-    char *arg, *pattern, *varName, *p, *startOfLine;
+    CONST char *arg, *pattern, *varName, *p, *startOfLine;
     char buffer[20];
     TkTextIndex index, stopIndex;
     Tcl_DString line, patDString;
@@ -2064,8 +2066,8 @@
     if (noCase && exact) {
 	Tcl_DStringInit(&patDString);
 	Tcl_DStringAppend(&patDString, pattern, -1);
+	Tcl_UtfToLower(Tcl_DStringValue(&patDString));
 	pattern = Tcl_DStringValue(&patDString);
-	Tcl_UtfToLower(pattern);
     }
 
     Tcl_DStringInit(&line);
@@ -2490,7 +2492,7 @@
     register TkText *textPtr;	/* Information about text widget. */
     Tcl_Interp *interp;		/* Current interpreter. */
     int argc;			/* Number of arguments. */
-    char **argv;		/* Argument strings.  Someone else has already
+    CONST char **argv;		/* Argument strings.  Someone else has already
 				 * parsed this command enough to know that
 				 * argv[1] is "dump". */
 {
@@ -2500,7 +2502,7 @@
     int what = 0;		/* bitfield to select segment types */
     int atEnd;			/* True if dumping up to logical end */
     TkTextLine *linePtr;
-    char *command = NULL;	/* Script callback to apply to segments */
+    CONST char *command = NULL;	/* Script callback to apply to segments */
 #define TK_DUMP_TEXT	0x1
 #define TK_DUMP_MARK	0x2
 #define TK_DUMP_TAG	0x4
@@ -2613,7 +2615,7 @@
     TkTextLine *linePtr;	/* The current line */
     int startByte, endByte;	/* Byte range to dump */
     int lineno;			/* Line number for indices dump */
-    char *command;		/* Script to apply to the segment */
+    CONST char *command;	/* Script to apply to the segment */
 {
     int offset;
     TkTextSegment *segPtr;
@@ -2707,13 +2709,13 @@
     Tcl_Interp *interp;
     char *key;			/* Segment type key */
     char *value;		/* Segment value */
-    char *command;		/* Script callback */
+    CONST char *command;	/* Script callback */
     TkTextIndex *index;         /* index with line/byte position info */
     int what;			/* Look for TK_DUMP_INDEX bit */
 {
     char buffer[TCL_INTEGER_SPACE*2];
     TkTextPrintIndex(index, buffer);
-    if (command == (char *) NULL) {
+    if (command == NULL) {
 	Tcl_AppendElement(interp, key);
 	Tcl_AppendElement(interp, value);
 	Tcl_AppendElement(interp, buffer);
@@ -2725,7 +2727,7 @@
 	argv[0] = key;
 	argv[1] = value;
 	argv[2] = buffer;
-	argv[3] = (char *) NULL;
+	argv[3] = NULL;
 	list = Tcl_Merge(3, argv);
 	result = Tcl_VarEval(interp, command, " ", list, (char *) NULL);
 	ckfree(list);
@@ -2823,7 +2825,7 @@
     TkText *textPtr;          /* Information about text widget. */
     Tcl_Interp *interp;       /* Current interpreter. */
     int argc;                 /* Number of arguments. */
-    char **argv;              /* Argument strings. */
+    CONST char **argv;        /* Argument strings. */
 {
     int      c, setModified;
     size_t   length;
Index: generic/tkText.h
===================================================================
RCS file: /cvsroot/tktoolkit/tk/generic/tkText.h,v
retrieving revision 1.11
diff -u -r1.11 tkText.h
--- generic/tkText.h	21 Jun 2002 23:09:54 -0000	1.11
+++ generic/tkText.h	2 Aug 2002 22:15:38 -0000
@@ -795,7 +795,7 @@
 EXTERN TkTextTag **	TkBTreeGetTags _ANSI_ARGS_((TkTextIndex *indexPtr,
 			    int *numTagsPtr));
 EXTERN void		TkBTreeInsertChars _ANSI_ARGS_((TkTextIndex *indexPtr,
-			    char *string));
+			    CONST char *string));
 EXTERN int		TkBTreeLineIndex _ANSI_ARGS_((TkTextLine *linePtr));
 EXTERN void		TkBTreeLinkSegment _ANSI_ARGS_((TkTextSegment *segPtr,
 			    TkTextIndex *indexPtr));
@@ -836,7 +836,7 @@
 EXTERN void		TkTextFreeTag _ANSI_ARGS_((TkText *textPtr,
 			    TkTextTag *tagPtr));
 EXTERN int		TkTextGetIndex _ANSI_ARGS_((Tcl_Interp *interp,
-			    TkText *textPtr, char *string,
+			    TkText *textPtr, CONST char *string,
 			    TkTextIndex *indexPtr));
 EXTERN TkTextTabArray *	TkTextGetTabs _ANSI_ARGS_((Tcl_Interp *interp,
 			    Tk_Window tkwin, char *string));
@@ -872,9 +872,9 @@
 			    int lineIndex, int byteIndex,
 			    TkTextIndex *indexPtr));
 EXTERN int		TkTextMarkCmd _ANSI_ARGS_((TkText *textPtr,
-			    Tcl_Interp *interp, int argc, char **argv));
+			    Tcl_Interp *interp, int argc, CONST char **argv));
 EXTERN int		TkTextMarkNameToIndex _ANSI_ARGS_((TkText *textPtr,
-			    char *name, TkTextIndex *indexPtr));
+			    CONST char *name, TkTextIndex *indexPtr));
 EXTERN void		TkTextMarkSegToIndex _ANSI_ARGS_((TkText *textPtr,
 			    TkTextSegment *markPtr, TkTextIndex *indexPtr));
 EXTERN void		TkTextEventuallyRepick _ANSI_ARGS_((TkText *textPtr));
@@ -891,30 +891,30 @@
 			    TkTextTag *tagPtr, int withTag));
 EXTERN void		TkTextRelayoutWindow _ANSI_ARGS_((TkText *textPtr));
 EXTERN int		TkTextScanCmd _ANSI_ARGS_((TkText *textPtr,
-			    Tcl_Interp *interp, int argc, char **argv));
+			    Tcl_Interp *interp, int argc, CONST char **argv));
 EXTERN int		TkTextSeeCmd _ANSI_ARGS_((TkText *textPtr,
-			    Tcl_Interp *interp, int argc, char **argv));
+			    Tcl_Interp *interp, int argc, CONST char **argv));
 EXTERN int		TkTextSegToOffset _ANSI_ARGS_((
 			    CONST TkTextSegment *segPtr,
 			    CONST TkTextLine *linePtr));
-EXTERN TkTextSegment *	TkTextSetMark _ANSI_ARGS_((TkText *textPtr, char *name,
-			    TkTextIndex *indexPtr));
+EXTERN TkTextSegment *	TkTextSetMark _ANSI_ARGS_((TkText *textPtr,
+			    CONST char *name, TkTextIndex *indexPtr));
 EXTERN void		TkTextSetYView _ANSI_ARGS_((TkText *textPtr,
 			    TkTextIndex *indexPtr, int pickPlace));
 EXTERN int		TkTextTagCmd _ANSI_ARGS_((TkText *textPtr,
-			    Tcl_Interp *interp, int argc, char **argv));
+			    Tcl_Interp *interp, int argc, CONST char **argv));
 EXTERN int		TkTextImageCmd _ANSI_ARGS_((TkText *textPtr,
-			    Tcl_Interp *interp, int argc, char **argv));
+			    Tcl_Interp *interp, int argc, CONST char **argv));
 EXTERN int		TkTextImageIndex _ANSI_ARGS_((TkText *textPtr,
-			    char *name, TkTextIndex *indexPtr));
+			    CONST char *name, TkTextIndex *indexPtr));
 EXTERN int		TkTextWindowCmd _ANSI_ARGS_((TkText *textPtr,
-			    Tcl_Interp *interp, int argc, char **argv));
+			    Tcl_Interp *interp, int argc, CONST char **argv));
 EXTERN int		TkTextWindowIndex _ANSI_ARGS_((TkText *textPtr,
-			    char *name, TkTextIndex *indexPtr));
+			    CONST char *name, TkTextIndex *indexPtr));
 EXTERN int		TkTextXviewCmd _ANSI_ARGS_((TkText *textPtr,
-			    Tcl_Interp *interp, int argc, char **argv));
+			    Tcl_Interp *interp, int argc, CONST char **argv));
 EXTERN int		TkTextYviewCmd _ANSI_ARGS_((TkText *textPtr,
-			    Tcl_Interp *interp, int argc, char **argv));
+			    Tcl_Interp *interp, int argc, CONST char **argv));
 
 # undef TCL_STORAGE_CLASS
 # define TCL_STORAGE_CLASS DLLIMPORT
Index: generic/tkTextBTree.c
===================================================================
RCS file: /cvsroot/tktoolkit/tk/generic/tkTextBTree.c,v
retrieving revision 1.5
diff -u -r1.5 tkTextBTree.c
--- generic/tkTextBTree.c	6 Jan 2000 02:18:58 -0000	1.5
+++ generic/tkTextBTree.c	2 Aug 2002 22:15:38 -0000
@@ -393,7 +393,7 @@
 					 * index is no longer valid because
 					 * of changes to the segment
 					 * structure. */
-    char *string;			/* Pointer to bytes to insert (may
+    CONST char *string;			/* Pointer to bytes to insert (may
 					 * contain newlines, must be null-
 					 * terminated). */
 {
@@ -410,7 +410,7 @@
     register TkTextSegment *segPtr;
     TkTextLine *newLinePtr;
     int chunkSize;			/* # characters in current chunk. */
-    register char *eol;			/* Pointer to character just after last
+    register CONST char *eol;		/* Pointer to character just after last
 					 * one in current chunk. */
     int changeToLineCount;		/* Counts change to total number of
 					 * lines in file. */
Index: generic/tkTextDisp.c
===================================================================
RCS file: /cvsroot/tktoolkit/tk/generic/tkTextDisp.c,v
retrieving revision 1.12
diff -u -r1.12 tkTextDisp.c
--- generic/tkTextDisp.c	15 Jun 2002 04:44:02 -0000	1.12
+++ generic/tkTextDisp.c	2 Aug 2002 22:15:39 -0000
@@ -3299,7 +3299,7 @@
     TkText *textPtr;		/* Information about text widget. */
     Tcl_Interp *interp;		/* Current interpreter. */
     int argc;			/* Number of arguments. */
-    char **argv;		/* Argument strings.  Someone else has already
+    CONST char **argv;		/* Argument strings.  Someone else has already
 				 * parsed this command enough to know that
 				 * argv[1] is "see". */
 {
@@ -3421,7 +3421,7 @@
     TkText *textPtr;		/* Information about text widget. */
     Tcl_Interp *interp;		/* Current interpreter. */
     int argc;			/* Number of arguments. */
-    char **argv;		/* Argument strings.  Someone else has already
+    CONST char **argv;		/* Argument strings.  Someone else has already
 				 * parsed this command enough to know that
 				 * argv[1] is "xview". */
 {
@@ -3609,7 +3609,7 @@
     TkText *textPtr;		/* Information about text widget. */
     Tcl_Interp *interp;		/* Current interpreter. */
     int argc;			/* Number of arguments. */
-    char **argv;		/* Argument strings.  Someone else has already
+    CONST char **argv;		/* Argument strings.  Someone else has already
 				 * parsed this command enough to know that
 				 * argv[1] is "yview". */
 {
@@ -3775,7 +3775,7 @@
     register TkText *textPtr;	/* Information about text widget. */
     Tcl_Interp *interp;		/* Current interpreter. */
     int argc;			/* Number of arguments. */
-    char **argv;		/* Argument strings.  Someone else has already
+    CONST char **argv;		/* Argument strings.  Someone else has already
 				 * parsed this command enough to know that
 				 * argv[1] is "scan". */
 {
Index: generic/tkTextImage.c
===================================================================
RCS file: /cvsroot/tktoolkit/tk/generic/tkTextImage.c,v
retrieving revision 1.4
diff -u -r1.4 tkTextImage.c
--- generic/tkTextImage.c	14 Dec 1999 06:52:33 -0000	1.4
+++ generic/tkTextImage.c	2 Aug 2002 22:15:39 -0000
@@ -38,8 +38,8 @@
  */
 
 static int		AlignParseProc _ANSI_ARGS_((ClientData clientData,
-			    Tcl_Interp *interp, Tk_Window tkwin, char *value,
-			    char *widgRec, int offset));
+			    Tcl_Interp *interp, Tk_Window tkwin,
+			    CONST char *value, char *widgRec, int offset));
 static char *		AlignPrintProc _ANSI_ARGS_((ClientData clientData,
 			    Tk_Window tkwin, char *widgRec, int offset,
 			    Tcl_FreeProc **freeProcPtr));
@@ -52,7 +52,7 @@
 			    int *xPtr, int *yPtr, int *widthPtr,
 			    int *heightPtr));
 static int		EmbImageConfigure _ANSI_ARGS_((TkText *textPtr,
-			    TkTextSegment *eiPtr, int argc, char **argv));
+			    TkTextSegment *eiPtr, int argc, CONST char **argv));
 static int		EmbImageDeleteProc _ANSI_ARGS_((TkTextSegment *segPtr,
 			    TkTextLine *linePtr, int treeGone));
 static void		EmbImageDisplayProc _ANSI_ARGS_((
@@ -132,7 +132,7 @@
     register TkText *textPtr;	/* Information about text widget. */
     Tcl_Interp *interp;		/* Current interpreter. */
     int argc;			/* Number of arguments. */
-    char **argv;		/* Argument strings.  Someone else has already
+    CONST char **argv;		/* Argument strings.  Someone else has already
 				 * parsed this command enough to know that
 				 * argv[1] is "image". */
 {
@@ -303,7 +303,7 @@
 				 * contains embedded image. */
     TkTextSegment *eiPtr;	/* Embedded image to be configured. */
     int argc;			/* Number of strings in argv. */
-    char **argv;		/* Array of strings describing configuration
+    CONST char **argv;		/* Array of strings describing configuration
 				 * options. */
 {
     Tk_Image image;
@@ -423,7 +423,7 @@
     ClientData clientData;		/* Not used.*/
     Tcl_Interp *interp;			/* Used for reporting errors. */
     Tk_Window tkwin;			/* Window for text widget. */
-    char *value;			/* Value of option. */
+    CONST char *value;			/* Value of option. */
     char *widgRec;			/* Pointer to TkTextEmbWindow
 					 * structure. */
     int offset;				/* Offset into item (ignored). */
@@ -844,7 +844,7 @@
 int
 TkTextImageIndex(textPtr, name, indexPtr)
     TkText *textPtr;		/* Text widget containing image. */
-    char *name;			/* Name of image. */
+    CONST char *name;			/* Name of image. */
     TkTextIndex *indexPtr;	/* Index information gets stored here. */
 {
     Tcl_HashEntry *hPtr;
Index: generic/tkTextIndex.c
===================================================================
RCS file: /cvsroot/tktoolkit/tk/generic/tkTextIndex.c,v
retrieving revision 1.5
diff -u -r1.5 tkTextIndex.c
--- generic/tkTextIndex.c	22 Jun 2002 08:21:51 -0000	1.5
+++ generic/tkTextIndex.c	2 Aug 2002 22:15:39 -0000
@@ -28,9 +28,9 @@
  * Forward declarations for procedures defined later in this file:
  */
 
-static char *		ForwBack _ANSI_ARGS_((char *string,
+static CONST char *	ForwBack _ANSI_ARGS_((CONST char *string,
 			    TkTextIndex *indexPtr));
-static char *		StartEnd _ANSI_ARGS_(( char *string,
+static CONST char *	StartEnd _ANSI_ARGS_((CONST char *string,
 			    TkTextIndex *indexPtr));
 
 /*
@@ -314,7 +314,7 @@
 TkTextGetIndex(interp, textPtr, string, indexPtr)
     Tcl_Interp *interp;		/* Use this for error reporting. */
     TkText *textPtr;		/* Information about text widget. */
-    char *string;		/* Textual description of position. */
+    CONST char *string;		/* Textual description of position. */
     TkTextIndex *indexPtr;	/* Index structure to fill in. */
 {
     char *p, *end, *endOfBase;
@@ -324,6 +324,8 @@
     TkTextIndex first, last;
     int wantLast, result;
     char c;
+    CONST char *cp;
+    Tcl_DString copy;
 
     /*
      *---------------------------------------------------------------------
@@ -354,7 +356,8 @@
      * funny characters like "@" or "+1c".
      */
 
-    p = strrchr(string, '.');
+    Tcl_DStringInit(&copy);
+    p = strrchr(Tcl_DStringAppend(&copy, string, -1), '.');
     if (p != NULL) {
 	if ((p[1] == 'f') && (strncmp(p+1, "first", 5) == 0)) {
 	    wantLast = 0;
@@ -366,7 +369,7 @@
 	    goto tryxy;
 	}
 	*p = 0;
-	hPtr = Tcl_FindHashEntry(&textPtr->tagTable, string);
+	hPtr = Tcl_FindHashEntry(&textPtr->tagTable, Tcl_DStringValue(&copy));
 	*p = '.';
 	if (hPtr == NULL) {
 	    goto tryxy;
@@ -382,6 +385,7 @@
 		    "text doesn't contain any characters tagged with \"",
 		    Tcl_GetHashKey(&textPtr->tagTable, hPtr), "\"",
 			    (char *) NULL);
+	    Tcl_DStringFree(&copy);
 	    return TCL_ERROR;
 	}
 	*indexPtr = search.curIndex;
@@ -401,14 +405,14 @@
 
 	int x, y;
 
-	p = string+1;
-	x = strtol(p, &end, 0);
-	if ((end == p) || (*end != ',')) {
+	cp = string+1;
+	x = strtol(cp, &end, 0);
+	if ((end == cp) || (*end != ',')) {
 	    goto error;
 	}
-	p = end+1;
-	y = strtol(p, &end, 0);
-	if (end == p) {
+	cp = end+1;
+	y = strtol(cp, &end, 0);
+	if (end == cp) {
 	    goto error;
 	}
 	TkTextPixelIndex(textPtr, x, y, indexPtr);
@@ -442,7 +446,7 @@
 	goto gotBase;
     }
 
-    for (p = string; *p != 0; p++) {
+    for (p = Tcl_DStringValue(&copy); *p != 0; p++) {
 	if (isspace(UCHAR(*p)) || (*p == '+') || (*p == '-')) {
 	    break;
 	}
@@ -455,14 +459,15 @@
 
 	c = *endOfBase;
 	*endOfBase = 0;
-	result = TkTextWindowIndex(textPtr, string, indexPtr);
+	result = TkTextWindowIndex(textPtr, Tcl_DStringValue(&copy), indexPtr);
 	*endOfBase = c;
 	if (result != 0) {
 	    goto gotBase;
 	}
     }
     if ((string[0] == 'e')
-	    && (strncmp(string, "end", (size_t) (endOfBase-string)) == 0)) {
+	    && (strncmp(string, "end",
+	    (size_t) (endOfBase-Tcl_DStringValue(&copy))) == 0)) {
 	/*
 	 * Base position is end of text.
 	 */
@@ -477,7 +482,8 @@
 
 	c = *endOfBase;
 	*endOfBase = 0;
-	result = TkTextMarkNameToIndex(textPtr, string, indexPtr);
+	result = TkTextMarkNameToIndex(textPtr, Tcl_DStringValue(&copy),
+		indexPtr);
 	*endOfBase = c;
 	if (result == TCL_OK) {
 	    goto gotBase;
@@ -489,7 +495,7 @@
 
 	c = *endOfBase;
 	*endOfBase = 0;
-	result = TkTextImageIndex(textPtr, string, indexPtr);
+	result = TkTextImageIndex(textPtr, Tcl_DStringValue(&copy), indexPtr);
 	*endOfBase = c;
 	if (result != 0) {
 	    goto gotBase;
@@ -507,27 +513,29 @@
      */
 
     gotBase:
-    p = endOfBase;
+    cp = endOfBase;
     while (1) {
-	while (isspace(UCHAR(*p))) {
-	    p++;
+	while (isspace(UCHAR(*cp))) {
+	    cp++;
 	}
-	if (*p == 0) {
+	if (*cp == 0) {
 	    break;
 	}
     
-	if ((*p == '+') || (*p == '-')) {
-	    p = ForwBack(p, indexPtr);
+	if ((*cp == '+') || (*cp == '-')) {
+	    cp = ForwBack(cp, indexPtr);
 	} else {
-	    p = StartEnd(p, indexPtr);
+	    cp = StartEnd(cp, indexPtr);
 	}
-	if (p == NULL) {
+	if (cp == NULL) {
 	    goto error;
 	}
     }
+    Tcl_DStringFree(&copy);
     return TCL_OK;
 
     error:
+    Tcl_DStringFree(&copy);
     Tcl_ResetResult(interp);
     Tcl_AppendResult(interp, "bad text index \"", string, "\"",
 	    (char *) NULL);
@@ -647,16 +655,16 @@
  *---------------------------------------------------------------------------
  */
 
-static char *
+static CONST char *
 ForwBack(string, indexPtr)
-    char *string;		/* String to parse for additional info
+    CONST char *string;		/* String to parse for additional info
 				 * about modifier (count and units). 
 				 * Points to "+" or "-" that starts
 				 * modifier. */
     TkTextIndex *indexPtr;	/* Index to update as specified in string. */
 {
-    register char *p;
-    char *end, *units;
+    register CONST char *p, *units;
+    char *end;
     int count, lineIndex;
     size_t length;
 
@@ -1087,15 +1095,15 @@
  *----------------------------------------------------------------------
  */
 
-static char *
+static CONST char *
 StartEnd(string, indexPtr)
-    char *string;		/* String to parse for additional info
+    CONST char *string;		/* String to parse for additional info
 				 * about modifier (count and units). 
 				 * Points to first character of modifer
 				 * word. */
     TkTextIndex *indexPtr;	/* Index to mdoify based on string. */
 {
-    char *p;
+    CONST char *p;
     int c, offset;
     size_t length;
     register TkTextSegment *segPtr;
Index: generic/tkTextMark.c
===================================================================
RCS file: /cvsroot/tktoolkit/tk/generic/tkTextMark.c,v
retrieving revision 1.5
diff -u -r1.5 tkTextMark.c
--- generic/tkTextMark.c	5 Apr 2002 08:43:22 -0000	1.5
+++ generic/tkTextMark.c	2 Aug 2002 22:15:39 -0000
@@ -42,9 +42,9 @@
 			    int noCharsYet, TkWrapMode wrapMode,
 			    TkTextDispChunk *chunkPtr));
 static int		MarkFindNext _ANSI_ARGS_((Tcl_Interp *interp,
-			    TkText *textPtr, char *markName));
+			    TkText *textPtr, CONST char *markName));
 static int		MarkFindPrev _ANSI_ARGS_((Tcl_Interp *interp,
-			    TkText *textPtr, char *markName));
+			    TkText *textPtr, CONST char *markName));
 
 
 /*
@@ -99,7 +99,7 @@
     register TkText *textPtr;	/* Information about text widget. */
     Tcl_Interp *interp;		/* Current interpreter. */
     int argc;			/* Number of arguments. */
-    char **argv;		/* Argument strings.  Someone else has already
+    CONST char **argv;		/* Argument strings.  Someone else has already
 				 * parsed this command enough to know that
 				 * argv[1] is "mark". */
 {
@@ -235,7 +235,7 @@
 TkTextSegment *
 TkTextSetMark(textPtr, name, indexPtr)
     TkText *textPtr;		/* Text widget in which to create mark. */
-    char *name;			/* Name of mark to set. */
+    CONST char *name;			/* Name of mark to set. */
     TkTextIndex *indexPtr;	/* Where to set mark. */
 {
     Tcl_HashEntry *hPtr;
@@ -350,7 +350,7 @@
 int
 TkTextMarkNameToIndex(textPtr, name, indexPtr)
     TkText *textPtr;		/* Text widget containing mark. */
-    char *name;			/* Name of mark. */
+    CONST char *name;		/* Name of mark. */
     TkTextIndex *indexPtr;	/* Index information gets stored here. */
 {
     Tcl_HashEntry *hPtr;
@@ -647,7 +647,7 @@
 MarkFindNext(interp, textPtr, string)
     Tcl_Interp *interp;			/* For error reporting */
     TkText *textPtr;			/* The widget */
-    char *string;			/* The starting index or mark name */
+    CONST char *string;			/* The starting index or mark name */
 {
     TkTextIndex index;
     Tcl_HashEntry *hPtr;
@@ -721,7 +721,7 @@
 MarkFindPrev(interp, textPtr, string)
     Tcl_Interp *interp;			/* For error reporting */
     TkText *textPtr;			/* The widget */
-    char *string;			/* The starting index or mark name */
+    CONST char *string;			/* The starting index or mark name */
 {
     TkTextIndex index;
     Tcl_HashEntry *hPtr;
Index: generic/tkTextTag.c
===================================================================
RCS file: /cvsroot/tktoolkit/tk/generic/tkTextTag.c,v
retrieving revision 1.7
diff -u -r1.7 tkTextTag.c
--- generic/tkTextTag.c	25 Jan 2002 21:09:37 -0000	1.7
+++ generic/tkTextTag.c	2 Aug 2002 22:15:39 -0000
@@ -76,7 +76,7 @@
 static void		ChangeTagPriority _ANSI_ARGS_((TkText *textPtr,
 			    TkTextTag *tagPtr, int prio));
 static TkTextTag *	FindTag _ANSI_ARGS_((Tcl_Interp *interp,
-			    TkText *textPtr, char *tagName));
+			    TkText *textPtr, CONST char *tagName));
 static void		SortTags _ANSI_ARGS_((int numTags,
 			    TkTextTag **tagArrayPtr));
 static int		TagSortProc _ANSI_ARGS_((CONST VOID *first,
@@ -105,7 +105,7 @@
     register TkText *textPtr;	/* Information about text widget. */
     Tcl_Interp *interp;		/* Current interpreter. */
     int argc;			/* Number of arguments. */
-    char **argv;		/* Argument strings.  Someone else has already
+    CONST char **argv;		/* Argument strings.  Someone else has already
 				 * parsed this command enough to know that
 				 * argv[1] is "tag". */
 {
@@ -245,7 +245,7 @@
 		return TCL_ERROR;
 	    }
 	} else if (argc == 5) {
-	    char *command;
+	    CONST char *command;
     
 	    command = Tk_GetBinding(interp, textPtr->bindingTable,
 		    (ClientData) tagPtr, argv[4]);
@@ -264,7 +264,7 @@
 		    Tcl_ResetResult(interp);
 		}
 	    } else {
-		Tcl_SetResult(interp, command, TCL_STATIC);
+		Tcl_SetResult(interp, (char *) command, TCL_STATIC);
 	    }
 	} else {
 	    Tk_GetAllBindings(interp, textPtr->bindingTable,
@@ -890,7 +890,7 @@
 				 * if NULL, then don't record an error
 				 * message. */
     TkText *textPtr;		/* Widget in which tag is being used. */
-    char *tagName;		/* Name of desired tag. */
+    CONST char *tagName;	/* Name of desired tag. */
 {
     Tcl_HashEntry *hPtr;
 
Index: generic/tkTextWind.c
===================================================================
RCS file: /cvsroot/tktoolkit/tk/generic/tkTextWind.c,v
retrieving revision 1.5
diff -u -r1.5 tkTextWind.c
--- generic/tkTextWind.c	14 Jun 2002 22:25:12 -0000	1.5
+++ generic/tkTextWind.c	2 Aug 2002 22:15:39 -0000
@@ -55,8 +55,8 @@
  */
 
 static int		AlignParseProc _ANSI_ARGS_((ClientData clientData,
-			    Tcl_Interp *interp, Tk_Window tkwin, char *value,
-			    char *widgRec, int offset));
+			    Tcl_Interp *interp, Tk_Window tkwin,
+			    CONST char *value, char *widgRec, int offset));
 static char *		AlignPrintProc _ANSI_ARGS_((ClientData clientData,
 			    Tk_Window tkwin, char *widgRec, int offset,
 			    Tcl_FreeProc **freeProcPtr));
@@ -69,7 +69,7 @@
 			    int *xPtr, int *yPtr, int *widthPtr,
 			    int *heightPtr));
 static int		EmbWinConfigure _ANSI_ARGS_((TkText *textPtr,
-			    TkTextSegment *ewPtr, int argc, char **argv));
+			    TkTextSegment *ewPtr, int argc, CONST char **argv));
 static void		EmbWinDelayedUnmap _ANSI_ARGS_((
 			    ClientData clientData));
 static int		EmbWinDeleteProc _ANSI_ARGS_((TkTextSegment *segPtr,
@@ -155,7 +155,7 @@
     register TkText *textPtr;	/* Information about text widget. */
     Tcl_Interp *interp;		/* Current interpreter. */
     int argc;			/* Number of arguments. */
-    char **argv;		/* Argument strings.  Someone else has already
+    CONST char **argv;		/* Argument strings.  Someone else has already
 				 * parsed this command enough to know that
 				 * argv[1] is "window". */
 {
@@ -327,7 +327,7 @@
 				 * contains embedded window. */
     TkTextSegment *ewPtr;	/* Embedded window to be configured. */
     int argc;			/* Number of strings in argv. */
-    char **argv;		/* Array of strings describing configuration
+    CONST char **argv;		/* Array of strings describing configuration
 				 * options. */
 {
     Tk_Window oldWindow;
@@ -435,7 +435,7 @@
     ClientData clientData;		/* Not used.*/
     Tcl_Interp *interp;			/* Used for reporting errors. */
     Tk_Window tkwin;			/* Window for text widget. */
-    char *value;			/* Value of option. */
+    CONST char *value;			/* Value of option. */
     char *widgRec;			/* Pointer to TkTextEmbWindow
 					 * structure. */
     int offset;				/* Offset into item (ignored). */
@@ -1158,7 +1158,7 @@
 int
 TkTextWindowIndex(textPtr, name, indexPtr)
     TkText *textPtr;		/* Text widget containing window. */
-    char *name;			/* Name of window. */
+    CONST char *name;		/* Name of window. */
     TkTextIndex *indexPtr;	/* Index information gets stored here. */
 {
     Tcl_HashEntry *hPtr;
Index: generic/tkUtil.c
===================================================================
RCS file: /cvsroot/tktoolkit/tk/generic/tkUtil.c,v
retrieving revision 1.11
diff -u -r1.11 tkUtil.c
--- generic/tkUtil.c	26 Sep 2001 20:25:17 -0000	1.11
+++ generic/tkUtil.c	2 Aug 2002 22:15:39 -0000
@@ -630,7 +630,7 @@
 Tk_GetScrollInfo(interp, argc, argv, dblPtr, intPtr)
     Tcl_Interp *interp;			/* Used for error reporting. */
     int argc;				/* # arguments for command. */
-    char **argv;			/* Arguments for command. */
+    CONST char **argv;			/* Arguments for command. */
     double *dblPtr;			/* Filled in with argument "moveto"
 					 * option, if any. */
     int *intPtr;			/* Filled in with number of pages
Index: generic/tkVisual.c
===================================================================
RCS file: /cvsroot/tktoolkit/tk/generic/tkVisual.c,v
retrieving revision 1.3
diff -u -r1.3 tkVisual.c
--- generic/tkVisual.c	16 Apr 1999 01:51:25 -0000	1.3
+++ generic/tkVisual.c	2 Aug 2002 22:15:39 -0000
@@ -92,7 +92,7 @@
 					 * reporting. */
     Tk_Window tkwin;			/* Window in which visual will be
 					 * used. */
-    char *string;			/* String describing visual.  See
+    CONST char *string;			/* String describing visual.  See
 					 * manual entry for details. */
     int *depthPtr;			/* The depth of the returned visual
 					 * is stored here. */
@@ -106,7 +106,7 @@
     long mask;
     Visual *visual;
     int length, c, numVisuals, prio, bestPrio, i;
-    char *p;
+    CONST char *p;
     VisualDictionary *dictPtr;
     TkColormap *cmapPtr;
     TkDisplay *dispPtr = ((TkWindow *) tkwin)->dispPtr;
@@ -369,7 +369,7 @@
 					 * reporting. */
     Tk_Window tkwin;			/* Window where colormap will be
 					 * used. */
-    char *string;			/* String that identifies colormap:
+    CONST char *string;			/* String that identifies colormap:
 					 * either "new" or the name of
 					 * another window. */
 {
Index: generic/tkWindow.c
===================================================================
RCS file: /cvsroot/tktoolkit/tk/generic/tkWindow.c,v
retrieving revision 1.51
diff -u -r1.51 tkWindow.c
--- generic/tkWindow.c	25 Jul 2002 21:35:22 -0000	1.51
+++ generic/tkWindow.c	2 Aug 2002 22:15:40 -0000
@@ -159,7 +159,7 @@
     {"::tk::unsupported::MacWindowStyle",
 	    		TkUnsupported1Cmd,	NULL,			1, 1},
 #endif
-    {(char *) NULL,	(int (*) _ANSI_ARGS_((ClientData, Tcl_Interp *, int, char **))) NULL, NULL, 0}
+    {(char *) NULL,	(int (*) _ANSI_ARGS_((ClientData, Tcl_Interp *, int, CONST char **))) NULL, NULL, 0}
 };
 
 /*
@@ -202,8 +202,8 @@
  */
 
 static Tk_Window	CreateTopLevelWindow _ANSI_ARGS_((Tcl_Interp *interp,
-			    Tk_Window parent, char *name, char *screenName,
-			    unsigned int flags));
+			    Tk_Window parent, CONST char *name, 
+			    CONST char *screenName, unsigned int flags));
 static void		DeleteWindowsExitProc _ANSI_ARGS_((
 			    ClientData clientData));
 static TkDisplay *	GetScreen _ANSI_ARGS_((Tcl_Interp *interp,
@@ -211,7 +211,7 @@
 static int		Initialize _ANSI_ARGS_((Tcl_Interp *interp));
 static int		NameWindow _ANSI_ARGS_((Tcl_Interp *interp,
 			    TkWindow *winPtr, TkWindow *parentPtr,
-			    char *name));
+			    CONST char *name));
 static void		UnlinkWindow _ANSI_ARGS_((TkWindow *winPtr));
 
 /*
@@ -302,10 +302,10 @@
     Tk_Window parent;		/* Token for logical parent of new window
 				 * (used for naming, options, etc.).  May
 				 * be NULL. */
-    char *name;			/* Name for new window;  if parent is
+    CONST char *name;		/* Name for new window;  if parent is
 				 * non-NULL, must be unique among parent's
 				 * children. */
-    char *screenName;		/* Name of screen on which to create
+    CONST char *screenName;	/* Name of screen on which to create
 				 * window.  NULL means use DISPLAY environment
 				 * variable to determine.  Empty string means
 				 * use parent's screen, or DISPLAY if no
@@ -704,7 +704,7 @@
     register TkWindow *winPtr;	/* Window that is to be named and inserted. */
     TkWindow *parentPtr;	/* Pointer to logical parent for winPtr
 				 * (used for naming, options, etc.). */
-    char *name;			/* Name for winPtr;   must be unique among
+    CONST char *name;		/* Name for winPtr;   must be unique among
 				 * parentPtr's children. */
 {
 #define FIXED_SIZE 200
@@ -821,7 +821,7 @@
 Tk_Window
 TkCreateMainWindow(interp, screenName, baseName)
     Tcl_Interp *interp;		/* Interpreter to use for error reporting. */
-    char *screenName;		/* Name of screen on which to create
+    CONST char *screenName;	/* Name of screen on which to create
 				 * window.  Empty or NULL string means
 				 * use DISPLAY environment variable. */
     char *baseName;		/* Base name for application;  usually of the
@@ -971,9 +971,9 @@
 				 * the interp's result is assumed to be
 				 * initialized by the caller. */
     Tk_Window parent;		/* Token for parent of new window. */
-    char *name;			/* Name for new window.  Must be unique
+    CONST char *name;		/* Name for new window.  Must be unique
 				 * among parent's children. */
-    char *screenName;		/* If NULL, new window will be internal on
+    CONST char *screenName;	/* If NULL, new window will be internal on
 				 * same screen as its parent.  If non-NULL,
 				 * gives name of screen on which to create
 				 * new window;  window will be a top-level
@@ -1039,7 +1039,7 @@
 				 * the interp's result is assumed to be
 				 * initialized by the caller. */
     Tk_Window parent;		/* Token for parent of new window. */
-    char *screenName;		/* If NULL, new window will be internal on
+    CONST char *screenName;	/* If NULL, new window will be internal on
 				 * same screen as its parent.  If non-NULL,
 				 * gives name of screen on which to create
 				 * new window;  window will be a top-level
@@ -1111,11 +1111,11 @@
 				 * initialized by the caller. */
     Tk_Window tkwin;		/* Token for any window in application
 				 * that is to contain new window. */
-    char *pathName;		/* Path name for new window within the
+    CONST char *pathName;	/* Path name for new window within the
 				 * application of tkwin.  The parent of
 				 * this window must already exist, but
 				 * the window itself must not exist. */
-    char *screenName;		/* If NULL, new window will be on same
+    CONST char *screenName;	/* If NULL, new window will be on same
 				 * screen as its parent.  If non-NULL,
 				 * gives name of screen on which to create
 				 * new window;  window will be a top-level
@@ -2164,7 +2164,7 @@
 void
 Tk_SetClass(tkwin, className)
     Tk_Window tkwin;		/* Token for window to assign class. */
-    char *className;		/* New class for tkwin. */
+    CONST char *className;	/* New class for tkwin. */
 {
     register TkWindow *winPtr = (TkWindow *) tkwin;
 
@@ -2314,7 +2314,7 @@
  *----------------------------------------------------------------------
  */
 
-char *
+CONST char *
 Tk_DisplayName(tkwin)
     Tk_Window tkwin;		/* Window whose display name is desired. */
 {
Index: mac/tkMacConfig.c
===================================================================
RCS file: /cvsroot/tktoolkit/tk/mac/tkMacConfig.c,v
retrieving revision 1.2
diff -u -r1.2 tkMacConfig.c
--- mac/tkMacConfig.c	16 Apr 1999 01:51:30 -0000	1.2
+++ mac/tkMacConfig.c	2 Aug 2002 22:15:40 -0000
@@ -38,8 +38,8 @@
 Tcl_Obj *
 TkpGetSystemDefault(
     Tk_Window tkwin,		/* A window to use. */
-    char *dbName,		/* The option database name. */
-    char *className)		/* The name of the option class. */
+    CONST char *dbName,		/* The option database name. */
+    CONST char *className)	/* The name of the option class. */
 {
     return NULL;
 }
Index: mac/tkMacCursor.c
===================================================================
RCS file: /cvsroot/tktoolkit/tk/mac/tkMacCursor.c,v
retrieving revision 1.6
diff -u -r1.6 tkMacCursor.c
--- mac/tkMacCursor.c	25 Jan 2002 21:09:37 -0000	1.6
+++ mac/tkMacCursor.c	2 Aug 2002 22:15:40 -0000
@@ -249,8 +249,8 @@
 TkCursor *
 TkCreateCursorFromData(
     Tk_Window tkwin,		/* Window in which cursor will be used. */
-    char *source,		/* Bitmap data for cursor shape. */
-    char *mask,			/* Bitmap data for cursor mask. */
+    CONST char *source,		/* Bitmap data for cursor shape. */
+    CONST char *mask,		/* Bitmap data for cursor mask. */
     int width, int height,	/* Dimensions of cursor. */
     int xHot, int yHot,		/* Location of hot-spot in cursor. */
     XColor fgColor,		/* Foreground color for cursor. */
Index: mac/tkMacEmbed.c
===================================================================
RCS file: /cvsroot/tktoolkit/tk/mac/tkMacEmbed.c,v
retrieving revision 1.4
diff -u -r1.4 tkMacEmbed.c
--- mac/tkMacEmbed.c	16 Apr 1999 01:51:30 -0000	1.4
+++ mac/tkMacEmbed.c	2 Aug 2002 22:15:40 -0000
@@ -232,7 +232,7 @@
 				 * if string is bogus. */
     Tk_Window tkwin,		/* Tk window that does not yet have an
 				 * associated X window. */
-    char *string)		/* String identifying an X window to use
+    CONST char *string)		/* String identifying an X window to use
 				 * for tkwin;  must be an integer value. */
 {
     TkWindow *winPtr = (TkWindow *) tkwin;
@@ -620,7 +620,7 @@
     ClientData clientData,		/* Main window for application. */
     Tcl_Interp *interp,			/* Current interpreter. */
     int argc,				/* Number of arguments. */
-    char **argv)			/* Argument strings. */
+    CONST char **argv)			/* Argument strings. */
 {
     int all;
     Container *containerPtr;
Index: mac/tkMacSend.c
===================================================================
RCS file: /cvsroot/tktoolkit/tk/mac/tkMacSend.c,v
retrieving revision 1.5
diff -u -r1.5 tkMacSend.c
--- mac/tkMacSend.c	18 Jan 2002 03:24:28 -0000	1.5
+++ mac/tkMacSend.c	2 Aug 2002 22:15:40 -0000
@@ -234,12 +234,12 @@
  *--------------------------------------------------------------
  */
 
-char *
+CONST char *
 Tk_SetAppName(
     Tk_Window tkwin,		/* Token for any window in the application
 				 * to be named:  it is just used to identify
 				 * the application and the display.  */
-    char *name)			/* The name that will be used to
+    CONST char *name)		/* The name that will be used to
 				 * refer to the interpreter in later
 				 * "send" commands.  Must be globally
 				 * unique. */
Index: unix/tkUnixConfig.c
===================================================================
RCS file: /cvsroot/tktoolkit/tk/unix/tkUnixConfig.c,v
retrieving revision 1.2
diff -u -r1.2 tkUnixConfig.c
--- unix/tkUnixConfig.c	16 Apr 1999 01:51:45 -0000	1.2
+++ unix/tkUnixConfig.c	2 Aug 2002 22:15:40 -0000
@@ -38,8 +38,8 @@
 Tcl_Obj *
 TkpGetSystemDefault(tkwin, dbName, className)
     Tk_Window tkwin;		/* A window to use. */
-    char *dbName;		/* The option database name. */
-    char *className;		/* The name of the option class. */
+    CONST char *dbName;		/* The option database name. */
+    CONST char *className;		/* The name of the option class. */
 {
     return NULL;
 }
Index: unix/tkUnixCursor.c
===================================================================
RCS file: /cvsroot/tktoolkit/tk/unix/tkUnixCursor.c,v
retrieving revision 1.5
diff -u -r1.5 tkUnixCursor.c
--- unix/tkUnixCursor.c	25 Jan 2002 21:09:37 -0000	1.5
+++ unix/tkUnixCursor.c	2 Aug 2002 22:15:40 -0000
@@ -352,8 +352,8 @@
 TkCreateCursorFromData(tkwin, source, mask, width, height, xHot, yHot,
 	fgColor, bgColor)
     Tk_Window tkwin;		/* Window in which cursor will be used. */
-    char *source;		/* Bitmap data for cursor shape. */
-    char *mask;			/* Bitmap data for cursor mask. */
+    CONST char *source;		/* Bitmap data for cursor shape. */
+    CONST char *mask;		/* Bitmap data for cursor mask. */
     int width, height;		/* Dimensions of cursor. */
     int xHot, yHot;		/* Location of hot-spot in cursor. */
     XColor fgColor;		/* Foreground color for cursor. */
Index: unix/tkUnixEmbed.c
===================================================================
RCS file: /cvsroot/tktoolkit/tk/unix/tkUnixEmbed.c,v
retrieving revision 1.5
diff -u -r1.5 tkUnixEmbed.c
--- unix/tkUnixEmbed.c	14 Jun 2002 22:25:12 -0000	1.5
+++ unix/tkUnixEmbed.c	2 Aug 2002 22:15:40 -0000
@@ -101,7 +101,7 @@
 				 * if string is bogus. */
     Tk_Window tkwin;		/* Tk window that does not yet have an
 				 * associated X window. */
-    char *string;		/* String identifying an X window to use
+    CONST char *string;		/* String identifying an X window to use
 				 * for tkwin;  must be an integer value. */
 {
     TkWindow *winPtr = (TkWindow *) tkwin;
@@ -882,7 +882,7 @@
     ClientData clientData;		/* Main window for application. */
     Tcl_Interp *interp;			/* Current interpreter. */
     int argc;				/* Number of arguments. */
-    char **argv;			/* Argument strings. */
+    CONST char **argv;			/* Argument strings. */
 {
     int all;
     Container *containerPtr;
Index: unix/tkUnixFont.c
===================================================================
RCS file: /cvsroot/tktoolkit/tk/unix/tkUnixFont.c,v
retrieving revision 1.14
diff -u -r1.14 tkUnixFont.c
--- unix/tkUnixFont.c	26 Jun 2002 23:02:45 -0000	1.14
+++ unix/tkUnixFont.c	2 Aug 2002 22:15:40 -0000
@@ -202,7 +202,7 @@
 static FontFamily *	AllocFontFamily _ANSI_ARGS_((Display *display,
 			    XFontStruct *fontStructPtr, int base));
 static SubFont *	CanUseFallback _ANSI_ARGS_((UnixFont *fontPtr,
-			    char *fallbackName, int ch));
+			    CONST char *fallbackName, int ch));
 static SubFont *	CanUseFallbackWithAliases _ANSI_ARGS_((
 			    UnixFont *fontPtr, char *fallbackName,
 			    int ch, Tcl_DString *nameTriedPtr));
@@ -1802,7 +1802,8 @@
     int ch;			/* The Unicode character to be displayed. */
 {
     int i, j, k, numNames;
-    char *faceName, *fallback;
+    Tk_Uid faceName; 
+    char *fallback;
     char **aliases, **nameList, **anyFallbacks;
     char ***fontFallbacks;
     SubFont *subFontPtr;
@@ -2221,7 +2222,7 @@
 CanUseFallback(fontPtr, faceName, ch)
     UnixFont *fontPtr;		/* The font object that will own the new
 				 * screen font. */
-    char *faceName;		/* Desired face name for new screen font. */
+    CONST char *faceName;	/* Desired face name for new screen font. */
     int ch;			/* The Unicode character that the new
 				 * screen font must be able to display. */
 {
Index: unix/tkUnixSelect.c
===================================================================
RCS file: /cvsroot/tktoolkit/tk/unix/tkUnixSelect.c,v
retrieving revision 1.8
diff -u -r1.8 tkUnixSelect.c
--- unix/tkUnixSelect.c	12 Apr 2002 09:21:49 -0000	1.8
+++ unix/tkUnixSelect.c	2 Aug 2002 22:15:40 -0000
@@ -1497,7 +1497,7 @@
 {
     char *result;
     int resultSpace, curSize, fieldSize;
-    char *atomName;
+    CONST char *atomName;
 
     /*
      * Convert each long in the property to a string value, which is
Index: unix/tkUnixSend.c
===================================================================
RCS file: /cvsroot/tktoolkit/tk/unix/tkUnixSend.c,v
retrieving revision 1.9
diff -u -r1.9 tkUnixSend.c
--- unix/tkUnixSend.c	18 Jul 2002 16:02:48 -0000	1.9
+++ unix/tkUnixSend.c	2 Aug 2002 22:15:41 -0000
@@ -85,7 +85,7 @@
     int serial;			/* Serial number expected in
 				 * result. */
     TkDisplay *dispPtr;		/* Display being used for communication. */
-    char *target;		/* Name of interpreter command is
+    CONST char *target;		/* Name of interpreter command is
 				 * being sent to. */
     Window commWindow;		/* Target's communication window. */
     Tcl_Interp *interp;		/* Interpreter from which the send
@@ -224,12 +224,12 @@
 			    int length, PendingCommand *pendingPtr));
 static void		DeleteProc _ANSI_ARGS_((ClientData clientData));
 static void		RegAddName _ANSI_ARGS_((NameRegistry *regPtr,
-			    char *name, Window commWindow));
+			    CONST char *name, Window commWindow));
 static void		RegClose _ANSI_ARGS_((NameRegistry *regPtr));
 static void		RegDeleteName _ANSI_ARGS_((NameRegistry *regPtr,
-			    char *name));
+			    CONST char *name));
 static Window		RegFindName _ANSI_ARGS_((NameRegistry *regPtr,
-			    char *name));
+			    CONST char *name));
 static NameRegistry *	RegOpen _ANSI_ARGS_((Tcl_Interp *interp,
 			    TkDisplay *dispPtr, int lock));
 static void		SendEventProc _ANSI_ARGS_((ClientData clientData,
@@ -241,7 +241,7 @@
 static int		ServerSecure _ANSI_ARGS_((TkDisplay *dispPtr));
 static void		UpdateCommWindow _ANSI_ARGS_((TkDisplay *dispPtr));
 static int		ValidateName _ANSI_ARGS_((TkDisplay *dispPtr,
-			    char *name, Window commWindow, int oldOK));
+			    CONST char *name, Window commWindow, int oldOK));
 
 /*
  *----------------------------------------------------------------------
@@ -365,7 +365,7 @@
 RegFindName(regPtr, name)
     NameRegistry *regPtr;	/* Pointer to a registry opened with a
 				 * previous call to RegOpen. */
-    char *name;			/* Name of an application. */
+    CONST char *name;		/* Name of an application. */
 {
     char *p, *entry;
     unsigned int id;
@@ -416,7 +416,7 @@
 RegDeleteName(regPtr, name)
     NameRegistry *regPtr;	/* Pointer to a registry opened with a
 				 * previous call to RegOpen. */
-    char *name;			/* Name of an application. */
+    CONST char *name;		/* Name of an application. */
 {
     char *p, *entry, *entryName;
     int count;
@@ -476,7 +476,7 @@
 RegAddName(regPtr, name, commWindow)
     NameRegistry *regPtr;	/* Pointer to a registry opened with a
 				 * previous call to RegOpen. */
-    char *name;			/* Name of an application.  The caller
+    CONST char *name;		/* Name of an application.  The caller
 				 * must ensure that this name isn't
 				 * already registered. */
     Window commWindow;		/* X identifier for comm. window of
@@ -590,7 +590,7 @@
 ValidateName(dispPtr, name, commWindow, oldOK)
     TkDisplay *dispPtr;		/* Display for which to perform the
 				 * validation. */
-    char *name;			/* The name of an application. */
+    CONST char *name;		/* The name of an application. */
     Window commWindow;		/* X identifier for the application's
 				 * comm. window. */
     int oldOK;			/* Non-zero means that we should consider
@@ -735,12 +735,12 @@
  *--------------------------------------------------------------
  */
 
-char *
+CONST char *
 Tk_SetAppName(tkwin, name)
     Tk_Window tkwin;		/* Token for any window in the application
 				 * to be named:  it is just used to identify
 				 * the application and the display.  */
-    char *name;			/* The name that will be used to
+    CONST char *name;		/* The name that will be used to
 				 * refer to the interpreter in later
 				 * "send" commands.  Must be globally
 				 * unique. */
@@ -751,7 +751,7 @@
     TkDisplay *dispPtr = winPtr->dispPtr;
     NameRegistry *regPtr;
     Tcl_Interp *interp;
-    char *actualName;
+    CONST char *actualName;
     Tcl_DString dString;
     int offset, i;
     ThreadSpecificData *tsdPtr = (ThreadSpecificData *) 
@@ -816,15 +816,17 @@
 					 * set" compiler warnings. */
     for (i = 1; ; i++) {
 	if (i > 1) {
+	    char *copy;
 	    if (i == 2) {
 		Tcl_DStringInit(&dString);
 		Tcl_DStringAppend(&dString, name, -1);
 		Tcl_DStringAppend(&dString, " #", 2);
 		offset = Tcl_DStringLength(&dString);
-		Tcl_DStringSetLength(&dString, offset+10);
-		actualName = Tcl_DStringValue(&dString);
+		Tcl_DStringSetLength(&dString, offset+TCL_INTEGER_SPACE);
+		copy = Tcl_DStringValue(&dString);
+		actualName = copy;
 	    }
-	    sprintf(actualName + offset, "%d", i);
+	    sprintf(copy + offset, "%d", i);
 	}
 	w = RegFindName(regPtr, actualName);
 	if (w == None) {
@@ -896,13 +898,13 @@
 					 * dispPtr field is used). */
     Tcl_Interp *interp;			/* Current interpreter. */
     int argc;				/* Number of arguments. */
-    char **argv;			/* Argument strings. */
+    CONST char **argv;			/* Argument strings. */
 {
     TkWindow *winPtr;
     Window commWindow;
     PendingCommand pending;
     register RegisteredInterp *riPtr;
-    char *destName;
+    CONST char *destName;
     int result, c, async, i, firstArg;
     size_t length;
     Tk_RestrictProc *prevRestrictProc;
Index: unix/tkUnixWm.c
===================================================================
RCS file: /cvsroot/tktoolkit/tk/unix/tkUnixWm.c,v
retrieving revision 1.29
diff -u -r1.29 tkUnixWm.c
--- unix/tkUnixWm.c	2 Aug 2002 15:12:23 -0000	1.29
+++ unix/tkUnixWm.c	2 Aug 2002 22:15:41 -0000
@@ -605,7 +605,7 @@
 {
     register WmInfo *wmPtr = winPtr->wmInfoPtr;
     XTextProperty textProp;
-    char *string;
+    Tk_Uid string;
 
     if (wmPtr->flags & WM_NEVER_MAPPED) {
 	Tcl_DString ds;
@@ -1856,7 +1856,7 @@
     }
     if (objc == 3) {
 	if (wmPtr->hints.flags & IconPixmapHint) {
-	    Tcl_SetResult(interp,
+	    Tcl_SetResult(interp, (char *)
 		    Tk_NameOfBitmap(winPtr->display, wmPtr->hints.icon_pixmap),
 		    TCL_STATIC);
 	}
@@ -1976,7 +1976,7 @@
     }
     if (objc == 3) {
 	if (wmPtr->hints.flags & IconMaskHint) {
-	    Tcl_SetResult(interp,
+	    Tcl_SetResult(interp, (char *)
 		    Tk_NameOfBitmap(winPtr->display, wmPtr->hints.icon_mask),
 		    TCL_STATIC);
 	}
@@ -2928,7 +2928,7 @@
 	return TCL_ERROR;
     }
     if (objc == 3) {
-	Tcl_SetResult(interp,
+	Tcl_SetResult(interp, (char *)
 		((wmPtr->title != NULL) ? wmPtr->title : winPtr->nameUid),
 		TCL_STATIC);
 	return TCL_OK;
@@ -5261,7 +5261,7 @@
     register ProtocolHandler *protPtr;
     Atom protocol;
     int result;
-    char *protocolName;
+    CONST char *protocolName;
     Tcl_Interp *interp;
 
     wmPtr = winPtr->wmInfoPtr;
Index: win/tkWinConfig.c
===================================================================
RCS file: /cvsroot/tktoolkit/tk/win/tkWinConfig.c,v
retrieving revision 1.2
diff -u -r1.2 tkWinConfig.c
--- win/tkWinConfig.c	16 Apr 1999 01:51:50 -0000	1.2
+++ win/tkWinConfig.c	2 Aug 2002 22:15:41 -0000
@@ -39,8 +39,8 @@
 Tcl_Obj *
 TkpGetSystemDefault(
     Tk_Window tkwin,		/* A window to use. */
-    char *dbName,		/* The option database name. */
-    char *className)		/* The name of the option class. */
+    CONST char *dbName,		/* The option database name. */
+    CONST char *className)		/* The name of the option class. */
 {
     Tcl_Obj *valueObjPtr;
     Tk_Uid classUid;
Index: win/tkWinCursor.c
===================================================================
RCS file: /cvsroot/tktoolkit/tk/win/tkWinCursor.c,v
retrieving revision 1.9
diff -u -r1.9 tkWinCursor.c
--- win/tkWinCursor.c	13 Jun 2002 09:46:39 -0000	1.9
+++ win/tkWinCursor.c	2 Aug 2002 22:15:41 -0000
@@ -181,8 +181,8 @@
 TkCreateCursorFromData(tkwin, source, mask, width, height, xHot, yHot,
 	fgColor, bgColor)
     Tk_Window tkwin;		/* Window in which cursor will be used. */
-    char *source;		/* Bitmap data for cursor shape. */
-    char *mask;			/* Bitmap data for cursor mask. */
+    CONST char *source;		/* Bitmap data for cursor shape. */
+    CONST char *mask;		/* Bitmap data for cursor mask. */
     int width, height;		/* Dimensions of cursor. */
     int xHot, yHot;		/* Location of hot-spot in cursor. */
     XColor fgColor;		/* Foreground color for cursor. */
Index: win/tkWinEmbed.c
===================================================================
RCS file: /cvsroot/tktoolkit/tk/win/tkWinEmbed.c,v
retrieving revision 1.6
diff -u -r1.6 tkWinEmbed.c
--- win/tkWinEmbed.c	22 Jun 2002 08:37:25 -0000	1.6
+++ win/tkWinEmbed.c	2 Aug 2002 22:15:41 -0000
@@ -110,7 +110,7 @@
     ClientData clientData;
     Tcl_Interp *interp;
     int argc;
-    char **argv;
+    CONST char **argv;
 {
     return TCL_OK;
 }
@@ -144,7 +144,7 @@
 				 * if string is bogus. */
     Tk_Window tkwin;		/* Tk window that does not yet have an
 				 * associated X window. */
-    char *string;		/* String identifying an X window to use
+    CONST char *string;		/* String identifying an X window to use
 				 * for tkwin;  must be an integer value. */
 {
     TkWindow *winPtr = (TkWindow *) tkwin;
Index: win/tkWinMenu.c
===================================================================
RCS file: /cvsroot/tktoolkit/tk/win/tkWinMenu.c,v
retrieving revision 1.19
diff -u -r1.19 tkWinMenu.c
--- win/tkWinMenu.c	17 Jan 2002 03:35:01 -0000	1.19
+++ win/tkWinMenu.c	2 Aug 2002 22:15:41 -0000
@@ -2744,8 +2744,8 @@
 Tcl_Obj *
 TkWinGetMenuSystemDefault(
     Tk_Window tkwin,		/* A window to use. */
-    char *dbName,		/* The option database name. */
-    char *className)		/* The name of the option class. */
+    CONST char *dbName,		/* The option database name. */
+    CONST char *className)	/* The name of the option class. */
 {
     Tcl_Obj *valuePtr = NULL;
 
Index: win/tkWinSend.c
===================================================================
RCS file: /cvsroot/tktoolkit/tk/win/tkWinSend.c,v
retrieving revision 1.2
diff -u -r1.2 tkWinSend.c
--- win/tkWinSend.c	14 Sep 1998 18:24:01 -0000	1.2
+++ win/tkWinSend.c	2 Aug 2002 22:15:41 -0000
@@ -42,12 +42,12 @@
  *--------------------------------------------------------------
  */
 
-char *
+CONST char *
 Tk_SetAppName(tkwin, name)
     Tk_Window tkwin;		/* Token for any window in the application
 				 * to be named:  it is just used to identify
 				 * the application and the display.  */
-    char *name;			/* The name that will be used to
+    CONST char *name;		/* The name that will be used to
 				 * refer to the interpreter in later
 				 * "send" commands.  Must be globally
 				 * unique. */
