summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2002-01-17 03:03:10 (GMT)
committerdgp <dgp@users.sourceforge.net>2002-01-17 03:03:10 (GMT)
commit2955a401d559c6249d4f2ad18a4c7b000df1a3de (patch)
treed3199c60f6666de3fc69c7f34d074408746ec7f2
parenta47d47cbb35ee1acc2ecb44bb6b37631ce05d137 (diff)
downloadtcl-2955a401d559c6249d4f2ad18a4c7b000df1a3de.zip
tcl-2955a401d559c6249d4f2ad18a4c7b000df1a3de.tar.gz
tcl-2955a401d559c6249d4f2ad18a4c7b000df1a3de.tar.bz2
* Updated APIs in generic/tclUtf.c and generic/tclRegexp.c according
to the guidelines of TIP 27. Updated callers.
-rw-r--r--ChangeLog19
-rw-r--r--doc/RegExp.310
-rw-r--r--doc/Utf.322
-rw-r--r--generic/regc_locale.c7
-rw-r--r--generic/tcl.decls31
-rw-r--r--generic/tclCmdMZ.c10
-rw-r--r--generic/tclDecls.h47
-rw-r--r--generic/tclFileName.c6
-rw-r--r--generic/tclIO.c4
-rw-r--r--generic/tclInt.decls4
-rw-r--r--generic/tclIntDecls.h6
-rw-r--r--generic/tclRegexp.c22
-rw-r--r--generic/tclUtf.c28
-rw-r--r--mac/tclMacLoad.c7
-rw-r--r--win/tclWinFile.c5
15 files changed, 130 insertions, 98 deletions
diff --git a/ChangeLog b/ChangeLog
index e745183..b1c2484 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -8,6 +8,25 @@
2002-01-16 Don Porter <dgp@users.sourceforge.net>
+ * doc/RegExp.3:
+ * doc/Utf.3:
+ * generic/tcl.decls:
+ * generic/tclInt.decls:
+ * generic/tclRegexp.c:
+ * generic/tclUtf.c: Updated APIs in generic/tclUtf.c and
+ generic/tclRegexp.c according to the guidelines of TIP 27.
+ [Patch 471509]
+
+ * generic/regc_locale.c (element,cclass):
+ * generic/tclCmdMZ.c (Tcl_StringObjCmd):
+ * generic/tclFileName.c (TclpGetNativePathType,SplitMacPath):
+ * generic/tclIO.c (ReadChars):
+ * mac/tclMacLoad.c (TclpLoadFile):
+ * win/tclWinFile.c (TclpGetUserHome): Updated callers.
+
+ * generic/tclDecls.h:
+ * generic/tclIntDecls.h: make genstubs
+
* doc/ParseCmd.3 (Tcl_ParseVar):
* generic/tcl.decls (Tcl_ParseVar):
* generic/tclParse.c (Tcl_ParseVar):
diff --git a/doc/RegExp.3 b/doc/RegExp.3
index 5f2634c..6a4fbb4 100644
--- a/doc/RegExp.3
+++ b/doc/RegExp.3
@@ -6,7 +6,7 @@
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
-'\" RCS: @(#) $Id: RegExp.3,v 1.9 2001/10/14 16:21:45 dgp Exp $
+'\" RCS: @(#) $Id: RegExp.3,v 1.10 2002/01/17 03:03:10 dgp Exp $
'\"
.so man.macros
.TH Tcl_RegExpMatch 3 8.1 Tcl "Tcl Library Procedures"
@@ -57,7 +57,7 @@ compiled regular expression is cached in the object.
.VE 8.1
.AP char *string in
String to check for a match with a regular expression.
-.AP char *pattern in
+.AP "CONST char" *pattern in
String in the form of a regular expression pattern.
.AP Tcl_RegExp regexp in
Compiled regular expression. Must have been returned previously
@@ -71,12 +71,14 @@ will be allowed.
Specifies which range is desired: 0 means the range of the entire
match, 1 or greater means the range that matched a parenthesized
sub-expression.
-.AP char **startPtr out
+.VS 8.4
+.AP "CONST char" **startPtr out
The address of the first character in the range is stored here, or
NULL if there is no such range.
-.AP char **endPtr out
+.AP "CONST char" **endPtr out
The address of the character just after the last one in the range
is stored here, or NULL if there is no such range.
+.VE 8.4
.VS 8.1
.AP int cflags in
OR-ed combination of compilation flags. See below for more information.
diff --git a/doc/Utf.3 b/doc/Utf.3
index a56d911..2cab940 100644
--- a/doc/Utf.3
+++ b/doc/Utf.3
@@ -4,7 +4,7 @@
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
-'\" RCS: @(#) $Id: Utf.3,v 1.10 2001/12/10 15:50:47 dgp Exp $
+'\" RCS: @(#) $Id: Utf.3,v 1.11 2002/01/17 03:03:10 dgp Exp $
'\"
.so man.macros
.TH Utf 3 "8.1" Tcl "Tcl Library Procedures"
@@ -22,12 +22,14 @@ int
.sp
int
\fBTcl_UtfToUniChar\fR(\fIsrc, chPtr\fR)
+.VS 8.4
.sp
-char *
+CONST char *
\fBTcl_UniCharToUtfDString\fR(\fIuniStr, numChars, dstPtr\fR)
.sp
-Tcl_UniChar *
+CONST Tcl_UniChar *
\fBTcl_UtfToUniCharDString\fR(\fIsrc, len, dstPtr\fR)
+.VE 8.4
.sp
int
\fBTcl_UniCharLen\fR(\fIuniStr\fR)
@@ -54,24 +56,28 @@ int
.sp
int
\fBTcl_NumUtfChars\fR(\fIsrc, len\fR)
+.VS 8.4
.sp
-char *
+CONST char *
\fBTcl_UtfFindFirst\fR(\fIsrc, ch\fR)
.sp
-char *
+CONST char *
\fBTcl_UtfFindLast\fR(\fIsrc, ch\fR)
.sp
-char *
+CONST char *
\fBTcl_UtfNext\fR(\fIsrc\fR)
.sp
-char *
+CONST char *
\fBTcl_UtfPrev\fR(\fIsrc, start\fR)
+.VE 8.4
.sp
Tcl_UniChar
\fBTcl_UniCharAtIndex\fR(\fIsrc, index\fR)
+.VS 8.4
.sp
-char *
+CONST char *
\fBTcl_UtfAtIndex\fR(\fIsrc, index\fR)
+.VE 8.4
.sp
int
\fBTcl_UtfBackslash\fR(\fIsrc, readPtr, dst\fR)
diff --git a/generic/regc_locale.c b/generic/regc_locale.c
index 4af4724..06f553f 100644
--- a/generic/regc_locale.c
+++ b/generic/regc_locale.c
@@ -9,7 +9,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: regc_locale.c,v 1.6 2001/05/28 04:45:43 hobbs Exp $
+ * RCS: @(#) $Id: regc_locale.c,v 1.7 2002/01/17 03:03:10 dgp Exp $
*/
/* ASCII character-name table */
@@ -567,7 +567,7 @@ chr *endp; /* points just past end of name */
struct cname *cn;
size_t len;
Tcl_DString ds;
- char *np;
+ CONST char *np;
/* generic: one-chr names stand for themselves */
assert(startp < endp);
@@ -714,7 +714,8 @@ int cases; /* case-independent? */
size_t len;
struct cvec *cv = NULL;
Tcl_DString ds;
- char *np, **namePtr;
+ CONST char *np;
+ char **namePtr;
int i, index;
/*
diff --git a/generic/tcl.decls b/generic/tcl.decls
index 72df355..9d85df4 100644
--- a/generic/tcl.decls
+++ b/generic/tcl.decls
@@ -10,7 +10,7 @@
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#
-# RCS: @(#) $Id: tcl.decls,v 1.73 2002/01/17 02:43:19 dgp Exp $
+# RCS: @(#) $Id: tcl.decls,v 1.74 2002/01/17 03:03:11 dgp Exp $
library tcl
@@ -750,18 +750,19 @@ declare 211 generic {
void Tcl_RegisterObjType(Tcl_ObjType *typePtr)
}
declare 212 generic {
- Tcl_RegExp Tcl_RegExpCompile(Tcl_Interp *interp, char *string)
+ Tcl_RegExp Tcl_RegExpCompile(Tcl_Interp *interp, CONST char *string)
}
declare 213 generic {
int Tcl_RegExpExec(Tcl_Interp *interp, Tcl_RegExp regexp, \
CONST char *str, CONST char *start)
}
declare 214 generic {
- int Tcl_RegExpMatch(Tcl_Interp *interp, char *str, char *pattern)
+ int Tcl_RegExpMatch(Tcl_Interp *interp, CONST char *str, \
+ CONST char *pattern)
}
declare 215 generic {
- void Tcl_RegExpRange(Tcl_RegExp regexp, int index, char **startPtr, \
- char **endPtr)
+ void Tcl_RegExpRange(Tcl_RegExp regexp, int index, \
+ CONST char **startPtr, CONST char **endPtr)
}
declare 216 generic {
void Tcl_Release(ClientData clientData)
@@ -1153,7 +1154,7 @@ declare 324 generic {
int Tcl_UniCharToUtf(int ch, char *buf)
}
declare 325 generic {
- char * Tcl_UtfAtIndex(CONST char *src, int index)
+ CONST char * Tcl_UtfAtIndex(CONST char *src, int index)
}
declare 326 generic {
int Tcl_UtfCharComplete(CONST char *src, int len)
@@ -1162,16 +1163,16 @@ declare 327 generic {
int Tcl_UtfBackslash(CONST char *src, int *readPtr, char *dst)
}
declare 328 generic {
- char * Tcl_UtfFindFirst(CONST char *src, int ch)
+ CONST char * Tcl_UtfFindFirst(CONST char *src, int ch)
}
declare 329 generic {
- char * Tcl_UtfFindLast(CONST char *src, int ch)
+ CONST char * Tcl_UtfFindLast(CONST char *src, int ch)
}
declare 330 generic {
- char * Tcl_UtfNext(CONST char *src)
+ CONST char * Tcl_UtfNext(CONST char *src)
}
declare 331 generic {
- char * Tcl_UtfPrev(CONST char *src, CONST char *start)
+ CONST char * Tcl_UtfPrev(CONST char *src, CONST char *start)
}
declare 332 generic {
int Tcl_UtfToExternal(Tcl_Interp *interp, Tcl_Encoding encoding, \
@@ -1238,19 +1239,19 @@ declare 351 generic {
int Tcl_UniCharIsWordChar(int ch)
}
declare 352 generic {
- int Tcl_UniCharLen(Tcl_UniChar *str)
+ int Tcl_UniCharLen(CONST Tcl_UniChar *str)
}
declare 353 generic {
int Tcl_UniCharNcmp(CONST Tcl_UniChar *cs, CONST Tcl_UniChar *ct,\
unsigned long n)
}
declare 354 generic {
- char * Tcl_UniCharToUtfDString(CONST Tcl_UniChar *string, int numChars, \
- Tcl_DString *dsPtr)
+ CONST char * Tcl_UniCharToUtfDString(CONST Tcl_UniChar *string, \
+ int numChars, Tcl_DString *dsPtr)
}
declare 355 generic {
- Tcl_UniChar * Tcl_UtfToUniCharDString(CONST char *string, int length, \
- Tcl_DString *dsPtr)
+ CONST Tcl_UniChar * Tcl_UtfToUniCharDString(CONST char *string, \
+ int length, Tcl_DString *dsPtr)
}
declare 356 generic {
Tcl_RegExp Tcl_GetRegExpFromObj(Tcl_Interp *interp, Tcl_Obj *patObj, int flags)
diff --git a/generic/tclCmdMZ.c b/generic/tclCmdMZ.c
index fadd866..413d52f 100644
--- a/generic/tclCmdMZ.c
+++ b/generic/tclCmdMZ.c
@@ -13,7 +13,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclCmdMZ.c,v 1.53 2001/12/20 23:33:27 dgp Exp $
+ * RCS: @(#) $Id: tclCmdMZ.c,v 1.54 2002/01/17 03:03:11 dgp Exp $
*/
#include "tclInt.h"
@@ -2027,7 +2027,7 @@ Tcl_StringObjCmd(dummy, interp, objc, objv)
Tcl_SetObjLength(resultPtr, length1);
} else {
int first, last;
- char *start, *end;
+ CONST char *start, *end;
length1 = Tcl_NumUtfChars(string1, length1) - 1;
if (TclGetIntForIndex(interp, objv[3], length1,
@@ -2071,7 +2071,7 @@ Tcl_StringObjCmd(dummy, interp, objc, objv)
case STR_TRIM: {
Tcl_UniChar ch, trim;
- register char *p, *end;
+ register CONST char *p, *end;
char *check, *checkEnd;
int offset;
@@ -2160,7 +2160,7 @@ Tcl_StringObjCmd(dummy, interp, objc, objv)
case STR_WORDEND: {
int cur;
Tcl_UniChar ch;
- char *p, *end;
+ CONST char *p, *end;
int numChars;
if (objc != 4) {
@@ -2198,7 +2198,7 @@ Tcl_StringObjCmd(dummy, interp, objc, objv)
case STR_WORDSTART: {
int cur;
Tcl_UniChar ch;
- char *p;
+ CONST char *p;
int numChars;
if (objc != 4) {
diff --git a/generic/tclDecls.h b/generic/tclDecls.h
index 78bc4aa..f860487 100644
--- a/generic/tclDecls.h
+++ b/generic/tclDecls.h
@@ -8,7 +8,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclDecls.h,v 1.73 2002/01/17 02:43:19 dgp Exp $
+ * RCS: @(#) $Id: tclDecls.h,v 1.74 2002/01/17 03:03:11 dgp Exp $
*/
#ifndef _TCLDECLS
@@ -692,17 +692,18 @@ EXTERN void Tcl_RegisterObjType _ANSI_ARGS_((
Tcl_ObjType * typePtr));
/* 212 */
EXTERN Tcl_RegExp Tcl_RegExpCompile _ANSI_ARGS_((Tcl_Interp * interp,
- char * string));
+ CONST char * string));
/* 213 */
EXTERN int Tcl_RegExpExec _ANSI_ARGS_((Tcl_Interp * interp,
Tcl_RegExp regexp, CONST char * str,
CONST char * start));
/* 214 */
EXTERN int Tcl_RegExpMatch _ANSI_ARGS_((Tcl_Interp * interp,
- char * str, char * pattern));
+ CONST char * str, CONST char * pattern));
/* 215 */
EXTERN void Tcl_RegExpRange _ANSI_ARGS_((Tcl_RegExp regexp,
- int index, char ** startPtr, char ** endPtr));
+ int index, CONST char ** startPtr,
+ CONST char ** endPtr));
/* 216 */
EXTERN void Tcl_Release _ANSI_ARGS_((ClientData clientData));
/* 217 */
@@ -1041,7 +1042,7 @@ EXTERN Tcl_UniChar Tcl_UniCharToUpper _ANSI_ARGS_((int ch));
/* 324 */
EXTERN int Tcl_UniCharToUtf _ANSI_ARGS_((int ch, char * buf));
/* 325 */
-EXTERN char * Tcl_UtfAtIndex _ANSI_ARGS_((CONST char * src,
+EXTERN CONST char * Tcl_UtfAtIndex _ANSI_ARGS_((CONST char * src,
int index));
/* 326 */
EXTERN int Tcl_UtfCharComplete _ANSI_ARGS_((CONST char * src,
@@ -1050,15 +1051,15 @@ EXTERN int Tcl_UtfCharComplete _ANSI_ARGS_((CONST char * src,
EXTERN int Tcl_UtfBackslash _ANSI_ARGS_((CONST char * src,
int * readPtr, char * dst));
/* 328 */
-EXTERN char * Tcl_UtfFindFirst _ANSI_ARGS_((CONST char * src,
+EXTERN CONST char * Tcl_UtfFindFirst _ANSI_ARGS_((CONST char * src,
int ch));
/* 329 */
-EXTERN char * Tcl_UtfFindLast _ANSI_ARGS_((CONST char * src,
+EXTERN CONST char * Tcl_UtfFindLast _ANSI_ARGS_((CONST char * src,
int ch));
/* 330 */
-EXTERN char * Tcl_UtfNext _ANSI_ARGS_((CONST char * src));
+EXTERN CONST char * Tcl_UtfNext _ANSI_ARGS_((CONST char * src));
/* 331 */
-EXTERN char * Tcl_UtfPrev _ANSI_ARGS_((CONST char * src,
+EXTERN CONST char * Tcl_UtfPrev _ANSI_ARGS_((CONST char * src,
CONST char * start));
/* 332 */
EXTERN int Tcl_UtfToExternal _ANSI_ARGS_((Tcl_Interp * interp,
@@ -1111,16 +1112,16 @@ EXTERN int Tcl_UniCharIsUpper _ANSI_ARGS_((int ch));
/* 351 */
EXTERN int Tcl_UniCharIsWordChar _ANSI_ARGS_((int ch));
/* 352 */
-EXTERN int Tcl_UniCharLen _ANSI_ARGS_((Tcl_UniChar * str));
+EXTERN int Tcl_UniCharLen _ANSI_ARGS_((CONST Tcl_UniChar * str));
/* 353 */
EXTERN int Tcl_UniCharNcmp _ANSI_ARGS_((CONST Tcl_UniChar * cs,
CONST Tcl_UniChar * ct, unsigned long n));
/* 354 */
-EXTERN char * Tcl_UniCharToUtfDString _ANSI_ARGS_((
+EXTERN CONST char * Tcl_UniCharToUtfDString _ANSI_ARGS_((
CONST Tcl_UniChar * string, int numChars,
Tcl_DString * dsPtr));
/* 355 */
-EXTERN Tcl_UniChar * Tcl_UtfToUniCharDString _ANSI_ARGS_((
+EXTERN CONST Tcl_UniChar * Tcl_UtfToUniCharDString _ANSI_ARGS_((
CONST char * string, int length,
Tcl_DString * dsPtr));
/* 356 */
@@ -1784,10 +1785,10 @@ typedef struct TclStubs {
int (*tcl_RecordAndEvalObj) _ANSI_ARGS_((Tcl_Interp * interp, Tcl_Obj * cmdPtr, int flags)); /* 209 */
void (*tcl_RegisterChannel) _ANSI_ARGS_((Tcl_Interp * interp, Tcl_Channel chan)); /* 210 */
void (*tcl_RegisterObjType) _ANSI_ARGS_((Tcl_ObjType * typePtr)); /* 211 */
- Tcl_RegExp (*tcl_RegExpCompile) _ANSI_ARGS_((Tcl_Interp * interp, char * string)); /* 212 */
+ Tcl_RegExp (*tcl_RegExpCompile) _ANSI_ARGS_((Tcl_Interp * interp, CONST char * string)); /* 212 */
int (*tcl_RegExpExec) _ANSI_ARGS_((Tcl_Interp * interp, Tcl_RegExp regexp, CONST char * str, CONST char * start)); /* 213 */
- int (*tcl_RegExpMatch) _ANSI_ARGS_((Tcl_Interp * interp, char * str, char * pattern)); /* 214 */
- void (*tcl_RegExpRange) _ANSI_ARGS_((Tcl_RegExp regexp, int index, char ** startPtr, char ** endPtr)); /* 215 */
+ int (*tcl_RegExpMatch) _ANSI_ARGS_((Tcl_Interp * interp, CONST char * str, CONST char * pattern)); /* 214 */
+ void (*tcl_RegExpRange) _ANSI_ARGS_((Tcl_RegExp regexp, int index, CONST char ** startPtr, CONST char ** endPtr)); /* 215 */
void (*tcl_Release) _ANSI_ARGS_((ClientData clientData)); /* 216 */
void (*tcl_ResetResult) _ANSI_ARGS_((Tcl_Interp * interp)); /* 217 */
int (*tcl_ScanElement) _ANSI_ARGS_((CONST char * str, int * flagPtr)); /* 218 */
@@ -1897,13 +1898,13 @@ typedef struct TclStubs {
Tcl_UniChar (*tcl_UniCharToTitle) _ANSI_ARGS_((int ch)); /* 322 */
Tcl_UniChar (*tcl_UniCharToUpper) _ANSI_ARGS_((int ch)); /* 323 */
int (*tcl_UniCharToUtf) _ANSI_ARGS_((int ch, char * buf)); /* 324 */
- char * (*tcl_UtfAtIndex) _ANSI_ARGS_((CONST char * src, int index)); /* 325 */
+ CONST char * (*tcl_UtfAtIndex) _ANSI_ARGS_((CONST char * src, int index)); /* 325 */
int (*tcl_UtfCharComplete) _ANSI_ARGS_((CONST char * src, int len)); /* 326 */
int (*tcl_UtfBackslash) _ANSI_ARGS_((CONST char * src, int * readPtr, char * dst)); /* 327 */
- char * (*tcl_UtfFindFirst) _ANSI_ARGS_((CONST char * src, int ch)); /* 328 */
- char * (*tcl_UtfFindLast) _ANSI_ARGS_((CONST char * src, int ch)); /* 329 */
- char * (*tcl_UtfNext) _ANSI_ARGS_((CONST char * src)); /* 330 */
- char * (*tcl_UtfPrev) _ANSI_ARGS_((CONST char * src, CONST char * start)); /* 331 */
+ CONST char * (*tcl_UtfFindFirst) _ANSI_ARGS_((CONST char * src, int ch)); /* 328 */
+ CONST char * (*tcl_UtfFindLast) _ANSI_ARGS_((CONST char * src, int ch)); /* 329 */
+ CONST char * (*tcl_UtfNext) _ANSI_ARGS_((CONST char * src)); /* 330 */
+ CONST char * (*tcl_UtfPrev) _ANSI_ARGS_((CONST char * src, CONST char * start)); /* 331 */
int (*tcl_UtfToExternal) _ANSI_ARGS_((Tcl_Interp * interp, Tcl_Encoding encoding, CONST char * src, int srcLen, int flags, Tcl_EncodingState * statePtr, char * dst, int dstLen, int * srcReadPtr, int * dstWrotePtr, int * dstCharsPtr)); /* 332 */
char * (*tcl_UtfToExternalDString) _ANSI_ARGS_((Tcl_Encoding encoding, CONST char * src, int srcLen, Tcl_DString * dsPtr)); /* 333 */
int (*tcl_UtfToLower) _ANSI_ARGS_((char * src)); /* 334 */
@@ -1924,10 +1925,10 @@ typedef struct TclStubs {
int (*tcl_UniCharIsSpace) _ANSI_ARGS_((int ch)); /* 349 */
int (*tcl_UniCharIsUpper) _ANSI_ARGS_((int ch)); /* 350 */
int (*tcl_UniCharIsWordChar) _ANSI_ARGS_((int ch)); /* 351 */
- int (*tcl_UniCharLen) _ANSI_ARGS_((Tcl_UniChar * str)); /* 352 */
+ int (*tcl_UniCharLen) _ANSI_ARGS_((CONST Tcl_UniChar * str)); /* 352 */
int (*tcl_UniCharNcmp) _ANSI_ARGS_((CONST Tcl_UniChar * cs, CONST Tcl_UniChar * ct, unsigned long n)); /* 353 */
- char * (*tcl_UniCharToUtfDString) _ANSI_ARGS_((CONST Tcl_UniChar * string, int numChars, Tcl_DString * dsPtr)); /* 354 */
- Tcl_UniChar * (*tcl_UtfToUniCharDString) _ANSI_ARGS_((CONST char * string, int length, Tcl_DString * dsPtr)); /* 355 */
+ CONST char * (*tcl_UniCharToUtfDString) _ANSI_ARGS_((CONST Tcl_UniChar * string, int numChars, Tcl_DString * dsPtr)); /* 354 */
+ CONST Tcl_UniChar * (*tcl_UtfToUniCharDString) _ANSI_ARGS_((CONST char * string, int length, Tcl_DString * dsPtr)); /* 355 */
Tcl_RegExp (*tcl_GetRegExpFromObj) _ANSI_ARGS_((Tcl_Interp * interp, Tcl_Obj * patObj, int flags)); /* 356 */
Tcl_Obj * (*tcl_EvalTokens) _ANSI_ARGS_((Tcl_Interp * interp, Tcl_Token * tokenPtr, int count)); /* 357 */
void (*tcl_FreeParse) _ANSI_ARGS_((Tcl_Parse * parsePtr)); /* 358 */
diff --git a/generic/tclFileName.c b/generic/tclFileName.c
index 5833135..d29b25c 100644
--- a/generic/tclFileName.c
+++ b/generic/tclFileName.c
@@ -10,7 +10,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclFileName.c,v 1.25 2001/10/16 05:31:18 dgp Exp $
+ * RCS: @(#) $Id: tclFileName.c,v 1.26 2002/01/17 03:03:11 dgp Exp $
*/
#include "tclInt.h"
@@ -382,7 +382,7 @@ TclpGetNativePathType(pathObjPtr, driveNameLengthPtr, driveNameRef)
if (!Tcl_RegExpExec(NULL, re, path, path)) {
type = TCL_PATH_RELATIVE;
} else {
- char *root, *end;
+ CONST char *root, *end;
Tcl_RegExpRange(re, 2, &root, &end);
if (root != NULL) {
type = TCL_PATH_RELATIVE;
@@ -814,7 +814,7 @@ SplitMacPath(path)
re = Tcl_GetRegExpFromObj(NULL, tsdPtr->macRootPatternPtr, REG_ADVANCED);
if (Tcl_RegExpExec(NULL, re, path, path) == 1) {
- char *start, *end;
+ CONST char *start, *end;
Tcl_Obj *nextElt;
/*
diff --git a/generic/tclIO.c b/generic/tclIO.c
index 02d966b..aa72bb3 100644
--- a/generic/tclIO.c
+++ b/generic/tclIO.c
@@ -10,7 +10,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclIO.c,v 1.45 2002/01/15 21:19:07 dgp Exp $
+ * RCS: @(#) $Id: tclIO.c,v 1.46 2002/01/17 03:03:12 dgp Exp $
*/
#include "tclInt.h"
@@ -4707,7 +4707,7 @@ ReadChars(statePtr, objPtr, charsToRead, offsetPtr, factorPtr)
* Got too many chars.
*/
- char *eof;
+ CONST char *eof;
eof = Tcl_UtfAtIndex(dst, toRead);
statePtr->inputEncodingState = oldState;
diff --git a/generic/tclInt.decls b/generic/tclInt.decls
index f0e04ef..f3cb1d9 100644
--- a/generic/tclInt.decls
+++ b/generic/tclInt.decls
@@ -12,7 +12,7 @@
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#
-# RCS: @(#) $Id: tclInt.decls,v 1.41 2002/01/15 21:19:07 dgp Exp $
+# RCS: @(#) $Id: tclInt.decls,v 1.42 2002/01/17 03:03:12 dgp Exp $
library tcl
@@ -604,7 +604,7 @@ declare 153 generic {
#}
declare 156 generic {
- void TclRegError (Tcl_Interp *interp, char *msg, \
+ void TclRegError (Tcl_Interp *interp, CONST char *msg, \
int status)
}
declare 157 generic {
diff --git a/generic/tclIntDecls.h b/generic/tclIntDecls.h
index 686cdd9..6de0c22 100644
--- a/generic/tclIntDecls.h
+++ b/generic/tclIntDecls.h
@@ -11,7 +11,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclIntDecls.h,v 1.34 2002/01/15 21:19:07 dgp Exp $
+ * RCS: @(#) $Id: tclIntDecls.h,v 1.35 2002/01/17 03:03:12 dgp Exp $
*/
#ifndef _TCLINTDECLS
@@ -471,7 +471,7 @@ EXTERN Tcl_Obj * TclGetLibraryPath _ANSI_ARGS_((void));
/* Slot 155 is reserved */
/* 156 */
EXTERN void TclRegError _ANSI_ARGS_((Tcl_Interp * interp,
- char * msg, int status));
+ CONST char * msg, int status));
/* 157 */
EXTERN Var * TclVarTraceExists _ANSI_ARGS_((Tcl_Interp * interp,
char * varName));
@@ -695,7 +695,7 @@ typedef struct TclIntStubs {
Tcl_Obj * (*tclGetLibraryPath) _ANSI_ARGS_((void)); /* 153 */
void *reserved154;
void *reserved155;
- void (*tclRegError) _ANSI_ARGS_((Tcl_Interp * interp, char * msg, int status)); /* 156 */
+ void (*tclRegError) _ANSI_ARGS_((Tcl_Interp * interp, CONST char * msg, int status)); /* 156 */
Var * (*tclVarTraceExists) _ANSI_ARGS_((Tcl_Interp * interp, char * varName)); /* 157 */
void (*tclSetStartupScriptFileName) _ANSI_ARGS_((CONST char * filename)); /* 158 */
CONST char * (*tclGetStartupScriptFileName) _ANSI_ARGS_((void)); /* 159 */
diff --git a/generic/tclRegexp.c b/generic/tclRegexp.c
index 37900f5..3722278 100644
--- a/generic/tclRegexp.c
+++ b/generic/tclRegexp.c
@@ -10,7 +10,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclRegexp.c,v 1.13 2001/10/16 05:31:19 dgp Exp $
+ * RCS: @(#) $Id: tclRegexp.c,v 1.14 2002/01/17 03:03:12 dgp Exp $
*/
#include "tclInt.h"
@@ -88,7 +88,7 @@ static Tcl_ThreadDataKey dataKey;
*/
static TclRegexp * CompileRegexp _ANSI_ARGS_((Tcl_Interp *interp,
- char *pattern, int length, int flags));
+ CONST char *pattern, int length, int flags));
static void DupRegexpInternalRep _ANSI_ARGS_((Tcl_Obj *srcPtr,
Tcl_Obj *copyPtr));
static void FinalizeRegexp _ANSI_ARGS_((ClientData clientData));
@@ -141,7 +141,7 @@ Tcl_RegExp
Tcl_RegExpCompile(interp, string)
Tcl_Interp *interp; /* For use in error reporting and
* to access the interp regexp cache. */
- char *string; /* String for which to produce
+ CONST char *string; /* String for which to produce
* compiled regular expression. */
{
return (Tcl_RegExp) CompileRegexp(interp, string, (int) strlen(string),
@@ -183,7 +183,7 @@ Tcl_RegExpExec(interp, re, string, start)
int flags, result, numChars;
TclRegexp *regexp = (TclRegexp *)re;
Tcl_DString ds;
- Tcl_UniChar *ustr;
+ CONST Tcl_UniChar *ustr;
/*
* If the starting point is offset from the beginning of the buffer,
@@ -243,9 +243,9 @@ Tcl_RegExpRange(re, index, startPtr, endPtr)
int index; /* 0 means give the range of the entire
* match, > 0 means give the range of
* a matching subrange. */
- char **startPtr; /* Store address of first character in
+ CONST char **startPtr; /* Store address of first character in
* (sub-) range here. */
- char **endPtr; /* Store address of character just after last
+ CONST char **endPtr; /* Store address of character just after last
* in (sub-) range here. */
{
TclRegexp *regexpPtr = (TclRegexp *) re;
@@ -398,8 +398,8 @@ TclRegExpRangeUniChar(re, index, startPtr, endPtr)
int
Tcl_RegExpMatch(interp, string, pattern)
Tcl_Interp *interp; /* Used for error reporting. May be NULL. */
- char *string; /* String. */
- char *pattern; /* Regular expression to match against
+ CONST char *string; /* String. */
+ CONST char *pattern; /* Regular expression to match against
* string. */
{
Tcl_RegExp re;
@@ -696,7 +696,7 @@ TclRegAbout(interp, re)
void
TclRegError(interp, msg, status)
Tcl_Interp *interp; /* Interpreter for error reporting. */
- char *msg; /* Message to prepend to error. */
+ CONST char *msg; /* Message to prepend to error. */
int status; /* Status code to report. */
{
char buf[100]; /* ample in practice */
@@ -831,12 +831,12 @@ SetRegexpFromAny(interp, objPtr)
static TclRegexp *
CompileRegexp(interp, string, length, flags)
Tcl_Interp *interp; /* Used for error reporting if not NULL. */
- char *string; /* The regexp to compile (UTF-8). */
+ CONST char *string; /* The regexp to compile (UTF-8). */
int length; /* The length of the string in bytes. */
int flags; /* Compilation flags. */
{
TclRegexp *regexpPtr;
- Tcl_UniChar *uniString;
+ CONST Tcl_UniChar *uniString;
int numChars;
Tcl_DString stringBuf;
int status, i;
diff --git a/generic/tclUtf.c b/generic/tclUtf.c
index 5bdf557..d8b6565 100644
--- a/generic/tclUtf.c
+++ b/generic/tclUtf.c
@@ -8,7 +8,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclUtf.c,v 1.20 2002/01/02 13:52:04 dkf Exp $
+ * RCS: @(#) $Id: tclUtf.c,v 1.21 2002/01/17 03:03:12 dgp Exp $
*/
#include "tclInt.h"
@@ -231,7 +231,7 @@ Tcl_UniCharToUtf(ch, str)
*---------------------------------------------------------------------------
*/
-char *
+CONST char *
Tcl_UniCharToUtfDString(wString, numChars, dsPtr)
CONST Tcl_UniChar *wString; /* Unicode string to convert to UTF-8. */
int numChars; /* Length of Unicode string in Tcl_UniChars
@@ -393,7 +393,7 @@ Tcl_UtfToUniChar(str, chPtr)
*---------------------------------------------------------------------------
*/
-Tcl_UniChar *
+CONST Tcl_UniChar *
Tcl_UtfToUniCharDString(string, length, dsPtr)
CONST char *string; /* UTF-8 string to convert to Unicode. */
int length; /* Length of UTF-8 string in bytes, or -1
@@ -536,7 +536,7 @@ Tcl_NumUtfChars(str, len)
*
*---------------------------------------------------------------------------
*/
-char *
+CONST char *
Tcl_UtfFindFirst(string, ch)
CONST char *string; /* The UTF-8 string to be searched. */
int ch; /* The Tcl_UniChar to search for. */
@@ -547,7 +547,7 @@ Tcl_UtfFindFirst(string, ch)
while (1) {
len = Tcl_UtfToUniChar(string, &find);
if (find == ch) {
- return (char *) string;
+ return string;
}
if (*string == '\0') {
return NULL;
@@ -576,7 +576,7 @@ Tcl_UtfFindFirst(string, ch)
*---------------------------------------------------------------------------
*/
-char *
+CONST char *
Tcl_UtfFindLast(string, ch)
CONST char *string; /* The UTF-8 string to be searched. */
int ch; /* The Tcl_UniChar to search for. */
@@ -596,7 +596,7 @@ Tcl_UtfFindLast(string, ch)
}
string += len;
}
- return (char *) last;
+ return last;
}
/*
@@ -619,13 +619,13 @@ Tcl_UtfFindLast(string, ch)
*---------------------------------------------------------------------------
*/
-char *
+CONST char *
Tcl_UtfNext(str)
CONST char *str; /* The current location in the string. */
{
Tcl_UniChar ch;
- return (char *) str + Tcl_UtfToUniChar(str, &ch);
+ return str + Tcl_UtfToUniChar(str, &ch);
}
/*
@@ -649,7 +649,7 @@ Tcl_UtfNext(str)
*---------------------------------------------------------------------------
*/
-char *
+CONST char *
Tcl_UtfPrev(str, start)
CONST char *str; /* The current location in the string. */
CONST char *start; /* Pointer to the beginning of the
@@ -677,7 +677,7 @@ Tcl_UtfPrev(str, start)
}
look--;
}
- return (char *) str;
+ return str;
}
/*
@@ -728,7 +728,7 @@ Tcl_UniCharAtIndex(src, index)
*---------------------------------------------------------------------------
*/
-char *
+CONST char *
Tcl_UtfAtIndex(src, index)
register CONST char *src; /* The UTF-8 string. */
register int index; /* The position of the desired character. */
@@ -739,7 +739,7 @@ Tcl_UtfAtIndex(src, index)
index--;
src += Tcl_UtfToUniChar(src, &ch);
}
- return (char *) src;
+ return src;
}
/*
@@ -1272,7 +1272,7 @@ Tcl_UniCharToTitle(ch)
int
Tcl_UniCharLen(str)
- Tcl_UniChar *str; /* Unicode string to find length of. */
+ CONST Tcl_UniChar *str; /* Unicode string to find length of. */
{
int len = 0;
diff --git a/mac/tclMacLoad.c b/mac/tclMacLoad.c
index b12c057..9dd32be 100644
--- a/mac/tclMacLoad.c
+++ b/mac/tclMacLoad.c
@@ -10,7 +10,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclMacLoad.c,v 1.9 2002/01/09 19:09:28 kennykb Exp $
+ * RCS: @(#) $Id: tclMacLoad.c,v 1.10 2002/01/17 03:03:12 dgp Exp $
*/
#include <CodeFragments.h>
@@ -140,8 +140,9 @@ TclpLoadFile(
/*
* First thing we must do is infer the package name from the sym1
- * variable. This is kind of dumb since the caller actually knows
- * this value, it just doesn't give it to us.
+ * variable (by removing the "_Init" suffix). This is kind of dumb
+ * since the caller actually knows this value, it just doesn't give
+ * it to us.
*/
native = Tcl_UtfToExternalDString(NULL, sym1, -1, &ds);
native[strlen(native) - 5] = 0;
diff --git a/win/tclWinFile.c b/win/tclWinFile.c
index d64c833..cf2ff04 100644
--- a/win/tclWinFile.c
+++ b/win/tclWinFile.c
@@ -11,7 +11,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclWinFile.c,v 1.19 2001/11/19 17:45:13 vincentdarley Exp $
+ * RCS: @(#) $Id: tclWinFile.c,v 1.20 2002/01/17 03:03:12 dgp Exp $
*/
#include "tclWinInt.h"
@@ -499,7 +499,8 @@ TclpGetUserHome(name, bufferPtr)
Tcl_DString ds;
int nameLen, badDomain;
char *domain;
- WCHAR *wName, *wHomeDir, *wDomain;
+ CONST WCHAR *wName;
+ WCHAR *wHomeDir, *wDomain;
WCHAR buf[MAX_PATH];
badDomain = 0;