From bbcbb88d883dcc18f919fea1bf078fb8168cfcba Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Wed, 15 May 2019 15:18:22 +0000 Subject: Add documentation, don't overwrite earlier stub entry! --- doc/IntObj.3 | 17 ++++++++++++++++- generic/tcl.decls | 2 +- generic/tclDecls.h | 17 ++++++++++++----- generic/tclStubInit.c | 3 ++- 4 files changed, 31 insertions(+), 8 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 \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 9011ea7..19672a7 100644 --- a/generic/tcl.decls +++ b/generic/tcl.decls @@ -2385,7 +2385,7 @@ declare 644 { int type, int size) } -declare 635 { +declare 645 { int Tcl_GetIntForIndex(Tcl_Interp *interp, Tcl_Obj *objPtr, int endValue, int *indexPtr) } diff --git a/generic/tclDecls.h b/generic/tclDecls.h index 0e5ca24..3f39cd5 100644 --- a/generic/tclDecls.h +++ b/generic/tclDecls.h @@ -1874,8 +1874,9 @@ EXTERN int TclZipfs_Unmount(Tcl_Interp *interp, /* 634 */ EXTERN Tcl_Obj * TclZipfs_TclLibrary(void); /* 635 */ -EXTERN int Tcl_GetIntForIndex(Tcl_Interp *interp, - Tcl_Obj *objPtr, int endValue, int *indexPtr); +EXTERN int TclZipfs_MountBuffer(Tcl_Interp *interp, + const char *mountPoint, unsigned char *data, + size_t datalen, int copy); /* 636 */ EXTERN void Tcl_FreeIntRep(Tcl_Obj *objPtr); /* 637 */ @@ -1900,6 +1901,9 @@ EXTERN int Tcl_IsShared(Tcl_Obj *objPtr); EXTERN int Tcl_LinkArray(Tcl_Interp *interp, const char *varName, void *addr, int type, int size); +/* 645 */ +EXTERN int Tcl_GetIntForIndex(Tcl_Interp *interp, + Tcl_Obj *objPtr, int endValue, int *indexPtr); typedef struct { const struct TclPlatStubs *tclPlatStubs; @@ -2570,7 +2574,7 @@ typedef struct TclStubs { int (*tclZipfs_Mount) (Tcl_Interp *interp, const char *mountPoint, const char *zipname, const char *passwd); /* 632 */ int (*tclZipfs_Unmount) (Tcl_Interp *interp, const char *mountPoint); /* 633 */ Tcl_Obj * (*tclZipfs_TclLibrary) (void); /* 634 */ - int (*tcl_GetIntForIndex) (Tcl_Interp *interp, Tcl_Obj *objPtr, int endValue, int *indexPtr); /* 635 */ + int (*tclZipfs_MountBuffer) (Tcl_Interp *interp, const char *mountPoint, unsigned char *data, size_t datalen, int copy); /* 635 */ void (*tcl_FreeIntRep) (Tcl_Obj *objPtr); /* 636 */ char * (*tcl_InitStringRep) (Tcl_Obj *objPtr, const char *bytes, unsigned int numBytes); /* 637 */ Tcl_ObjIntRep * (*tcl_FetchIntRep) (Tcl_Obj *objPtr, const Tcl_ObjType *typePtr); /* 638 */ @@ -2580,6 +2584,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, int size); /* 644 */ + int (*tcl_GetIntForIndex) (Tcl_Interp *interp, Tcl_Obj *objPtr, int endValue, int *indexPtr); /* 645 */ } TclStubs; extern const TclStubs *tclStubsPtr; @@ -3880,8 +3885,8 @@ extern const TclStubs *tclStubsPtr; (tclStubsPtr->tclZipfs_Unmount) /* 633 */ #define TclZipfs_TclLibrary \ (tclStubsPtr->tclZipfs_TclLibrary) /* 634 */ -#define Tcl_GetIntForIndex \ - (tclStubsPtr->tcl_GetIntForIndex) /* 635 */ +#define TclZipfs_MountBuffer \ + (tclStubsPtr->tclZipfs_MountBuffer) /* 635 */ #define Tcl_FreeIntRep \ (tclStubsPtr->tcl_FreeIntRep) /* 636 */ #define Tcl_InitStringRep \ @@ -3900,6 +3905,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/tclStubInit.c b/generic/tclStubInit.c index 2a3212c..987a59d 100644 --- a/generic/tclStubInit.c +++ b/generic/tclStubInit.c @@ -1623,7 +1623,7 @@ const TclStubs tclStubs = { TclZipfs_Mount, /* 632 */ TclZipfs_Unmount, /* 633 */ TclZipfs_TclLibrary, /* 634 */ - Tcl_GetIntForIndex, /* 635 */ + TclZipfs_MountBuffer, /* 635 */ Tcl_FreeIntRep, /* 636 */ Tcl_InitStringRep, /* 637 */ Tcl_FetchIntRep, /* 638 */ @@ -1633,6 +1633,7 @@ const TclStubs tclStubs = { Tcl_DecrRefCount, /* 642 */ Tcl_IsShared, /* 643 */ Tcl_LinkArray, /* 644 */ + Tcl_GetIntForIndex, /* 645 */ }; /* !END!: Do not edit above this line. */ -- cgit v0.12