Jim Tcl
Check-in [876c29d3a8]
Not logged in

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:jim.c: Jim_Length/Jim_String internal checks

Perform the same internal checks as Jim_GetString() when the string rep needs to be generated by calling Jim_GetString()

Reported-by: Stuart Cassoff <stwo@bell.net> Signed-off-by: Steve Bennett <steveb@workware.net.au>

Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:876c29d3a88977ff85125c7861effc8e6c51aee9
User & Date: steveb@workware.net.au 2018-06-03 06:18:32
Context
2018-06-07
21:13
jim.c: Allow Jim_WrongNumArgs() to accept NULL for msg

For consistency with Tcl

Reported-by: Stuart Cassoff <stwo@bell.net> Signed-off-by: Steve Bennett <steveb@workware.net.au> check-in: f971c9f700 user: steveb@workware.net.au tags: trunk

2018-06-03
06:18
jim.c: Jim_Length/Jim_String internal checks

Perform the same internal checks as Jim_GetString() when the string rep needs to be generated by calling Jim_GetString()

Reported-by: Stuart Cassoff <stwo@bell.net> Signed-off-by: Steve Bennett <steveb@workware.net.au> check-in: 876c29d3a8 user: steveb@workware.net.au tags: trunk

2018-03-25
00:47
linenoise: Update to support multiline mode.

Updated to: https://github.com/msteveb/linenoise/commit/ad5172e99520e2fe2a35b4bbd7fbc74d9df36df1

Now supports multiline mode (by setting $history::multiline to 1) Improved windows support

Signed-off-by: Steve Bennett <steveb@workware.net.au> check-in: 4f1592c24e user: steveb@workware.net.au tags: trunk

Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to jim.c.

2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
}

/* Just returns the length (in bytes) of the object's string rep */
int Jim_Length(Jim_Obj *objPtr)
{
    if (objPtr->bytes == NULL) {
        /* Invalid string repr. Generate it. */
        JimPanic((objPtr->typePtr->updateStringProc == NULL, "UpdateStringProc called against '%s' type.", objPtr->typePtr->name));
        objPtr->typePtr->updateStringProc(objPtr);
    }
    return objPtr->length;
}

/* Just returns object's string rep */
const char *Jim_String(Jim_Obj *objPtr)
{
    if (objPtr->bytes == NULL) {
        /* Invalid string repr. Generate it. */
        JimPanic((objPtr->typePtr == NULL, "UpdateStringProc called against typeless value."));
        JimPanic((objPtr->typePtr->updateStringProc == NULL, "UpdateStringProc called against '%s' type.", objPtr->typePtr->name));
        objPtr->typePtr->updateStringProc(objPtr);
    }
    return objPtr->bytes;
}

static void JimSetStringBytes(Jim_Obj *objPtr, const char *str)
{
    objPtr->bytes = Jim_StrDup(str);







|
<









|
<
<







2282
2283
2284
2285
2286
2287
2288
2289

2290
2291
2292
2293
2294
2295
2296
2297
2298
2299


2300
2301
2302
2303
2304
2305
2306
}

/* Just returns the length (in bytes) of the object's string rep */
int Jim_Length(Jim_Obj *objPtr)
{
    if (objPtr->bytes == NULL) {
        /* Invalid string repr. Generate it. */
        Jim_GetString(objPtr, NULL);

    }
    return objPtr->length;
}

/* Just returns object's string rep */
const char *Jim_String(Jim_Obj *objPtr)
{
    if (objPtr->bytes == NULL) {
        /* Invalid string repr. Generate it. */
        Jim_GetString(objPtr, NULL);


    }
    return objPtr->bytes;
}

static void JimSetStringBytes(Jim_Obj *objPtr, const char *str)
{
    objPtr->bytes = Jim_StrDup(str);