diff options
author | dgp <dgp@users.sourceforge.net> | 2021-01-15 21:46:54 (GMT) |
---|---|---|
committer | dgp <dgp@users.sourceforge.net> | 2021-01-15 21:46:54 (GMT) |
commit | 3d5d443c72f5b384643fecf9bdaa1c20800261bd (patch) | |
tree | 56c4d265fdc9fc6f49860bab2f4822447ffdf855 /generic/tclDecls.h | |
parent | d56c55457797cecd40ae706ddd0476f26e76b3ba (diff) | |
parent | 089b9970444fbf3410572b30650c80fc75bdda82 (diff) | |
download | tcl-3d5d443c72f5b384643fecf9bdaa1c20800261bd.zip tcl-3d5d443c72f5b384643fecf9bdaa1c20800261bd.tar.gz tcl-3d5d443c72f5b384643fecf9bdaa1c20800261bd.tar.bz2 |
Merge TIP 481 (resolve conflicts)
Diffstat (limited to 'generic/tclDecls.h')
-rw-r--r-- | generic/tclDecls.h | 47 |
1 files changed, 45 insertions, 2 deletions
diff --git a/generic/tclDecls.h b/generic/tclDecls.h index 69d8e66..4e7f3f8b 100644 --- a/generic/tclDecls.h +++ b/generic/tclDecls.h @@ -1923,6 +1923,16 @@ EXTERN int * Tcl_UtfToUniCharDString(const char *src, int length, /* 649 */ EXTERN unsigned char * Tcl_GetBytesFromObj(Tcl_Interp *interp, Tcl_Obj *objPtr, int *lengthPtr); +/* Slot 650 is reserved */ +/* 651 */ +EXTERN char * TclGetStringFromObj(Tcl_Obj *objPtr, + size_t *lengthPtr); +/* 652 */ +EXTERN Tcl_UniChar * TclGetUnicodeFromObj(Tcl_Obj *objPtr, + size_t *lengthPtr); +/* 653 */ +EXTERN unsigned char * TclGetByteArrayFromObj(Tcl_Obj *objPtr, + size_t *lengthPtr); typedef struct { const struct TclPlatStubs *tclPlatStubs; @@ -2608,6 +2618,10 @@ typedef struct TclStubs { char * (*tcl_UniCharToUtfDString) (const int *uniStr, int uniLength, Tcl_DString *dsPtr); /* 647 */ int * (*tcl_UtfToUniCharDString) (const char *src, int length, Tcl_DString *dsPtr); /* 648 */ unsigned char * (*tcl_GetBytesFromObj) (Tcl_Interp *interp, Tcl_Obj *objPtr, int *lengthPtr); /* 649 */ + void (*reserved650)(void); + char * (*tclGetStringFromObj) (Tcl_Obj *objPtr, size_t *lengthPtr); /* 651 */ + Tcl_UniChar * (*tclGetUnicodeFromObj) (Tcl_Obj *objPtr, size_t *lengthPtr); /* 652 */ + unsigned char * (*tclGetByteArrayFromObj) (Tcl_Obj *objPtr, size_t *lengthPtr); /* 653 */ } TclStubs; extern const TclStubs *tclStubsPtr; @@ -3938,6 +3952,13 @@ extern const TclStubs *tclStubsPtr; (tclStubsPtr->tcl_UtfToUniCharDString) /* 648 */ #define Tcl_GetBytesFromObj \ (tclStubsPtr->tcl_GetBytesFromObj) /* 649 */ +/* Slot 650 is reserved */ +#define TclGetStringFromObj \ + (tclStubsPtr->tclGetStringFromObj) /* 651 */ +#define TclGetUnicodeFromObj \ + (tclStubsPtr->tclGetUnicodeFromObj) /* 652 */ +#define TclGetByteArrayFromObj \ + (tclStubsPtr->tclGetByteArrayFromObj) /* 653 */ #endif /* defined(USE_TCL_STUBS) */ @@ -4120,6 +4141,30 @@ extern const TclStubs *tclStubsPtr; # endif #endif +#undef Tcl_GetStringFromObj +#undef Tcl_GetUnicodeFromObj +#undef Tcl_GetByteArrayFromObj +#undef Tcl_GetUnicode +#if defined(USE_TCL_STUBS) +#define Tcl_GetStringFromObj(objPtr, sizePtr) \ + (sizeof(*sizePtr) <= sizeof(int) ? tclStubsPtr->tcl_GetStringFromObj(objPtr, (int *)sizePtr) : tclStubsPtr->tclGetStringFromObj(objPtr, (size_t *)sizePtr)) +#define Tcl_GetByteArrayFromObj(objPtr, sizePtr) \ + (sizeof(*sizePtr) <= sizeof(int) ? tclStubsPtr->tcl_GetByteArrayFromObj(objPtr, (int *)sizePtr) : tclStubsPtr->tclGetByteArrayFromObj(objPtr, (size_t *)sizePtr)) +#define Tcl_GetUnicodeFromObj(objPtr, sizePtr) \ + (sizeof(*sizePtr) <= sizeof(int) ? tclStubsPtr->tcl_GetUnicodeFromObj(objPtr, (int *)sizePtr) : tclStubsPtr->tclGetUnicodeFromObj(objPtr, (size_t *)sizePtr)) +#define Tcl_GetUnicode(objPtr) \ + tclStubsPtr->tcl_GetUnicodeFromObj(objPtr, NULL) +#else +#define Tcl_GetStringFromObj(objPtr, sizePtr) \ + (sizeof(*sizePtr) <= sizeof(int) ? (Tcl_GetStringFromObj)(objPtr, (int *)sizePtr) : (TclGetStringFromObj)(objPtr, (size_t *)sizePtr)) +#define Tcl_GetByteArrayFromObj(objPtr, sizePtr) \ + (sizeof(*sizePtr) <= sizeof(int) ? (Tcl_GetByteArrayFromObj)(objPtr, (int *)sizePtr) : TclGetByteArrayFromObj(objPtr, (size_t *)sizePtr)) +#define Tcl_GetUnicodeFromObj(objPtr, sizePtr) \ + (sizeof(*sizePtr) <= sizeof(int) ? (Tcl_GetUnicodeFromObj)(objPtr, (int *)sizePtr) : TclGetUnicodeFromObj(objPtr, (size_t *)sizePtr)) +#define Tcl_GetUnicode(objPtr) \ + (Tcl_GetUnicodeFromObj)(objPtr, NULL) +#endif + #undef Tcl_NewLongObj #define Tcl_NewLongObj(value) Tcl_NewWideIntObj((long)(value)) #undef Tcl_NewIntObj @@ -4130,8 +4175,6 @@ extern const TclStubs *tclStubsPtr; #define Tcl_SetIntObj(objPtr, value) Tcl_SetWideIntObj((objPtr), (int)(value)) #undef Tcl_SetLongObj #define Tcl_SetLongObj(objPtr, value) Tcl_SetWideIntObj((objPtr), (long)(value)) -#undef Tcl_GetUnicode -#define Tcl_GetUnicode(objPtr) Tcl_GetUnicodeFromObj((objPtr), NULL) #undef Tcl_BackgroundError #define Tcl_BackgroundError(interp) Tcl_BackgroundException((interp), TCL_ERROR) #undef Tcl_StringMatch |