/ Check-in [9b5f84253c]
DEMO | DOWNLOAD | DEPLOY | SEARCH
Login

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

Overview
Comment:Release "2.8.40". Fix sqlite add row.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:9b5f84253c99feabdb4af919d3c5c490cc8e128b
User & Date: pmacdona 2019-11-11 01:10:38
Context
2019-12-01
17:59
Fix ws url check-in: 26279a33d5 user: pmacdona tags: trunk
2019-11-11
01:10
Release "2.8.40". Fix sqlite add row. check-in: 9b5f84253c user: pmacdona tags: trunk
2019-08-23
04:29
Test check-in: c3073e09ce user: pmacdona tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to lib/SqliteUI/html/sqlite.jsi.

650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
        id = z[i].id.substr(prefix.length+1);
        res[id] = z[i].value;
    }
    return res;
};

function DlgAddRow() {
    flds = DlgAddFields("add_tvals", "edt");
    var trow = self.tlist.sel;
    var tdata = self.tlist.data[trow];
    if (!tdata || tdata.type !== 'table') return;
    var subd = {table:tdata.name, res:flds};
    WsSend('dbAdd',subd);
};








|







650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
        id = z[i].id.substr(prefix.length+1);
        res[id] = z[i].value;
    }
    return res;
};

function DlgAddRow() {
    var flds = DlgAddFields("add_tvals", "edt");
    var trow = self.tlist.sel;
    var tdata = self.tlist.data[trow];
    if (!tdata || tdata.type !== 'table') return;
    var subd = {table:tdata.name, res:flds};
    WsSend('dbAdd',subd);
};

Changes to src/jsi.c.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
.....
28073
28074
28075
28076
28077
28078
28079
28080
28081
28082
28083
28084
28085
28086
28087
28088
28089
.....
28996
28997
28998
28999
29000
29001
29002
29003
29004
29005
29006
29007
29008
29009
29010
.....
33597
33598
33599
33600
33601
33602
33603

33604
33605
33606
33607
33608
33609
33610
33611
33612

33613




33614
33615
33616
33617
33618
33619
33620
/* jsi.h : External API header file for Jsi. */
#ifndef __JSI_H__
#define __JSI_H__

#define JSI_VERSION_MAJOR   2
#define JSI_VERSION_MINOR   8
#define JSI_VERSION_RELEASE 39

#define JSI_VERSION (JSI_VERSION_MAJOR + ((Jsi_Number)JSI_VERSION_MINOR/100.0) + ((Jsi_Number)JSI_VERSION_RELEASE/10000.0))

#ifndef JSI_EXTERN
#define JSI_EXTERN extern
#endif

................................................................................
    /* TODO: differentiate from re.exec() */
    return jsi_RegExpMatches(interp, seq, v, bLen, *ret, NULL, 1);
}

