Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Changes In Branch jim076 Excluding Merge-Ins
This is equivalent to a diff from 188c62c2d5 to 523e68e945
|
2015-02-05
| ||
| 01:16 | Update the Jim Tcl included with autosetup to 0.76. check-in: 31c03de8f4 user: mistachkin tags: trunk | |
|
2015-02-04
| ||
| 13:32 | Add autofocus to search entry boxes. check-in: c799881474 user: drh tags: trunk | |
| 07:17 | Update the Jim Tcl included with autosetup to 0.76. Closed-Leaf check-in: 523e68e945 user: mistachkin tags: jim076 | |
| 03:12 | Increase the default number of tokens present in snippets from an indexed search so that a typical snippet is about two lines of text instead of just one. check-in: 188c62c2d5 user: drh tags: trunk | |
|
2015-02-03
| ||
| 20:59 | Physically move the 'index-page' setting into the project section. check-in: 8151106b8d user: mistachkin tags: trunk | |
Changes to autosetup/jimsh0.c.
| ︙ | |||
36 37 38 39 40 41 42 43 44 45 46 | 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 | + + - + | #else #define TCL_PLATFORM_OS "unknown" #define TCL_PLATFORM_PLATFORM "unix" #define TCL_PLATFORM_PATH_SEPARATOR ":" #define HAVE_VFORK #define HAVE_WAITPID #define HAVE_ISATTY #define HAVE_MKSTEMP #define HAVE_LINK #define HAVE_SYS_TIME_H #define HAVE_DIRENT_H #define HAVE_UNISTD_H #endif |
| ︙ | |||
111 112 113 114 115 116 117 118 119 120 121 122 123 124 | 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 | + | DIR *opendir(const char *name); int closedir(DIR *dir); struct dirent *readdir(DIR *dir); #elif defined(__MINGW32__) #include <stdlib.h> #define strtod __strtod #endif #endif #ifdef __cplusplus |
| ︙ | |||
1046 1047 1048 1049 1050 1051 1052 1053 1054 | 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 | + + + + + + + + + + + + + + + + - - + + + + + - - + - + + - + |
return Jim_EvalSource(interp, "initjimsh.tcl", 1,
"\n"
"\n"
"\n"
"proc _jimsh_init {} {\n"
" rename _jimsh_init {}\n"
" global jim::exe jim::argv0 tcl_interactive auto_path tcl_platform\n"
"\n"
"\n"
" if {[exists jim::argv0]} {\n"
" if {[string match \"*/*\" $jim::argv0]} {\n"
" set jim::exe [file join [pwd] $jim::argv0]\n"
" } else {\n"
" foreach path [split [env PATH \"\"] $tcl_platform(pathSeparator)] {\n"
" set exec [file join [pwd] [string map {\\\\ /} $path] $jim::argv0]\n"
" if {[file executable $exec]} {\n"
" set jim::exe $exec\n"
" break\n"
" }\n"
" }\n"
" }\n"
" }\n"
"\n"
"\n"
|
| ︙ | |||
1089 1090 1091 1092 1093 1094 1095 | 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 | - + |
"\n"
"package require readdir\n"
"\n"
"\n"
"proc glob.globdir {dir pattern} {\n"
" if {[file exists $dir/$pattern]} {\n"
"\n"
|
| ︙ | |||
1151 1152 1153 1154 1155 1156 1157 | 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 | - + |
" break\n"
" }\n"
" }\n"
"\n"
" foreach old $oldexp {\n"
" lappend newexp $old$suf\n"
" }\n"
|
| ︙ | |||
1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 | 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 | + - + - - + - - - + + + - + - + + + - + + + + + - + |
"\n"
"\n"
"\n"
"\n"
"proc glob {args} {\n"
" set nocomplain 0\n"
" set base \"\"\n"
" set tails 0\n"
"\n"
" set n 0\n"
" foreach arg $args {\n"
" if {[info exists param]} {\n"
" set $param $arg\n"
" unset param\n"
" incr n\n"
" continue\n"
" }\n"
" switch -glob -- $arg {\n"
" -d* {\n"
" set switch $arg\n"
" set param base\n"
" }\n"
" -n* {\n"
" set nocomplain 1\n"
" }\n"
|
| ︙ | |||
1346 1347 1348 1349 1350 1351 1352 | 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 | - + - + - - - - - - - + - - - |
"\n"
" set stacktrace [info stacktrace]\n"
"\n"
" lappend stacktrace {*}[stacktrace 1]\n"
" }\n"
" lassign $stacktrace p f l\n"
" if {$f ne \"\"} {\n"
|
| ︙ | |||
1585 1586 1587 1588 1589 1590 1591 | 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 | - + - + |
"\n"
"proc {file copy} {{force {}} source target} {\n"
" try {\n"
" if {$force ni {{} -force}} {\n"
" error \"bad option \\\"$force\\\": should be -force\"\n"
" }\n"
"\n"
|
| ︙ | |||
1689 1690 1691 1692 1693 1694 1695 | 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 | - + - + - + |
" }\n"
" lappend catchopts $opt\n"
" }\n"
" if {[llength $args] == 0} {\n"
" return -code error {wrong # args: should be \"try ?options? script ?argument ...?\"}\n"
" }\n"
" set args [lassign $args script]\n"
|
| ︙ | |||
2500 2501 2502 2503 2504 2505 2506 2507 2508 2509 2510 2511 2512 2513 2514 2515 2516 2517 2518 2519 2520 2521 2522 2523 2524 2525 2526 2527 2528 2529 2530 2531 2532 2533 | 2519 2520 2521 2522 2523 2524 2525 2526 2527 2528 2529 2530 2531 2532 2533 2534 2535 2536 2537 2538 2539 2540 2541 2542 2543 2544 2545 2546 2547 2548 2549 2550 2551 2552 2553 2554 | + + |
Jim_CreateCommand(interp, buf, JimAioSubCmdProc, af, JimAioDelProc);
Jim_SetResult(interp, Jim_MakeGlobalNamespaceName(interp, Jim_NewStringObj(interp, buf, -1)));
return JIM_OK;
}
#if defined(HAVE_PIPE) || (defined(HAVE_SOCKETPAIR) && defined(HAVE_SYS_UN_H))
static int JimMakeChannelPair(Jim_Interp *interp, int p[2], Jim_Obj *filename,
const char *hdlfmt, int family, const char *mode[2])
{
if (JimMakeChannel(interp, NULL, p[0], filename, hdlfmt, family, mode[0]) == JIM_OK) {
Jim_Obj *objPtr = Jim_NewListObj(interp, NULL, 0);
Jim_ListAppendElement(interp, objPtr, Jim_GetResult(interp));
if (JimMakeChannel(interp, NULL, p[1], filename, hdlfmt, family, mode[1]) == JIM_OK) {
Jim_ListAppendElement(interp, objPtr, Jim_GetResult(interp));
Jim_SetResult(interp, objPtr);
return JIM_OK;
}
}
close(p[0]);
close(p[1]);
JimAioSetError(interp, NULL);
return JIM_ERR;
}
#endif
int Jim_MakeTempFile(Jim_Interp *interp, const char *template)
{
#ifdef HAVE_MKSTEMP
int fd;
mode_t mask;
|
| ︙ | |||
2550 2551 2552 2553 2554 2555 2556 | 2571 2572 2573 2574 2575 2576 2577 2578 2579 2580 2581 2582 2583 2584 2585 2586 2587 2588 2589 2590 2591 2592 2593 | - + - + |
mask = umask(S_IXUSR | S_IRWXG | S_IRWXO);
fd = mkstemp(filenameObj->bytes);
umask(mask);
if (fd < 0) {
|
| ︙ | |||
3174 3175 3176 3177 3178 3179 3180 3181 3182 3183 3184 3185 3186 3187 | 3195 3196 3197 3198 3199 3200 3201 3202 3203 3204 3205 3206 3207 3208 3209 3210 3211 3212 3213 3214 | + + + + + + |
#define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR)
#endif
# ifndef MAXPATHLEN
# define MAXPATHLEN JIM_PATH_LEN
# endif
#if defined(__MINGW32__) || defined(_MSC_VER)
#define ISWINDOWS 1
#else
#define ISWINDOWS 0
#endif
static const char *JimGetFileType(int mode)
{
if (S_ISREG(mode)) {
return "file";
}
else if (S_ISDIR(mode)) {
|
| ︙ | |||
3279 3280 3281 3282 3283 3284 3285 | 3306 3307 3308 3309 3310 3311 3312 3313 3314 3315 3316 3317 3318 3319 3320 3321 3322 3323 | - - + - |
Jim_SetResultString(interp, "..", -1);
} else if (!p) {
Jim_SetResultString(interp, ".", -1);
}
else if (p == path) {
Jim_SetResultString(interp, "/", -1);
}
|
| ︙ | |||
3371 3372 3373 3374 3375 3376 3377 | 3396 3397 3398 3399 3400 3401 3402 3403 3404 3405 3406 3407 3408 3409 3410 3411 3412 3413 | - - + - |
int len;
const char *part = Jim_GetString(argv[i], &len);
if (*part == '/') {
last = newname;
}
|
| ︙ | |||
3405 3406 3407 3408 3409 3410 3411 | 3428 3429 3430 3431 3432 3433 3434 3435 3436 3437 3438 3439 3440 3441 3442 3443 3444 3445 | + + - + + |
}
memcpy(last, part, len);
last += len;
}
if (last > newname + 1 && last[-1] == '/') {
if (!ISWINDOWS || !(last > newname + 2 && last[-2] == ':')) {
|
| ︙ | |||
3589 3590 3591 3592 3593 3594 3595 3596 3597 3598 3599 3600 3601 3602 | 3615 3616 3617 3618 3619 3620 3621 3622 3623 3624 3625 3626 3627 3628 3629 3630 3631 3632 3633 3634 3635 3636 3637 3638 3639 3640 3641 3642 3643 3644 3645 3646 3647 3648 3649 3650 3651 3652 3653 3654 3655 3656 3657 3658 3659 3660 3661 3662 3663 3664 3665 3666 | + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + |
Jim_SetResultFormatted(interp, "error renaming \"%#s\" to \"%#s\": %s", argv[0], argv[1],
strerror(errno));
return JIM_ERR;
}
return JIM_OK;
}
#if defined(HAVE_LINK) && defined(HAVE_SYMLINK)
static int file_cmd_link(Jim_Interp *interp, int argc, Jim_Obj *const *argv)
{
int ret;
const char *source;
const char *dest;
static const char * const options[] = { "-hard", "-symbolic", NULL };
enum { OPT_HARD, OPT_SYMBOLIC, };
int option = OPT_HARD;
if (argc == 3) {
if (Jim_GetEnum(interp, argv[0], options, &option, NULL, JIM_ENUM_ABBREV | JIM_ERRMSG) != JIM_OK) {
return JIM_ERR;
}
argv++;
argc--;
}
dest = Jim_String(argv[0]);
source = Jim_String(argv[1]);
if (option == OPT_HARD) {
ret = link(source, dest);
}
else {
ret = symlink(source, dest);
}
if (ret != 0) {
Jim_SetResultFormatted(interp, "error linking \"%#s\" to \"%#s\": %s", argv[0], argv[1],
strerror(errno));
return JIM_ERR;
}
return JIM_OK;
}
#endif
static int file_stat(Jim_Interp *interp, Jim_Obj *filename, struct stat *sb)
{
const char *path = Jim_String(filename);
if (stat(path, sb) == -1) {
Jim_SetResultFormatted(interp, "could not read \"%#s\": %s", filename, strerror(errno));
|
| ︙ | |||
3887 3888 3889 3890 3891 3892 3893 3894 3895 3896 3897 3898 3899 3900 | 3951 3952 3953 3954 3955 3956 3957 3958 3959 3960 3961 3962 3963 3964 3965 3966 3967 3968 3969 3970 3971 3972 3973 | + + + + + + + + + |
{ "rename",
"?-force? source dest",
file_cmd_rename,
2,
3,
},
#if defined(HAVE_LINK) && defined(HAVE_SYMLINK)
{ "link",
"?-symbolic|-hard? newname target",
file_cmd_link,
2,
3,
},
#endif
#if defined(HAVE_READLINK)
{ "readlink",
"name",
file_cmd_readlink,
1,
1,
|
| ︙ | |||
3980 3981 3982 3983 3984 3985 3986 | 4053 4054 4055 4056 4057 4058 4059 4060 4061 4062 4063 4064 4065 4066 4067 4068 4069 4070 4071 4072 4073 | - + - - |
char *cwd = Jim_Alloc(MAXPATHLEN);
if (getcwd(cwd, MAXPATHLEN) == NULL) {
Jim_SetResultString(interp, "Failed to get pwd", -1);
Jim_Free(cwd);
return JIM_ERR;
}
|
| ︙ | |||
5320 5321 5322 5323 5324 5325 5326 | 5391 5392 5393 5394 5395 5396 5397 5398 5399 5400 5401 5402 5403 5404 5405 5406 5407 5408 5409 5410 5411 5412 5413 5414 | - + - - - - - - - - - - - + + + + + + + + + |
return lseek(fd, 0L, SEEK_SET);
}
static int JimCreateTemp(Jim_Interp *interp, const char *contents, int len)
{
int fd = Jim_MakeTempFile(interp, NULL);
|
| ︙ | |||
7766 7767 7768 7769 7770 7771 7772 7773 7774 7775 7776 7777 7778 7779 | 7835 7836 7837 7838 7839 7840 7841 7842 7843 7844 7845 7846 7847 7848 7849 | + |
}
const char *Jim_String(Jim_Obj *objPtr)
{
if (objPtr->bytes == NULL) {
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)
|
| ︙ | |||
8528 8529 8530 8531 8532 8533 8534 | 8598 8599 8600 8601 8602 8603 8604 8605 8606 8607 8608 8609 8610 8611 8612 | - + |
objPtr->internalRep.scriptLineValue.line = line;
return objPtr;
}
static void FreeScriptInternalRep(Jim_Interp *interp, Jim_Obj *objPtr);
static void DupScriptInternalRep(Jim_Interp *interp, Jim_Obj *srcPtr, Jim_Obj *dupPtr);
|
| ︙ | |||
8556 8557 8558 8559 8560 8561 8562 8563 8564 8565 8566 8567 8568 8569 | 8626 8627 8628 8629 8630 8631 8632 8633 8634 8635 8636 8637 8638 8639 8640 | + |
int len;
int substFlags;
int inUse; /* Used to share a ScriptObj. Currently
only used by Jim_EvalObj() as protection against
shimmering of the currently evaluated object. */
int firstline;
int linenr;
int missing;
} ScriptObj;
void FreeScriptInternalRep(Jim_Interp *interp, Jim_Obj *objPtr)
{
int i;
struct ScriptObj *script = (void *)objPtr->internalRep.ptr;
|
| ︙ | |||
8834 8835 8836 8837 8838 8839 8840 | 8905 8906 8907 8908 8909 8910 8911 8912 8913 8914 8915 8916 8917 8918 8919 8920 8921 8922 8923 8924 8925 8926 8927 8928 8929 8930 8931 8932 8933 8934 8935 8936 8937 8938 8939 8940 8941 8942 8943 8944 8945 8946 8947 8948 8949 8950 8951 8952 8953 8954 8955 8956 8957 8958 8959 8960 8961 8962 8963 8964 8965 8966 8967 8968 8969 8970 8971 8972 8973 8974 8975 8976 8977 8978 8979 8980 8981 8982 8983 8984 8985 8986 8987 8988 8989 8990 8991 8992 8993 8994 8995 | - + - - - - + + - + - - + + - + - - - - + + + + + + + + + + + + + + - - + |
Jim_IncrRefCount(token->objPtr);
token++;
}
script->len = i;
}
|
| ︙ | |||
10899 10900 10901 10902 10903 10904 10905 | 10977 10978 10979 10980 10981 10982 10983 10984 10985 10986 10987 10988 10989 10990 10991 | - + |
objPtr->typePtr = &coercedDoubleObjType;
objPtr->internalRep.wideValue = wideValue;
return JIM_OK;
}
else {
if (Jim_StringToDouble(str, &doubleValue) != JIM_OK) {
|
| ︙ | |||
12329 12330 12331 12332 12333 12334 12335 12336 12337 12338 12339 12340 12341 12342 | 12407 12408 12409 12410 12411 12412 12413 12414 12415 12416 12417 12418 12419 12420 12421 | + |
JIM_EXPROP_BITNOT,
JIM_EXPROP_UNARYMINUS,
JIM_EXPROP_UNARYPLUS,
JIM_EXPROP_FUNC_FIRST,
JIM_EXPROP_FUNC_INT = JIM_EXPROP_FUNC_FIRST,
JIM_EXPROP_FUNC_WIDE,
JIM_EXPROP_FUNC_ABS,
JIM_EXPROP_FUNC_DOUBLE,
JIM_EXPROP_FUNC_ROUND,
JIM_EXPROP_FUNC_RAND,
JIM_EXPROP_FUNC_SRAND,
|
| ︙ | |||
12395 12396 12397 12398 12399 12400 12401 12402 12403 12404 12405 12406 12407 12408 | 12474 12475 12476 12477 12478 12479 12480 12481 12482 12483 12484 12485 12486 12487 12488 | + |
Jim_Obj *A = ExprPop(e);
double dA, dC = 0;
jim_wide wA, wC = 0;
if ((A->typePtr != &doubleObjType || A->bytes) && JimGetWideNoErr(interp, A, &wA) == JIM_OK) {
switch (e->opcode) {
case JIM_EXPROP_FUNC_INT:
case JIM_EXPROP_FUNC_WIDE:
case JIM_EXPROP_FUNC_ROUND:
case JIM_EXPROP_UNARYPLUS:
wC = wA;
break;
case JIM_EXPROP_FUNC_DOUBLE:
dC = wA;
intresult = 0;
|
| ︙ | |||
12419 12420 12421 12422 12423 12424 12425 12426 12427 12428 12429 12430 12431 12432 | 12499 12500 12501 12502 12503 12504 12505 12506 12507 12508 12509 12510 12511 12512 12513 | + |
default:
abort();
}
}
else if ((rc = Jim_GetDouble(interp, A, &dA)) == JIM_OK) {
switch (e->opcode) {
case JIM_EXPROP_FUNC_INT:
case JIM_EXPROP_FUNC_WIDE:
wC = dA;
break;
case JIM_EXPROP_FUNC_ROUND:
wC = dA < 0 ? (dA - 0.5) : (dA + 0.5);
break;
case JIM_EXPROP_FUNC_DOUBLE:
case JIM_EXPROP_UNARYPLUS:
|
| ︙ | |||
13091 13092 13093 13094 13095 13096 13097 13098 13099 13100 13101 13102 13103 13104 | 13172 13173 13174 13175 13176 13177 13178 13179 13180 13181 13182 13183 13184 13185 13186 | + |
OPRINIT("~", 150, 1, JimExprOpIntUnary),
OPRINIT(NULL, 150, 1, JimExprOpNumUnary),
OPRINIT(NULL, 150, 1, JimExprOpNumUnary),
OPRINIT("int", 200, 1, JimExprOpNumUnary),
OPRINIT("wide", 200, 1, JimExprOpNumUnary),
OPRINIT("abs", 200, 1, JimExprOpNumUnary),
OPRINIT("double", 200, 1, JimExprOpNumUnary),
OPRINIT("round", 200, 1, JimExprOpNumUnary),
OPRINIT("rand", 200, 0, JimExprOpNone),
OPRINIT("srand", 200, 1, JimExprOpIntUnary),
#ifdef JIM_MATH_FUNCTIONS
|
| ︙ | |||
14748 14749 14750 14751 14752 14753 14754 | 14830 14831 14832 14833 14834 14835 14836 14837 14838 14839 14840 14841 14842 14843 14844 14845 14846 14847 14848 14849 14850 14851 14852 14853 14854 14855 14856 14857 14858 14859 14860 14861 14862 14863 14864 14865 14866 14867 14868 14869 14870 14871 14872 | - + - - - + - + - - - - - - |
nargv[0] = prefix;
memcpy(&nargv[1], &objv[0], sizeof(nargv[0]) * objc);
ret = Jim_EvalObjVector(interp, objc + 1, nargv);
Jim_Free(nargv);
return ret;
}
|
| ︙ | |||
14926 14927 14928 14929 14930 14931 14932 14933 14934 14935 14936 14937 14938 14939 | 15000 15001 15002 15003 15004 15005 15006 15007 15008 15009 15010 15011 15012 15013 15014 15015 | + + |
}
static int JimEvalObjList(Jim_Interp *interp, Jim_Obj *listPtr)
{
int retcode = JIM_OK;
JimPanic((Jim_IsList(listPtr) == 0, "JimEvalObjList() invoked on non-list."));
if (listPtr->internalRep.listValue.len) {
Jim_IncrRefCount(listPtr);
retcode = JimInvokeCommand(interp,
listPtr->internalRep.listValue.len,
listPtr->internalRep.listValue.ele);
Jim_DecrRefCount(interp, listPtr);
}
|
| ︙ | |||
14956 14957 14958 14959 14960 14961 14962 | 15032 15033 15034 15035 15036 15037 15038 15039 15040 15041 15042 15043 15044 15045 15046 15047 | - - + + |
Jim_Obj *prevScriptObj;
if (Jim_IsList(scriptObjPtr) && scriptObjPtr->bytes == NULL) {
return JimEvalObjList(interp, scriptObjPtr);
}
Jim_IncrRefCount(scriptObjPtr);
|
| ︙ | |||
15123 15124 15125 15126 15127 15128 15129 | 15199 15200 15201 15202 15203 15204 15205 15206 15207 15208 15209 15210 15211 15212 15213 15214 15215 15216 15217 15218 15219 15220 | + - + + + + + + + |
if (argv != sargv) {
Jim_Free(argv);
argv = sargv;
}
}
if (retcode == JIM_ERR) {
|
| ︙ | |||
15274 15275 15276 15277 15278 15279 15280 | 15357 15358 15359 15360 15361 15362 15363 15364 15365 15366 15367 15368 15369 15370 15371 | - + |
callFramePtr->argv = argv;
callFramePtr->argc = argc;
callFramePtr->procArgsObjPtr = cmd->u.proc.argListObjPtr;
callFramePtr->procBodyObjPtr = cmd->u.proc.bodyObjPtr;
callFramePtr->staticVars = cmd->u.proc.staticVars;
|
| ︙ | |||
15471 15472 15473 15474 15475 15476 15477 | 15554 15555 15556 15557 15558 15559 15560 15561 15562 15563 15564 15565 15566 15567 | - - - - - - - - |
fclose(fp);
buf[readlen] = 0;
scriptObjPtr = Jim_NewStringObjNoAlloc(interp, buf, readlen);
JimSetSourceInfo(interp, scriptObjPtr, Jim_NewStringObj(interp, filename, -1), 1);
Jim_IncrRefCount(scriptObjPtr);
|
| ︙ | |||
16028 16029 16030 16031 16032 16033 16034 | 16103 16104 16105 16106 16107 16108 16109 16110 16111 16112 16113 16114 16115 16116 16117 | - + |
ExprByteCode *expr;
jim_wide stop, currentVal;
Jim_Obj *objPtr;
int cmpOffset;
expr = JimGetExpression(interp, argv[2]);
|
| ︙ | |||
17015 17016 17017 17018 17019 17020 17021 | 17090 17091 17092 17093 17094 17095 17096 17097 17098 17099 17100 17101 17102 17103 17104 | - + |
static int Jim_AppendCoreCommand(Jim_Interp *interp, int argc, Jim_Obj *const *argv)
{
Jim_Obj *stringObjPtr;
int i;
if (argc < 2) {
|
| ︙ | |||
17064 17065 17066 17067 17068 17069 17070 | 17139 17140 17141 17142 17143 17144 17145 17146 17147 17148 17149 17150 17151 17152 17153 | - + |
static int Jim_EvalCoreCommand(Jim_Interp *interp, int argc, Jim_Obj *const *argv)
{
int rc;
if (argc < 2) {
|
| ︙ | |||
17275 17276 17277 17278 17279 17280 17281 | 17350 17351 17352 17353 17354 17355 17356 17357 17358 17359 17360 17361 17362 17363 17364 | - + |
static int JimAliasCmd(Jim_Interp *interp, int argc, Jim_Obj *const *argv)
{
Jim_Obj *cmdList;
Jim_Obj *prefixListObj = Jim_CmdPrivData(interp);
cmdList = Jim_DuplicateObj(interp, prefixListObj);
|
| ︙ | |||
17595 17596 17597 17598 17599 17600 17601 | 17670 17671 17672 17673 17674 17675 17676 17677 17678 17679 17680 17681 17682 17683 17684 17685 17686 17687 17688 17689 17690 | - + - + |
static int Jim_StringCoreCommand(Jim_Interp *interp, int argc, Jim_Obj *const *argv)
{
int len;
int opt_case = 1;
int option;
static const char * const options[] = {
"bytelength", "length", "compare", "match", "equal", "is", "byterange", "range", "replace",
|
| ︙ | |||
17634 17635 17636 17637 17638 17639 17640 17641 17642 17643 17644 17645 17646 17647 | 17709 17710 17711 17712 17713 17714 17715 17716 17717 17718 17719 17720 17721 17722 17723 17724 17725 17726 17727 17728 17729 17730 17731 17732 17733 17734 17735 17736 17737 17738 17739 17740 17741 | + + + + + + + + + + + + + + + + + + + |
len = Jim_Utf8Length(interp, argv[2]);
}
else {
len = Jim_Length(argv[2]);
}
Jim_SetResultInt(interp, len);
return JIM_OK;
case OPT_CAT:{
Jim_Obj *objPtr;
if (argc == 3) {
objPtr = argv[2];
}
else {
int i;
objPtr = Jim_NewStringObj(interp, "", 0);
for (i = 2; i < argc; i++) {
Jim_AppendObj(interp, objPtr, argv[i]);
}
}
Jim_SetResult(interp, objPtr);
return JIM_OK;
}
case OPT_COMPARE:
case OPT_EQUAL:
{
long opt_length = -1;
int n = argc - 4;
|
| ︙ | |||
18617 18618 18619 18620 18621 18622 18623 | 18711 18712 18713 18714 18715 18716 18717 18718 18719 18720 18721 18722 18723 18724 18725 18726 18727 18728 18729 18730 18731 18732 18733 18734 18735 18736 18737 18738 18739 18740 18741 18742 18743 18744 18745 18746 18747 18748 18749 18750 18751 18752 18753 18754 18755 18756 18757 18758 18759 18760 18761 | - + - + - - + + + + + + + + + + - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + |
break;
case INFO_SCRIPT:
if (argc != 2) {
Jim_WrongNumArgs(interp, 2, argv, "");
return JIM_ERR;
}
|
| ︙ | |||
21841 21842 21843 21844 21845 21846 21847 | 21944 21945 21946 21947 21948 21949 21950 21951 21952 21953 21954 21955 21956 21957 21958 | - + |
Jim_RegisterCoreCommands(interp);
if (Jim_InitStaticExtensions(interp) != JIM_OK) {
JimPrintErrorMessage(interp);
}
|
| ︙ |