summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2019-05-31 12:37:16 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2019-05-31 12:37:16 (GMT)
commit2ed71e62a0e1b2fc0b0dca264ffa417ba2d9b159 (patch)
treeb84707f19c2ee6857f6a3bb99d1d9055b539cb16
parentd988f34ccf70a6f52475399257c185748fc019aa (diff)
parenta8f9285bd0caab44eabbdac73de5bfb58cb35cb3 (diff)
downloadtcl-2ed71e62a0e1b2fc0b0dca264ffa417ba2d9b159.zip
tcl-2ed71e62a0e1b2fc0b0dca264ffa417ba2d9b159.tar.gz
tcl-2ed71e62a0e1b2fc0b0dca264ffa417ba2d9b159.tar.bz2
Merge 8.7
-rw-r--r--doc/IntObj.317
-rw-r--r--generic/tcl.decls5
-rw-r--r--generic/tclDecls.h7
-rw-r--r--generic/tclInt.decls9
-rw-r--r--generic/tclInt.h4
-rw-r--r--generic/tclIntDecls.h10
-rw-r--r--generic/tclStubInit.c3
-rw-r--r--generic/tclUtil.c6
8 files changed, 43 insertions, 18 deletions
diff --git a/doc/IntObj.3 b/doc/IntObj.3
index 6d5ee69..e793303 100644
--- a/doc/IntObj.3
+++ b/doc/IntObj.3
@@ -8,7 +8,7 @@
.so man.macros
.BS
.SH NAME
-Tcl_NewIntObj, Tcl_NewLongObj, Tcl_NewWideIntObj, Tcl_SetIntObj, Tcl_SetLongObj, Tcl_SetWideIntObj, Tcl_GetIntFromObj, Tcl_GetLongFromObj, Tcl_GetWideIntFromObj, Tcl_NewBignumObj, Tcl_SetBignumObj, Tcl_GetBignumFromObj, Tcl_TakeBignumFromObj \- manipulate Tcl values as integers
+Tcl_NewIntObj, Tcl_NewLongObj, Tcl_NewWideIntObj, Tcl_SetIntObj, Tcl_SetLongObj, Tcl_SetWideIntObj, Tcl_GetIntFromObj, Tcl_GetIntForIndex, Tcl_GetLongFromObj, Tcl_GetWideIntFromObj, Tcl_NewBignumObj, Tcl_SetBignumObj, Tcl_GetBignumFromObj, Tcl_TakeBignumFromObj \- manipulate Tcl values as integers
.SH SYNOPSIS
.nf
\fB#include <tcl.h>\fR
@@ -32,6 +32,9 @@ int
\fBTcl_GetIntFromObj\fR(\fIinterp, objPtr, intPtr\fR)
.sp
int
+\fBTcl_GetIntForIndex\fR(\fIinterp, objPtr, endValue, intPtr\fR)
+.sp
+int
\fBTcl_GetLongFromObj\fR(\fIinterp, objPtr, longPtr\fR)
.sp
int
@@ -55,6 +58,8 @@ int
\fBTcl_InitBignumFromDouble\fR(\fIinterp, doubleValue, bigValue\fR)
.SH ARGUMENTS
.AS Tcl_WideInt doubleValue in/out
+.AP int endValue in
+\fBTcl_GetIntForIndex\fR will return this when the input value is "end".
.AP int intValue in
Integer value used to initialize or set a Tcl value.
.AP long longValue in
@@ -115,6 +120,16 @@ violates Tcl's copy-on-write policy. Any existing string representation
or internal representation in the unshared Tcl value will be freed
as a consequence of setting the new value.
.PP
+The \fBTcl_GetIntForIndex\fR routine attempts to retrieve an index
+value from the Tcl value \fIobjPtr\fR. If the attempt succeeds,
+then \fBTCL_OK\fR is returned, and the value is written to the
+storage provided by the caller. The attempt might fail if
+\fIobjPtr\fR does not hold an index value. If the attempt fails,
+then \fBTCL_ERROR\fR is returned, and if \fIinterp\fR is non-NULL,
+an error message is left in \fIinterp\fR. The \fBTcl_ObjType\fR
+of \fIobjPtr\fR may be changed to make subsequent calls to the
+same routine more efficient.
+.PP
The \fBTcl_GetIntFromObj\fR, \fBTcl_GetLongFromObj\fR,
\fBTcl_GetWideIntFromObj\fR, \fBTcl_GetBignumFromObj\fR, and
\fBTcl_TakeBignumFromObj\fR routines attempt to retrieve an integral
diff --git a/generic/tcl.decls b/generic/tcl.decls
index 3dbbcb7..6cf7e36 100644
--- a/generic/tcl.decls
+++ b/generic/tcl.decls
@@ -2439,6 +2439,11 @@ declare 644 {
int type, size_t size)
}
+declare 645 {
+ int Tcl_GetIntForIndex(Tcl_Interp *interp, Tcl_Obj *objPtr,
+ size_t endValue, size_t *indexPtr)
+}
+
# ----- BASELINE -- FOR -- 8.7.0 ----- #
##############################################################################
diff --git a/generic/tclDecls.h b/generic/tclDecls.h
index c912868..35ad3fa 100644
--- a/generic/tclDecls.h
+++ b/generic/tclDecls.h
@@ -1753,6 +1753,10 @@ EXTERN int Tcl_IsShared(Tcl_Obj *objPtr);
EXTERN int Tcl_LinkArray(Tcl_Interp *interp,
const char *varName, void *addr, int type,
size_t size);
+/* 645 */
+EXTERN int Tcl_GetIntForIndex(Tcl_Interp *interp,
+ Tcl_Obj *objPtr, size_t endValue,
+ size_t *indexPtr);
typedef struct {
const struct TclPlatStubs *tclPlatStubs;
@@ -2433,6 +2437,7 @@ typedef struct TclStubs {
void (*tcl_DecrRefCount) (Tcl_Obj *objPtr); /* 642 */
int (*tcl_IsShared) (Tcl_Obj *objPtr); /* 643 */
int (*tcl_LinkArray) (Tcl_Interp *interp, const char *varName, void *addr, int type, size_t size); /* 644 */
+ int (*tcl_GetIntForIndex) (Tcl_Interp *interp, Tcl_Obj *objPtr, size_t endValue, size_t *indexPtr); /* 645 */
} TclStubs;
extern const TclStubs *tclStubsPtr;
@@ -3699,6 +3704,8 @@ extern const TclStubs *tclStubsPtr;
(tclStubsPtr->tcl_IsShared) /* 643 */
#define Tcl_LinkArray \
(tclStubsPtr->tcl_LinkArray) /* 644 */
+#define Tcl_GetIntForIndex \
+ (tclStubsPtr->tcl_GetIntForIndex) /* 645 */
#endif /* defined(USE_TCL_STUBS) */
diff --git a/generic/tclInt.decls b/generic/tclInt.decls
index 6dc748b..2a66d18 100644
--- a/generic/tclInt.decls
+++ b/generic/tclInt.decls
@@ -152,10 +152,11 @@ declare 32 {
#declare 33 {
# TclCmdProcType TclGetInterpProc(void)
#}
-declare 34 {
- int TclGetIntForIndex(Tcl_Interp *interp, Tcl_Obj *objPtr,
- size_t endValue, size_t *indexPtr)
-}
+# Removed in 9.0:
+#declare 34 {deprecated {Use Tcl_GetIntForIndex}} {
+# int TclGetIntForIndex(Tcl_Interp *interp, Tcl_Obj *objPtr,
+# int endValue, int *indexPtr)
+#}
# Removed in 8.4b2:
#declare 35 {
# Tcl_Obj *TclGetIndexedScalar(Tcl_Interp *interp, int localIndex,
diff --git a/generic/tclInt.h b/generic/tclInt.h
index 389b5da..6f61f1a 100644
--- a/generic/tclInt.h
+++ b/generic/tclInt.h
@@ -2413,7 +2413,7 @@ typedef struct List {
/*
* Macros providing a faster path to booleans and integers:
* Tcl_GetBooleanFromObj, Tcl_GetLongFromObj, Tcl_GetIntFromObj
- * and TclGetIntForIndex.
+ * and Tcl_GetIntForIndex.
*
* WARNING: these macros eval their args more than once.
*/
@@ -2449,7 +2449,7 @@ typedef struct List {
&& (objPtr)->internalRep.wideValue <= (Tcl_WideInt)(INT_MAX)) \
? ((*(idxPtr) = ((objPtr)->internalRep.wideValue >= 0) \
? (size_t)(objPtr)->internalRep.wideValue : TCL_INDEX_NONE), TCL_OK) \
- : TclGetIntForIndex((interp), (objPtr), (endValue), (idxPtr)))
+ : Tcl_GetIntForIndex((interp), (objPtr), (endValue), (idxPtr)))
/*
* Macro used to save a function call for common uses of
diff --git a/generic/tclIntDecls.h b/generic/tclIntDecls.h
index ec86071..2d4817b 100644
--- a/generic/tclIntDecls.h
+++ b/generic/tclIntDecls.h
@@ -108,10 +108,7 @@ EXTERN const char * TclGetExtension(const char *name);
EXTERN int TclGetFrame(Tcl_Interp *interp, const char *str,
CallFrame **framePtrPtr);
/* Slot 33 is reserved */
-/* 34 */
-EXTERN int TclGetIntForIndex(Tcl_Interp *interp,
- Tcl_Obj *objPtr, size_t endValue,
- size_t *indexPtr);
+/* Slot 34 is reserved */
/* Slot 35 is reserved */
/* Slot 36 is reserved */
/* 37 */
@@ -625,7 +622,7 @@ typedef struct TclIntStubs {
const char * (*tclGetExtension) (const char *name); /* 31 */
int (*tclGetFrame) (Tcl_Interp *interp, const char *str, CallFrame **framePtrPtr); /* 32 */
void (*reserved33)(void);
- int (*tclGetIntForIndex) (Tcl_Interp *interp, Tcl_Obj *objPtr, size_t endValue, size_t *indexPtr); /* 34 */
+ void (*reserved34)(void);
void (*reserved35)(void);
void (*reserved36)(void);
int (*tclGetLoadedPackages) (Tcl_Interp *interp, const char *targetName); /* 37 */
@@ -915,8 +912,7 @@ extern const TclIntStubs *tclIntStubsPtr;
#define TclGetFrame \
(tclIntStubsPtr->tclGetFrame) /* 32 */
/* Slot 33 is reserved */
-#define TclGetIntForIndex \
- (tclIntStubsPtr->tclGetIntForIndex) /* 34 */
+/* Slot 34 is reserved */
/* Slot 35 is reserved */
/* Slot 36 is reserved */
#define TclGetLoadedPackages \
diff --git a/generic/tclStubInit.c b/generic/tclStubInit.c
index 78b7dd5..493d56f 100644
--- a/generic/tclStubInit.c
+++ b/generic/tclStubInit.c
@@ -234,7 +234,7 @@ static const TclIntStubs tclIntStubs = {
TclGetExtension, /* 31 */
TclGetFrame, /* 32 */
0, /* 33 */
- TclGetIntForIndex, /* 34 */
+ 0, /* 34 */
0, /* 35 */
0, /* 36 */
TclGetLoadedPackages, /* 37 */
@@ -1339,6 +1339,7 @@ const TclStubs tclStubs = {
Tcl_DecrRefCount, /* 642 */
Tcl_IsShared, /* 643 */
Tcl_LinkArray, /* 644 */
+ Tcl_GetIntForIndex, /* 645 */
};
/* !END!: Do not edit above this line. */
diff --git a/generic/tclUtil.c b/generic/tclUtil.c
index 9791e26..7373085 100644
--- a/generic/tclUtil.c
+++ b/generic/tclUtil.c
@@ -114,7 +114,7 @@ static int FindElement(Tcl_Interp *interp, const char *string,
/*
* The following is the Tcl object type definition for an object that
* represents a list index in the form, "end-offset". It is used as a
- * performance optimization in TclGetIntForIndex. The internal rep is
+ * performance optimization in Tcl_GetIntForIndex. The internal rep is
* stored directly in the wideValue, so no memory management is required
* for it. This is a caching intrep, keeping the result of a parse
* around. This type is only created from a pre-existing string, so an
@@ -3562,7 +3562,7 @@ GetWideForIndex(
/*
*----------------------------------------------------------------------
*
- * TclGetIntForIndex --
+ * Tcl_GetIntForIndex --
*
* Provides an integer corresponding to the list index held in a Tcl
* object. The string value 'objPtr' is expected have the format
@@ -3589,7 +3589,7 @@ GetWideForIndex(
*/
int
-TclGetIntForIndex(
+Tcl_GetIntForIndex(
Tcl_Interp *interp, /* Interpreter to use for error reporting. If
* NULL, then no error message is left after
* errors. */