static Jsi_RC StringFromCharCodeCmd(Jsi_Interp *interp, Jsi_Value *args, Jsi_Value *_this,
    Jsi_Value **ret, Jsi_Func *funcPtr)
{
    if (!(_this->vt == JSI_VT_OBJECT && _this->d.obj->ot == JSI_OT_FUNCTION &&
       _this->d.obj->__proto__ == interp->String_prototype->d.obj->__proto__ ))
        return Jsi_LogError("must be called as String.fromCharCode");
    
    Jsi_DString dStr = {};
    int n, i, len, argc = Jsi_ValueGetLength(interp, args);
    for (i=0; i<argc; i++) {
        Jsi_Value *v = Jsi_ValueArrayIndex(interp, args, i);
        if (!Jsi_ValueIsNumber(interp, v) || Jsi_GetIntFromValue(interp, v, &n) != JSI_OK) {
            Jsi_DSFree(&dStr);
................................................................................
    Jsi_GetDoubleFromValue(interp, v, &num);
    if (argc>skip && (Jsi_GetIntFromValue(interp, Jsi_ValueArrayIndex(interp, args, skip), &radix) != JSI_OK
        || radix<2))
        return JSI_ERROR;
    if (argc==skip)
        return jsi_ObjectToStringCmd(interp, args, _this, ret, funcPtr);
    switch (radix) {
        case 16: snprintf(buf, sizeof(buf), "%"PRIx64, (Jsi_Wide)num); break;
        case 8: snprintf(buf, sizeof(buf), "%" PRIo64, (Jsi_Wide)num); break;
        case 10: snprintf(buf, sizeof(buf), "%" PRId64, (Jsi_Wide)num); break;
        default: return jsi_ObjectToStringCmd(interp, args, _this, ret, funcPtr);
    }
    Jsi_ValueMakeStringDup(interp, ret, buf);
    return JSI_OK;
}
................................................................................
                Jsi_DSSetLength(&pStr, 0);
                formatted_bytes = formatted_chars = precision;
                formatted_buf = Jsi_DSAppendLen(&pStr, formatted_buf, precision);
                //formatted_bytes = Jsi_UtfIndexToOffset(formatted_buf, precision);
            }
            break;
        case 'c':

            v = Jsi_ValueArrayIndex(interp, args, argIndex);
            if ((formatted_buf = Jsi_ValueString(interp, v, &formatted_bytes))==NULL || formatted_bytes!=1) {
                Jsi_Wide code;
                if (!Jsi_ValueIsNumber(interp, v))
                    goto error;
                Jsi_GetWideFromValue(interp, v, &code);
                if (code<0 || code>255)
                    goto error;
                /* Just store the value in the 'spec' buffer */

                formatted_bytes = Jsi_UniCharToUtf(code, spec);




                formatted_buf = spec;
            }
            formatted_chars = 1;
            break;

        case 'a':
        case 'A':






|







 







|
|
<







 







|







 







>









>
|
>
>
>
>







1
2
3
4
5
6
7
8
9
10
11
12
13
14
.....
28073
28074
28075
28076
28077
28078
28079
28080
28081

28082
28083
28084
28085
28086
28087
28088
.....
28995
28996
28997
28998
28999
29000
29001
29002
29003
29004
29005
29006
29007
29008
29009
.....
33596
33597
33598
33599
33600
33601
33602
33603
33604
33605
33606
33607
33608
33609
33610
33611
33612
33613
33614
33615
33616
33617
33618
33619
33620
33621
33622
33623
33624
33625
/* jsi.h : External API header file for Jsi. */
#ifndef __JSI_H__
#define __JSI_H__

#define JSI_VERSION_MAJOR   2
#define JSI_VERSION_MINOR   8
#define JSI_VERSION_RELEASE 40

#define JSI_VERSION (JSI_VERSION_MAJOR + ((Jsi_Number)JSI_VERSION_MINOR/100.0) + ((Jsi_Number)JSI_VERSION_RELEASE/10000.0))

#ifndef JSI_EXTERN
#define JSI_EXTERN extern
#endif

................................................................................
    /* TODO: differentiate from re.exec() */
    return jsi_RegExpMatches(interp, seq, v, bLen, *ret, NULL, 1);
}

