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

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

Overview
Comment:Release "2.8.27". require: change default version back to 0, and add back lastReq field.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:fea7a7d0f48b855e15a9eeb4cdf277a6505a7c8d
User & Date: pmacdona 2019-05-13 14:15:21
Context
2019-05-15
01:38
Release "2.8.28". Fix String.match() to not force /g always on. check-in: 2c45c82274 user: pmacdona tags: trunk
2019-05-13
14:15
Release "2.8.27". require: change default version back to 0, and add back lastReq field. check-in: fea7a7d0f4 user: pmacdona tags: trunk
2019-05-11
22:17
Add isMain on cmdline source. check-in: 44acfc514f user: pmacdona tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to md/Reference.md.

1304
1305
1306
1307
1308
1309
1310

1311
1312
1313
1314
1315
1316
1317
1318
1319
<tr><td>printf</td><td>printf(format:string, ...):void </td><td>Formatted output to stdout.</td></tr>
<tr><td>provide</td><td>provide(name:string|function=void, version:number|string=1.0, opts:object|function=void):void </td><td>Provide a package for use with require. Default is the file tail-rootname.</td></tr>
<tr><td>puts</td><td>puts(val, ...):void </td><td>Output one or more values to stdout. Each argument is quoted.  Use Interp.logOpts to control source line and/or timestamps output.</td></tr>
<tr><td>quote</td><td>quote(val:string):string </td><td>Return quoted string.</td></tr>
<tr><td>require</td><td>require(name:string=void, version:number|string=1, <a href='#System.requireOptions'>options</a>:object=void):number|array|object </td><td>Load/query packages. With no arguments, returns the list of all loaded packages.
With one argument, loads the package (if necessary) and returns its version.
With two arguments, returns object containing: version, loadFile, func.

An error is thrown if requested version is greater than actual version.</td></tr>
<tr><td>runModule</td><td>runModule(cmd:string|function=void, conf:array=undefined) </td><td>Invoke named module. If name is empty, uses file basename. If isMain and no args givine parses console.args.</td></tr>
<tr><td>setInterval</td><td>setInterval(callback:function, ms:number):number </td><td>Setup recurring function to run every given millisecs.</td></tr>
<tr><td>setTimeout</td><td>setTimeout(callback:function, ms:number):number </td><td>Setup function to run after given millisecs.</td></tr>
<tr><td>sleep</td><td>sleep(secs:number=1.0):void </td><td>sleep for N milliseconds, minimum .001.</td></tr>
<tr><td>source</td><td>source(val:string|array, <a href='#System.sourceOptions'>options</a>:object=void):void </td><td>Load and evaluate source files.</td></tr>
<tr><td>strftime</td><td>strftime(num:number=null, <a href='#System.strftimeOptions'>options</a>:string|object=void):string </td><td>Format numeric time (in ms) to a string. Null or no value will use current time.</td></tr>
<tr><td>strptime</td><td>strptime(val:string=void, <a href='#System.strptimeOptions'>options</a>:string|object=void):number </td><td>Parse time from string and return ms time since 1970-01-01 in UTC, or NaN.</td></tr>
<tr><td>times</td><td>times(callback:function|boolean, count:number=1):number </td><td>Call function count times and return execution time in microseconds.</td></tr>







>
|
|







