diff options
| author | apnadkarni <apnmbx-wits@yahoo.com> | 2024-05-24 16:05:19 (GMT) |
|---|---|---|
| committer | apnadkarni <apnmbx-wits@yahoo.com> | 2024-05-24 16:05:19 (GMT) |
| commit | b7eeffcdef4802086b4f43db1619b2784d74aa79 (patch) | |
| tree | 0e5d90abdf8a9e69a0fc4383d8ceac9d115a02c4 /generic/tclTest.c | |
| parent | 14145609e7b52c939ce5bc328b87b8ab02c7a431 (diff) | |
| parent | b230de2a4d3e8748a542c21d0dfde9e357ac0b0a (diff) | |
| download | tcl-b7eeffcdef4802086b4f43db1619b2784d74aa79.zip tcl-b7eeffcdef4802086b4f43db1619b2784d74aa79.tar.gz tcl-b7eeffcdef4802086b4f43db1619b2784d74aa79.tar.bz2 | |
Merge trunk
Diffstat (limited to 'generic/tclTest.c')
| -rw-r--r-- | generic/tclTest.c | 26 |
1 files changed, 24 insertions, 2 deletions
diff --git a/generic/tclTest.c b/generic/tclTest.c index 3aa066d..b224797 100644 --- a/generic/tclTest.c +++ b/generic/tclTest.c @@ -21,9 +21,8 @@ #ifndef USE_TCL_STUBS # define USE_TCL_STUBS #endif -#include "tclInt.h" -#undef TCLBOOLWARNING #define TCLBOOLWARNING(boolPtr) /* needed here because we compile with -Wc++-compat */ +#include "tclInt.h" #include "tclOO.h" #include <math.h> @@ -278,6 +277,7 @@ static Tcl_CmdProc Testset2Cmd; static Tcl_CmdProc TestseterrorcodeCmd; static Tcl_ObjCmdProc TestsetobjerrorcodeCmd; static Tcl_CmdProc TestsetplatformCmd; +static Tcl_ObjCmdProc TestSizeCmd; static Tcl_CmdProc TeststaticlibraryCmd; static Tcl_CmdProc TesttranslatefilenameCmd; static Tcl_CmdProc TestupvarCmd; @@ -689,6 +689,7 @@ Tcltest_Init( TestGetIntForIndexCmd, NULL, NULL); Tcl_CreateCommand(interp, "testsetplatform", TestsetplatformCmd, NULL, NULL); + Tcl_CreateObjCommand(interp, "testsize", TestSizeCmd, NULL, NULL); Tcl_CreateCommand(interp, "testsocket", TestSocketCmd, NULL, NULL); Tcl_CreateCommand(interp, "teststaticlibrary", TeststaticlibraryCmd, @@ -4859,6 +4860,27 @@ TestsetplatformCmd( return TCL_OK; } +static int +TestSizeCmd( + TCL_UNUSED(void *), /* Unused */ + Tcl_Interp* interp, /* Tcl interpreter */ + int objc, /* Parameter count */ + Tcl_Obj *const * objv) /* Parameter vector */ +{ + if (objc != 2) { + goto syntax; + } + if (strcmp(Tcl_GetString(objv[1]), "st_mtime") == 0) { + Tcl_StatBuf *statPtr; + Tcl_SetObjResult(interp, Tcl_NewWideIntObj(sizeof(statPtr->st_mtime))); + return TCL_OK; + } + +syntax: + Tcl_WrongNumArgs(interp, 1, objv, "st_mtime"); + return TCL_ERROR; +} + /* *---------------------------------------------------------------------- * |