static Jsi_RC StringFromCharCodeCmd(Jsi_Interp *interp, Jsi_Value *args, Jsi_Value *_this,
    Jsi_Value **ret, Jsi_Func *funcPtr)
{
    if (_this->vt != JSI_VT_OBJECT || _this->d.obj->ot == JSI_OT_STRING)
        return Jsi_LogError("should be called via String.fromCharCode");

    
    Jsi_DString dStr = {};
    int n, i, len, argc = Jsi_ValueGetLength(interp, args);
    for (i=0; i<argc; i++) {
        Jsi_Value *v = Jsi_ValueArrayIndex(interp, args, i);
        if (!Jsi_ValueIsNumber(interp, v) || Jsi_GetIntFromValue(interp, v, &n) != JSI_OK) {
            Jsi_DSFree(&dStr);
................................................................................
    Jsi_GetDoubleFromValue(interp, v, &num);
    if (argc>skip && (Jsi_GetIntFromValue(interp, Jsi_ValueArrayIndex(interp, args, skip), &radix) != JSI_OK
        || radix<2))
        return JSI_ERROR;
    if (argc==skip)
        return jsi_ObjectToStringCmd(interp, args, _this, ret, funcPtr);
    switch (radix) {
        case 16: snprintf(buf, sizeof(buf), "%" PRIx64, (Jsi_Wide)num); break;
        case 8: snprintf(buf, sizeof(buf), "%" PRIo64, (Jsi_Wide)num); break;
        case 10: snprintf(buf, sizeof(buf), "%" PRId64, (Jsi_Wide)num); break;
        default: return jsi_ObjectToStringCmd(interp, args, _this, ret, funcPtr);
    }
    Jsi_ValueMakeStringDup(interp, ret, buf);
    return JSI_OK;
}
................................................................................
                Jsi_DSSetLength(&pStr, 0);
                formatted_bytes = formatted_chars = precision;
                formatted_buf = Jsi_DSAppendLen(&pStr, formatted_buf, precision);
                //formatted_bytes = Jsi_UtfIndexToOffset(formatted_buf, precision);
            }
            break;
        case 'c':
        case 'C':
            v = Jsi_ValueArrayIndex(interp, args, argIndex);
            if ((formatted_buf = Jsi_ValueString(interp, v, &formatted_bytes))==NULL || formatted_bytes!=1) {
                Jsi_Wide code;
                if (!Jsi_ValueIsNumber(interp, v))
                    goto error;
                Jsi_GetWideFromValue(interp, v, &code);
                if (code<0 || code>255)
                    goto error;
                /* Just store the value in the 'spec' buffer */
                if (ch == 'C')
                    formatted_bytes = Jsi_UniCharToUtf(code, spec);
                else {
                    snprintf(spec, sizeof(spec), "%c", (int)code);
                    formatted_bytes = 1;
                }
                formatted_buf = spec;
            }
            formatted_chars = 1;
            break;

        case 'a':
        case 'A':

Changes to src/jsi.h.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
/* jsi.h : External API header file for Jsi. */
#ifndef __JSI_H__
#define __JSI_H__

#define JSI_VERSION_MAJOR   2
#define JSI_VERSION_MINOR   8
#define JSI_VERSION_RELEASE 39

#define JSI_VERSION (JSI_VERSION_MAJOR + ((Jsi_Number)JSI_VERSION_MINOR/100.0) + ((Jsi_Number)JSI_VERSION_RELEASE/10000.0))

#ifndef JSI_EXTERN
#define JSI_EXTERN extern
#endif







|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
/* jsi.h : External API header file for Jsi. */
#ifndef __JSI_H__
#define __JSI_H__

#define JSI_VERSION_MAJOR   2
#define JSI_VERSION_MINOR   8
#define JSI_VERSION_RELEASE 40

#define JSI_VERSION (JSI_VERSION_MAJOR + ((Jsi_Number)JSI_VERSION_MINOR/100.0) + ((Jsi_Number)JSI_VERSION_RELEASE/10000.0))

#ifndef JSI_EXTERN
#define JSI_EXTERN extern
#endif

Changes to src/jsiNumber.c.

199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
    Jsi_GetDoubleFromValue(interp, v, &num);
    if (argc>skip && (Jsi_GetIntFromValue(interp, Jsi_ValueArrayIndex(interp, args, skip), &radix) != JSI_OK
        || radix<2))
        return JSI_ERROR;
    if (argc==skip)
        return jsi_ObjectToStringCmd(interp, args, _this, ret, funcPtr);
    switch (radix) {
        case 16: snprintf(buf, sizeof(buf), "%"PRIx64, (Jsi_Wide)num); break;
        case 8: snprintf(buf, sizeof(buf), "%" PRIo64, (Jsi_Wide)num); break;
        case 10: snprintf(buf, sizeof(buf), "%" PRId64, (Jsi_Wide)num); break;
        default: return jsi_ObjectToStringCmd(interp, args, _this, ret, funcPtr);
    }
    Jsi_ValueMakeStringDup(interp, ret, buf);
    return JSI_OK;
}







|







199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
    Jsi_GetDoubleFromValue(interp, v, &num);
    if (argc>skip && (Jsi_GetIntFromValue(interp, Jsi_ValueArrayIndex(interp, args, skip), &radix) != JSI_OK
        || radix<2))
        return JSI_ERROR;
    if (argc==skip)
        return jsi_ObjectToStringCmd(interp, args, _this, ret, funcPtr);
    switch (radix) {
        case 16: snprintf(buf, sizeof(buf), "%" PRIx64, (Jsi_Wide)num); break;
        case 8: snprintf(buf, sizeof(buf), "%" PRIo64, (Jsi_Wide)num); break;
        case 10: snprintf(buf, sizeof(buf), "%" PRId64, (Jsi_Wide)num); break;
        default: return jsi_ObjectToStringCmd(interp, args, _this, ret, funcPtr);
    }
    Jsi_ValueMakeStringDup(interp, ret, buf);
    return JSI_OK;
}

Changes to tools/protos.jsi.

1
2
3
4
5
6
7
8
//JSI Command Prototypes: version 2.8.39
throw("NOT EXECUTABLE: USE FILE IN GEANY EDITOR FOR CMD LINE COMPLETION + GOTO TAG");

var Array = function(cmd,args) {};
Array.prototype.concat = function(...):array {};
Array.prototype.every = function(callback:function):any {};
Array.prototype.fill = function(value:any, start:number=0, end:number=-1):array {};
Array.prototype.filter = function(callback:function, this:object=void):array {};
|







1
2
3
4
5
6
7
8
//JSI Command Prototypes: version 2.8.40
throw("NOT EXECUTABLE: USE FILE IN GEANY EDITOR FOR CMD LINE COMPLETION + GOTO TAG");

var Array = function(cmd,args) {};
Array.prototype.concat = function(...):array {};
Array.prototype.every = function(callback:function):any {};
Array.prototype.fill = function(value:any, start:number=0, end:number=-1):array {};
Array.prototype.filter = function(callback:function, this:object=void):array {};