1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
<tr><td>printf</td><td>printf(format:string, ...):void </td><td>Formatted output to stdout.</td></tr>
<tr><td>provide</td><td>provide(name:string|function=void, version:number|string=1.0, opts:object|function=void):void </td><td>Provide a package for use with require. Default is the file tail-rootname.</td></tr>
<tr><td>puts</td><td>puts(val, ...):void </td><td>Output one or more values to stdout. Each argument is quoted.  Use Interp.logOpts to control source line and/or timestamps output.</td></tr>
<tr><td>quote</td><td>quote(val:string):string </td><td>Return quoted string.</td></tr>
<tr><td>require</td><td>require(name:string=void, version:number|string=1, <a href='#System.requireOptions'>options</a>:object=void):number|array|object </td><td>Load/query packages. With no arguments, returns the list of all loaded packages.
With one argument, loads the package (if necessary) and returns its version.
With two arguments, returns object containing: version, loadFile, func.
A third argument sets options for package or module.
Note an error is thrown if requested version is greater than actual version.</td></tr>
<tr><td>runModule</td><td>runModule(cmd:string|null|function=void, conf:array=undefined) </td><td>Invoke named module. If name is empty, uses file basename. If isMain and no args givine parses console.args.</td></tr>
<tr><td>setInterval</td><td>setInterval(callback:function, ms:number):number </td><td>Setup recurring function to run every given millisecs.</td></tr>
<tr><td>setTimeout</td><td>setTimeout(callback:function, ms:number):number </td><td>Setup function to run after given millisecs.</td></tr>
<tr><td>sleep</td><td>sleep(secs:number=1.0):void </td><td>sleep for N milliseconds, minimum .001.</td></tr>
<tr><td>source</td><td>source(val:string|array, <a href='#System.sourceOptions'>options</a>:object=void):void </td><td>Load and evaluate source files.</td></tr>
<tr><td>strftime</td><td>strftime(num:number=null, <a href='#System.strftimeOptions'>options</a>:string|object=void):string </td><td>Format numeric time (in ms) to a string. Null or no value will use current time.</td></tr>
<tr><td>strptime</td><td>strptime(val:string=void, <a href='#System.strptimeOptions'>options</a>:string|object=void):number </td><td>Parse time from string and return ms time since 1970-01-01 in UTC, or NaN.</td></tr>
<tr><td>times</td><td>times(callback:function|boolean, count:number=1):number </td><td>Call function count times and return execution time in microseconds.</td></tr>

Changes to src/jsi.c.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
....
8332
8333
8334
8335
8336
8337
8338
8339
8340
8341
8342
8343
8344
8345
8346
.....
34851
34852
34853
34854
34855
34856
34857


34858
34859
34860
34861
34862
34863
34864
.....
34951
34952
34953
34954
34955
34956
34957

34958
34959
34960
34961
34962
34963
34964
.....
35004
35005
35006
35007
35008
35009
35010

35011
35012
35013
35014
35015
35016
35017
35018
35019
35020
35021
35022
/* 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 26

#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

................................................................................
    int id;
    int hits;
    bool enabled;
    bool temp;
} jsi_BreakPoint;

typedef struct jsi_PkgInfo {
    Jsi_Number version;
    const char *loadFile;  // Full path of file name loaded.
    Jsi_InitProc *initProc; // For C-extensions.
    bool needInit;  // If a C-extension and _Init func needs calling in this interp.
    Jsi_Value *info;
    Jsi_PkgOpts popts;
} jsi_PkgInfo;

................................................................................
    return rc;
}

Jsi_Number Jsi_PkgRequireEx(Jsi_Interp *interp, const char *name, Jsi_Number version, Jsi_PkgOpts **poptsPtr)
{
    jsi_PkgInfo *ptr = jsi_PkgGet(interp, name), *ptr2 = NULL;
    if (ptr) {


        if (ptr->initProc && ptr->needInit) {
            if ((*ptr->initProc)(interp, 0) != JSI_OK) 
                return -1;
            ptr->needInit = 0;
        }
            if (poptsPtr)
                *poptsPtr = &ptr->popts;
................................................................................
Jsi_RC jsi_PkgDumpInfo(Jsi_Interp *interp, const char *name, Jsi_Value **ret) {
    jsi_PkgInfo *ptr;
    Jsi_HashEntry *hPtr = Jsi_HashEntryFind(interp->packageHash, name);
    if (hPtr && ((ptr = (jsi_PkgInfo*)Jsi_HashValueGet(hPtr)))) {
        Jsi_Obj *nobj = Jsi_ObjNew(interp);
        Jsi_ValueMakeObject(interp, ret, nobj);
        Jsi_ObjInsert(interp, nobj, "version", Jsi_ValueNewNumber(interp, ptr->version), 0);

        char buf[200];
        jsi_VersionNormalize(ptr->version, buf, sizeof(buf));
        Jsi_ObjInsert(interp, nobj, "verStr", Jsi_ValueNewStringDup(interp, buf), 0);
        const char *cp = (ptr->loadFile?ptr->loadFile:"");
        Jsi_ObjInsert(interp, nobj, "loadFile", Jsi_ValueNewStringDup(interp, cp), 0);
        Jsi_Value *fval2, *fval = Jsi_NameLookup(interp, name);
        if (!fval || !Jsi_ValueIsFunction(interp, fval))
................................................................................
    return JSI_OK;
}

#define FN_require JSI_INFO("\
With no arguments, returns the list of all loaded packages.\n\
With one argument, loads the package (if necessary) and returns its version.\n\
With two arguments, returns object containing: version, loadFile, func.\n\

An error is thrown if requested version is greater than actual version.")
static Jsi_RC SysRequireCmd(Jsi_Interp *interp, Jsi_Value *args, Jsi_Value *_this,
    Jsi_Value **ret, Jsi_Func *funcPtr)
{
    Jsi_Number n = 1;
    int argc = Jsi_ValueGetLength(interp, args);
    if (argc == 0)
        return Jsi_HashKeysDump(interp, interp->packageHash, ret, 0);
        
    Jsi_Value *vname = Jsi_ValueArrayIndex(interp, args, 0);
    const char *name = NULL;
    if (Jsi_ValueIsString(interp, vname)) {






|







 







|







 







>
>







 







>







 







>
|



|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
....
8332
8333
8334
8335
8336
8337
8338
8339
8340
8341
8342
8343
8344
8345
8346
.....
34851
34852
34853
34854
34855
34856
34857
34858
34859
34860
34861
34862
34863
34864
34865
34866
.....
34953
34954
34955
34956
34957
34958
34959
34960
34961
34962
34963
34964
34965
34966
34967
.....
35007
35008
35009
35010
35011
35012
35013
35014
35015
35016
35017
35018
35019
35020
35021
35022
35023
35024
35025
35026
/* 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 27

#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

................................................................................
    int id;
    int hits;
    bool enabled;
    bool temp;
} jsi_BreakPoint;

typedef struct jsi_PkgInfo {
    Jsi_Number version, lastReq;
    const char *loadFile;  // Full path of file name loaded.
    Jsi_InitProc *initProc; // For C-extensions.
    bool needInit;  // If a C-extension and _Init func needs calling in this interp.
    Jsi_Value *info;
    Jsi_PkgOpts popts;
} jsi_PkgInfo;

................................................................................
    return rc;
}

Jsi_Number Jsi_PkgRequireEx(Jsi_Interp *interp, const char *name, Jsi_Number version, Jsi_PkgOpts **poptsPtr)
{
    jsi_PkgInfo *ptr = jsi_PkgGet(interp, name), *ptr2 = NULL;
    if (ptr) {
        if (version)
            ptr->lastReq = version;
        if (ptr->initProc && ptr->needInit) {
            if ((*ptr->initProc)(interp, 0) != JSI_OK) 
                return -1;
            ptr->needInit = 0;
        }
            if (poptsPtr)
                *poptsPtr = &ptr->popts;
................................................................................
Jsi_RC jsi_PkgDumpInfo(Jsi_Interp *interp, const char *name, Jsi_Value **ret) {
    jsi_PkgInfo *ptr;
    Jsi_HashEntry *hPtr = Jsi_HashEntryFind(interp->packageHash, name);
    if (hPtr && ((ptr = (jsi_PkgInfo*)Jsi_HashValueGet(hPtr)))) {
        Jsi_Obj *nobj = Jsi_ObjNew(interp);
        Jsi_ValueMakeObject(interp, ret, nobj);
        Jsi_ObjInsert(interp, nobj, "version", Jsi_ValueNewNumber(interp, ptr->version), 0);
        Jsi_ObjInsert(interp, nobj, "lastReq", Jsi_ValueNewNumber(interp, ptr->lastReq), 0);
        char buf[200];
        jsi_VersionNormalize(ptr->version, buf, sizeof(buf));
        Jsi_ObjInsert(interp, nobj, "verStr", Jsi_ValueNewStringDup(interp, buf), 0);
        const char *cp = (ptr->loadFile?ptr->loadFile:"");
        Jsi_ObjInsert(interp, nobj, "loadFile", Jsi_ValueNewStringDup(interp, cp), 0);
        Jsi_Value *fval2, *fval = Jsi_NameLookup(interp, name);
        if (!fval || !Jsi_ValueIsFunction(interp, fval))
................................................................................
    return JSI_OK;
}

#define FN_require JSI_INFO("\
With no arguments, returns the list of all loaded packages.\n\
With one argument, loads the package (if necessary) and returns its version.\n\
With two arguments, returns object containing: version, loadFile, func.\n\
A third argument sets options for package or module.\n\
Note an error is thrown if requested version is greater than actual version.")
static Jsi_RC SysRequireCmd(Jsi_Interp *interp, Jsi_Value *args, Jsi_Value *_this,
    Jsi_Value **ret, Jsi_Func *funcPtr)
{
    Jsi_Number n = 0;
    int argc = Jsi_ValueGetLength(interp, args);
    if (argc == 0)
        return Jsi_HashKeysDump(interp, interp->packageHash, ret, 0);
        
    Jsi_Value *vname = Jsi_ValueArrayIndex(interp, args, 0);
    const char *name = NULL;
    if (Jsi_ValueIsString(interp, vname)) {

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 26

#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 27

#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/jsiCmds.c.

732
733
734
735
736
737
738


739
740
741
742
743
744
745
...
832
833
834
835
836
837
838

839
840
841
842
843
844
845
...
885
886
887
888
889
890
891

892
893
894
895
896
897
898
899
900
901
902
903
    return rc;
}

Jsi_Number Jsi_PkgRequireEx(Jsi_Interp *interp, const char *name, Jsi_Number version, Jsi_PkgOpts **poptsPtr)
{
    jsi_PkgInfo *ptr = jsi_PkgGet(interp, name), *ptr2 = NULL;
    if (ptr) {


        if (ptr->initProc && ptr->needInit) {
            if ((*ptr->initProc)(interp, 0) != JSI_OK) 
                return -1;
            ptr->needInit = 0;
        }
            if (poptsPtr)
                *poptsPtr = &ptr->popts;
................................................................................
Jsi_RC jsi_PkgDumpInfo(Jsi_Interp *interp, const char *name, Jsi_Value **ret) {
    jsi_PkgInfo *ptr;
    Jsi_HashEntry *hPtr = Jsi_HashEntryFind(interp->packageHash, name);
    if (hPtr && ((ptr = (jsi_PkgInfo*)Jsi_HashValueGet(hPtr)))) {
        Jsi_Obj *nobj = Jsi_ObjNew(interp);
        Jsi_ValueMakeObject(interp, ret, nobj);
        Jsi_ObjInsert(interp, nobj, "version", Jsi_ValueNewNumber(interp, ptr->version), 0);

        char buf[200];
        jsi_VersionNormalize(ptr->version, buf, sizeof(buf));
        Jsi_ObjInsert(interp, nobj, "verStr", Jsi_ValueNewStringDup(interp, buf), 0);
        const char *cp = (ptr->loadFile?ptr->loadFile:"");
        Jsi_ObjInsert(interp, nobj, "loadFile", Jsi_ValueNewStringDup(interp, cp), 0);
        Jsi_Value *fval2, *fval = Jsi_NameLookup(interp, name);
        if (!fval || !Jsi_ValueIsFunction(interp, fval))
................................................................................
    return JSI_OK;
}

#define FN_require JSI_INFO("\
With no arguments, returns the list of all loaded packages.\n\
With one argument, loads the package (if necessary) and returns its version.\n\
With two arguments, returns object containing: version, loadFile, func.\n\

An error is thrown if requested version is greater than actual version.")
static Jsi_RC SysRequireCmd(Jsi_Interp *interp, Jsi_Value *args, Jsi_Value *_this,
    Jsi_Value **ret, Jsi_Func *funcPtr)
{
    Jsi_Number n = 1;
    int argc = Jsi_ValueGetLength(interp, args);
    if (argc == 0)
        return Jsi_HashKeysDump(interp, interp->packageHash, ret, 0);
        
    Jsi_Value *vname = Jsi_ValueArrayIndex(interp, args, 0);
    const char *name = NULL;
    if (Jsi_ValueIsString(interp, vname)) {







>
>







 







>







 







>
|



|







732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
...
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
...
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
    return rc;
}

Jsi_Number Jsi_PkgRequireEx(Jsi_Interp *interp, const char *name, Jsi_Number version, Jsi_PkgOpts **poptsPtr)
{
    jsi_PkgInfo *ptr = jsi_PkgGet(interp, name), *ptr2 = NULL;
    if (ptr) {
        if (version)
            ptr->lastReq = version;
        if (ptr->initProc && ptr->needInit) {
            if ((*ptr->initProc)(interp, 0) != JSI_OK) 
                return -1;
            ptr->needInit = 0;
        }
            if (poptsPtr)
                *poptsPtr = &ptr->popts;
................................................................................
Jsi_RC jsi_PkgDumpInfo(Jsi_Interp *interp, const char *name, Jsi_Value **ret) {
    jsi_PkgInfo *ptr;
    Jsi_HashEntry *hPtr = Jsi_HashEntryFind(interp->packageHash, name);
    if (hPtr && ((ptr = (jsi_PkgInfo*)Jsi_HashValueGet(hPtr)))) {
        Jsi_Obj *nobj = Jsi_ObjNew(interp);
        Jsi_ValueMakeObject(interp, ret, nobj);
        Jsi_ObjInsert(interp, nobj, "version", Jsi_ValueNewNumber(interp, ptr->version), 0);
        Jsi_ObjInsert(interp, nobj, "lastReq", Jsi_ValueNewNumber(interp, ptr->lastReq), 0);
        char buf[200];
        jsi_VersionNormalize(ptr->version, buf, sizeof(buf));
        Jsi_ObjInsert(interp, nobj, "verStr", Jsi_ValueNewStringDup(interp, buf), 0);
        const char *cp = (ptr->loadFile?ptr->loadFile:"");
        Jsi_ObjInsert(interp, nobj, "loadFile", Jsi_ValueNewStringDup(interp, cp), 0);
        Jsi_Value *fval2, *fval = Jsi_NameLookup(interp, name);
        if (!fval || !Jsi_ValueIsFunction(interp, fval))
................................................................................
    return JSI_OK;
}

#define FN_require JSI_INFO("\
With no arguments, returns the list of all loaded packages.\n\
With one argument, loads the package (if necessary) and returns its version.\n\
With two arguments, returns object containing: version, loadFile, func.\n\
A third argument sets options for package or module.\n\
Note an error is thrown if requested version is greater than actual version.")
static Jsi_RC SysRequireCmd(Jsi_Interp *interp, Jsi_Value *args, Jsi_Value *_this,
    Jsi_Value **ret, Jsi_Func *funcPtr)
{
    Jsi_Number n = 0;
    int argc = Jsi_ValueGetLength(interp, args);
    if (argc == 0)
        return Jsi_HashKeysDump(interp, interp->packageHash, ret, 0);
        
    Jsi_Value *vname = Jsi_ValueArrayIndex(interp, args, 0);
    const char *name = NULL;
    if (Jsi_ValueIsString(interp, vname)) {

Changes to src/jsiInt.h.

902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
    int id;
    int hits;
    bool enabled;
    bool temp;
} jsi_BreakPoint;

typedef struct jsi_PkgInfo {
    Jsi_Number version;
    const char *loadFile;  // Full path of file name loaded.
    Jsi_InitProc *initProc; // For C-extensions.
    bool needInit;  // If a C-extension and _Init func needs calling in this interp.
    Jsi_Value *info;
    Jsi_PkgOpts popts;
} jsi_PkgInfo;








|







902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
    int id;
    int hits;
    bool enabled;
    bool temp;
} jsi_BreakPoint;

typedef struct jsi_PkgInfo {
    Jsi_Number version, lastReq;
    const char *loadFile;  // Full path of file name loaded.
    Jsi_InitProc *initProc; // For C-extensions.
    bool needInit;  // If a C-extension and _Init func needs calling in this interp.
    Jsi_Value *info;
    Jsi_PkgOpts popts;
} jsi_PkgInfo;

Changes to tools/protos.jsi.

1
2
3
4
5
6
7
8
...
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
...
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
//JSI Command Prototypes: version 2.8.26
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 {};
................................................................................
System.prototype.parseInt = function(val:any, base:number=10):number {};
System.prototype.parseOpts = function(self:object|userobj, options:object, conf:object|null|undefined):any {};
System.prototype.printf = function(format:string, ...):void {};
System.prototype.provide = function(name:string|function=void, version:number|string=1.0, opts:object|function=void):void {};
System.prototype.puts = function(val, ...):void {};
System.prototype.quote = function(val:string):string {};
System.prototype.require = function(name:string=void, version:number|string=1, options:object=void):number|array|object {};
System.prototype.runModule = function(cmd:string|function=void, conf:array=undefined):any {};
System.prototype.setInterval = function(callback:function, ms:number):number {};
System.prototype.setTimeout = function(callback:function, ms:number):number {};
System.prototype.sleep = function(secs:number=1.0):void {};
System.prototype.source = function(val:string|array, options:object=void):void {};
System.prototype.strftime = function(num:number=null, options:string|object=void):string {};
System.prototype.strptime = function(val:string=void, options:string|object=void):number {};
System.prototype.times = function(callback:function|boolean, count:number=1):number {};
................................................................................
var parseInt = function(val:any, base:number=10):number {};
var parseOpts = function(self:object|userobj, options:object, conf:object|null|undefined):any {};
var printf = function(format:string, ...):void {};
var provide = function(name:string|function=void, version:number|string=1.0, opts:object|function=void):void {};
var puts = function(val, ...):void {};
var quote = function(val:string):string {};
var require = function(name:string=void, version:number|string=1, options:object=void):number|array|object {};
var runModule = function(cmd:string|function=void, conf:array=undefined):any {};
var setInterval = function(callback:function, ms:number):number {};
var setTimeout = function(callback:function, ms:number):number {};
var sleep = function(secs:number=1.0):void {};
var source = function(val:string|array, options:object=void):void {};
var strftime = function(num:number=null, options:string|object=void):string {};
var strptime = function(val:string=void, options:string|object=void):number {};
var times = function(callback:function|boolean, count:number=1):number {};
var unload = function(shlib:string):void {};
var update = function(options:number|object=void):number {};

|







 







|







 







|










1
2
3
4
5
6
7
8
...
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
...
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
//JSI Command Prototypes: version 2.8.27
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 {};
................................................................................
System.prototype.parseInt = function(val:any, base:number=10):number {};
System.prototype.parseOpts = function(self:object|userobj, options:object, conf:object|null|undefined):any {};
System.prototype.printf = function(format:string, ...):void {};
System.prototype.provide = function(name:string|function=void, version:number|string=1.0, opts:object|function=void):void {};
System.prototype.puts = function(val, ...):void {};
System.prototype.quote = function(val:string):string {};
System.prototype.require = function(name:string=void, version:number|string=1, options:object=void):number|array|object {};
System.prototype.runModule = function(cmd:string|null|function=void, conf:array=undefined):any {};
System.prototype.setInterval = function(callback:function, ms:number):number {};
System.prototype.setTimeout = function(callback:function, ms:number):number {};
System.prototype.sleep = function(secs:number=1.0):void {};
System.prototype.source = function(val:string|array, options:object=void):void {};
System.prototype.strftime = function(num:number=null, options:string|object=void):string {};
System.prototype.strptime = function(val:string=void, options:string|object=void):number {};
System.prototype.times = function(callback:function|boolean, count:number=1):number {};
................................................................................
var parseInt = function(val:any, base:number=10):number {};
var parseOpts = function(self:object|userobj, options:object, conf:object|null|undefined):any {};
var printf = function(format:string, ...):void {};
var provide = function(name:string|function=void, version:number|string=1.0, opts:object|function=void):void {};
var puts = function(val, ...):void {};
var quote = function(val:string):string {};
var require = function(name:string=void, version:number|string=1, options:object=void):number|array|object {};
var runModule = function(cmd:string|null|function=void, conf:array=undefined):any {};
var setInterval = function(callback:function, ms:number):number {};
var setTimeout = function(callback:function, ms:number):number {};
var sleep = function(secs:number=1.0):void {};
var source = function(val:string|array, options:object=void):void {};
var strftime = function(num:number=null, options:string|object=void):string {};
var strptime = function(val:string=void, options:string|object=void):number {};
var times = function(callback:function|boolean, count:number=1):number {};
var unload = function(shlib:string):void {};
var update = function(options:number|object=void):number {};

Changes to www/reference.wiki.

1337
1338
1339
1340
1341
1342
1343

1344
1345
1346
1347
1348
1349
1350
1351
1352
<tr><td>printf</td><td>printf(format:string, ...):void </td><td>Formatted output to stdout.</td></tr>
<tr><td>provide</td><td>provide(name:string|function=void, version:number|string=1.0, opts:object|function=void):void </td><td>Provide a package for use with require. Default is the file tail-rootname.</td></tr>
<tr><td>puts</td><td>puts(val, ...):void </td><td>Output one or more values to stdout. Each argument is quoted.  Use Interp.logOpts to control source line and/or timestamps output.</td></tr>
<tr><td>quote</td><td>quote(val:string):string </td><td>Return quoted string.</td></tr>
<tr><td>require</td><td>require(name:string=void, version:number|string=1, <a href='#System.requireOptions'>options</a>:object=void):number|array|object </td><td>Load/query packages. With no arguments, returns the list of all loaded packages.
With one argument, loads the package (if necessary) and returns its version.
With two arguments, returns object containing: version, loadFile, func.

An error is thrown if requested version is greater than actual version.</td></tr>
<tr><td>runModule</td><td>runModule(cmd:string|function=void, conf:array=undefined) </td><td>Invoke named module. If name is empty, uses file basename. If isMain and no args givine parses console.args.</td></tr>
<tr><td>setInterval</td><td>setInterval(callback:function, ms:number):number </td><td>Setup recurring function to run every given millisecs.</td></tr>
<tr><td>setTimeout</td><td>setTimeout(callback:function, ms:number):number </td><td>Setup function to run after given millisecs.</td></tr>
<tr><td>sleep</td><td>sleep(secs:number=1.0):void </td><td>sleep for N milliseconds, minimum .001.</td></tr>
<tr><td>source</td><td>source(val:string|array, <a href='#System.sourceOptions'>options</a>:object=void):void </td><td>Load and evaluate source files.</td></tr>
<tr><td>strftime</td><td>strftime(num:number=null, <a href='#System.strftimeOptions'>options</a>:string|object=void):string </td><td>Format numeric time (in ms) to a string. Null or no value will use current time.</td></tr>
<tr><td>strptime</td><td>strptime(val:string=void, <a href='#System.strptimeOptions'>options</a>:string|object=void):number </td><td>Parse time from string and return ms time since 1970-01-01 in UTC, or NaN.</td></tr>
<tr><td>times</td><td>times(callback:function|boolean, count:number=1):number </td><td>Call function count times and return execution time in microseconds.</td></tr>







>
|
|







1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
<tr><td>printf</td><td>printf(format:string, ...):void </td><td>Formatted output to stdout.</td></tr>
<tr><td>provide</td><td>provide(name:string|function=void, version:number|string=1.0, opts:object|function=void):void </td><td>Provide a package for use with require. Default is the file tail-rootname.</td></tr>
<tr><td>puts</td><td>puts(val, ...):void </td><td>Output one or more values to stdout. Each argument is quoted.  Use Interp.logOpts to control source line and/or timestamps output.</td></tr>
<tr><td>quote</td><td>quote(val:string):string </td><td>Return quoted string.</td></tr>
<tr><td>require</td><td>require(name:string=void, version:number|string=1, <a href='#System.requireOptions'>options</a>:object=void):number|array|object </td><td>Load/query packages. With no arguments, returns the list of all loaded packages.
With one argument, loads the package (if necessary) and returns its version.
With two arguments, returns object containing: version, loadFile, func.
A third argument sets options for package or module.
Note an error is thrown if requested version is greater than actual version.</td></tr>
<tr><td>runModule</td><td>runModule(cmd:string|null|function=void, conf:array=undefined) </td><td>Invoke named module. If name is empty, uses file basename. If isMain and no args givine parses console.args.</td></tr>
<tr><td>setInterval</td><td>setInterval(callback:function, ms:number):number </td><td>Setup recurring function to run every given millisecs.</td></tr>
<tr><td>setTimeout</td><td>setTimeout(callback:function, ms:number):number </td><td>Setup function to run after given millisecs.</td></tr>
<tr><td>sleep</td><td>sleep(secs:number=1.0):void </td><td>sleep for N milliseconds, minimum .001.</td></tr>
<tr><td>source</td><td>source(val:string|array, <a href='#System.sourceOptions'>options</a>:object=void):void </td><td>Load and evaluate source files.</td></tr>
<tr><td>strftime</td><td>strftime(num:number=null, <a href='#System.strftimeOptions'>options</a>:string|object=void):string </td><td>Format numeric time (in ms) to a string. Null or no value will use current time.</td></tr>
<tr><td>strptime</td><td>strptime(val:string=void, <a href='#System.strptimeOptions'>options</a>:string|object=void):number </td><td>Parse time from string and return ms time since 1970-01-01 in UTC, or NaN.</td></tr>
<tr><td>times</td><td>times(callback:function|boolean, count:number=1):number </td><td>Call function count times and return execution time in microseconds.</td></tr>