Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Changes In Branch cleanX Excluding Merge-Ins
This is equivalent to a diff from 75ddc3687a to 81d72e7257
|
2017-08-30
| ||
| 13:29 | Merge cleanX Leaf check-in: fd47eae7da user: jan.nijtmans tags: cleanX-no-clean-glob | |
| 13:17 | Don't prompt before removing empty directories Leaf check-in: 81d72e7257 user: jan.nijtmans tags: cleanX | |
| 13:02 | Merge trunk check-in: d4f98e25c1 user: jan.nijtmans tags: cleanX | |
|
2016-10-05
| ||
| 12:59 | Ensure that inputs to delta_create() are always memory aligned as if obtained from malloc(). check-in: c91e487140 user: drh tags: trunk | |
| 06:54 | Given that the buffer may not actually be memory obtained by malloc(), make sure that it is, that checksum() doesn't fail an assertion. Closed-Leaf check-in: 75ddc3687a user: andybradford tags: pending-review | |
| 06:40 | The 'manifest' setting still needs to be marked as 'versionable'. check-in: 3604802d55 user: mistachkin tags: trunk | |
Added .fossil-settings/binary-glob.
|
Deleted .fossil-settings/clean-glob.
| - - - - - - - - - - - - - - - - - |
|
Added .fossil-settings/crlf-glob.
|
Changes to .fossil-settings/encoding-glob.
1 2 | 1 2 3 4 | + + | compat/zlib/contrib/dotzlib/DotZLib/*.cs test/utf16be.txt test/utf16le.txt win/fossil.rc |
Changes to .fossil-settings/ignore-glob.
|
Changes to Dockerfile.
1 2 3 | 1 2 3 4 5 6 7 8 9 10 11 | - + | ### # Dockerfile for Fossil ### |
| ︙ |
Changes to Makefile.in.
| ︙ | |||
35 36 37 38 39 40 41 42 43 44 45 46 47 48 | 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 | + | #### Tcl shell for use in running the fossil testsuite. If you do not # care about testing the end result, this can be blank. # TCLSH = tclsh LIB = @LDFLAGS@ @EXTRA_LDFLAGS@ @LIBS@ BCCFLAGS = @CPPFLAGS@ @CFLAGS@ TCCFLAGS = @EXTRA_CFLAGS@ @CPPFLAGS@ @CFLAGS@ -DHAVE_AUTOCONFIG_H -D_HAVE_SQLITE_CONFIG_H INSTALLDIR = $(DESTDIR)@prefix@/bin USE_SYSTEM_SQLITE = @USE_SYSTEM_SQLITE@ USE_LINENOISE = @USE_LINENOISE@ USE_SEE = @USE_SEE@ FOSSIL_ENABLE_MINIZ = @FOSSIL_ENABLE_MINIZ@ |
| ︙ |
Changes to VERSION.
| 1 | - + |
|
Changes to ajax/index.html.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 | - + - - - + + |
|
| ︙ |
Changes to ajax/wiki-editor.html.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 | - + - - - + + |
|
| ︙ |
Changes to art/CollRev3.dia.
| ︙ | |||
782 783 784 785 786 787 788 | 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 | - + |
</dia:attribute>
<dia:attribute name="obj_bb">
<dia:rectangle val="6,14.4575;9.245,16.1975"/>
</dia:attribute>
<dia:attribute name="text">
<dia:composite type="text">
<dia:attribute name="string">
|
| ︙ |
Changes to art/CollRev4.dia.
| ︙ | |||
472 473 474 475 476 477 478 | 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 | - + |
</dia:attribute>
<dia:attribute name="obj_bb">
<dia:rectangle val="6,2.4575;7.385,4.1975"/>
</dia:attribute>
<dia:attribute name="text">
<dia:composite type="text">
<dia:attribute name="string">
|
| ︙ | |||
506 507 508 509 510 511 512 | 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 | - + |
</dia:attribute>
<dia:attribute name="obj_bb">
<dia:rectangle val="4,9.4575;5.385,11.1975"/>
</dia:attribute>
<dia:attribute name="text">
<dia:composite type="text">
<dia:attribute name="string">
|
| ︙ | |||
607 608 609 610 611 612 613 | 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 | - + |
</dia:attribute>
<dia:attribute name="obj_bb">
<dia:rectangle val="8,6.4575;10.2797,8.1975"/>
</dia:attribute>
<dia:attribute name="text">
<dia:composite type="text">
<dia:attribute name="string">
|
| ︙ |
Changes to auto.def.
| ︙ | |||
9 10 11 12 13 14 15 | 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | - + |
with-zlib:path|auto|tree
=> {Look for zlib in the given path, automatically, or in the source tree}
with-exec-rel-paths=0
=> {Enable relative paths for external diff/gdiff}
with-legacy-mv-rm=0 => {Enable legacy behavior for mv/rm (skip checkout files)}
with-th1-docs=0 => {Enable TH1 for embedded documentation pages}
with-th1-hooks=0 => {Enable TH1 hooks for commands and web pages}
|
| ︙ | |||
86 87 88 89 90 91 92 | 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 | - - + + - - + + |
# search for the system SQLite once with -ldl, and once without. If
# the library can only be found with $extralibs set to -ldl, then
# the code below will append -ldl to LIBS.
#
foreach extralibs {{} {-ldl}} {
# Locate the system SQLite by searching for sqlite3_open(). Then check
|
| ︙ | |||
130 131 132 133 134 135 136 137 138 139 140 141 142 143 | 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 | + |
if {[string match *-solaris* [get-define host]]} {
define-append EXTRA_CFLAGS {-D_XOPEN_SOURCE=500 -D__EXTENSIONS__}
}
if {[opt-bool fossil-debug]} {
define-append EXTRA_CFLAGS -DFOSSIL_DEBUG
define CFLAGS {-g -O0}
msg-result "Debugging support enabled"
}
if {[opt-bool with-see]} {
define-append EXTRA_CFLAGS -DUSE_SEE
define USE_SEE 1
msg-result "Enabling encryption support"
|
| ︙ | |||
477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 | 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 | + |
}
cc-check-function-in-lib dlopen dl
cc-check-function-in-lib sin m
# Check for the FuseFS library
if {[opt-bool fusefs]} {
if {[cc-check-function-in-lib fuse_mount fuse]} {
define-append EXTRA_CFLAGS -DFOSSIL_HAVE_FUSEFS
define FOSSIL_HAVE_FUSEFS 1
define-append LIBS -lfuse
msg-result "FuseFS support enabled"
}
}
make-template Makefile.in
make-config-header autoconfig.h -auto {USE_* FOSSIL_*}
|
Changes to autosetup/autosetup.
| ︙ | |||
57 58 59 60 61 62 63 | 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 | - + + + + + + + + - + - |
# (b)
if {[getenv WRAPPER ""] eq ""} {
# Invoked directly
set autosetup(srcdir) [pwd]
} else {
# Invoked via the configure wrapper
|
| ︙ | |||
196 197 198 199 200 201 202 | 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 | - + - - + + + + + + + + + + + + - + + + + + + + + + + + + - + + + + + + + + + + - + - + | configlog "define $n $define($n)" } } exit 0 } |
| ︙ | |||
273 274 275 276 277 278 279 | 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 | - - - + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + |
if {[string match "-*" $opt]} {
# This is a documentation-only option, like "-C <dir>"
set opthelp $opt
} elseif {$colon eq ""} {
# Boolean option
lappend autosetup(options) $name
|
| ︙ | |||
428 429 430 431 432 433 434 | 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 | - + |
if {$::autosetup(showhelp)} {
options-show
exit 0
}
# Check for invalid options
if {[opt-bool option-checking]} {
|
| ︙ | |||
1094 1095 1096 1097 1098 1099 1100 | 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 | - + + + + + + + + - + - - + + - + - + + - + - - - - - - - - - - - - - - - + - - - - - - - - - - - - - - - - - - - - - |
set modsource(getopt) {
# Copyright (c) 2006 WorkWare Systems http://www.workware.net.au/
# All rights reserved
# Simple getopt module
# Parse everything out of the argv list which looks like an option
|
| ︙ |
Changes to autosetup/cc-lib.tcl.
| ︙ | |||
155 156 157 158 159 160 161 | 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 | + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + |
msg-result "not found"
}
cctest_alignof _Alignof
cctest_alignof __alignof__
cctest_alignof __alignof
}
# @cc-check-alloca
#
# The equivalent of the AC_FUNC_ALLOCA macro
#
# Checks for the existence of alloca
# defines HAVE_ALLOCA and returns 1 if it exists
proc cc-check-alloca {} {
cc-check-some-feature alloca {
cctest -includes alloca.h -code { alloca (2 * sizeof (int)); }
}
}
# @cc-signal-return-type
#
# The equivalent of the AC_TYPE_SIGNAL macro
#
# defines RETSIGTYPE to int or void
proc cc-signal-return-type {} {
msg-checking "Checking return type of signal handlers..."
cc-with {-includes {sys/types.h signal.h}} {
if {[cctest -code {return *(signal (0, 0)) (0) == 1;}]} {
set type int
} else {
set type void
}
define RETSIGTYPE $type
msg-result $type
}
}
|
Changes to autosetup/cc-shared.tcl.
| ︙ | |||
101 102 103 104 105 106 107 108 109 110 111 112 | 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 | + + + + + |
define SHOBJ_LDFLAGS -shared
define SH_CFLAGS ""
define SH_LDFLAGS -shared
define SH_LINKFLAGS ""
define SH_SOPREFIX ""
define LD_LIBRARY_PATH LIBRARY_PATH
}
microblaze* {
# Microblaze generally needs -fPIC rather than -fpic
define SHOBJ_CFLAGS -fPIC
define SH_CFLAGS -fPIC
}
}
if {![is-defined SHOBJ_LDFLAGS_R]} {
define SHOBJ_LDFLAGS_R [get-define SHOBJ_LDFLAGS]
}
|
Changes to autosetup/cc.tcl.
| ︙ | |||
45 46 47 48 49 50 51 | 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 | + - + |
proc cctest_type {type} {
cctest -code "$type _x;"
}
# Checks for the existence of the given type/structure member.
# e.g. "struct stat.st_mtime"
proc cctest_member {struct_member} {
# split at the first dot
|
| ︙ | |||
206 207 208 209 210 211 212 | 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 | - + | # Checks that the given function can be found in one of the libs. # # First checks for no library required, then checks each of the libraries # in turn. # # If the function is found, the feature is defined and lib_$function is defined # to -l$lib where the function was found, or "" if no library required. |
| ︙ | |||
228 229 230 231 232 233 234 | 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 | - + + |
incr found
} else {
foreach lib $libs {
cc-with [list -libs -l$lib] {
if {[cctest_function $function]} {
msg-result -l$lib
define lib_$function -l$lib
|
| ︙ | |||
494 495 496 497 498 499 500 | 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 | - + + + - + + + |
lappend cmdline {*}[get-define CC] {*}[get-define CFLAGS]
}
default {
autosetup-error "cctest called with unknown language: $opts(-lang)"
}
}
|
| ︙ |
Changes to autosetup/jimsh0.c.
1 2 3 4 5 6 7 8 9 | 1 2 3 4 5 6 7 8 9 10 11 | + + | /* This is single source file, bootstrap version of Jim Tcl. See http://jim.tcl.tk/ */ #define _GNU_SOURCE #define JIM_TCL_COMPAT #define JIM_REFERENCES #define JIM_ANSIC #define JIM_REGEXP #define HAVE_NO_AUTOCONF #define _JIMAUTOCONF_H #define TCL_LIBRARY "." #define jim_ext_bootstrap #define jim_ext_aio |
| ︙ | |||
31 32 33 34 35 36 37 | 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 | - - - - - - - + | #define HAVE_SYS_TIME_H #define HAVE_DIRENT_H #define HAVE_UNISTD_H #else #define TCL_PLATFORM_OS "unknown" #define TCL_PLATFORM_PLATFORM "unix" #define TCL_PLATFORM_PATH_SEPARATOR ":" |
| ︙ | |||
107 108 109 110 111 112 113 | 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 | - + - - + + - + |
#define HAVE_OPENDIR
struct dirent {
char *d_name;
};
typedef struct DIR {
|
| ︙ | |||
177 178 179 180 181 182 183 | 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 | - - - + + + |
#ifdef __cplusplus
extern "C" {
#endif
#include <time.h>
#include <limits.h>
|
| ︙ | |||
226 227 228 229 230 231 232 | 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 | - - + + - - - - - + + + + + - - - - + + + + - - + + | #define JIM_BREAK 3 #define JIM_CONTINUE 4 #define JIM_SIGNAL 5 #define JIM_EXIT 6 #define JIM_EVAL 7 |
| ︙ | |||
341 342 343 344 345 346 347 | 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 | - - - - - + + + + + - + - + - + - + - + - + - - + + - + - + - + - - - + + + - + - + - + - + - + - + - + - - + + |
#define Jim_GetHashEntryVal(he) ((he)->u.val)
#define Jim_GetHashTableCollisions(ht) ((ht)->collisions)
#define Jim_GetHashTableSize(ht) ((ht)->size)
#define Jim_GetHashTableUsed(ht) ((ht)->used)
typedef struct Jim_Obj {
|
| ︙ | |||
444 445 446 447 448 449 450 | 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 | - + - - + + - - - - - - - - - - - - + + + + + + + + + + + + - - - + + + - - - + + + - - - - + + + + - + - - - - - - + + + + + + - - + + - + - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + - - - - - - - - - - + + + + + + + + + + - - - - - - + + + + + + - - - - - + + + + + |
typedef void (Jim_FreeInternalRepProc)(struct Jim_Interp *interp,
struct Jim_Obj *objPtr);
typedef void (Jim_DupInternalRepProc)(struct Jim_Interp *interp,
struct Jim_Obj *srcPtr, Jim_Obj *dupPtr);
typedef void (Jim_UpdateStringProc)(struct Jim_Obj *objPtr);
typedef struct Jim_ObjType {
|
| ︙ | |||
833 834 835 836 837 838 839 | 829 830 831 832 833 834 835 836 837 838 839 840 841 842 | - - - - |
JIM_EXPORT int Jim_EvalExpression (Jim_Interp *interp,
Jim_Obj *exprObjPtr, Jim_Obj **exprResultPtrPtr);
JIM_EXPORT int Jim_GetBoolFromExpr (Jim_Interp *interp,
Jim_Obj *exprObjPtr, int *boolPtr);
|
| ︙ | |||
910 911 912 913 914 915 916 | 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 | - + - - + + - - - - - - + + + + + + | JIM_EXPORT int Jim_IsDict(Jim_Obj *objPtr); JIM_EXPORT int Jim_IsList(Jim_Obj *objPtr); #ifdef __cplusplus } #endif |
| ︙ | |||
966 967 968 969 970 971 972 | 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 | - - + + - - - - - - - - + + + + + + + + - - - - + + + + - - - - - + + + + + - - - + + + - - - + + + |
typedef struct {
int rm_so;
int rm_eo;
} regmatch_t;
typedef struct regexp {
|
| ︙ | |||
1786 1787 1788 1789 1790 1791 1792 | 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 | - | " }\n" " file delete $path\n" "}\n" ); } |
| ︙ | |||
1815 1816 1817 1818 1819 1820 1821 | 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 | - - + + | #if defined(JIM_SSL) #include <openssl/ssl.h> #include <openssl/err.h> #endif |
| ︙ | |||
1855 1856 1857 1858 1859 1860 1861 | 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 | - + |
} JimAioFopsType;
typedef struct AioFile
{
FILE *fp;
Jim_Obj *filename;
int type;
|
| ︙ | |||
1886 1887 1888 1889 1890 1891 1892 | 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 | - + |
static int stdio_error(const AioFile *af)
{
if (!ferror(af->fp)) {
return JIM_OK;
}
clearerr(af->fp);
|
| ︙ | |||
1952 1953 1954 1955 1956 1957 1958 | 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 | - - + + |
AioFile *af = privData;
JIM_NOTUSED(interp);
Jim_DecrRefCount(interp, af->filename);
#ifdef jim_ext_eventloop
|
| ︙ | |||
1975 1976 1977 1978 1979 1980 1981 | 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 | - + |
static int aio_cmd_read(Jim_Interp *interp, int argc, Jim_Obj *const *argv)
{
AioFile *af = Jim_CmdPrivData(interp);
char buf[AIO_BUF_LEN];
Jim_Obj *objPtr;
int nonewline = 0;
|
| ︙ | |||
2014 2015 2016 2017 2018 2019 2020 | 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 | - + |
if (neededLen != -1) {
neededLen -= retval;
}
}
if (retval != readlen)
break;
}
|
| ︙ | |||
2036 2037 2038 2039 2040 2041 2042 | 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 | - + |
return JIM_OK;
}
AioFile *Jim_AioFile(Jim_Interp *interp, Jim_Obj *command)
{
Jim_Cmd *cmdPtr = Jim_GetCommand(interp, command, JIM_ERRMSG);
|
| ︙ | |||
2117 2118 2119 2120 2121 2122 2123 | 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 | - + - + - + |
if (buf[AIO_BUF_LEN - 1] == '\0' && buf[AIO_BUF_LEN - 2] != '\n') {
Jim_AppendString(interp, objPtr, buf, AIO_BUF_LEN - 1);
}
else {
len = strlen(buf);
if (len && (buf[len - 1] == '\n')) {
|
| ︙ | |||
2371 2372 2373 2374 2375 2376 2377 | 2362 2363 2364 2365 2366 2367 2368 2369 2370 2371 2372 2373 2374 2375 2376 2377 2378 2379 2380 2381 2382 2383 2384 2385 2386 2387 2388 2389 2390 2391 2392 2393 2394 2395 2396 2397 2398 | - + - - + + - + - + - + - + |
return Jim_EvalObjBackground(interp, *objPtrPtr);
}
static int aio_eventinfo(Jim_Interp *interp, AioFile * af, unsigned mask, Jim_Obj **scriptHandlerObj,
int argc, Jim_Obj * const *argv)
{
if (argc == 0) {
|
| ︙ | |||
2422 2423 2424 2425 2426 2427 2428 | 2413 2414 2415 2416 2417 2418 2419 2420 2421 2422 2423 2424 2425 2426 2427 2428 2429 2430 2431 2432 2433 2434 2435 2436 2437 2438 2439 2440 2441 2442 2443 2444 2445 2446 2447 2448 2449 2450 2451 2452 2453 2454 2455 2456 2457 2458 2459 2460 2461 2462 2463 2464 2465 2466 2467 2468 2469 2470 2471 2472 2473 2474 2475 2476 2477 2478 2479 2480 2481 2482 2483 2484 2485 2486 2487 2488 2489 2490 2491 2492 2493 2494 2495 2496 2497 2498 2499 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 2534 2535 2536 2537 2538 2539 2540 2541 2542 2543 2544 2545 2546 2547 2548 2549 2550 2551 | - - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + |
AioFile *af = Jim_CmdPrivData(interp);
return aio_eventinfo(interp, af, JIM_EVENT_EXCEPTION, &af->eEvent, argc, argv);
}
#endif
|
| ︙ | |||
2574 2575 2576 2577 2578 2579 2580 | 2564 2565 2566 2567 2568 2569 2570 2571 2572 2573 2574 2575 2576 2577 2578 | - + |
mode = (argc == 3) ? Jim_String(argv[2]) : "r";
#ifdef jim_ext_tclcompat
{
const char *filename = Jim_String(argv[1]);
|
| ︙ | |||
2631 2632 2633 2634 2635 2636 2637 | 2621 2622 2623 2624 2625 2626 2627 2628 2629 2630 2631 2632 2633 2634 2635 | - + |
}
#endif
Jim_DecrRefCount(interp, filename);
return NULL;
}
}
|
| ︙ | |||
2669 2670 2671 2672 2673 2674 2675 | 2659 2660 2661 2662 2663 2664 2665 2666 2667 2668 2669 2670 2671 2672 2673 | - + |
if (JimMakeChannel(interp, NULL, p[1], filename, hdlfmt, family, mode[1])) {
Jim_ListAppendElement(interp, objPtr, Jim_GetResult(interp));
Jim_SetResult(interp, objPtr);
return JIM_OK;
}
}
|
| ︙ | |||
2703 2704 2705 2706 2707 2708 2709 | 2693 2694 2695 2696 2697 2698 2699 2700 2701 2702 2703 2704 2705 2706 2707 2708 2709 2710 2711 | - + - + |
else {
filenameObj = Jim_NewStringObj(interp, template, -1);
}
#if defined(S_IRWXG) && defined(S_IRWXO)
mask = umask(S_IXUSR | S_IRWXG | S_IRWXO);
#else
|
| ︙ | |||
2739 2740 2741 2742 2743 2744 2745 | 2729 2730 2731 2732 2733 2734 2735 2736 2737 2738 2739 2740 2741 2742 2743 | - + |
#endif
Jim_CreateCommand(interp, "open", JimAioOpenCommand, NULL, NULL);
#ifndef JIM_ANSIC
Jim_CreateCommand(interp, "socket", JimAioSockCommand, NULL, NULL);
#endif
|
| ︙ | |||
2839 2840 2841 2842 2843 2844 2845 | 2829 2830 2831 2832 2833 2834 2835 2836 2837 2838 2839 2840 2841 2842 2843 2844 2845 2846 2847 2848 2849 2850 2851 2852 | - + - + - + - + |
static regex_t *SetRegexpFromAny(Jim_Interp *interp, Jim_Obj *objPtr, unsigned flags)
{
regex_t *compre;
const char *pattern;
int ret;
|
| ︙ | |||
3009 3010 3011 3012 3013 3014 3015 | 2999 3000 3001 3002 3003 3004 3005 3006 3007 3008 3009 3010 3011 3012 3013 | - + |
if (match == REG_NOMATCH) {
goto done;
}
num_matches++;
if (opt_all && !opt_inline) {
|
| ︙ | |||
3049 3050 3051 3052 3053 3054 3055 | 3039 3040 3041 3042 3043 3044 3045 3046 3047 3048 3049 3050 3051 3052 3053 | - + |
}
}
if (opt_inline) {
Jim_ListAppendElement(interp, resultListObj, resultObj);
}
else {
|
| ︙ | |||
3176 3177 3178 3179 3180 3181 3182 | 3166 3167 3168 3169 3170 3171 3172 3173 3174 3175 3176 3177 3178 3179 3180 3181 3182 3183 3184 3185 3186 3187 3188 3189 3190 3191 3192 3193 3194 3195 | - + - + |
}
pattern = Jim_String(argv[i]);
source_str = Jim_GetString(argv[i + 1], &source_len);
replace_str = Jim_GetString(argv[i + 2], &replace_len);
varname = argv[i + 3];
|
| ︙ | |||
3250 3251 3252 3253 3254 3255 3256 | 3240 3241 3242 3243 3244 3245 3246 3247 3248 3249 3250 3251 3252 3253 3254 3255 3256 3257 3258 3259 3260 3261 3262 3263 3264 3265 3266 3267 3268 3269 3270 3271 3272 3273 3274 3275 3276 3277 | - + - + - + - + - + |
pmatch[idx].rm_eo - pmatch[idx].rm_so);
}
}
p += pmatch[0].rm_eo;
n -= pmatch[0].rm_eo;
|
| ︙ | |||
3379 3380 3381 3382 3383 3384 3385 | 3369 3370 3371 3372 3373 3374 3375 3376 3377 3378 3379 3380 3381 3382 3383 3384 3385 3386 3387 3388 3389 3390 3391 3392 3393 3394 3395 3396 3397 3398 3399 3400 3401 3402 3403 3404 3405 3406 3407 3408 3409 3410 3411 3412 3413 3414 3415 3416 3417 3418 3419 3420 3421 3422 3423 3424 3425 3426 3427 3428 3429 3430 3431 3432 3433 3434 3435 3436 3437 3438 3439 3440 3441 3442 3443 3444 | - + - + - + - + - + - + |
{
Jim_ListAppendElement(interp, listObj, Jim_NewStringObj(interp, key, -1));
Jim_ListAppendElement(interp, listObj, Jim_NewIntObj(interp, value));
}
static int StoreStatData(Jim_Interp *interp, Jim_Obj *varName, const struct stat *sb)
{
|
| ︙ | |||
3520 3521 3522 3523 3524 3525 3526 | 3510 3511 3512 3513 3514 3515 3516 3517 3518 3519 3520 3521 3522 3523 3524 3525 3526 3527 3528 3529 3530 3531 3532 3533 3534 3535 3536 3537 3538 3539 3540 3541 3542 3543 3544 3545 3546 3547 3548 3549 3550 3551 3552 3553 3554 3555 3556 3557 3558 3559 3560 3561 3562 3563 3564 3565 3566 3567 3568 3569 3570 3571 3572 3573 3574 | - + - + - + - + - + - + - + - + |
{
int i;
char *newname = Jim_Alloc(MAXPATHLEN + 1);
char *last = newname;
*newname = 0;
|
| ︙ | |||
3599 3600 3601 3602 3603 3604 3605 | 3589 3590 3591 3592 3593 3594 3595 3596 3597 3598 3599 3600 3601 3602 3603 | - + |
}
static int file_cmd_executable(Jim_Interp *interp, int argc, Jim_Obj *const *argv)
{
#ifdef X_OK
return file_access(interp, argv[0], X_OK);
#else
|
| ︙ | |||
3624 3625 3626 3627 3628 3629 3630 | 3614 3615 3616 3617 3618 3619 3620 3621 3622 3623 3624 3625 3626 3627 3628 | - + |
}
while (argc--) {
const char *path = Jim_String(argv[0]);
if (unlink(path) == -1 && errno != ENOENT) {
if (rmdir(path) == -1) {
|
| ︙ | |||
3647 3648 3649 3650 3651 3652 3653 | 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 3667 3668 3669 3670 3671 3672 3673 3674 3675 3676 3677 3678 3679 3680 3681 3682 3683 3684 3685 | - + - + - + - + - + - + |
#define MKDIR_DEFAULT(PATHNAME) mkdir(PATHNAME, 0755)
#endif
static int mkdir_all(char *path)
{
int ok = 1;
|
| ︙ | |||
3970 3971 3972 3973 3974 3975 3976 | 3960 3961 3962 3963 3964 3965 3966 3967 3968 3969 3970 3971 3972 3973 3974 3975 3976 3977 3978 3979 3980 3981 3982 3983 3984 3985 3986 3987 3988 3989 3990 3991 3992 3993 3994 3995 3996 3997 3998 3999 4000 4001 4002 4003 4004 4005 4006 4007 4008 4009 4010 4011 4012 4013 4014 4015 4016 4017 4018 4019 4020 4021 4022 4023 4024 4025 4026 4027 4028 4029 4030 4031 4032 4033 4034 4035 4036 4037 4038 4039 4040 4041 4042 4043 4044 4045 4046 4047 4048 4049 4050 4051 4052 4053 4054 4055 4056 4057 4058 4059 4060 4061 4062 4063 4064 4065 4066 4067 4068 4069 4070 4071 4072 4073 4074 4075 4076 4077 4078 4079 4080 4081 4082 4083 4084 4085 4086 4087 4088 4089 4090 4091 4092 4093 4094 4095 4096 4097 4098 4099 4100 4101 4102 4103 4104 4105 4106 4107 4108 4109 4110 4111 4112 4113 4114 4115 4116 4117 4118 4119 4120 4121 4122 4123 4124 4125 4126 4127 4128 4129 4130 4131 4132 4133 4134 4135 4136 4137 4138 4139 4140 4141 4142 4143 4144 4145 4146 4147 4148 4149 4150 4151 4152 4153 4154 4155 | - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + |
static const jim_subcmd_type file_command_table[] = {
{ "atime",
"name",
file_cmd_atime,
1,
1,
|
| ︙ | |||
4187 4188 4189 4190 4191 4192 4193 | 4177 4178 4179 4180 4181 4182 4183 4184 4185 4186 4187 4188 4189 4190 4191 | - + |
if (getcwd(cwd, MAXPATHLEN) == NULL) {
Jim_SetResultString(interp, "Failed to get pwd", -1);
Jim_Free(cwd);
return JIM_ERR;
}
else if (ISWINDOWS) {
|
| ︙ | |||
4211 4212 4213 4214 4215 4216 4217 | 4201 4202 4203 4204 4205 4206 4207 4208 4209 4210 4211 4212 4213 4214 4215 4216 4217 4218 4219 4220 4221 4222 4223 4224 4225 4226 4227 4228 4229 4230 4231 4232 4233 4234 4235 | - - + - + |
Jim_CreateCommand(interp, "file", Jim_SubCmdProc, (void *)file_command_table, NULL);
Jim_CreateCommand(interp, "pwd", Jim_PwdCmd, NULL, NULL);
Jim_CreateCommand(interp, "cd", Jim_CdCmd, NULL, NULL);
return JIM_OK;
}
|
| ︙ | |||
4277 4278 4279 4280 4281 4282 4283 | 4266 4267 4268 4269 4270 4271 4272 4273 4274 4275 4276 4277 4278 4279 4280 | - + | #else #include <errno.h> #include <signal.h> #if defined(__MINGW32__) |
| ︙ | |||
4403 4404 4405 4406 4407 4408 4409 | 4392 4393 4394 4395 4396 4397 4398 4399 4400 4401 4402 4403 4404 4405 4406 4407 4408 4409 | - + - + |
Jim_Obj *objPtr = Jim_GetGlobalVariableStr(interp, "env", JIM_NONE);
if (!objPtr) {
return Jim_GetEnviron();
}
|
| ︙ | |||
4502 4503 4504 4505 4506 4507 4508 | 4491 4492 4493 4494 4495 4496 4497 4498 4499 4500 4501 4502 4503 4504 4505 4506 4507 4508 4509 4510 4511 4512 4513 | - - - + + + - - - + + + |
return JIM_ERR;
}
struct WaitInfo
{
|
| ︙ | |||
4537 4538 4539 4540 4541 4542 4543 | 4526 4527 4528 4529 4530 4531 4532 4533 4534 4535 4536 4537 4538 4539 4540 4541 4542 4543 4544 4545 4546 4547 4548 4549 4550 4551 4552 4553 4554 4555 4556 4557 | - - + + - + |
table->size = table->used = 0;
return table;
}
static int Jim_ExecCmd(Jim_Interp *interp, int argc, Jim_Obj *const *argv)
{
|
| ︙ | |||
4576 4577 4578 4579 4580 4581 4582 | 4565 4566 4567 4568 4569 4570 4571 4572 4573 4574 4575 4576 4577 4578 4579 4580 4581 4582 4583 4584 4585 4586 4587 4588 4589 4590 4591 4592 4593 4594 4595 4596 4597 4598 4599 4600 4601 4602 4603 4604 4605 4606 4607 4608 4609 4610 4611 4612 4613 4614 4615 4616 4617 4618 | - + - + - + - + - + - + |
return JIM_ERR;
}
result = JIM_OK;
errStrObj = Jim_NewStringObj(interp, "", 0);
|
| ︙ | |||
4638 4639 4640 4641 4642 4643 4644 | 4627 4628 4629 4630 4631 4632 4633 4634 4635 4636 4637 4638 4639 4640 4641 4642 4643 4644 4645 4646 4647 4648 4649 4650 4651 4652 4653 4654 4655 4656 4657 4658 4659 4660 4661 4662 4663 4664 4665 4666 4667 4668 4669 4670 4671 4672 4673 4674 4675 4676 4677 4678 4679 4680 4681 4682 | - + - + - + - + - + - + |
waitPtr = table->info;
dest = 0;
for (count = table->used; count > 0; waitPtr++, count--) {
if (waitPtr->flags & WI_DETACHED) {
int status;
pidtype pid = JimWaitPid(waitPtr->pid, &status, WNOHANG);
if (pid == waitPtr->pid) {
|
| ︙ | |||
4716 4717 4718 4719 4720 4721 4722 | 4705 4706 4707 4708 4709 4710 4711 4712 4713 4714 4715 4716 4717 4718 4719 4720 4721 4722 4723 4724 | - + - - - - + + + + |
int numPids = 0; /* Actual number of processes that exist
* at *pidPtr right now. */
int cmdCount; /* Count of number of distinct commands
* found in argc/argv. */
const char *input = NULL; /* Describes input for pipeline, depending
* on "inputFile". NULL means take input
* from stdin/pipe. */
|
| ︙ | |||
4746 4747 4748 4749 4750 4751 4752 | 4735 4736 4737 4738 4739 4740 4741 4742 4743 4744 4745 4746 4747 4748 4749 4750 4751 4752 4753 4754 4755 4756 4757 4758 | - + - + |
* or NULL if output goes to stdout/pipe. */
const char *error = NULL; /* Holds name of stderr file to pipe to,
* or NULL if stderr goes to stderr/pipe. */
fdtype inputId = JIM_BAD_FD;
fdtype outputId = JIM_BAD_FD;
fdtype errorId = JIM_BAD_FD;
fdtype lastOutputId = JIM_BAD_FD;
|
| ︙ | |||
4805 4806 4807 4808 4809 4810 4811 | 4794 4795 4796 4797 4798 4799 4800 4801 4802 4803 4804 4805 4806 4807 4808 | - + |
output = arg + 1;
if (*output == '>') {
outputFile = FILE_APPEND;
output++;
}
if (*output == '&') {
|
| ︙ | |||
4846 4847 4848 4849 4850 4851 4852 | 4835 4836 4837 4838 4839 4840 4841 4842 4843 4844 4845 4846 4847 4848 4849 4850 4851 4852 4853 4854 4855 4856 4857 4858 4859 4860 4861 4862 4863 4864 4865 4866 4867 4868 4869 4870 4871 4872 4873 4874 4875 4876 4877 4878 | - + - + - + |
if (i == lastBar + 1 || i == argc - 1) {
Jim_SetResultString(interp, "illegal use of | or |& in command", -1);
goto badargs;
}
lastBar = i;
cmdCount++;
}
|
| ︙ | |||
4927 4928 4929 4930 4931 4932 4933 | 4916 4917 4918 4919 4920 4921 4922 4923 4924 4925 4926 4927 4928 4929 4930 4931 4932 4933 4934 4935 4936 4937 4938 4939 | - + - + - + |
Jim_SetResultErrno(interp, "couldn't create output pipe");
goto error;
}
lastOutputId = pipeIds[1];
*outPipePtr = pipeIds[0];
pipeIds[0] = pipeIds[1] = JIM_BAD_FD;
}
|
| ︙ | |||
4982 4983 4984 4985 4986 4987 4988 | 4971 4972 4973 4974 4975 4976 4977 4978 4979 4980 4981 4982 4983 4984 4985 4986 4987 4988 4989 4990 4991 4992 4993 4994 4995 4996 4997 4998 4999 5000 5001 5002 5003 5004 5005 5006 5007 5008 5009 5010 5011 5012 5013 5014 5015 5016 5017 5018 5019 5020 5021 5022 5023 5024 5025 5026 5027 5028 5029 5030 5031 5032 5033 5034 5035 5036 5037 5038 5039 5040 5041 5042 5043 5044 5045 5046 5047 5048 5049 5050 5051 5052 | - + - + - + - + - + - + - + - + |
if (arg_array[lastArg][0] == '|') {
if (arg_array[lastArg][1] == '&') {
pipe_dup_err = 1;
}
break;
}
}
|
| ︙ | |||
5120 5121 5122 5123 5124 5125 5126 | 5109 5110 5111 5112 5113 5114 5115 5116 5117 5118 5119 5120 5121 5122 5123 | - + |
static int JimCleanupChildren(Jim_Interp *interp, int numPids, pidtype *pidPtr, Jim_Obj *errStrObj)
{
struct WaitInfoTable *table = Jim_CmdPrivData(interp);
int result = JIM_OK;
int i;
|
| ︙ | |||
5293 5294 5295 5296 5297 5298 5299 | 5282 5283 5284 5285 5286 5287 5288 5289 5290 5291 5292 5293 5294 5295 5296 5297 5298 5299 5300 5301 5302 5303 5304 5305 5306 5307 5308 5309 5310 5311 5312 5313 5314 | - + - - + + - - - - - + |
{
return (fdtype)_get_osfhandle(_fileno(fh));
}
static fdtype JimOpenForRead(const char *filename)
{
return CreateFile(filename, GENERIC_READ, FILE_SHARE_READ | FILE_SHARE_WRITE,
|
| ︙ | |||
5342 5343 5344 5345 5346 5347 5348 | 5327 5328 5329 5330 5331 5332 5333 5334 5335 5336 5337 5338 5339 5340 5341 | - + |
NULL);
if (handle == INVALID_HANDLE_VALUE) {
goto error;
}
if (contents != NULL) {
|
| ︙ | |||
5614 5615 5616 5617 5618 5619 5620 | 5599 5600 5601 5602 5603 5604 5605 5606 5607 5608 5609 5610 5611 5612 5613 | - + |
#ifdef HAVE_SYS_TIME_H
#include <sys/time.h>
#endif
static int clock_cmd_format(Jim_Interp *interp, int argc, Jim_Obj *const *argv)
{
|
| ︙ | |||
5655 5656 5657 5658 5659 5660 5661 | 5640 5641 5642 5643 5644 5645 5646 5647 5648 5649 5650 5651 5652 5653 5654 5655 5656 5657 5658 5659 5660 5661 5662 5663 | - + - + |
struct tm tm;
time_t now = time(0);
if (!Jim_CompareStringImmediate(interp, argv[1], "-format")) {
return -1;
}
|
| ︙ | |||
5706 5707 5708 5709 5710 5711 5712 | 5691 5692 5693 5694 5695 5696 5697 5698 5699 5700 5701 5702 5703 5704 5705 5706 5707 5708 5709 5710 5711 5712 5713 5714 5715 5716 5717 5718 5719 5720 5721 5722 5723 5724 5725 5726 5727 5728 5729 5730 5731 5732 5733 5734 5735 5736 5737 5738 5739 5740 5741 | - + - + - + - + - + - + |
static const jim_subcmd_type clock_command_table[] = {
{ "seconds",
NULL,
clock_cmd_seconds,
0,
0,
|
| ︙ | |||
5766 5767 5768 5769 5770 5771 5772 | 5751 5752 5753 5754 5755 5756 5757 5758 5759 5760 5761 5762 5763 5764 5765 5766 5767 5768 5769 5770 5771 5772 5773 5774 5775 5776 5777 5778 5779 5780 5781 5782 5783 5784 5785 5786 5787 5788 5789 5790 | - + - + - + - + |
#include <string.h>
#include <stdio.h>
#include <errno.h>
static int array_cmd_exists(Jim_Interp *interp, int argc, Jim_Obj *const *argv)
{
|
| ︙ | |||
5815 5816 5817 5818 5819 5820 5821 | 5800 5801 5802 5803 5804 5805 5806 5807 5808 5809 5810 5811 5812 5813 5814 5815 5816 5817 5818 5819 5820 5821 5822 5823 5824 5825 5826 5827 5828 5829 5830 5831 5832 5833 5834 5835 5836 5837 5838 5839 5840 5841 5842 5843 5844 5845 5846 5847 5848 5849 | - + - + - + - + |
int i;
int len;
Jim_Obj *resultObj;
Jim_Obj *objPtr;
Jim_Obj **dictValuesObj;
if (argc == 1 || Jim_CompareStringImmediate(interp, argv[1], "*")) {
|
| ︙ | |||
5889 5890 5891 5892 5893 5894 5895 | 5874 5875 5876 5877 5878 5879 5880 5881 5882 5883 5884 5885 5886 5887 5888 | - + |
if (len % 2) {
Jim_SetResultString(interp, "list must have an even number of elements", -1);
return JIM_ERR;
}
dictObj = Jim_GetVariable(interp, argv[0], JIM_UNSHARED);
if (!dictObj) {
|
| ︙ | |||
5918 5919 5920 5921 5922 5923 5924 | 5903 5904 5905 5906 5907 5908 5909 5910 5911 5912 5913 5914 5915 5916 5917 5918 5919 5920 5921 5922 5923 5924 5925 5926 5927 5928 5929 5930 5931 5932 5933 5934 5935 5936 5937 5938 5939 5940 5941 5942 5943 5944 5945 5946 5947 5948 5949 5950 5951 5952 5953 5954 5955 5956 5957 5958 5959 | - + - + - + - + - + - + - + |
static const jim_subcmd_type array_command_table[] = {
{ "exists",
"arrayName",
array_cmd_exists,
1,
1,
|
| ︙ | |||
6000 6001 6002 6003 6004 6005 6006 | 5985 5986 5987 5988 5989 5990 5991 5992 5993 5994 5995 5996 5997 5998 5999 | - + - | Jim_execInit(interp); Jim_clockInit(interp); Jim_arrayInit(interp); Jim_stdlibInit(interp); Jim_tclcompatInit(interp); return JIM_OK; } |
| ︙ | |||
6070 6071 6072 6073 6074 6075 6076 | 6054 6055 6056 6057 6058 6059 6060 6061 6062 6063 6064 6065 6066 6067 | - - - - - - | #ifdef JIM_DEBUG_PANIC static void JimPanicDump(int fail_condition, const char *fmt, ...); #define JimPanic(X) JimPanicDump X #else #define JimPanic(X) #endif |
| ︙ | |||
6132 6133 6134 6135 6136 6137 6138 | 6110 6111 6112 6113 6114 6115 6116 6117 6118 6119 6120 6121 6122 6123 6124 6125 6126 6127 6128 6129 6130 6131 6132 6133 6134 6135 6136 6137 6138 6139 6140 6141 6142 6143 6144 6145 6146 6147 | - + - + - + - + - + |
if (flags & JIM_CHARSET_SCAN) {
if (*pattern == '^') {
not++;
pattern++;
}
|
| ︙ | |||
6189 6190 6191 6192 6193 6194 6195 | 6167 6168 6169 6170 6171 6172 6173 6174 6175 6176 6177 6178 6179 6180 6181 6182 6183 6184 6185 6186 6187 6188 6189 6190 6191 6192 6193 6194 6195 6196 6197 6198 6199 6200 6201 6202 6203 6204 6205 6206 6207 6208 6209 6210 6211 | - + - + - + - + - + - + |
switch (pattern[0]) {
case '*':
while (pattern[1] == '*') {
pattern++;
}
pattern++;
if (!pattern[0]) {
|
| ︙ | |||
6269 6270 6271 6272 6273 6274 6275 | 6247 6248 6249 6250 6251 6252 6253 6254 6255 6256 6257 6258 6259 6260 6261 | - + |
return JimSign(c1 - c2);
}
maxchars--;
}
if (!maxchars) {
return 0;
}
|
| ︙ | |||
6310 6311 6312 6313 6314 6315 6316 | 6288 6289 6290 6291 6292 6293 6294 6295 6296 6297 6298 6299 6300 6301 6302 | - + |
static int JimStringLast(const char *s1, int l1, const char *s2, int l2)
{
const char *p;
if (!l1 || !l2 || l1 > l2)
return -1;
|
| ︙ | |||
6369 6370 6371 6372 6373 6374 6375 | 6347 6348 6349 6350 6351 6352 6353 6354 6355 6356 6357 6358 6359 6360 6361 6362 6363 6364 6365 6366 6367 6368 6369 6370 6371 6372 6373 6374 6375 6376 6377 6378 6379 6380 6381 6382 6383 6384 6385 6386 6387 6388 6389 6390 6391 6392 6393 6394 6395 6396 6397 6398 6399 6400 6401 6402 6403 6404 6405 6406 6407 6408 6409 6410 6411 6412 6413 6414 6415 | - + - + - + - + - + - + - + |
if (str[i] == '+') {
i++;
}
*sign = 1;
}
if (str[i] != '0') {
|
| ︙ | |||
6448 6449 6450 6451 6452 6453 6454 | 6426 6427 6428 6429 6430 6431 6432 6433 6434 6435 6436 6437 6438 6439 6440 6441 6442 6443 6444 6445 6446 6447 6448 6449 6450 6451 6452 6453 6454 6455 | - + - + - + - - - - - - - + - - + - - - - - + - - - |
return JimCheckConversion(str, endptr);
}
int Jim_StringToDouble(const char *str, double *doublePtr)
{
char *endptr;
|
| ︙ | |||
6543 6544 6545 6546 6547 6548 6549 | 6507 6508 6509 6510 6511 6512 6513 6514 6515 6516 6517 6518 6519 6520 6521 | - + |
}
char *Jim_StrDupLen(const char *s, int l)
{
char *copy = Jim_Alloc(l + 1);
memcpy(copy, s, l + 1);
|
| ︙ | |||
6632 6633 6634 6635 6636 6637 6638 | 6596 6597 6598 6599 6600 6601 6602 6603 6604 6605 6606 6607 6608 6609 6610 6611 6612 6613 6614 6615 6616 6617 6618 6619 6620 6621 6622 6623 6624 6625 6626 6627 6628 6629 6630 6631 6632 6633 6634 6635 6636 6637 6638 6639 6640 6641 6642 6643 6644 6645 6646 6647 6648 6649 6650 6651 6652 6653 6654 6655 6656 6657 6658 6659 6660 6661 6662 6663 6664 | - + - + - + - + - + - + - + - + |
minimal = JIM_HT_INITIAL_SIZE;
Jim_ExpandHashTable(ht, minimal);
}
void Jim_ExpandHashTable(Jim_HashTable *ht, unsigned int size)
{
|
| ︙ | |||
6712 6713 6714 6715 6716 6717 6718 | 6676 6677 6678 6679 6680 6681 6682 6683 6684 6685 6686 6687 6688 6689 6690 | - + |
else {
Jim_FreeEntryVal(ht, entry);
Jim_SetHashVal(ht, entry, val);
}
existed = 1;
}
else {
|
| ︙ | |||
6735 6736 6737 6738 6739 6740 6741 | 6699 6700 6701 6702 6703 6704 6705 6706 6707 6708 6709 6710 6711 6712 6713 6714 6715 6716 6717 6718 6719 6720 6721 6722 6723 6724 6725 6726 6727 6728 6729 6730 6731 6732 6733 6734 6735 6736 6737 6738 6739 6740 6741 6742 6743 6744 6745 6746 6747 6748 6749 6750 6751 6752 6753 6754 | - + - + - + - + - + - + |
return JIM_ERR;
h = Jim_HashKey(ht, key) & ht->sizemask;
he = ht->table[h];
prevHe = NULL;
while (he) {
if (Jim_CompareHashKeys(ht, key, he->key)) {
|
| ︙ | |||
6853 6854 6855 6856 6857 6858 6859 | 6817 6818 6819 6820 6821 6822 6823 6824 6825 6826 6827 6828 6829 6830 6831 6832 6833 6834 6835 6836 6837 6838 6839 6840 6841 6842 6843 6844 | - + - + - + - + |
}
static Jim_HashEntry *JimInsertHashEntry(Jim_HashTable *ht, const void *key, int replace)
{
unsigned int h;
Jim_HashEntry *he;
|
| ︙ | |||
6899 6900 6901 6902 6903 6904 6905 | 6863 6864 6865 6866 6867 6868 6869 6870 6871 6872 6873 6874 6875 6876 6877 6878 6879 6880 6881 6882 6883 6884 6885 6886 6887 6888 6889 6890 6891 6892 6893 6894 6895 6896 6897 6898 6899 6900 6901 6902 6903 6904 6905 6906 | - - - - - - + + + + + + - - - - - - + + + + + + |
static void JimStringCopyHTKeyDestructor(void *privdata, void *key)
{
Jim_Free(key);
}
static const Jim_HashTableType JimPackageHashTableType = {
|
| ︙ | |||
6985 6986 6987 6988 6989 6990 6991 | 6949 6950 6951 6952 6953 6954 6955 6956 6957 6958 6959 6960 6961 6962 6963 6964 6965 6966 6967 6968 6969 6970 6971 6972 6973 6974 6975 6976 6977 6978 6979 6980 6981 6982 6983 6984 6985 6986 6987 6988 6989 6990 6991 6992 6993 6994 6995 6996 6997 6998 6999 7000 7001 7002 7003 7004 7005 7006 7007 7008 | - - - - - - + + + + + + - - - + + + - - + + - - + - - - - - - + + - - - + + + - - - - - - - + + + + + + + |
for (i = 0; i < stack->len; i++)
freeFunc(stack->vector[i]);
}
|
| ︙ | |||
7069 7070 7071 7072 7073 7074 7075 | 7028 7029 7030 7031 7032 7033 7034 7035 7036 7037 7038 7039 7040 7041 7042 | - + |
pc->comment = 1;
pc->missing.ch = ' ';
pc->missing.line = linenr;
}
static int JimParseScript(struct JimParserCtx *pc)
{
|
| ︙ | |||
7105 7106 7107 7108 7109 7110 7111 | 7064 7065 7066 7067 7068 7069 7070 7071 7072 7073 7074 7075 7076 7077 7078 | - + |
return JimParseStr(pc);
case '[':
pc->comment = 0;
return JimParseCmd(pc);
case '$':
pc->comment = 0;
if (JimParseVar(pc) == JIM_ERR) {
|
| ︙ | |||
7166 7167 7168 7169 7170 7171 7172 | 7125 7126 7127 7128 7129 7130 7131 7132 7133 7134 7135 7136 7137 7138 7139 | - + |
}
static void JimParseSubBrace(struct JimParserCtx *pc)
{
int level = 1;
|
| ︙ | |||
7210 7211 7212 7213 7214 7215 7216 | 7169 7170 7171 7172 7173 7174 7175 7176 7177 7178 7179 7180 7181 7182 7183 | - + |
}
static int JimParseSubQuote(struct JimParserCtx *pc)
{
int tt = JIM_TT_STR;
int line = pc->tline;
|
| ︙ | |||
7259 7260 7261 7262 7263 7264 7265 | 7218 7219 7220 7221 7222 7223 7224 7225 7226 7227 7228 7229 7230 7231 7232 | - + |
static void JimParseSubCmd(struct JimParserCtx *pc)
{
int level = 1;
int startofword = 1;
int line = pc->tline;
|
| ︙ | |||
7339 7340 7341 7342 7343 7344 7345 | 7298 7299 7300 7301 7302 7303 7304 7305 7306 7307 7308 7309 7310 7311 7312 7313 7314 7315 7316 7317 7318 | - + - + |
pc->tline = pc->linenr;
pc->tt = JimParseSubQuote(pc);
return JIM_OK;
}
static int JimParseVar(struct JimParserCtx *pc)
{
|
| ︙ | |||
7375 7376 7377 7378 7379 7380 7381 | 7334 7335 7336 7337 7338 7339 7340 7341 7342 7343 7344 7345 7346 7347 7348 7349 7350 7351 7352 7353 7354 7355 7356 7357 7358 7359 7360 7361 7362 7363 | - + - + |
if (pc->len) {
pc->p++;
pc->len--;
}
}
else {
while (1) {
|
| ︙ | |||
7417 7418 7419 7420 7421 7422 7423 | 7376 7377 7378 7379 7380 7381 7382 7383 7384 7385 7386 7387 7388 7389 7390 | - + |
}
}
if (count == 0) {
pc->p++;
pc->len--;
}
else if (paren) {
|
| ︙ | |||
7442 7443 7444 7445 7446 7447 7448 | 7401 7402 7403 7404 7405 7406 7407 7408 7409 7410 7411 7412 7413 7414 7415 7416 7417 7418 7419 7420 7421 7422 7423 | - + - + |
return JIM_OK;
}
static int JimParseStr(struct JimParserCtx *pc)
{
if (pc->tt == JIM_TT_SEP || pc->tt == JIM_TT_EOL ||
pc->tt == JIM_TT_NONE || pc->tt == JIM_TT_STR) {
|
| ︙ | |||
7480 7481 7482 7483 7484 7485 7486 | 7439 7440 7441 7442 7443 7444 7445 7446 7447 7448 7449 7450 7451 7452 7453 7454 7455 7456 7457 7458 7459 7460 7461 7462 7463 7464 7465 7466 7467 | - + - + - + - + - + |
if (*(pc->p + 1) == '\n') {
pc->linenr++;
}
pc->p++;
pc->len--;
}
else if (pc->len == 1) {
|
| ︙ | |||
7538 7539 7540 7541 7542 7543 7544 | 7497 7498 7499 7500 7501 7502 7503 7504 7505 7506 7507 7508 7509 7510 7511 | - + |
return JIM_OK;
}
break;
}
pc->p++;
pc->len--;
}
|
| ︙ | |||
7649 7650 7651 7652 7653 7654 7655 | 7608 7609 7610 7611 7612 7613 7614 7615 7616 7617 7618 7619 7620 7621 7622 7623 7624 7625 7626 7627 7628 7629 7630 7631 7632 7633 7634 7635 7636 7637 7638 7639 7640 7641 7642 7643 7644 7645 7646 7647 7648 7649 7650 7651 7652 7653 7654 7655 7656 7657 7658 7659 7660 7661 7662 7663 7664 7665 7666 7667 7668 7669 7670 7671 7672 | - + - + - + - + - + - + - + |
for (k = 0; k < maxchars; k++) {
int c = xdigitval(s[i + k + 1]);
if (c == -1) {
break;
}
val = (val << 4) | c;
}
|
| ︙ | |||
7756 7757 7758 7759 7760 7761 7762 | 7715 7716 7717 7718 7719 7720 7721 7722 7723 7724 7725 7726 7727 7728 7729 7730 7731 7732 7733 7734 | - + - + |
token = Jim_Alloc(1);
token[0] = '\0';
}
else {
len = (end - start) + 1;
token = Jim_Alloc(len + 1);
if (pc->tt != JIM_TT_ESC) {
|
| ︙ | |||
7829 7830 7831 7832 7833 7834 7835 | 7788 7789 7790 7791 7792 7793 7794 7795 7796 7797 7798 7799 7800 7801 7802 | - + |
pc->tt = JIM_TT_STR;
while (pc->len) {
switch (*pc->p) {
case '\\':
pc->tt = JIM_TT_ESC;
if (--pc->len == 0) {
|
| ︙ | |||
7865 7866 7867 7868 7869 7870 7871 | 7824 7825 7826 7827 7828 7829 7830 7831 7832 7833 7834 7835 7836 7837 7838 7839 7840 7841 7842 7843 7844 7845 7846 7847 7848 7849 7850 7851 7852 7853 7854 7855 7856 7857 7858 7859 7860 7861 7862 7863 7864 7865 7866 7867 7868 7869 7870 7871 7872 7873 7874 7875 7876 7877 7878 7879 7880 7881 7882 7883 7884 7885 7886 7887 7888 7889 7890 7891 7892 7893 7894 7895 7896 7897 7898 7899 7900 7901 7902 7903 7904 | - + - + - + - + - + - + - + - + - + - + |
while (pc->len) {
if (isspace(UCHAR(*pc->p))) {
pc->tend = pc->p - 1;
return JIM_OK;
}
if (*pc->p == '\\') {
if (--pc->len == 0) {
|
| ︙ | |||
7958 7959 7960 7961 7962 7963 7964 | 7917 7918 7919 7920 7921 7922 7923 7924 7925 7926 7927 7928 7929 7930 7931 7932 7933 7934 7935 7936 7937 7938 7939 7940 7941 7942 7943 7944 7945 7946 7947 7948 7949 7950 7951 7952 7953 7954 7955 7956 7957 7958 7959 7960 7961 7962 7963 7964 7965 7966 7967 7968 7969 7970 7971 7972 7973 7974 7975 7976 7977 7978 7979 7980 7981 7982 7983 7984 7985 7986 7987 7988 7989 | - + - + - + - + - + - + - + - + |
Jim_Obj *Jim_DuplicateObj(Jim_Interp *interp, Jim_Obj *objPtr)
{
Jim_Obj *dupPtr;
dupPtr = Jim_NewObj(interp);
if (objPtr->bytes == NULL) {
|
| ︙ | |||
8076 8077 8078 8079 8080 8081 8082 | 8035 8036 8037 8038 8039 8040 8041 8042 8043 8044 8045 8046 8047 8048 8049 8050 8051 8052 8053 8054 8055 8056 8057 8058 8059 8060 | - + - + - + - + - + |
dupPtr->internalRep.strValue.maxLength = srcPtr->length;
dupPtr->internalRep.strValue.charLength = srcPtr->internalRep.strValue.charLength;
}
static int SetStringFromAny(Jim_Interp *interp, Jim_Obj *objPtr)
{
if (objPtr->typePtr != &stringObjType) {
|
| ︙ | |||
8112 8113 8114 8115 8116 8117 8118 | 8071 8072 8073 8074 8075 8076 8077 8078 8079 8080 8081 8082 8083 8084 8085 8086 8087 8088 8089 8090 8091 8092 8093 8094 8095 8096 8097 8098 8099 8100 8101 8102 8103 8104 8105 8106 8107 8108 8109 8110 8111 8112 8113 | - + - + - + - + - + |
}
Jim_Obj *Jim_NewStringObj(Jim_Interp *interp, const char *s, int len)
{
Jim_Obj *objPtr = Jim_NewObj(interp);
|
| ︙ | |||
8171 8172 8173 8174 8175 8176 8177 | 8130 8131 8132 8133 8134 8135 8136 8137 8138 8139 8140 8141 8142 8143 8144 8145 8146 8147 8148 8149 8150 8151 8152 8153 8154 8155 8156 8157 8158 8159 8160 | - + - + |
if (len == -1)
len = strlen(str);
needlen = objPtr->length + len;
if (objPtr->internalRep.strValue.maxLength < needlen ||
objPtr->internalRep.strValue.maxLength == 0) {
needlen *= 2;
|
| ︙ | |||
8249 8250 8251 8252 8253 8254 8255 | 8208 8209 8210 8211 8212 8213 8214 8215 8216 8217 8218 8219 8220 8221 8222 | - + |
int Jim_StringCompareObj(Jim_Interp *interp, Jim_Obj *firstObjPtr, Jim_Obj *secondObjPtr, int nocase)
{
int l1, l2;
const char *s1 = Jim_GetString(firstObjPtr, &l1);
const char *s2 = Jim_GetString(secondObjPtr, &l2);
if (nocase) {
|
| ︙ | |||
8351 8352 8353 8354 8355 8356 8357 | 8310 8311 8312 8313 8314 8315 8316 8317 8318 8319 8320 8321 8322 8323 8324 | - + |
return NULL;
}
if (first == 0 && rangeLen == len) {
return strObjPtr;
}
if (len == bytelen) {
|
| ︙ | |||
8380 8381 8382 8383 8384 8385 8386 | 8339 8340 8341 8342 8343 8344 8345 8346 8347 8348 8349 8350 8351 8352 8353 8354 8355 8356 8357 8358 8359 8360 8361 | - + - + - + |
if (last < first) {
return strObjPtr;
}
str = Jim_String(strObjPtr);
|
| ︙ | |||
8491 8492 8493 8494 8495 8496 8497 | 8450 8451 8452 8453 8454 8455 8456 8457 8458 8459 8460 8461 8462 8463 8464 | - + |
static const char *JimFindTrimLeft(const char *str, int len, const char *trimchars, int trimlen)
{
while (len) {
int c;
int n = utf8_tounicode(str, &c);
if (utf8_memchr(trimchars, trimlen, c) == NULL) {
|
| ︙ | |||
8562 8563 8564 8565 8566 8567 8568 | 8521 8522 8523 8524 8525 8526 8527 8528 8529 8530 8531 8532 8533 8534 8535 8536 8537 8538 8539 8540 8541 8542 8543 8544 8545 8546 8547 8548 8549 8550 8551 8552 8553 8554 8555 8556 8557 8558 8559 8560 8561 8562 8563 8564 8565 | - + - + - + - + - + - + - + |
SetStringFromAny(interp, strObjPtr);
len = Jim_Length(strObjPtr);
nontrim = JimFindTrimRight(strObjPtr->bytes, len, trimchars, trimcharslen);
if (nontrim == NULL) {
|
| ︙ | |||
8614 8615 8616 8617 8618 8619 8620 | 8573 8574 8575 8576 8577 8578 8579 8580 8581 8582 8583 8584 8585 8586 8587 8588 8589 8590 8591 8592 8593 | - + - + |
#endif
static int JimStringIs(Jim_Interp *interp, Jim_Obj *strObjPtr, Jim_Obj *strClass, int strict)
{
static const char * const strclassnames[] = {
"integer", "alpha", "alnum", "ascii", "digit",
"double", "lower", "upper", "space", "xdigit",
|
| ︙ | |||
8653 8654 8655 8656 8657 8658 8659 | 8612 8613 8614 8615 8616 8617 8618 8619 8620 8621 8622 8623 8624 8625 | - - - - - - - |
case STR_IS_DOUBLE:
{
double d;
Jim_SetResultBool(interp, Jim_GetDouble(interp, strObjPtr, &d) == JIM_OK && errno != ERANGE);
return JIM_OK;
}
|
| ︙ | |||
8711 8712 8713 8714 8715 8716 8717 | 8663 8664 8665 8666 8667 8668 8669 8670 8671 8672 8673 8674 8675 8676 8677 | - + |
if (strcmp(str, objStr) != 0)
return 0;
if (objPtr->typePtr != &comparedStringObjType) {
Jim_FreeIntRep(interp, objPtr);
objPtr->typePtr = &comparedStringObjType;
}
|
| ︙ | |||
8804 8805 8806 8807 8808 8809 8810 | 8756 8757 8758 8759 8760 8761 8762 8763 8764 8765 8766 8767 8768 8769 8770 8771 8772 8773 8774 8775 8776 8777 8778 8779 | - - - - + + + + - - - + + + |
{
Jim_Obj *objPtr;
int type;
} ScriptToken;
typedef struct ScriptObj
{
|
| ︙ | |||
8845 8846 8847 8848 8849 8850 8851 | 8797 8798 8799 8800 8801 8802 8803 8804 8805 8806 8807 8808 8809 8810 8811 8812 8813 8814 8815 8816 8817 8818 8819 8820 8821 8822 8823 | - - - - + + + + - - - - - + + + + + |
JIM_NOTUSED(srcPtr);
dupPtr->typePtr = NULL;
}
typedef struct
{
|
| ︙ | |||
8880 8881 8882 8883 8884 8885 8886 | 8832 8833 8834 8835 8836 8837 8838 8839 8840 8841 8842 8843 8844 8845 8846 8847 8848 8849 8850 8851 8852 8853 8854 8855 8856 8857 8858 8859 8860 8861 8862 8863 8864 8865 8866 8867 8868 8869 8870 8871 8872 8873 8874 8875 8876 8877 8878 8879 8880 8881 8882 8883 8884 8885 8886 8887 8888 8889 8890 8891 8892 8893 8894 8895 8896 8897 8898 8899 8900 8901 8902 8903 8904 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 | - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + |
static void ScriptAddToken(ParseTokenList *tokenlist, const char *token, int len, int type,
int line)
{
ParseToken *t;
if (tokenlist->count == tokenlist->size) {
|
| ︙ | |||
9095 9096 9097 9098 9099 9100 9101 | 9047 9048 9049 9050 9051 9052 9053 9054 9055 9056 9057 9058 9059 9060 9061 9062 9063 9064 9065 9066 9067 9068 9069 9070 9071 9072 9073 9074 9075 9076 9077 9078 9079 9080 9081 9082 9083 9084 9085 9086 9087 9088 9089 9090 9091 9092 9093 9094 9095 9096 9097 9098 9099 9100 9101 9102 9103 9104 9105 9106 9107 9108 9109 9110 9111 9112 9113 9114 9115 9116 9117 9118 9119 9120 9121 9122 9123 9124 9125 9126 9127 9128 | - + - + - + - + - + - + - + - + |
struct ScriptToken *token;
token = script->token = Jim_Alloc(sizeof(ScriptToken) * tokenlist->count);
for (i = 0; i < tokenlist->count; i++) {
const ParseToken *t = &tokenlist->list[i];
|
| ︙ | |||
9201 9202 9203 9204 9205 9206 9207 | 9153 9154 9155 9156 9157 9158 9159 9160 9161 9162 9163 9164 9165 9166 9167 9168 9169 9170 9171 9172 9173 9174 9175 9176 9177 9178 9179 9180 9181 9182 9183 9184 9185 9186 9187 9188 9189 9190 9191 9192 9193 9194 9195 9196 9197 9198 9199 9200 9201 9202 9203 9204 9205 9206 9207 9208 9209 9210 9211 9212 9213 9214 9215 9216 9217 9218 9219 9220 9221 9222 9223 | - + - + - - - - - - + + + + + + - - - - - - + + + + + + - + - + |
Jim_DecrRefCount(interp, cmdPtr->u.proc.nsObj);
if (cmdPtr->u.proc.staticVars) {
Jim_FreeHashTable(cmdPtr->u.proc.staticVars);
Jim_Free(cmdPtr->u.proc.staticVars);
}
}
else {
|
| ︙ | |||
9285 9286 9287 9288 9289 9290 9291 | 9237 9238 9239 9240 9241 9242 9243 9244 9245 9246 9247 9248 9249 9250 9251 9252 9253 9254 9255 9256 9257 9258 9259 9260 9261 9262 9263 9264 9265 9266 9267 9268 9269 9270 9271 9272 9273 9274 9275 9276 9277 9278 9279 9280 9281 9282 9283 9284 9285 9286 9287 9288 9289 9290 9291 9292 9293 9294 9295 9296 9297 9298 9299 9300 9301 9302 9303 9304 9305 9306 9307 9308 9309 | - + - + - + - + - + - + |
}
static const char *JimQualifyName(Jim_Interp *interp, const char *name, Jim_Obj **objPtrPtr)
{
Jim_Obj *objPtr = interp->emptyObj;
if (name[0] == ':' && name[1] == ':') {
|
| ︙ | |||
9372 9373 9374 9375 9376 9377 9378 | 9324 9325 9326 9327 9328 9329 9330 9331 9332 9333 9334 9335 9336 9337 9338 | - + |
Jim_InitHashTable(cmdPtr->u.proc.staticVars, &JimVariablesHashTableType, interp);
for (i = 0; i < len; i++) {
Jim_Obj *objPtr, *initObjPtr, *nameObjPtr;
Jim_Var *varPtr;
int subLen;
objPtr = Jim_ListGetIndex(interp, staticsListObjPtr, i);
|
| ︙ | |||
9418 9419 9420 9421 9422 9423 9424 | 9370 9371 9372 9373 9374 9375 9376 9377 9378 9379 9380 9381 9382 9383 9384 9385 9386 9387 9388 9389 9390 9391 9392 9393 9394 9395 9396 9397 9398 9399 9400 9401 9402 9403 9404 9405 9406 9407 9408 9409 9410 9411 9412 9413 9414 9415 9416 9417 9418 9419 9420 9421 9422 9423 9424 9425 9426 9427 9428 9429 9430 9431 9432 9433 9434 9435 9436 9437 9438 9439 9440 9441 9442 9443 9444 9445 9446 9447 9448 9449 9450 9451 9452 9453 9454 9455 9456 9457 | - + - + - + - + - - + + - + - + - + |
return JIM_OK;
}
static void JimUpdateProcNamespace(Jim_Interp *interp, Jim_Cmd *cmdPtr, const char *cmdname)
{
#ifdef jim_ext_namespace
if (cmdPtr->isproc) {
|
| ︙ | |||
9556 9557 9558 9559 9560 9561 9562 | 9508 9509 9510 9511 9512 9513 9514 9515 9516 9517 9518 9519 9520 9521 9522 9523 9524 9525 9526 9527 9528 9529 9530 9531 9532 9533 9534 9535 9536 9537 9538 9539 9540 | - + - + - + - + |
if (newName[0] == 0) {
return Jim_DeleteCommand(interp, oldName);
}
fqold = JimQualifyName(interp, oldName, &qualifiedOldNameObj);
fqnew = JimQualifyName(interp, newName, &qualifiedNewNameObj);
|
| ︙ | |||
9617 9618 9619 9620 9621 9622 9623 | 9569 9570 9571 9572 9573 9574 9575 9576 9577 9578 9579 9580 9581 9582 9583 9584 9585 9586 9587 9588 9589 9590 9591 9592 9593 9594 9595 9596 9597 9598 9599 9600 9601 9602 9603 9604 9605 9606 9607 9608 9609 9610 9611 9612 9613 9614 9615 9616 9617 9618 9619 9620 9621 9622 9623 9624 9625 9626 9627 9628 9629 9630 9631 9632 9633 9634 9635 9636 9637 9638 9639 9640 9641 9642 9643 9644 9645 9646 9647 9648 9649 9650 9651 9652 9653 9654 9655 9656 9657 9658 9659 9660 9661 9662 9663 9664 9665 9666 9667 9668 9669 9670 9671 9672 9673 9674 9675 9676 9677 9678 9679 9680 9681 9682 9683 9684 9685 9686 9687 9688 9689 9690 9691 9692 9693 9694 9695 9696 9697 9698 9699 9700 9701 9702 9703 9704 9705 9706 9707 9708 9709 9710 9711 9712 9713 9714 9715 9716 9717 9718 9719 9720 9721 9722 9723 9724 9725 9726 9727 9728 9729 9730 9731 9732 9733 9734 9735 9736 9737 9738 9739 9740 9741 9742 9743 9744 9745 9746 9747 9748 9749 9750 9751 9752 9753 9754 9755 9756 9757 9758 9759 9760 | - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + |
if (objPtr->typePtr != &commandObjType ||
objPtr->internalRep.cmdValue.procEpoch != interp->procEpoch
#ifdef jim_ext_namespace
|| !Jim_StringEqObj(objPtr->internalRep.cmdValue.nsObj, interp->framePtr->nsObj)
#endif
) {
|
| ︙ | |||
9828 9829 9830 9831 9832 9833 9834 | 9780 9781 9782 9783 9784 9785 9786 9787 9788 9789 9790 9791 9792 9793 9794 | - + |
case JIM_OK:
var = nameObjPtr->internalRep.varValue.varPtr;
if (var->linkFramePtr == NULL) {
Jim_IncrRefCount(valObjPtr);
Jim_DecrRefCount(interp, var->objPtr);
var->objPtr = valObjPtr;
}
|
| ︙ | |||
9889 9890 9891 9892 9893 9894 9895 | 9841 9842 9843 9844 9845 9846 9847 9848 9849 9850 9851 9852 9853 9854 9855 9856 9857 9858 9859 9860 9861 9862 9863 9864 9865 9866 9867 9868 9869 9870 9871 9872 9873 9874 9875 9876 9877 9878 9879 9880 9881 9882 | - + - + - + - - + + - + |
Jim_Obj *targetNameObjPtr, Jim_CallFrame *targetCallFrame)
{
const char *varName;
const char *targetName;
Jim_CallFrame *framePtr;
Jim_Var *varPtr;
|
| ︙ | |||
9940 9941 9942 9943 9944 9945 9946 | 9892 9893 9894 9895 9896 9897 9898 9899 9900 9901 9902 9903 9904 9905 9906 9907 9908 9909 9910 9911 9912 9913 9914 9915 9916 9917 9918 9919 9920 9921 9922 9923 9924 9925 9926 9927 9928 9929 9930 9931 9932 9933 9934 9935 9936 9937 9938 9939 9940 9941 9942 9943 9944 9945 9946 9947 9948 9949 9950 9951 9952 9953 9954 9955 9956 9957 9958 9959 9960 9961 | - + - + - + - + - + - + - + |
Jim_SetResultFormatted(interp,
"bad variable name \"%#s\": upvar won't create namespace variable that refers to procedure variable",
nameObjPtr);
Jim_DecrRefCount(interp, targetNameObjPtr);
return JIM_ERR;
}
|
| ︙ | |||
10049 10050 10051 10052 10053 10054 10055 | 10001 10002 10003 10004 10005 10006 10007 10008 10009 10010 10011 10012 10013 10014 10015 10016 10017 10018 10019 10020 10021 10022 10023 10024 10025 10026 10027 10028 10029 10030 10031 10032 10033 10034 10035 10036 10037 10038 10039 10040 | - + - + - + |
{
Jim_Var *varPtr;
int retval;
Jim_CallFrame *framePtr;
retval = SetVariableFromAny(interp, nameObjPtr);
if (retval == JIM_DICT_SUGAR) {
|
| ︙ | |||
10107 10108 10109 10110 10111 10112 10113 | 10059 10060 10061 10062 10063 10064 10065 10066 10067 10068 10069 10070 10071 10072 10073 10074 10075 10076 10077 10078 10079 10080 10081 10082 10083 10084 10085 10086 10087 10088 10089 10090 10091 10092 10093 10094 10095 10096 10097 10098 10099 10100 10101 10102 10103 10104 | - + - + - + - + |
p++;
keyLen = (str + len) - p;
if (str[len - 1] == ')') {
keyLen--;
}
|
| ︙ | |||
10164 10165 10166 10167 10168 10169 10170 | 10116 10117 10118 10119 10120 10121 10122 10123 10124 10125 10126 10127 10128 10129 10130 | - + |
ret = Jim_DictKey(interp, dictObjPtr, keyObjPtr, &resObjPtr, JIM_NONE);
if (ret != JIM_OK) {
Jim_SetResultFormatted(interp,
"can't read \"%#s(%#s)\": %s array", varObjPtr, keyObjPtr,
ret < 0 ? "variable isn't" : "no such element in");
}
else if ((flags & JIM_UNSHARED) && Jim_IsShared(dictObjPtr)) {
|
| ︙ | |||
10206 10207 10208 10209 10210 10211 10212 | 10158 10159 10160 10161 10162 10163 10164 10165 10166 10167 10168 10169 10170 10171 10172 | - + |
static void SetDictSubstFromAny(Jim_Interp *interp, Jim_Obj *objPtr)
{
if (objPtr->typePtr != &dictSubstObjType) {
Jim_Obj *varObjPtr, *keyObjPtr;
if (objPtr->typePtr == &interpolatedObjType) {
|
| ︙ | |||
10251 10252 10253 10254 10255 10256 10257 | 10203 10204 10205 10206 10207 10208 10209 10210 10211 10212 10213 10214 10215 10216 10217 | - + |
}
static Jim_Obj *JimExpandExprSugar(Jim_Interp *interp, Jim_Obj *objPtr)
{
Jim_Obj *resultObjPtr;
if (Jim_EvalExpression(interp, objPtr, &resultObjPtr) == JIM_OK) {
|
| ︙ | |||
10295 10296 10297 10298 10299 10300 10301 | 10247 10248 10249 10250 10251 10252 10253 10254 10255 10256 10257 10258 10259 10260 10261 10262 10263 10264 10265 10266 10267 10268 10269 10270 10271 10272 10273 10274 10275 10276 10277 10278 10279 10280 10281 10282 10283 10284 10285 10286 10287 10288 10289 10290 10291 10292 10293 10294 10295 10296 10297 10298 10299 10300 10301 10302 | - + - + - + - - + + - - + + |
Jim_IncrRefCount(nsObj);
return cf;
}
static int JimDeleteLocalProcs(Jim_Interp *interp, Jim_Stack *localCommands)
{
|
| ︙ | |||
10373 10374 10375 10376 10377 10378 10379 10380 10381 10382 10383 10384 10385 10386 | 10325 10326 10327 10328 10329 10330 10331 10332 10333 10334 10335 10336 10337 10338 10339 10340 10341 10342 10343 10344 10345 10346 10347 10348 10349 10350 10351 10352 10353 10354 10355 10356 10357 10358 10359 10360 10361 10362 10363 10364 10365 10366 10367 10368 10369 10370 10371 10372 10373 10374 10375 10376 10377 10378 10379 10380 10381 10382 10383 10384 10385 10386 10387 10388 10389 10390 10391 10392 10393 10394 10395 10396 10397 10398 10399 10400 10401 10402 10403 10404 10405 10406 10407 10408 10409 10410 10411 10412 10413 10414 10415 10416 10417 10418 10419 10420 10421 10422 10423 10424 10425 10426 10427 10428 10429 10430 10431 10432 10433 10434 10435 10436 10437 10438 10439 10440 10441 10442 10443 10444 10445 10446 10447 10448 10449 10450 10451 10452 10453 10454 10455 10456 10457 10458 10459 10460 10461 10462 10463 10464 10465 10466 10467 10468 10469 10470 10471 10472 10473 10474 10475 10476 10477 10478 10479 10480 10481 10482 10483 10484 10485 10486 10487 10488 10489 10490 10491 10492 10493 10494 10495 10496 10497 10498 10499 10500 10501 10502 10503 10504 10505 10506 10507 10508 10509 10510 10511 10512 10513 10514 10515 10516 10517 10518 10519 10520 10521 10522 10523 10524 10525 10526 10527 10528 10529 10530 10531 10532 10533 10534 10535 10536 10537 10538 10539 10540 10541 10542 10543 10544 10545 10546 10547 10548 10549 10550 10551 10552 10553 10554 10555 10556 10557 10558 10559 10560 10561 10562 10563 10564 10565 10566 10567 10568 10569 10570 10571 10572 10573 10574 10575 10576 10577 10578 10579 10580 10581 10582 10583 10584 10585 10586 10587 10588 10589 10590 10591 | + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + |
cf->vars.used = 0;
}
cf->next = interp->freeFramesList;
interp->freeFramesList = cf;
}
#ifdef JIM_REFERENCES
static void JimReferencesHTValDestructor(void *interp, void *val)
{
Jim_Reference *refPtr = (void *)val;
Jim_DecrRefCount(interp, refPtr->objPtr);
if (refPtr->finalizerCmdNamePtr != NULL) {
Jim_DecrRefCount(interp, refPtr->finalizerCmdNamePtr);
}
Jim_Free(val);
}
static unsigned int JimReferencesHTHashFunction(const void *key)
{
const unsigned long *widePtr = key;
unsigned int intValue = (unsigned int)*widePtr;
return Jim_IntHashFunction(intValue);
}
static void *JimReferencesHTKeyDup(void *privdata, const void *key)
{
void *copy = Jim_Alloc(sizeof(unsigned long));
JIM_NOTUSED(privdata);
memcpy(copy, key, sizeof(unsigned long));
return copy;
}
static int JimReferencesHTKeyCompare(void *privdata, const void *key1, const void *key2)
{
JIM_NOTUSED(privdata);
return memcmp(key1, key2, sizeof(unsigned long)) == 0;
}
static void JimReferencesHTKeyDestructor(void *privdata, void *key)
{
JIM_NOTUSED(privdata);
Jim_Free(key);
}
static const Jim_HashTableType JimReferencesHashTableType = {
JimReferencesHTHashFunction,
JimReferencesHTKeyDup,
NULL,
JimReferencesHTKeyCompare,
JimReferencesHTKeyDestructor,
JimReferencesHTValDestructor
};
#define JIM_REFERENCE_SPACE (35+JIM_REFERENCE_TAGLEN)
static int JimFormatReference(char *buf, Jim_Reference *refPtr, unsigned long id)
{
const char *fmt = "<reference.<%s>.%020lu>";
sprintf(buf, fmt, refPtr->tag, id);
return JIM_REFERENCE_SPACE;
}
static void UpdateStringOfReference(struct Jim_Obj *objPtr);
static const Jim_ObjType referenceObjType = {
"reference",
NULL,
NULL,
UpdateStringOfReference,
JIM_TYPE_REFERENCES,
};
static void UpdateStringOfReference(struct Jim_Obj *objPtr)
{
char buf[JIM_REFERENCE_SPACE + 1];
JimFormatReference(buf, objPtr->internalRep.refValue.refPtr, objPtr->internalRep.refValue.id);
JimSetStringBytes(objPtr, buf);
}
static int isrefchar(int c)
{
return (c == '_' || isalnum(c));
}
static int SetReferenceFromAny(Jim_Interp *interp, Jim_Obj *objPtr)
{
unsigned long value;
int i, len;
const char *str, *start, *end;
char refId[21];
Jim_Reference *refPtr;
Jim_HashEntry *he;
char *endptr;
str = Jim_GetString(objPtr, &len);
if (len < JIM_REFERENCE_SPACE)
goto badformat;
start = str;
end = str + len - 1;
while (*start == ' ')
start++;
while (*end == ' ' && end > start)
end--;
if (end - start + 1 != JIM_REFERENCE_SPACE)
goto badformat;
if (memcmp(start, "<reference.<", 12) != 0)
goto badformat;
if (start[12 + JIM_REFERENCE_TAGLEN] != '>' || end[0] != '>')
goto badformat;
for (i = 0; i < JIM_REFERENCE_TAGLEN; i++) {
if (!isrefchar(start[12 + i]))
goto badformat;
}
memcpy(refId, start + 14 + JIM_REFERENCE_TAGLEN, 20);
refId[20] = '\0';
value = strtoul(refId, &endptr, 10);
if (JimCheckConversion(refId, endptr) != JIM_OK)
goto badformat;
he = Jim_FindHashEntry(&interp->references, &value);
if (he == NULL) {
Jim_SetResultFormatted(interp, "invalid reference id \"%#s\"", objPtr);
return JIM_ERR;
}
refPtr = Jim_GetHashEntryVal(he);
Jim_FreeIntRep(interp, objPtr);
objPtr->typePtr = &referenceObjType;
objPtr->internalRep.refValue.id = value;
objPtr->internalRep.refValue.refPtr = refPtr;
return JIM_OK;
badformat:
Jim_SetResultFormatted(interp, "expected reference but got \"%#s\"", objPtr);
return JIM_ERR;
}
Jim_Obj *Jim_NewReference(Jim_Interp *interp, Jim_Obj *objPtr, Jim_Obj *tagPtr, Jim_Obj *cmdNamePtr)
{
struct Jim_Reference *refPtr;
unsigned long id;
Jim_Obj *refObjPtr;
const char *tag;
int tagLen, i;
Jim_CollectIfNeeded(interp);
refPtr = Jim_Alloc(sizeof(*refPtr));
refPtr->objPtr = objPtr;
Jim_IncrRefCount(objPtr);
refPtr->finalizerCmdNamePtr = cmdNamePtr;
if (cmdNamePtr)
Jim_IncrRefCount(cmdNamePtr);
id = interp->referenceNextId++;
Jim_AddHashEntry(&interp->references, &id, refPtr);
refObjPtr = Jim_NewObj(interp);
refObjPtr->typePtr = &referenceObjType;
refObjPtr->bytes = NULL;
refObjPtr->internalRep.refValue.id = id;
refObjPtr->internalRep.refValue.refPtr = refPtr;
interp->referenceNextId++;
tag = Jim_GetString(tagPtr, &tagLen);
if (tagLen > JIM_REFERENCE_TAGLEN)
tagLen = JIM_REFERENCE_TAGLEN;
for (i = 0; i < JIM_REFERENCE_TAGLEN; i++) {
if (i < tagLen && isrefchar(tag[i]))
refPtr->tag[i] = tag[i];
else
refPtr->tag[i] = '_';
}
refPtr->tag[JIM_REFERENCE_TAGLEN] = '\0';
return refObjPtr;
}
Jim_Reference *Jim_GetReference(Jim_Interp *interp, Jim_Obj *objPtr)
{
if (objPtr->typePtr != &referenceObjType && SetReferenceFromAny(interp, objPtr) == JIM_ERR)
return NULL;
return objPtr->internalRep.refValue.refPtr;
}
int Jim_SetFinalizer(Jim_Interp *interp, Jim_Obj *objPtr, Jim_Obj *cmdNamePtr)
{
Jim_Reference *refPtr;
if ((refPtr = Jim_GetReference(interp, objPtr)) == NULL)
return JIM_ERR;
Jim_IncrRefCount(cmdNamePtr);
if (refPtr->finalizerCmdNamePtr)
Jim_DecrRefCount(interp, refPtr->finalizerCmdNamePtr);
refPtr->finalizerCmdNamePtr = cmdNamePtr;
return JIM_OK;
}
int Jim_GetFinalizer(Jim_Interp *interp, Jim_Obj *objPtr, Jim_Obj **cmdNamePtrPtr)
{
Jim_Reference *refPtr;
if ((refPtr = Jim_GetReference(interp, objPtr)) == NULL)
return JIM_ERR;
*cmdNamePtrPtr = refPtr->finalizerCmdNamePtr;
return JIM_OK;
}
static const Jim_HashTableType JimRefMarkHashTableType = {
JimReferencesHTHashFunction,
JimReferencesHTKeyDup,
NULL,
JimReferencesHTKeyCompare,
JimReferencesHTKeyDestructor,
NULL
};
int Jim_Collect(Jim_Interp *interp)
{
int collected = 0;
return collected;
}
#define JIM_COLLECT_ID_PERIOD 5000
#define JIM_COLLECT_TIME_PERIOD 300
void Jim_CollectIfNeeded(Jim_Interp *interp)
{
unsigned long elapsedId;
int elapsedTime;
elapsedId = interp->referenceNextId - interp->lastCollectId;
elapsedTime = time(NULL) - interp->lastCollectTime;
if (elapsedId > JIM_COLLECT_ID_PERIOD || elapsedTime > JIM_COLLECT_TIME_PERIOD) {
Jim_Collect(interp);
}
}
#endif
int Jim_IsBigEndian(void)
{
union {
unsigned short s;
unsigned char c[2];
} uval = {0x0102};
|
| ︙ | |||
10423 10424 10425 10426 10427 10428 10429 | 10628 10629 10630 10631 10632 10633 10634 10635 10636 10637 10638 10639 10640 10641 10642 | - + |
Jim_IncrRefCount(i->unknown);
Jim_IncrRefCount(i->currentScriptObj);
Jim_IncrRefCount(i->nullScriptObj);
Jim_IncrRefCount(i->errorProc);
Jim_IncrRefCount(i->trueObj);
Jim_IncrRefCount(i->falseObj);
|
| ︙ | |||
10445 10446 10447 10448 10449 10450 10451 | 10650 10651 10652 10653 10654 10655 10656 10657 10658 10659 10660 10661 10662 10663 10664 | - + |
void Jim_FreeInterp(Jim_Interp *i)
{
Jim_CallFrame *cf, *cfx;
Jim_Obj *objPtr, *nextObjPtr;
|
| ︙ | |||
10498 10499 10500 10501 10502 10503 10504 | 10703 10704 10705 10706 10707 10708 10709 10710 10711 10712 10713 10714 10715 10716 10717 10718 10719 10720 10721 10722 10723 10724 10725 10726 10727 10728 10729 10730 10731 10732 10733 | - + - + - + |
objPtr = objPtr->nextObjPtr;
}
printf("-------------------------------------\n\n");
JimPanic((1, "Live list non empty freeing the interpreter! Leak?"));
}
#endif
|
| ︙ | |||
10539 10540 10541 10542 10543 10544 10545 | 10744 10745 10746 10747 10748 10749 10750 10751 10752 10753 10754 10755 10756 10757 10758 10759 10760 10761 10762 10763 10764 10765 10766 10767 10768 10769 10770 10771 10772 10773 10774 10775 10776 10777 10778 10779 10780 10781 10782 10783 10784 10785 10786 10787 10788 10789 10790 10791 10792 10793 10794 10795 10796 10797 10798 10799 | - + - + - + - + - + |
}
}
else {
if (Jim_GetLong(interp, levelObjPtr, &level) != JIM_OK || level < 0) {
level = -1;
}
else {
|
| ︙ | |||
10603 10604 10605 10606 10607 10608 10609 | 10808 10809 10810 10811 10812 10813 10814 10815 10816 10817 10818 10819 10820 10821 10822 10823 10824 10825 10826 10827 10828 10829 10830 10831 10832 10833 10834 10835 10836 10837 10838 10839 10840 10841 10842 10843 10844 10845 10846 10847 10848 10849 10850 10851 10852 10853 10854 10855 10856 10857 10858 10859 10860 10861 10862 10863 10864 | - + - + - + - + - + - + |
Jim_IncrRefCount(interp->stackTrace);
}
static void JimSetStackTrace(Jim_Interp *interp, Jim_Obj *stackTraceObj)
{
int len;
|
| ︙ | |||
10751 10752 10753 10754 10755 10756 10757 | 10956 10957 10958 10959 10960 10961 10962 10963 10964 10965 10966 10967 10968 10969 10970 10971 10972 10973 10974 10975 10976 10977 10978 10979 10980 10981 10982 10983 10984 10985 10986 10987 10988 | - + - + - + - + |
static int SetIntFromAny(Jim_Interp *interp, Jim_Obj *objPtr, int flags)
{
jim_wide wideValue;
const char *str;
if (objPtr->typePtr == &coercedDoubleObjType) {
|
| ︙ | |||
10868 10869 10870 10871 10872 10873 10874 | 11073 11074 11075 11076 11077 11078 11079 11080 11081 11082 11083 11084 11085 11086 11087 11088 11089 11090 11091 11092 11093 | - + - + |
return;
}
{
char buf[JIM_DOUBLE_SPACE + 1];
int i;
int len = sprintf(buf, "%.12g", value);
|
| ︙ | |||
10900 10901 10902 10903 10904 10905 10906 | 11105 11106 11107 11108 11109 11110 11111 11112 11113 11114 11115 11116 11117 11118 11119 11120 11121 11122 11123 11124 11125 11126 11127 11128 11129 11130 11131 11132 11133 11134 11135 11136 11137 11138 11139 11140 11141 11142 11143 11144 11145 11146 | - + - + - + - + - + |
double doubleValue;
jim_wide wideValue;
const char *str;
str = Jim_String(objPtr);
#ifdef HAVE_LONG_LONG
|
| ︙ | |||
10964 10965 10966 10967 10968 10969 10970 | 11169 11170 11171 11172 11173 11174 11175 11176 11177 11178 11179 11180 11181 11182 | - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
objPtr = Jim_NewObj(interp);
objPtr->typePtr = &doubleObjType;
objPtr->bytes = NULL;
objPtr->internalRep.doubleValue = doubleValue;
return objPtr;
}
|
| ︙ | |||
11054 11055 11056 11057 11058 11059 11060 | 11219 11220 11221 11222 11223 11224 11225 11226 11227 11228 11229 11230 11231 11232 11233 | - + |
#define JIM_ELESTR_SIMPLE 0
#define JIM_ELESTR_BRACE 1
#define JIM_ELESTR_QUOTE 2
static unsigned char ListElementQuotingType(const char *s, int len)
{
int i, level, blevel, trySimple = 1;
|
| ︙ | |||
11076 11077 11078 11079 11080 11081 11082 | 11241 11242 11243 11244 11245 11246 11247 11248 11249 11250 11251 11252 11253 11254 11255 11256 11257 11258 11259 11260 11261 11262 11263 11264 | - + - + |
case '\\':
case '\r':
case '\n':
case '\t':
case '\f':
case '\v':
trySimple = 0;
|
| ︙ | |||
11205 11206 11207 11208 11209 11210 11211 | 11370 11371 11372 11373 11374 11375 11376 11377 11378 11379 11380 11381 11382 11383 11384 11385 11386 11387 11388 11389 11390 11391 11392 11393 11394 11395 11396 11397 11398 11399 11400 11401 11402 11403 11404 11405 11406 11407 11408 11409 11410 11411 11412 11413 11414 11415 11416 11417 | - + - + - + - + - + |
{
#define STATIC_QUOTING_LEN 32
int i, bufLen, realLength;
const char *strRep;
char *p;
unsigned char *quotingType, staticQuoting[STATIC_QUOTING_LEN];
|
| ︙ | |||
11269 11270 11271 11272 11273 11274 11275 | 11434 11435 11436 11437 11438 11439 11440 11441 11442 11443 11444 11445 11446 11447 11448 11449 11450 11451 11452 11453 11454 | - + - + |
realLength++;
}
qlen = BackslashQuoteString(strRep, len, p);
p += qlen;
realLength += qlen;
break;
}
|
| ︙ | |||
11310 11311 11312 11313 11314 11315 11316 | 11475 11476 11477 11478 11479 11480 11481 11482 11483 11484 11485 11486 11487 11488 11489 11490 11491 11492 11493 11494 11495 11496 11497 11498 11499 11500 11501 11502 11503 11504 11505 11506 11507 11508 11509 11510 11511 11512 11513 11514 11515 11516 11517 11518 11519 | - + - + - + - + |
int i;
listObjPtrPtr = JimDictPairs(objPtr, &len);
for (i = 0; i < len; i++) {
Jim_IncrRefCount(listObjPtrPtr[i]);
}
|
| ︙ | |||
11474 11475 11476 11477 11478 11479 11480 | 11639 11640 11641 11642 11643 11644 11645 11646 11647 11648 11649 11650 11651 11652 11653 | - + |
static int ListSortCommand(Jim_Obj **lhsObj, Jim_Obj **rhsObj)
{
Jim_Obj *compare_script;
int rc;
jim_wide ret = 0;
|
| ︙ | |||
11496 11497 11498 11499 11500 11501 11502 | 11661 11662 11663 11664 11665 11666 11667 11668 11669 11670 11671 11672 11673 11674 11675 11676 11677 11678 11679 11680 11681 11682 11683 11684 11685 11686 11687 11688 11689 11690 11691 11692 11693 11694 11695 11696 11697 11698 11699 11700 11701 11702 11703 11704 11705 | - + - + - + - + - + |
{
int src;
int dst = 0;
Jim_Obj **ele = listObjPtr->internalRep.listValue.ele;
for (src = 1; src < listObjPtr->internalRep.listValue.len; src++) {
if (comp(&ele[dst], &ele[src]) == 0) {
|
| ︙ | |||
11549 11550 11551 11552 11553 11554 11555 | 11714 11715 11716 11717 11718 11719 11720 11721 11722 11723 11724 11725 11726 11727 11728 11729 11730 11731 11732 11733 11734 | - + - + - + |
case JIM_LSORT_REAL:
fn = ListSortReal;
break;
case JIM_LSORT_COMMAND:
fn = ListSortCommand;
break;
default:
|
| ︙ | |||
11583 11584 11585 11586 11587 11588 11589 | 11748 11749 11750 11751 11752 11753 11754 11755 11756 11757 11758 11759 11760 11761 11762 | - + |
int currentLen = listPtr->internalRep.listValue.len;
int requiredLen = currentLen + elemc;
int i;
Jim_Obj **point;
if (requiredLen > listPtr->internalRep.listValue.maxLen) {
if (requiredLen < 2) {
|
| ︙ | |||
11769 11770 11771 11772 11773 11774 11775 | 11934 11935 11936 11937 11938 11939 11940 11941 11942 11943 11944 11945 11946 11947 11948 11949 11950 11951 11952 11953 11954 11955 11956 11957 11958 11959 11960 11961 11962 11963 11964 11965 11966 11967 11968 11969 11970 11971 | - + - + - + - + - + - + |
Jim_Obj *objPtr = Jim_NewListObj(interp, NULL, 0);
for (i = 0; i < objc; i++)
ListAppendList(objPtr, objv[i]);
return objPtr;
}
else {
|
| ︙ | |||
11823 11824 11825 11826 11827 11828 11829 | 11988 11989 11990 11991 11992 11993 11994 11995 11996 11997 11998 11999 12000 12001 12002 | - + |
{
int first, last;
int len, rangeLen;
if (Jim_GetIndex(interp, firstObjPtr, &first) != JIM_OK ||
Jim_GetIndex(interp, lastObjPtr, &last) != JIM_OK)
return NULL;
|
| ︙ | |||
11863 11864 11865 11866 11867 11868 11869 | 12028 12029 12030 12031 12032 12033 12034 12035 12036 12037 12038 12039 12040 12041 12042 12043 12044 12045 12046 12047 | - - - - - - + + + + + + |
static void JimObjectHTKeyValDestructor(void *interp, void *val)
{
Jim_DecrRefCount(interp, (Jim_Obj *)val);
}
static const Jim_HashTableType JimDictHashTableType = {
|
| ︙ | |||
11893 11894 11895 11896 11897 11898 11899 | 12058 12059 12060 12061 12062 12063 12064 12065 12066 12067 12068 12069 12070 12071 12072 12073 12074 12075 12076 12077 12078 12079 12080 12081 12082 12083 12084 12085 12086 12087 12088 12089 12090 12091 12092 12093 12094 12095 12096 12097 12098 12099 12100 12101 12102 12103 12104 12105 12106 12107 12108 12109 12110 12111 12112 12113 12114 12115 12116 12117 12118 12119 12120 12121 12122 12123 12124 12125 12126 12127 12128 12129 12130 12131 12132 12133 12134 12135 12136 12137 12138 12139 12140 12141 | - + - + - + - + - + - + - + |
void DupDictInternalRep(Jim_Interp *interp, Jim_Obj *srcPtr, Jim_Obj *dupPtr)
{
Jim_HashTable *ht, *dupHt;
Jim_HashTableIterator htiter;
Jim_HashEntry *he;
|
| ︙ | |||
11991 11992 11993 11994 11995 11996 11997 | 12156 12157 12158 12159 12160 12161 12162 12163 12164 12165 12166 12167 12168 12169 12170 | - + |
static int DictAddElement(Jim_Interp *interp, Jim_Obj *objPtr,
Jim_Obj *keyObjPtr, Jim_Obj *valueObjPtr)
{
Jim_HashTable *ht = objPtr->internalRep.ptr;
|
| ︙ | |||
12091 12092 12093 12094 12095 12096 12097 | 12256 12257 12258 12259 12260 12261 12262 12263 12264 12265 12266 12267 12268 12269 12270 12271 12272 12273 12274 12275 12276 12277 12278 12279 12280 12281 12282 12283 12284 12285 12286 12287 12288 12289 12290 12291 12292 12293 12294 12295 12296 12297 12298 12299 12300 12301 12302 12303 12304 12305 12306 12307 12308 12309 12310 12311 12312 12313 12314 12315 12316 | - + - + - + - + - + |
{
Jim_Obj *varObjPtr, *objPtr, *dictObjPtr;
int shared, i;
varObjPtr = objPtr = Jim_GetVariable(interp, varNamePtr, flags);
if (objPtr == NULL) {
if (newObjPtr == NULL && (flags & JIM_MUSTEXIST)) {
|
| ︙ | |||
12174 12175 12176 12177 12178 12179 12180 | 12339 12340 12341 12342 12343 12344 12345 12346 12347 12348 12349 12350 12351 12352 12353 12354 12355 12356 12357 12358 12359 12360 12361 12362 12363 12364 12365 12366 12367 12368 12369 12370 12371 12372 12373 12374 12375 12376 12377 12378 12379 12380 12381 12382 12383 12384 12385 12386 12387 12388 12389 12390 12391 12392 12393 12394 12395 12396 12397 12398 12399 12400 12401 12402 12403 12404 12405 12406 12407 12408 12409 12410 12411 12412 12413 12414 12415 12416 12417 12418 12419 12420 12421 12422 12423 12424 12425 12426 12427 12428 | - + - + - + - + - + - + - + - + |
}
else {
char buf[JIM_INTEGER_SPACE + 1];
if (objPtr->internalRep.intValue >= 0) {
sprintf(buf, "%d", objPtr->internalRep.intValue);
}
else {
|
| ︙ | |||
12306 12307 12308 12309 12310 12311 12312 | 12471 12472 12473 12474 12475 12476 12477 12478 12479 12480 12481 12482 12483 12484 12485 12486 12487 12488 12489 12490 12491 12492 12493 12494 12495 12496 12497 12498 12499 12500 12501 12502 12503 12504 12505 12506 12507 12508 12509 12510 12511 12512 12513 12514 12515 12516 12517 12518 12519 12520 12521 12522 12523 12524 12525 12526 12527 12528 12529 12530 12531 12532 12533 12534 12535 12536 12537 12538 12539 12540 12541 12542 12543 12544 12545 12546 12547 12548 12549 12550 12551 12552 12553 12554 12555 12556 12557 12558 12559 12560 12561 12562 12563 12564 12565 12566 12567 12568 12569 12570 12571 12572 12573 12574 12575 12576 12577 12578 12579 12580 12581 12582 12583 12584 12585 12586 12587 12588 12589 12590 12591 12592 12593 12594 12595 12596 12597 12598 | - + - + - - - - + + + - + - - + + - - + + - - - + + + - - + + - + - + - + - - + + - - + + - - - |
}
static int SetReturnCodeFromAny(Jim_Interp *interp, Jim_Obj *objPtr)
{
int returnCode;
jim_wide wideValue;
|
| ︙ | |||
12504 12505 12506 12507 12508 12509 12510 | 12665 12666 12667 12668 12669 12670 12671 12672 12673 12674 12675 12676 12677 12678 12679 | - - - - |
break;
case JIM_EXPROP_FUNC_DOUBLE:
case JIM_EXPROP_UNARYPLUS:
dC = dA;
intresult = 0;
break;
case JIM_EXPROP_FUNC_ABS:
|
| ︙ | |||
12700 12701 12702 12703 12704 12705 12706 | 12857 12858 12859 12860 12861 12862 12863 12864 12865 12866 12867 12868 12869 12870 12871 12872 12873 12874 12875 12876 | - + - + |
if (negative) {
wC = -wC;
}
}
break;
case JIM_EXPROP_ROTL:
case JIM_EXPROP_ROTR:{
|
| ︙ | |||
12731 12732 12733 12734 12735 12736 12737 12738 12739 12740 12741 12742 12743 12744 12745 12746 12747 12748 | 12888 12889 12890 12891 12892 12893 12894 12895 12896 12897 12898 12899 12900 12901 12902 12903 12904 12905 12906 12907 12908 12909 12910 12911 12912 12913 12914 12915 12916 12917 12918 12919 12920 12921 12922 12923 12924 12925 12926 12927 12928 12929 12930 12931 12932 12933 12934 12935 12936 12937 12938 12939 12940 12941 12942 12943 12944 12945 12946 12947 12948 12949 12950 12951 12952 12953 12954 12955 12956 12957 12958 12959 12960 12961 12962 12963 12964 12965 12966 12967 12968 12969 12970 12971 12972 12973 12974 12975 12976 12977 12978 12979 12980 12981 12982 12983 12984 12985 12986 12987 12988 12989 12990 12991 12992 12993 12994 12995 12996 12997 12998 12999 13000 13001 13002 13003 13004 13005 13006 13007 13008 13009 13010 13011 13012 13013 13014 13015 13016 13017 13018 13019 13020 13021 13022 13023 13024 13025 13026 13027 13028 13029 13030 13031 13032 13033 13034 13035 13036 13037 13038 13039 13040 13041 13042 13043 13044 13045 13046 13047 13048 13049 13050 13051 13052 13053 13054 13055 13056 13057 13058 13059 13060 13061 13062 13063 13064 13065 13066 13067 13068 13069 13070 13071 13072 | + - + - - - - - - + - + - + - + - - + - + - + - + - + - + - - - - - - - - - - - - + - - - - - + + + + + + + + + + - - + - - + - - - - + - - + - + - + - + - + - + + - + + - + + - + + - + + - + + + + - + - + - + - + - + - + - + + - + + + - - + + + + + + + + + + - - - - - - |
return rc;
}
static int JimExprOpBin(Jim_Interp *interp, struct JimExprState *e)
{
int intresult = 1;
int rc = JIM_OK;
double dA, dB, dC = 0;
jim_wide wA, wB, wC = 0;
Jim_Obj *B = ExprPop(e);
Jim_Obj *A = ExprPop(e);
if ((A->typePtr != &doubleObjType || A->bytes) &&
(B->typePtr != &doubleObjType || B->bytes) &&
JimGetWideNoErr(interp, A, &wA) == JIM_OK && JimGetWideNoErr(interp, B, &wB) == JIM_OK) {
|
| ︙ | |||
12958 12959 12960 12961 12962 12963 12964 | 13111 13112 13113 13114 13115 13116 13117 13118 13119 13120 13121 13122 13123 13124 13125 13126 13127 13128 13129 13130 13131 13132 13133 13134 13135 13136 13137 13138 13139 13140 13141 13142 13143 13144 13145 13146 13147 13148 13149 13150 13151 13152 13153 13154 13155 13156 13157 13158 13159 13160 13161 13162 13163 13164 13165 13166 13167 13168 13169 13170 13171 13172 13173 13174 13175 13176 13177 13178 13179 13180 | - - - - - + - + - + - + - + - + |
return JIM_OK;
}
static int ExprBool(Jim_Interp *interp, Jim_Obj *obj)
{
long l;
double d;
|
| ︙ | |||
13042 13043 13044 13045 13046 13047 13048 | 13191 13192 13193 13194 13195 13196 13197 13198 13199 13200 13201 13202 13203 13204 13205 13206 13207 13208 13209 13210 13211 13212 13213 13214 13215 13216 13217 13218 13219 13220 13221 13222 13223 13224 13225 13226 13227 13228 13229 13230 13231 13232 13233 13234 13235 13236 13237 13238 13239 13240 13241 13242 13243 13244 13245 13246 13247 13248 13249 13250 13251 13252 13253 13254 13255 13256 13257 13258 13259 13260 13261 13262 13263 13264 13265 13266 13267 13268 13269 13270 13271 13272 13273 13274 13275 13276 13277 13278 13279 13280 | - + - + - + - + - + - + - + - + - + - + - - - + + |
break;
case 1:
ExprPush(e, Jim_NewIntObj(interp, 1));
break;
case -1:
|
| ︙ | |||
13146 13147 13148 13149 13150 13151 13152 | 13294 13295 13296 13297 13298 13299 13300 13301 13302 13303 13304 13305 13306 13307 13308 13309 13310 13311 13312 13313 13314 13315 13316 13317 13318 13319 13320 13321 13322 13323 13324 | - - - + + + - - - + + + - - - + + + - - - + + + - - + |
OPRINIT("==", 70, 2, JimExprOpBin),
OPRINIT("!=", 70, 2, JimExprOpBin),
OPRINIT("&", 50, 2, JimExprOpIntBin),
OPRINIT("^", 49, 2, JimExprOpIntBin),
OPRINIT("|", 48, 2, JimExprOpIntBin),
|
| ︙ | |||
13193 13194 13195 13196 13197 13198 13199 | 13340 13341 13342 13343 13344 13345 13346 13347 13348 13349 13350 13351 13352 13353 13354 13355 13356 13357 13358 13359 13360 13361 13362 13363 13364 13365 13366 13367 13368 13369 13370 13371 13372 13373 13374 13375 13376 13377 13378 13379 13380 13381 13382 13383 | - - - - + - + |
#ifdef JIM_MATH_FUNCTIONS
OPRINIT("sin", 200, 1, JimExprOpDoubleUnary),
OPRINIT("cos", 200, 1, JimExprOpDoubleUnary),
OPRINIT("tan", 200, 1, JimExprOpDoubleUnary),
OPRINIT("asin", 200, 1, JimExprOpDoubleUnary),
OPRINIT("acos", 200, 1, JimExprOpDoubleUnary),
OPRINIT("atan", 200, 1, JimExprOpDoubleUnary),
|
| ︙ | |||
13255 13256 13257 13258 13259 13260 13261 | 13399 13400 13401 13402 13403 13404 13405 13406 13407 13408 13409 13410 13411 13412 13413 | - + |
break;
case '[':
return JimParseCmd(pc);
case '$':
if (JimParseVar(pc) == JIM_ERR)
return JimParseExprOperator(pc);
else {
|
| ︙ | |||
13284 13285 13286 13287 13288 13289 13290 | 13428 13429 13430 13431 13432 13433 13434 13435 13436 13437 13438 13439 13440 13441 13442 13443 13444 13445 13446 13447 13448 13449 13450 13451 13452 13453 13454 13455 13456 13457 13458 13459 13460 13461 13462 13463 13464 13465 | - - - - - - - - - + - + - + - + |
return JimParseBrace(pc);
case 'N':
case 'I':
case 'n':
case 'i':
if (JimParseExprIrrational(pc) == JIM_ERR)
|
| ︙ | |||
13344 13345 13346 13347 13348 13349 13350 | 13480 13481 13482 13483 13484 13485 13486 13487 13488 13489 13490 13491 13492 13493 13494 13495 13496 13497 13498 13499 13500 13501 13502 13503 13504 13505 13506 13507 13508 13509 13510 13511 13512 13513 13514 13515 13516 13517 | - - - - - - - - - - - - - - - - - - - - - - + - + |
pc->tt = JIM_TT_EXPR_DOUBLE;
return JIM_OK;
}
}
return JIM_ERR;
}
|
| ︙ | |||
13422 13423 13424 13425 13426 13427 13428 | 13537 13538 13539 13540 13541 13542 13543 13544 13545 13546 13547 13548 13549 13550 13551 13552 13553 13554 | - + - - - - - - |
return &Jim_ExprOperators[opcode - JIM_TT_EXPR_OP];
}
const char *jim_tt_name(int type)
{
static const char * const tt_names[JIM_TT_EXPR_OP] =
{ "NIL", "STR", "ESC", "VAR", "ARY", "CMD", "SEP", "EOL", "EOF", "LIN", "WRD", "(((", ")))", ",,,", "INT",
|
| ︙ | |||
13459 13460 13461 13462 13463 13464 13465 | 13568 13569 13570 13571 13572 13573 13574 13575 13576 13577 13578 13579 13580 13581 13582 13583 13584 | - - - + + + |
NULL,
JIM_TYPE_REFERENCES,
};
typedef struct ExprByteCode
{
|
| ︙ | |||
13493 13494 13495 13496 13497 13498 13499 | 13602 13603 13604 13605 13606 13607 13608 13609 13610 13611 13612 13613 13614 13615 13616 13617 13618 13619 13620 13621 13622 13623 13624 13625 13626 13627 13628 13629 13630 13631 13632 13633 13634 13635 13636 13637 13638 13639 13640 13641 13642 13643 13644 13645 13646 13647 13648 13649 13650 13651 13652 13653 13654 13655 13656 13657 13658 13659 13660 13661 13662 13663 13664 13665 13666 13667 13668 13669 13670 13671 13672 13673 13674 13675 13676 13677 13678 13679 13680 13681 13682 13683 13684 13685 13686 13687 13688 13689 13690 13691 | - + + - + - - - - - + - - + + - - - - - - - - - - - - - - - - - - - - - - + - + - + - + - + |
}
static void DupExprInternalRep(Jim_Interp *interp, Jim_Obj *srcPtr, Jim_Obj *dupPtr)
{
JIM_NOTUSED(interp);
JIM_NOTUSED(srcPtr);
|
| ︙ | |||
13642 13643 13644 13645 13646 13647 13648 | 13727 13728 13729 13730 13731 13732 13733 13734 13735 13736 13737 13738 13739 13740 13741 | - + |
}
else if (expr->token[right_index].type == JIM_EXPROP_COLON_LEFT && ternary_count == 1) {
return right_index;
}
right_index--;
}
|
| ︙ | |||
13684 13685 13686 13687 13688 13689 13690 | 13769 13770 13771 13772 13773 13774 13775 13776 13777 13778 13779 13780 13781 13782 13783 13784 13785 13786 13787 13788 13789 13790 13791 13792 13793 13794 13795 13796 13797 13798 13799 13800 13801 13802 13803 13804 13805 13806 13807 13808 13809 13810 13811 13812 13813 13814 13815 13816 13817 13818 13819 13820 13821 13822 13823 13824 13825 13826 13827 13828 13829 13830 13831 13832 13833 13834 13835 13836 13837 13838 13839 13840 13841 13842 13843 13844 13845 13846 13847 13848 13849 13850 13851 13852 13853 13854 13855 13856 13857 13858 13859 13860 13861 13862 13863 13864 13865 13866 13867 13868 13869 13870 13871 13872 13873 13874 13875 13876 13877 13878 13879 13880 13881 13882 13883 13884 13885 13886 13887 13888 13889 13890 13891 13892 13893 13894 13895 13896 13897 13898 13899 13900 13901 13902 13903 13904 13905 13906 13907 13908 13909 13910 13911 13912 13913 13914 13915 13916 13917 13918 13919 13920 13921 13922 13923 13924 13925 13926 13927 13928 13929 13930 13931 13932 13933 13934 13935 13936 13937 13938 13939 13940 13941 13942 13943 13944 13945 13946 13947 13948 13949 13950 13951 13952 13953 13954 13955 13956 13957 13958 13959 13960 13961 13962 13963 13964 13965 13966 13967 13968 13969 13970 13971 13972 13973 13974 | - + - + - + - + - + - + - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - + + + + + + + + + - + - - - - + + + + - + - - + - - - - - - - - - - - - - + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - + |
int j;
ScriptToken tmp;
if (expr->token[i].type != JIM_EXPROP_COLON_RIGHT) {
continue;
}
|
| ︙ | |||
13902 13903 13904 13905 13906 13907 13908 | 13987 13988 13989 13990 13991 13992 13993 13994 13995 13996 13997 13998 13999 14000 14001 14002 14003 14004 14005 14006 14007 14008 14009 14010 14011 14012 14013 14014 14015 14016 14017 14018 14019 14020 14021 | - + - + + |
struct JimParserCtx parser;
struct ExprByteCode *expr;
ParseTokenList tokenlist;
int line;
Jim_Obj *fileNameObj;
int rc = JIM_ERR;
|
| ︙ | |||
13948 13949 13950 13951 13952 13953 13954 | 14034 14035 14036 14037 14038 14039 14040 14041 14042 14043 14044 14045 14046 14047 14048 14049 14050 14051 14052 14053 14054 14055 14056 14057 14058 14059 14060 14061 14062 14063 14064 14065 14066 14067 14068 14069 14070 14071 14072 14073 14074 14075 14076 14077 14078 14079 14080 | - - + + - + - - + + - - - + - + |
if (JimParseCheckMissing(interp, parser.missing.ch) == JIM_ERR) {
ScriptTokenListFree(&tokenlist);
Jim_DecrRefCount(interp, fileNameObj);
return JIM_ERR;
}
|
| ︙ | |||
14026 14027 14028 14029 14030 14031 14032 | 14110 14111 14112 14113 14114 14115 14116 14117 14118 14119 14120 14121 14122 14123 14124 | - + |
Jim_Obj *staticStack[JIM_EE_STATICSTACK_LEN];
int i;
int retcode = JIM_OK;
struct JimExprState e;
expr = JimGetExpression(interp, exprObjPtr);
if (!expr) {
|
| ︙ | |||
14099 14100 14101 14102 14103 14104 14105 | 14183 14184 14185 14186 14187 14188 14189 14190 14191 14192 14193 14194 14195 14196 14197 14198 14199 14200 14201 14202 14203 14204 14205 14206 14207 14208 14209 14210 14211 14212 | - + - + - |
}
}
noopt:
#endif
expr->inUse++;
|
| ︙ | |||
14155 14156 14157 14158 14159 14160 14161 | 14238 14239 14240 14241 14242 14243 14244 14245 14246 14247 14248 14249 14250 14251 14252 14253 14254 14255 14256 14257 | - + - + |
retcode = Jim_EvalObj(interp, expr->token[i].objPtr);
if (retcode == JIM_OK) {
ExprPush(&e, Jim_GetResult(interp));
}
break;
default:{
|
| ︙ | |||
14188 14189 14190 14191 14192 14193 14194 | 14271 14272 14273 14274 14275 14276 14277 14278 14279 14280 14281 14282 14283 14284 14285 14286 14287 14288 14289 14290 14291 14292 14293 14294 14295 14296 14297 14298 14299 14300 14301 14302 14303 14304 14305 14306 14307 14308 14309 14310 14311 14312 14313 14314 14315 14316 14317 14318 14319 14320 14321 14322 14323 14324 14325 14326 14327 14328 14329 14330 14331 | - - - - + + - - - - - - - - - - - + + + + + + - - - - - - - - + + + + + + + + |
}
int Jim_GetBoolFromExpr(Jim_Interp *interp, Jim_Obj *exprObjPtr, int *boolPtr)
{
int retcode;
jim_wide wideValue;
double doubleValue;
|
| ︙ | |||
14292 14293 14294 14295 14296 14297 14298 | 14368 14369 14370 14371 14372 14373 14374 14375 14376 14377 14378 14379 14380 14381 14382 14383 14384 14385 14386 14387 14388 14389 14390 14391 14392 14393 14394 14395 14396 14397 14398 14399 14400 14401 14402 14403 14404 14405 14406 14407 14408 14409 14410 14411 14412 14413 14414 14415 14416 14417 14418 14419 14420 14421 14422 14423 14424 14425 14426 14427 14428 14429 14430 14431 14432 14433 14434 14435 14436 14437 14438 14439 14440 14441 14442 14443 14444 14445 14446 14447 14448 14449 14450 14451 14452 14453 14454 14455 14456 14457 14458 14459 14460 14461 14462 14463 14464 14465 14466 14467 14468 14469 14470 14471 14472 14473 14474 14475 14476 14477 14478 14479 14480 14481 14482 14483 14484 14485 14486 14487 14488 14489 14490 14491 14492 14493 14494 14495 14496 14497 14498 14499 14500 14501 14502 14503 14504 14505 14506 14507 14508 14509 14510 14511 14512 | - + - - - - - - - - + + + + + + + + - - + + - + - + - + - + - - + + - + - + - + - + - + - + - + - + - + |
int maxCount, i, approxSize, lastPos = -1;
const char *fmt = objPtr->bytes;
int maxFmtLen = objPtr->length;
const char *fmtEnd = fmt + maxFmtLen;
int curr;
Jim_FreeIntRep(interp, objPtr);
|
| ︙ | |||
14465 14466 14467 14468 14469 14470 14471 | 14541 14542 14543 14544 14545 14546 14547 14548 14549 14550 14551 14552 14553 14554 14555 | - + |
char *p = buffer;
while (*str) {
int c;
int n;
if (!sdescr && isspace(UCHAR(*str)))
|
| ︙ | |||
14488 14489 14490 14491 14492 14493 14494 | 14564 14565 14566 14567 14568 14569 14570 14571 14572 14573 14574 14575 14576 14577 14578 14579 14580 14581 14582 14583 14584 14585 14586 14587 14588 14589 14590 14591 14592 14593 14594 14595 14596 14597 14598 14599 14600 14601 14602 14603 14604 14605 14606 14607 14608 14609 14610 14611 14612 14613 14614 14615 14616 14617 14618 14619 14620 14621 14622 14623 14624 14625 14626 14627 14628 14629 14630 14631 14632 14633 14634 14635 14636 14637 14638 14639 14640 14641 14642 14643 14644 14645 14646 14647 14648 14649 14650 14651 14652 14653 14654 14655 14656 14657 14658 14659 14660 14661 14662 14663 14664 14665 14666 14667 14668 14669 14670 14671 14672 14673 14674 14675 14676 14677 14678 14679 | - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + |
const char *tok;
const ScanFmtPartDescr *descr = &fmtObj->descr[idx];
size_t scanned = 0;
size_t anchor = pos;
int i;
Jim_Obj *tmpObj = NULL;
|
| ︙ | |||
14618 14619 14620 14621 14622 14623 14624 | 14694 14695 14696 14697 14698 14699 14700 14701 14702 14703 14704 14705 14706 14707 14708 14709 14710 14711 14712 14713 14714 14715 14716 14717 14718 14719 14720 14721 14722 14723 14724 14725 14726 14727 14728 14729 14730 14731 14732 14733 14734 14735 14736 14737 14738 14739 14740 14741 14742 14743 14744 14745 14746 14747 14748 14749 14750 14751 14752 14753 14754 14755 14756 14757 14758 14759 14760 14761 14762 | - + - + - + - + - + - + - + - + - + - + - + - + - + - + |
int strLen = Jim_Utf8Length(interp, strObjPtr);
Jim_Obj *resultList = 0;
Jim_Obj **resultVec = 0;
int resultc;
Jim_Obj *emptyStr = 0;
ScanFmtStringObj *fmtObj;
|
| ︙ | |||
14714 14715 14716 14717 14718 14719 14720 | 14790 14791 14792 14793 14794 14795 14796 14797 14798 14799 14800 14801 14802 14803 14804 14805 14806 14807 14808 14809 14810 14811 14812 14813 14814 14815 14816 14817 14818 14819 14820 14821 14822 14823 14824 14825 14826 14827 14828 14829 14830 14831 14832 14833 14834 | - + - + - + - + - + |
static void JimRandomBytes(Jim_Interp *interp, void *dest, unsigned int len)
{
Jim_PrngState *prng;
unsigned char *destByte = (unsigned char *)dest;
unsigned int si, sj, x;
|
| ︙ | |||
14775 14776 14777 14778 14779 14780 14781 | 14851 14852 14853 14854 14855 14856 14857 14858 14859 14860 14861 14862 14863 14864 14865 14866 14867 14868 14869 14870 14871 14872 14873 14874 14875 14876 14877 14878 14879 14880 14881 14882 14883 14884 14885 14886 14887 14888 14889 14890 14891 14892 14893 14894 14895 14896 14897 14898 14899 14900 14901 14902 14903 14904 14905 14906 14907 14908 14909 14910 14911 | - + - + - + - - + + - + - + |
}
if (argc == 3) {
if (Jim_GetWide(interp, argv[2], &increment) != JIM_OK)
return JIM_ERR;
}
intObjPtr = Jim_GetVariable(interp, argv[1], JIM_UNSHARED);
if (!intObjPtr) {
|
| ︙ | |||
14843 14844 14845 14846 14847 14848 14849 | 14919 14920 14921 14922 14923 14924 14925 14926 14927 14928 14929 14930 14931 14932 14933 14934 14935 14936 14937 14938 14939 14940 14941 14942 14943 14944 14945 14946 14947 14948 14949 14950 14951 14952 14953 14954 14955 14956 14957 14958 14959 14960 14961 14962 14963 14964 14965 14966 14967 14968 14969 14970 14971 14972 14973 14974 14975 14976 14977 14978 14979 | - + - + - + - + |
for (j = 0; j < objc; j++) {
printf(" '%s'", Jim_String(objv[j]));
}
printf("\n");
#endif
if (interp->framePtr->tailcallCmd) {
|
| ︙ | |||
14911 14912 14913 14914 14915 14916 14917 | 14987 14988 14989 14990 14991 14992 14993 14994 14995 14996 14997 14998 14999 15000 15001 15002 15003 15004 15005 15006 15007 15008 15009 15010 15011 15012 15013 15014 15015 | - + - + - + - + |
Jim_Free(nargv);
return ret;
}
static void JimAddErrorToStack(Jim_Interp *interp, ScriptObj *script)
{
if (!interp->errorFlag) {
|
| ︙ | |||
14964 14965 14966 14967 14968 14969 14970 | 15040 15041 15042 15043 15044 15045 15046 15047 15048 15049 15050 15051 15052 15053 15054 15055 15056 15057 | - + - + |
case JIM_TT_CMD:
switch (Jim_EvalObj(interp, token->objPtr)) {
case JIM_OK:
case JIM_RETURN:
objPtr = interp->result;
break;
case JIM_BREAK:
|
| ︙ | |||
15006 15007 15008 15009 15010 15011 15012 | 15082 15083 15084 15085 15086 15087 15088 15089 15090 15091 15092 15093 15094 15095 15096 15097 15098 15099 15100 15101 15102 15103 15104 15105 15106 15107 15108 15109 15110 15111 15112 15113 15114 15115 15116 15117 15118 15119 15120 15121 15122 15123 15124 15125 15126 15127 15128 15129 15130 15131 15132 15133 15134 15135 15136 15137 15138 15139 15140 15141 15142 15143 15144 15145 15146 15147 15148 15149 15150 15151 15152 15153 15154 15155 | - + - - + + - - + + - + - + - + - + |
for (i = 0; i < tokens; i++) {
switch (JimSubstOneToken(interp, &token[i], &intv[i])) {
case JIM_OK:
case JIM_RETURN:
break;
case JIM_BREAK:
if (flags & JIM_SUBST_FLAG) {
|
| ︙ | |||
15109 15110 15111 15112 15113 15114 15115 | 15185 15186 15187 15188 15189 15190 15191 15192 15193 15194 15195 15196 15197 15198 15199 | - + |
Jim_Obj *sargv[JIM_EVAL_SARGV_LEN], **argv = NULL;
Jim_Obj *prevScriptObj;
if (Jim_IsList(scriptObjPtr) && scriptObjPtr->bytes == NULL) {
return JimEvalObjList(interp, scriptObjPtr);
}
|
| ︙ | |||
15145 15146 15147 15148 15149 15150 15151 | 15221 15222 15223 15224 15225 15226 15227 15228 15229 15230 15231 15232 15233 15234 15235 15236 15237 15238 15239 15240 15241 15242 15243 15244 15245 15246 15247 15248 15249 15250 15251 15252 15253 15254 | - + - + - + - + |
return JIM_OK;
}
}
#endif
script->inUse++;
|
| ︙ | |||
15224 15225 15226 15227 15228 15229 15230 | 15300 15301 15302 15303 15304 15305 15306 15307 15308 15309 15310 15311 15312 15313 15314 15315 15316 15317 15318 15319 15320 15321 15322 15323 15324 15325 15326 15327 15328 15329 15330 15331 15332 15333 15334 15335 15336 15337 15338 15339 15340 15341 15342 15343 15344 15345 15346 15347 15348 15349 15350 15351 15352 15353 15354 15355 15356 15357 15358 15359 15360 15361 15362 15363 15364 15365 15366 15367 15368 15369 15370 15371 15372 15373 15374 15375 15376 15377 15378 15379 15380 15381 15382 15383 15384 15385 15386 15387 15388 15389 15390 15391 15392 15393 15394 15395 15396 15397 15398 15399 15400 15401 15402 15403 15404 15405 15406 15407 15408 15409 15410 15411 15412 15413 15414 15415 15416 15417 15418 15419 15420 15421 15422 15423 15424 15425 15426 15427 15428 15429 15430 15431 15432 15433 | - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + |
Jim_IncrRefCount(wordObjPtr);
i += wordtokens;
if (!expand) {
argv[j] = wordObjPtr;
}
else {
|
| ︙ | |||
15372 15373 15374 15375 15376 15377 15378 | 15448 15449 15450 15451 15452 15453 15454 15455 15456 15457 15458 15459 15460 15461 15462 15463 15464 15465 15466 15467 15468 15469 15470 15471 15472 15473 15474 15475 15476 15477 15478 15479 15480 15481 15482 15483 15484 15485 15486 15487 15488 15489 15490 15491 15492 15493 15494 15495 15496 15497 15498 15499 15500 15501 15502 15503 15504 15505 15506 15507 15508 15509 15510 15511 15512 15513 15514 15515 15516 15517 15518 15519 15520 15521 15522 15523 15524 15525 15526 15527 15528 15529 15530 15531 15532 15533 15534 15535 15536 15537 15538 15539 15540 15541 15542 15543 15544 15545 15546 15547 15548 15549 15550 15551 15552 15553 15554 15555 15556 15557 15558 15559 15560 15561 15562 15563 15564 15565 15566 15567 15568 15569 15570 15571 15572 15573 15574 15575 15576 15577 15578 15579 15580 15581 15582 15583 15584 15585 15586 15587 15588 15589 15590 15591 15592 15593 15594 15595 15596 15597 15598 15599 15600 15601 15602 15603 15604 15605 15606 15607 | - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + |
#ifdef jim_ext_namespace
int Jim_EvalNamespace(Jim_Interp *interp, Jim_Obj *scriptObj, Jim_Obj *nsObj)
{
Jim_CallFrame *callFramePtr;
int retcode;
|
| ︙ | |||
15633 15634 15635 15636 15637 15638 15639 | 15709 15710 15711 15712 15713 15714 15715 15716 15717 15718 15719 15720 15721 15722 15723 15724 15725 15726 15727 15728 15729 15730 15731 15732 | - + - + |
Jim_IncrRefCount(scriptObjPtr);
prevScriptObj = interp->currentScriptObj;
interp->currentScriptObj = scriptObjPtr;
retcode = Jim_EvalObj(interp, scriptObjPtr);
|
| ︙ | |||
15672 15673 15674 15675 15676 15677 15678 | 15748 15749 15750 15751 15752 15753 15754 15755 15756 15757 15758 15759 15760 15761 15762 | - + |
JimParseCmd(pc);
return;
}
if (*pc->p == '$' && !(flags & JIM_SUBST_NOVAR)) {
if (JimParseVar(pc) == JIM_OK) {
return;
}
|
| ︙ | |||
15703 15704 15705 15706 15707 15708 15709 | 15779 15780 15781 15782 15783 15784 15785 15786 15787 15788 15789 15790 15791 15792 15793 15794 15795 15796 15797 15798 15799 15800 15801 15802 15803 15804 15805 15806 15807 15808 15809 15810 15811 15812 15813 15814 15815 15816 15817 15818 15819 15820 15821 15822 15823 15824 15825 15826 15827 15828 15829 15830 15831 15832 15833 15834 15835 15836 15837 15838 15839 15840 15841 15842 15843 15844 15845 15846 15847 15848 15849 15850 15851 15852 15853 15854 15855 15856 15857 15858 15859 15860 15861 15862 15863 | - + - + - + - + - + - + - - - - - + |
{
int scriptTextLen;
const char *scriptText = Jim_GetString(objPtr, &scriptTextLen);
struct JimParserCtx parser;
struct ScriptObj *script = Jim_Alloc(sizeof(*script));
ParseTokenList tokenlist;
|
| ︙ | |||
15802 15803 15804 15805 15806 15807 15808 | 15874 15875 15876 15877 15878 15879 15880 15881 15882 15883 15884 15885 15886 15887 15888 | - + |
static Jim_Obj *JimHashtablePatternMatch(Jim_Interp *interp, Jim_HashTable *ht, Jim_Obj *patternObjPtr,
JimHashtableIteratorCallbackType *callback, int type)
{
Jim_HashEntry *he;
Jim_Obj *listObjPtr = Jim_NewListObj(interp, NULL, 0);
|
| ︙ | |||
15833 15834 15835 15836 15837 15838 15839 | 15905 15906 15907 15908 15909 15910 15911 15912 15913 15914 15915 15916 15917 15918 15919 | - + |
static void JimCommandMatch(Jim_Interp *interp, Jim_Obj *listObjPtr,
Jim_HashEntry *he, int type)
{
Jim_Cmd *cmdPtr = Jim_GetHashEntryVal(he);
Jim_Obj *objPtr;
if (type == JIM_CMDLIST_PROCS && !cmdPtr->isproc) {
|
| ︙ | |||
15893 15894 15895 15896 15897 15898 15899 | 15965 15966 15967 15968 15969 15970 15971 15972 15973 15974 15975 15976 15977 15978 15979 | - + |
{
Jim_CallFrame *targetCallFrame;
targetCallFrame = JimGetCallFrameByInteger(interp, levelObjPtr);
if (targetCallFrame == NULL) {
return JIM_ERR;
}
|
| ︙ | |||
16080 16081 16082 16083 16084 16085 16086 | 16152 16153 16154 16155 16156 16157 16158 16159 16160 16161 16162 16163 16164 16165 16166 | - + |
objPtr = Jim_GetVariable(interp, argv[1], JIM_ERRMSG);
if (!objPtr)
return JIM_ERR;
Jim_SetResult(interp, objPtr);
return JIM_OK;
}
|
| ︙ | |||
16123 16124 16125 16126 16127 16128 16129 | 16195 16196 16197 16198 16199 16200 16201 16202 16203 16204 16205 16206 16207 16208 16209 | - + |
static int Jim_WhileCoreCommand(Jim_Interp *interp, int argc, Jim_Obj *const *argv)
{
if (argc != 3) {
Jim_WrongNumArgs(interp, 1, argv, "condition body");
return JIM_ERR;
}
|
| ︙ | |||
16163 16164 16165 16166 16167 16168 16169 | 16235 16236 16237 16238 16239 16240 16241 16242 16243 16244 16245 16246 16247 16248 16249 16250 16251 16252 16253 16254 16255 16256 16257 16258 16259 16260 16261 16262 16263 16264 16265 16266 16267 16268 16269 16270 16271 16272 16273 16274 16275 16276 16277 16278 16279 16280 16281 16282 16283 16284 16285 16286 16287 16288 16289 16290 16291 16292 16293 16294 16295 16296 16297 16298 16299 16300 16301 16302 16303 16304 16305 16306 16307 16308 16309 16310 16311 16312 16313 16314 16315 16316 16317 16318 16319 16320 16321 16322 16323 16324 16325 16326 16327 16328 16329 16330 16331 16332 16333 16334 16335 16336 16337 16338 16339 16340 16341 16342 16343 16344 16345 16346 | - + - + - + - + - + - + - + - + - + - + - - + + - + - + - + |
Jim_Obj *stopVarNamePtr = NULL;
if (argc != 5) {
Jim_WrongNumArgs(interp, 1, argv, "start test next body");
return JIM_ERR;
}
|
| ︙ | |||
16284 16285 16286 16287 16288 16289 16290 | 16356 16357 16358 16359 16360 16361 16362 16363 16364 16365 16366 16367 16368 16369 16370 16371 16372 16373 16374 16375 16376 16377 16378 16379 16380 16381 16382 16383 16384 | - + - - + + - - + + - + |
}
goto out;
}
evalstart:
#endif
while (boolean && (retval == JIM_OK || retval == JIM_CONTINUE)) {
|
| ︙ | |||
16344 16345 16346 16347 16348 16349 16350 | 16416 16417 16418 16419 16420 16421 16422 16423 16424 16425 16426 16427 16428 16429 16430 | - + |
while (((i < limit && incr > 0) || (i > limit && incr < 0)) && retval == JIM_OK) {
retval = Jim_EvalObj(interp, bodyObjPtr);
if (retval == JIM_OK || retval == JIM_CONTINUE) {
Jim_Obj *objPtr = Jim_GetVariable(interp, argv[1], JIM_ERRMSG);
retval = JIM_OK;
|
| ︙ | |||
16409 16410 16411 16412 16413 16414 16415 | 16481 16482 16483 16484 16485 16486 16487 16488 16489 16490 16491 16492 16493 16494 16495 16496 16497 16498 16499 16500 16501 16502 16503 16504 16505 | - + - - + + |
}
static int JimForeachMapHelper(Jim_Interp *interp, int argc, Jim_Obj *const *argv, int doMap)
{
int result = JIM_OK;
int i, numargs;
|
| ︙ | |||
16447 16448 16449 16450 16451 16452 16453 | 16519 16520 16521 16522 16523 16524 16525 16526 16527 16528 16529 16530 16531 16532 16533 16534 16535 16536 16537 16538 16539 16540 16541 16542 16543 16544 16545 16546 16547 16548 16549 16550 16551 16552 16553 16554 16555 16556 | - + - + - + - + - + - + |
}
else {
resultObj = interp->emptyObj;
}
Jim_IncrRefCount(resultObj);
while (1) {
|
| ︙ | |||
16556 16557 16558 16559 16560 16561 16562 | 16628 16629 16630 16631 16632 16633 16634 16635 16636 16637 16638 16639 16640 16641 16642 16643 16644 16645 16646 16647 16648 16649 16650 16651 16652 16653 16654 16655 16656 16657 16658 16659 16660 16661 16662 16663 16664 16665 16666 16667 16668 16669 16670 16671 16672 | - + - + - + - + - + - + |
static int Jim_IfCoreCommand(Jim_Interp *interp, int argc, Jim_Obj *const *argv)
{
int boolean, retval, current = 1, falsebody = 0;
if (argc >= 3) {
while (1) {
|
| ︙ | |||
16698 16699 16700 16701 16702 16703 16704 | 16770 16771 16772 16773 16774 16775 16776 16777 16778 16779 16780 16781 16782 16783 16784 16785 16786 16787 16788 16789 16790 16791 16792 16793 16794 | - + - + |
break;
case SWITCH_GLOB:
if (Jim_StringMatchObj(interp, patObj, strObj, 0))
script = caseList[i + 1];
break;
case SWITCH_RE:
command = Jim_NewStringObj(interp, "regexp", -1);
|
| ︙ | |||
16846 16847 16848 16849 16850 16851 16852 | 16918 16919 16920 16921 16922 16923 16924 16925 16926 16927 16928 16929 16930 16931 16932 | - + |
opt_all = 1;
break;
case OPT_COMMAND:
if (i >= argc - 2) {
goto wrongargs;
}
commandObj = argv[++i];
|
| ︙ | |||
16894 16895 16896 16897 16898 16899 16900 | 16966 16967 16968 16969 16970 16971 16972 16973 16974 16975 16976 16977 16978 16979 16980 16981 16982 16983 16984 16985 16986 | - + - + |
}
rc = JIM_ERR;
goto done;
}
break;
}
|
| ︙ | |||
16927 16928 16929 16930 16931 16932 16933 | 16999 17000 17001 17002 17003 17004 17005 17006 17007 17008 17009 17010 17011 17012 17013 | - + |
}
}
if (opt_all) {
Jim_SetResult(interp, listObjPtr);
}
else {
|
| ︙ | |||
16956 16957 16958 16959 16960 16961 16962 | 17028 17029 17030 17031 17032 17033 17034 17035 17036 17037 17038 17039 17040 17041 17042 | - + |
if (argc < 2) {
Jim_WrongNumArgs(interp, 1, argv, "varName ?value value ...?");
return JIM_ERR;
}
listObjPtr = Jim_GetVariable(interp, argv[1], JIM_UNSHARED);
if (!listObjPtr) {
|
| ︙ | |||
17029 17030 17031 17032 17033 17034 17035 | 17101 17102 17103 17104 17105 17106 17107 17108 17109 17110 17111 17112 17113 17114 17115 17116 17117 17118 17119 17120 17121 17122 17123 17124 17125 17126 17127 17128 17129 17130 17131 17132 17133 17134 17135 17136 17137 17138 17139 17140 17141 17142 17143 17144 17145 17146 17147 17148 17149 17150 | - + - + - + - + - + - + - + |
len = Jim_ListLength(interp, listObj);
first = JimRelToAbsIndex(len, first);
last = JimRelToAbsIndex(len, last);
JimRelToAbsRange(len, &first, &last, &rangeLen);
|
| ︙ | |||
17179 17180 17181 17182 17183 17184 17185 | 17251 17252 17253 17254 17255 17256 17257 17258 17259 17260 17261 17262 17263 17264 17265 | - + |
if (!stringObjPtr)
return JIM_ERR;
}
else {
int new_obj = 0;
stringObjPtr = Jim_GetVariable(interp, argv[1], JIM_UNSHARED);
if (!stringObjPtr) {
|
| ︙ | |||
17228 17229 17230 17231 17232 17233 17234 | 17300 17301 17302 17303 17304 17305 17306 17307 17308 17309 17310 17311 17312 17313 17314 17315 17316 17317 17318 17319 17320 17321 17322 17323 17324 17325 17326 17327 17328 17329 17330 17331 17332 17333 17334 17335 17336 17337 17338 17339 17340 17341 17342 17343 17344 17345 17346 17347 17348 | - + - + - + - + |
rc = Jim_EvalObj(interp, argv[1]);
}
else {
rc = Jim_EvalObj(interp, Jim_ConcatObj(interp, argc - 1, argv + 1));
}
if (rc == JIM_ERR) {
|
| ︙ | |||
17364 17365 17366 17367 17368 17369 17370 | 17436 17437 17438 17439 17440 17441 17442 17443 17444 17445 17446 17447 17448 17449 17450 17451 17452 17453 17454 17455 17456 17457 17458 17459 17460 17461 17462 17463 17464 17465 17466 17467 17468 17469 17470 17471 17472 17473 17474 17475 17476 17477 17478 17479 17480 17481 17482 17483 17484 17485 17486 17487 17488 17489 17490 17491 17492 17493 17494 17495 17496 17497 17498 17499 17500 17501 17502 17503 17504 17505 17506 | - + - + - + - + - + - + - + |
}
if (i != argc - 1 && i != argc) {
Jim_WrongNumArgs(interp, 1, argv,
"?-code code? ?-errorinfo stacktrace? ?-level level? ?result?");
}
|
| ︙ | |||
17478 17479 17480 17481 17482 17483 17484 | 17550 17551 17552 17553 17554 17555 17556 17557 17558 17559 17560 17561 17562 17563 17564 17565 17566 17567 17568 17569 17570 17571 17572 17573 17574 17575 17576 17577 17578 17579 17580 17581 17582 17583 17584 17585 17586 17587 17588 17589 17590 17591 17592 17593 17594 17595 17596 17597 17598 | - + - + - + - + - + |
cmd = JimCreateProcedureCmd(interp, argv[2], NULL, argv[3], NULL);
}
else {
cmd = JimCreateProcedureCmd(interp, argv[2], argv[3], argv[4], NULL);
}
if (cmd) {
|
| ︙ | |||
17545 17546 17547 17548 17549 17550 17551 | 17617 17618 17619 17620 17621 17622 17623 17624 17625 17626 17627 17628 17629 17630 17631 17632 17633 17634 17635 17636 17637 17638 | - + - + - + |
int retcode;
Jim_Cmd *cmdPtr = Jim_GetCommand(interp, argv[1], JIM_ERRMSG);
if (cmdPtr == NULL || !cmdPtr->isproc || !cmdPtr->prevCmd) {
Jim_SetResultFormatted(interp, "no previous command: \"%#s\"", argv[1]);
return JIM_ERR;
}
|
| ︙ | |||
17583 17584 17585 17586 17587 17588 17589 | 17655 17656 17657 17658 17659 17660 17661 17662 17663 17664 17665 17666 17667 17668 17669 17670 17671 17672 17673 17674 17675 17676 17677 17678 17679 17680 17681 17682 | - + - + |
if (len != 2 && len != 3) {
Jim_SetResultFormatted(interp, "can't interpret \"%#s\" as a lambda expression", argv[1]);
return JIM_ERR;
}
if (len == 3) {
#ifdef jim_ext_namespace
|
| ︙ | |||
17626 17627 17628 17629 17630 17631 17632 | 17698 17699 17700 17701 17702 17703 17704 17705 17706 17707 17708 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 17742 17743 17744 17745 17746 17747 17748 17749 17750 17751 17752 | - + - + - + - + - + - + |
static int Jim_UpvarCoreCommand(Jim_Interp *interp, int argc, Jim_Obj *const *argv)
{
int i;
Jim_CallFrame *targetCallFrame;
|
| ︙ | |||
17693 17694 17695 17696 17697 17698 17699 | 17765 17766 17767 17768 17769 17770 17771 17772 17773 17774 17775 17776 17777 17778 17779 17780 17781 17782 17783 17784 17785 17786 17787 17788 17789 17790 17791 17792 17793 17794 17795 17796 17797 17798 17799 17800 17801 17802 17803 17804 17805 17806 | - + - + - - - + + + - + |
Jim_SetResultString(interp, "list must contain an even number of elements", -1);
return NULL;
}
str = Jim_String(objPtr);
strLen = Jim_Utf8Length(interp, objPtr);
|
| ︙ | |||
17785 17786 17787 17788 17789 17790 17791 | 17857 17858 17859 17860 17861 17862 17863 17864 17865 17866 17867 17868 17869 17870 17871 17872 17873 17874 17875 17876 17877 17878 17879 17880 17881 17882 17883 17884 17885 17886 17887 17888 17889 17890 17891 17892 17893 17894 17895 17896 17897 17898 17899 17900 17901 17902 17903 17904 17905 17906 17907 17908 17909 17910 17911 17912 17913 17914 17915 17916 17917 17918 17919 17920 17921 17922 17923 | - + - + - + - + - + |
}
Jim_SetResultInt(interp, len);
return JIM_OK;
case OPT_CAT:{
Jim_Obj *objPtr;
if (argc == 3) {
|
| ︙ | |||
17951 17952 17953 17954 17955 17956 17957 17958 17959 17960 17961 17962 17963 17964 | 18023 18024 18025 18026 18027 18028 18029 18030 18031 18032 18033 18034 18035 18036 18037 | + |
Jim_SetResult(interp, objPtr);
return JIM_OK;
}
case OPT_REVERSE:{
char *buf, *p;
const char *str;
int len;
int i;
if (argc != 3) {
Jim_WrongNumArgs(interp, 2, argv, "string");
return JIM_ERR;
}
|
| ︙ | |||
17994 17995 17996 17997 17998 17999 18000 | 18067 18068 18069 18070 18071 18072 18073 18074 18075 18076 18077 18078 18079 18080 18081 | - + |
if (idx != INT_MIN && idx != INT_MAX) {
idx = JimRelToAbsIndex(len, idx);
}
if (idx < 0 || idx >= len || str == NULL) {
Jim_SetResultString(interp, "", 0);
}
else if (len == Jim_Length(argv[2])) {
|
| ︙ | |||
18148 18149 18150 18151 18152 18153 18154 | 18221 18222 18223 18224 18225 18226 18227 18228 18229 18230 18231 18232 18233 18234 18235 18236 18237 18238 18239 18240 18241 18242 18243 18244 18245 18246 | - + - + |
static int Jim_CatchCoreCommand(Jim_Interp *interp, int argc, Jim_Obj *const *argv)
{
int exitCode = 0;
int i;
int sig = 0;
|
| ︙ | |||
18210 18211 18212 18213 18214 18215 18216 | 18283 18284 18285 18286 18287 18288 18289 18290 18291 18292 18293 18294 18295 18296 18297 18298 18299 18300 18301 18302 18303 18304 18305 18306 18307 18308 18309 18310 18311 18312 18313 18314 | - + - + - + - + - + |
if ((ignore_mask & (1 << JIM_SIGNAL)) == 0) {
sig++;
}
interp->signal_level += sig;
if (Jim_CheckSignal(interp)) {
|
| ︙ | |||
18270 18271 18272 18273 18274 18275 18276 18277 18278 18279 18280 18281 18282 18283 | 18343 18344 18345 18346 18347 18348 18349 18350 18351 18352 18353 18354 18355 18356 18357 18358 18359 18360 18361 18362 18363 18364 18365 18366 18367 18368 18369 18370 18371 18372 18373 18374 18375 18376 18377 18378 18379 18380 18381 18382 18383 18384 18385 18386 18387 18388 18389 18390 18391 18392 18393 18394 18395 18396 18397 18398 18399 18400 18401 18402 18403 18404 18405 18406 18407 18408 18409 18410 18411 18412 18413 18414 18415 18416 18417 18418 18419 18420 18421 18422 18423 18424 18425 18426 18427 18428 18429 18430 18431 18432 18433 18434 18435 18436 18437 18438 18439 18440 18441 18442 18443 18444 18445 18446 18447 18448 18449 18450 18451 18452 18453 18454 18455 18456 18457 18458 18459 18460 18461 18462 18463 18464 18465 18466 18467 18468 18469 18470 18471 | + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + |
}
}
}
Jim_SetResultInt(interp, exitCode);
return JIM_OK;
}
#ifdef JIM_REFERENCES
static int Jim_RefCoreCommand(Jim_Interp *interp, int argc, Jim_Obj *const *argv)
{
if (argc != 3 && argc != 4) {
Jim_WrongNumArgs(interp, 1, argv, "string tag ?finalizer?");
return JIM_ERR;
}
if (argc == 3) {
Jim_SetResult(interp, Jim_NewReference(interp, argv[1], argv[2], NULL));
}
else {
Jim_SetResult(interp, Jim_NewReference(interp, argv[1], argv[2], argv[3]));
}
return JIM_OK;
}
static int Jim_GetrefCoreCommand(Jim_Interp *interp, int argc, Jim_Obj *const *argv)
{
Jim_Reference *refPtr;
if (argc != 2) {
Jim_WrongNumArgs(interp, 1, argv, "reference");
return JIM_ERR;
}
if ((refPtr = Jim_GetReference(interp, argv[1])) == NULL)
return JIM_ERR;
Jim_SetResult(interp, refPtr->objPtr);
return JIM_OK;
}
static int Jim_SetrefCoreCommand(Jim_Interp *interp, int argc, Jim_Obj *const *argv)
{
Jim_Reference *refPtr;
if (argc != 3) {
Jim_WrongNumArgs(interp, 1, argv, "reference newValue");
return JIM_ERR;
}
if ((refPtr = Jim_GetReference(interp, argv[1])) == NULL)
return JIM_ERR;
Jim_IncrRefCount(argv[2]);
Jim_DecrRefCount(interp, refPtr->objPtr);
refPtr->objPtr = argv[2];
Jim_SetResult(interp, argv[2]);
return JIM_OK;
}
static int Jim_CollectCoreCommand(Jim_Interp *interp, int argc, Jim_Obj *const *argv)
{
if (argc != 1) {
Jim_WrongNumArgs(interp, 1, argv, "");
return JIM_ERR;
}
Jim_SetResultInt(interp, Jim_Collect(interp));
while (interp->freeList) {
Jim_Obj *nextObjPtr = interp->freeList->nextObjPtr;
Jim_Free(interp->freeList);
interp->freeList = nextObjPtr;
}
return JIM_OK;
}
static int Jim_FinalizeCoreCommand(Jim_Interp *interp, int argc, Jim_Obj *const *argv)
{
if (argc != 2 && argc != 3) {
Jim_WrongNumArgs(interp, 1, argv, "reference ?finalizerProc?");
return JIM_ERR;
}
if (argc == 2) {
Jim_Obj *cmdNamePtr;
if (Jim_GetFinalizer(interp, argv[1], &cmdNamePtr) != JIM_OK)
return JIM_ERR;
if (cmdNamePtr != NULL)
Jim_SetResult(interp, cmdNamePtr);
}
else {
if (Jim_SetFinalizer(interp, argv[1], argv[2]) != JIM_OK)
return JIM_ERR;
Jim_SetResult(interp, argv[2]);
}
return JIM_OK;
}
static int JimInfoReferences(Jim_Interp *interp, int argc, Jim_Obj *const *argv)
{
Jim_Obj *listObjPtr;
Jim_HashTableIterator htiter;
Jim_HashEntry *he;
listObjPtr = Jim_NewListObj(interp, NULL, 0);
JimInitHashTableIterator(&interp->references, &htiter);
while ((he = Jim_NextHashEntry(&htiter)) != NULL) {
char buf[JIM_REFERENCE_SPACE + 1];
Jim_Reference *refPtr = Jim_GetHashEntryVal(he);
const unsigned long *refId = he->key;
JimFormatReference(buf, refPtr, *refId);
Jim_ListAppendElement(interp, listObjPtr, Jim_NewStringObj(interp, buf, -1));
}
Jim_SetResult(interp, listObjPtr);
return JIM_OK;
}
#endif
static int Jim_RenameCoreCommand(Jim_Interp *interp, int argc, Jim_Obj *const *argv)
{
if (argc != 3) {
Jim_WrongNumArgs(interp, 1, argv, "oldName newName");
return JIM_ERR;
|
| ︙ | |||
18304 18305 18306 18307 18308 18309 18310 | 18492 18493 18494 18495 18496 18497 18498 18499 18500 18501 18502 18503 18504 18505 18506 | - + |
static Jim_Obj *JimDictPatternMatch(Jim_Interp *interp, Jim_HashTable *ht, Jim_Obj *patternObjPtr,
JimDictMatchCallbackType *callback, int type)
{
Jim_HashEntry *he;
Jim_Obj *listObjPtr = Jim_NewListObj(interp, NULL, 0);
|
| ︙ | |||
18354 18355 18356 18357 18358 18359 18360 | 18542 18543 18544 18545 18546 18547 18548 18549 18550 18551 18552 18553 18554 18555 18556 | - + |
if (SetDictFromAny(interp, objPtr) != JIM_OK) {
return JIM_ERR;
}
ht = (Jim_HashTable *)objPtr->internalRep.ptr;
|
| ︙ | |||
18478 18479 18480 18481 18482 18483 18484 | 18666 18667 18668 18669 18670 18671 18672 18673 18674 18675 18676 18677 18678 18679 18680 18681 18682 18683 18684 18685 18686 18687 18688 18689 18690 18691 18692 18693 18694 18695 18696 18697 18698 18699 18700 18701 18702 18703 18704 18705 18706 | - + - + - + |
case OPT_MERGE:
if (argc == 2) {
return JIM_OK;
}
if (Jim_DictSize(interp, argv[2]) < 0) {
return JIM_ERR;
}
|
| ︙ | |||
18574 18575 18576 18577 18578 18579 18580 | 18762 18763 18764 18765 18766 18767 18768 18769 18770 18771 18772 18773 18774 18775 18776 18777 18778 18779 18780 18781 18782 18783 18784 18785 18786 18787 18788 18789 18790 18791 18792 | - + - + |
INFO_RETURNCODES, INFO_REFERENCES, INFO_ALIAS,
};
#ifdef jim_ext_namespace
int nons = 0;
if (argc > 2 && Jim_CompareStringImmediate(interp, argv[1], "-nons")) {
|
| ︙ | |||
18619 18620 18621 18622 18623 18624 18625 | 18807 18808 18809 18810 18811 18812 18813 18814 18815 18816 18817 18818 18819 18820 18821 18822 18823 18824 18825 18826 18827 18828 18829 18830 18831 18832 18833 18834 18835 18836 18837 18838 18839 18840 18841 18842 18843 18844 18845 18846 18847 18848 18849 18850 18851 18852 18853 | - + - + - - + + - + - - + + - - + + - + |
return JIM_ERR;
}
Jim_SetResult(interp, (Jim_Obj *)cmdPtr->u.native.privData);
return JIM_OK;
}
case INFO_CHANNELS:
|
| ︙ | |||
18761 18762 18763 18764 18765 18766 18767 18768 | 18949 18950 18951 18952 18953 18954 18955 18956 18957 18958 18959 18960 18961 18962 18963 18964 18965 | + - + |
Jim_SetResult(interp, cmdPtr->u.proc.bodyObjPtr);
break;
case INFO_ARGS:
Jim_SetResult(interp, cmdPtr->u.proc.argListObjPtr);
break;
case INFO_STATICS:
if (cmdPtr->u.proc.staticVars) {
int mode = JIM_VARLIST_LOCALS | JIM_VARLIST_VALUES;
Jim_SetResult(interp, JimHashtablePatternMatch(interp, cmdPtr->u.proc.staticVars,
|
| ︙ | |||
18794 18795 18796 18797 18798 18799 18800 | 18983 18984 18985 18986 18987 18988 18989 18990 18991 18992 18993 18994 18995 18996 18997 18998 18999 19000 19001 | - + - + |
if (missing != ' ' && argc == 4) {
Jim_SetVariable(interp, argv[3], Jim_NewStringObj(interp, &missing, 1));
}
}
break;
case INFO_HOSTNAME:
|
| ︙ | |||
18879 18880 18881 18882 18883 18884 18885 | 19068 19069 19070 19071 19072 19073 19074 19075 19076 19077 19078 19079 19080 19081 19082 | - + |
return JIM_ERR;
}
if (option == OPT_VAR) {
result = Jim_GetVariable(interp, objPtr, 0) != NULL;
}
else {
|
| ︙ | |||
18922 18923 18924 18925 18926 18927 18928 | 19111 19112 19113 19114 19115 19116 19117 19118 19119 19120 19121 19122 19123 19124 19125 19126 19127 19128 19129 19130 19131 19132 19133 19134 19135 19136 19137 19138 | - + - + |
str = Jim_GetString(argv[1], &len);
if (len == 0) {
return JIM_OK;
}
strLen = Jim_Utf8Length(interp, argv[1]);
|
| ︙ | |||
18964 18965 18966 18967 18968 18969 18970 | 19153 19154 19155 19156 19157 19158 19159 19160 19161 19162 19163 19164 19165 19166 19167 | - + |
else {
Jim_Obj **commonObj = NULL;
#define NUM_COMMON (128 - 9)
while (strLen--) {
int n = utf8_tounicode(str, &c);
#ifdef JIM_OPTIMIZATION
if (c >= 9 && c < 128) {
|
| ︙ | |||
18998 18999 19000 19001 19002 19003 19004 | 19187 19188 19189 19190 19191 19192 19193 19194 19195 19196 19197 19198 19199 19200 19201 | - + |
const char *joinStr;
int joinStrLen;
if (argc != 2 && argc != 3) {
Jim_WrongNumArgs(interp, 1, argv, "list ?joinString?");
return JIM_ERR;
}
|
| ︙ | |||
19277 19278 19279 19280 19281 19282 19283 | 19466 19467 19468 19469 19470 19471 19472 19473 19474 19475 19476 19477 19478 19479 19480 19481 19482 | - + - + |
return 0;
else if (step > 0 && start > end)
return -1;
else if (step < 0 && end > start)
return -1;
len = end - start;
if (len < 0)
|
| ︙ | |||
19497 19498 19499 19500 19501 19502 19503 | 19686 19687 19688 19689 19690 19691 19692 19693 19694 19695 19696 19697 19698 19699 19700 19701 19702 19703 19704 19705 19706 19707 19708 19709 19710 19711 19712 19713 19714 19715 19716 19717 19718 | - + - + |
int arglen;
const char *arg = Jim_GetString(objPtr, &arglen);
*indexPtr = -1;
for (entryPtr = tablePtr, i = 0; *entryPtr != NULL; entryPtr++, i++) {
if (Jim_CompareStringImmediate(interp, objPtr, *entryPtr)) {
|
| ︙ | |||
19552 19553 19554 19555 19556 19557 19558 | 19741 19742 19743 19744 19745 19746 19747 19748 19749 19750 19751 19752 19753 19754 19755 | - + |
int Jim_IsList(Jim_Obj *objPtr)
{
return objPtr->typePtr == &listObjType;
}
void Jim_SetResultFormatted(Jim_Interp *interp, const char *format, ...)
{
|
| ︙ | |||
19617 19618 19619 19620 19621 19622 19623 | 19806 19807 19808 19809 19810 19811 19812 19813 19814 19815 19816 19817 19818 19819 19820 | - + |
#include <stdio.h>
#include <string.h>
static int subcmd_null(Jim_Interp *interp, int argc, Jim_Obj *const *argv)
{
|
| ︙ | |||
19696 19697 19698 19699 19700 19701 19702 | 19885 19886 19887 19888 19889 19890 19891 19892 19893 19894 19895 19896 19897 19898 19899 19900 19901 19902 19903 19904 19905 19906 19907 19908 19909 19910 19911 19912 19913 19914 19915 19916 19917 19918 19919 19920 19921 19922 19923 19924 19925 19926 19927 19928 19929 19930 19931 19932 19933 19934 19935 19936 19937 19938 19939 19940 19941 19942 19943 19944 19945 19946 19947 19948 19949 19950 19951 19952 19953 19954 19955 19956 19957 19958 19959 19960 19961 19962 19963 19964 19965 19966 19967 19968 19969 19970 19971 19972 19973 19974 19975 19976 | - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + |
" command ...\"\n", NULL);
Jim_AppendStrings(interp, Jim_GetResult(interp), "Use \"", cmdname, " -help ?command?\" for help", NULL);
return 0;
}
cmd = argv[1];
|
| ︙ | |||
19828 19829 19830 19831 19832 19833 19834 | 20017 20018 20019 20020 20021 20022 20023 20024 20025 20026 20027 20028 20029 20030 20031 | - + |
}
else if (uc <= 0xffff) {
*p++ = 0xe0 | ((uc & 0xf000) >> 12);
*p++ = 0x80 | ((uc & 0xfc0) >> 6);
*p = 0x80 | (uc & 0x3f);
return 3;
}
|
| ︙ | |||
20019 20020 20021 20022 20023 20024 20025 | 20208 20209 20210 20211 20212 20213 20214 20215 20216 20217 20218 20219 20220 20221 20222 | - + |
useShort = 0;
if (ch == 'h') {
useShort = 1;
format += step;
step = utf8_tounicode(format, &ch);
} else if (ch == 'l') {
|
| ︙ | |||
20046 20047 20048 20049 20050 20051 20052 | 20235 20236 20237 20238 20239 20240 20241 20242 20243 20244 20245 20246 20247 20248 20249 20250 20251 20252 20253 20254 20255 20256 20257 20258 20259 20260 20261 20262 20263 20264 20265 20266 20267 20268 20269 20270 20271 20272 20273 20274 20275 20276 20277 20278 20279 | - + - + - + |
case '\0':
msg = "format string ended in middle of field specifier";
goto errorMsg;
case 's': {
formatted_buf = Jim_GetString(objv[objIndex], &formatted_bytes);
formatted_chars = Jim_Utf8Length(interp, objv[objIndex]);
if (gotPrecision && (precision < formatted_chars)) {
|
| ︙ | |||
20104 20105 20106 20107 20108 20109 20110 | 20293 20294 20295 20296 20297 20298 20299 20300 20301 20302 20303 20304 20305 20306 20307 20308 20309 20310 20311 20312 20313 20314 20315 20316 20317 20318 20319 20320 20321 20322 20323 20324 20325 | - + - + - + |
case 'e':
case 'E':
case 'f':
case 'g':
case 'G':
doubleType = 1;
|
| ︙ | |||
20153 20154 20155 20156 20157 20158 20159 | 20342 20343 20344 20345 20346 20347 20348 20349 20350 20351 20352 20353 20354 20355 20356 20357 20358 20359 20360 20361 20362 20363 20364 20365 20366 20367 20368 20369 20370 20371 20372 20373 20374 20375 20376 20377 20378 20379 20380 20381 20382 | - + - + - + |
}
#endif
}
*p++ = (char) ch;
*p = '\0';
|
| ︙ | |||
20231 20232 20233 20234 20235 20236 20237 | 20420 20421 20422 20423 20424 20425 20426 20427 20428 20429 20430 20431 20432 20433 20434 20435 20436 20437 20438 20439 20440 20441 20442 20443 20444 20445 20446 20447 20448 20449 20450 20451 20452 20453 20454 20455 20456 20457 20458 20459 20460 20461 20462 20463 20464 20465 20466 20467 20468 20469 20470 20471 20472 20473 20474 20475 20476 20477 20478 20479 20480 20481 20482 20483 20484 | - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + - - - + + + - - + + - - - - + + + + - + | #define REG_MAX_PAREN 100 |
| ︙ | |||
20329 20330 20331 20332 20333 20334 20335 | 20518 20519 20520 20521 20522 20523 20524 20525 20526 20527 20528 20529 20530 20531 20532 20533 20534 20535 20536 20537 20538 20539 20540 20541 20542 20543 20544 20545 20546 20547 20548 20549 20550 20551 20552 20553 20554 20555 20556 20557 20558 20559 20560 | - + - + - - + + - - + + - - + + - + | fprintf(stderr, "Compiling: '%s'\n", exp); #endif memset(preg, 0, sizeof(*preg)); if (exp == NULL) FAIL(preg, REG_ERR_NULL_ARGUMENT); |
| ︙ | |||
20388 20389 20390 20391 20392 20393 20394 | 20577 20578 20579 20580 20581 20582 20583 20584 20585 20586 20587 20588 20589 20590 20591 20592 20593 20594 20595 20596 20597 20598 20599 20600 20601 20602 20603 20604 20605 20606 20607 20608 20609 20610 20611 20612 20613 20614 20615 20616 20617 20618 20619 20620 20621 20622 20623 20624 20625 20626 20627 20628 20629 20630 20631 20632 20633 20634 20635 20636 20637 20638 20639 20640 20641 20642 20643 20644 20645 | - + - + - + - + - + - + - + - + - + - + | #ifdef DEBUG regdump(preg); #endif return 0; } |
| ︙ | |||
20466 20467 20468 20469 20470 20471 20472 | 20655 20656 20657 20658 20659 20660 20661 20662 20663 20664 20665 20666 20667 20668 20669 20670 20671 20672 20673 20674 20675 20676 20677 20678 20679 20680 20681 20682 20683 20684 20685 20686 20687 | - + - + |
static int regbranch(regex_t *preg, int *flagp )
{
int ret;
int chain;
int latest;
int flags;
|
| ︙ | |||
20514 20515 20516 20517 20518 20519 20520 | 20703 20704 20705 20706 20707 20708 20709 20710 20711 20712 20713 20714 20715 20716 20717 | - + |
}
if (!(flags&HASWIDTH) && op != '?') {
preg->err = REG_ERR_OPERAND_COULD_BE_EMPTY;
return 0;
}
|
| ︙ | |||
20586 20587 20588 20589 20590 20591 20592 | 20775 20776 20777 20778 20779 20780 20781 20782 20783 20784 20785 20786 20787 20788 20789 | - + |
}
static void reg_addrange(regex_t *preg, int lower, int upper)
{
if (lower > upper) {
reg_addrange(preg, upper, lower);
}
|
| ︙ | |||
20654 20655 20656 20657 20658 20659 20660 | 20843 20844 20845 20846 20847 20848 20849 20850 20851 20852 20853 20854 20855 20856 20857 20858 20859 20860 20861 20862 20863 | - + - + |
case 'f': *ch = '\f'; break;
case 'n': *ch = '\n'; break;
case 'r': *ch = '\r'; break;
case 't': *ch = '\t'; break;
case 'v': *ch = '\v'; break;
case 'u':
if (*s == '{') {
|
| ︙ | |||
20695 20696 20697 20698 20699 20700 20701 | 20884 20885 20886 20887 20888 20889 20890 20891 20892 20893 20894 20895 20896 20897 20898 20899 20900 20901 20902 20903 20904 20905 20906 20907 20908 20909 20910 20911 20912 20913 20914 20915 20916 20917 20918 20919 20920 20921 20922 20923 20924 20925 20926 20927 20928 20929 20930 20931 20932 20933 20934 20935 20936 20937 20938 20939 20940 20941 20942 | - + - + - + - + - + - + | int ret; int flags; int nocase = (preg->cflags & REG_ICASE); int ch; int n = reg_utf8_tounicode_case(preg->regparse, &ch, nocase); |
| ︙ | |||
20766 20767 20768 20769 20770 20771 20772 | 20955 20956 20957 20958 20959 20960 20961 20962 20963 20964 20965 20966 20967 20968 20969 20970 20971 20972 20973 20974 20975 20976 20977 20978 20979 20980 | - + - + - + |
CC_ALPHA, CC_ALNUM, CC_SPACE, CC_BLANK, CC_UPPER, CC_LOWER,
CC_DIGIT, CC_XDIGIT, CC_CNTRL, CC_GRAPH, CC_PRINT, CC_PUNCT,
CC_NUM
};
int i;
for (i = 0; i < CC_NUM; i++) {
|
| ︙ | |||
20799 20800 20801 20802 20803 20804 20805 | 20988 20989 20990 20991 20992 20993 20994 20995 20996 20997 20998 20999 21000 21001 21002 | - + | break; case CC_LOWER: reg_addrange(preg, 'a', 'z'); break; case CC_XDIGIT: reg_addrange(preg, 'a', 'f'); reg_addrange(preg, 'A', 'F'); |
| ︙ | |||
20823 20824 20825 20826 20827 20828 20829 | 21012 21013 21014 21015 21016 21017 21018 21019 21020 21021 21022 21023 21024 21025 21026 | - + |
reg_addrange(preg, '[', '`');
reg_addrange(preg, '{', '~');
break;
}
continue;
}
}
|
| ︙ | |||
20846 20847 20848 20849 20850 20851 20852 | 21035 21036 21037 21038 21039 21040 21041 21042 21043 21044 21045 21046 21047 21048 21049 | - + | return 0; *flagp |= flags&(HASWIDTH|SPSTART); break; case '\0': case '|': case ')': preg->err = REG_ERR_INTERNAL; |
| ︙ | |||
20899 20900 20901 20902 20903 20904 20905 | 21088 21089 21090 21091 21092 21093 21094 21095 21096 21097 21098 21099 21100 21101 21102 21103 21104 21105 21106 21107 21108 21109 21110 21111 21112 21113 21114 21115 21116 21117 21118 21119 21120 21121 21122 21123 21124 21125 21126 21127 21128 21129 21130 21131 21132 21133 21134 21135 21136 21137 21138 21139 21140 21141 21142 21143 21144 21145 21146 21147 21148 21149 | - + - - + + - + - + - + - + - + - + - + | case 's': case 'S': ret = regnode(preg, ch == 's' ? ANYOF : ANYBUT); reg_addrange_str(preg," \t\r\n\f\v"); regc(preg, '\0'); *flagp |= HASWIDTH|SIMPLE; break; |
| ︙ | |||
20977 20978 20979 20980 20981 20982 20983 | 21166 21167 21168 21169 21170 21171 21172 21173 21174 21175 21176 21177 21178 21179 21180 21181 21182 21183 21184 21185 21186 21187 21188 21189 21190 21191 21192 21193 21194 21195 21196 21197 21198 21199 21200 21201 21202 21203 21204 21205 21206 21207 21208 21209 21210 21211 21212 21213 21214 21215 21216 21217 21218 21219 21220 21221 21222 21223 21224 21225 21226 21227 21228 21229 21230 21231 21232 21233 21234 21235 21236 21237 21238 21239 21240 21241 21242 21243 21244 21245 21246 21247 21248 21249 21250 21251 21252 21253 21254 21255 21256 21257 21258 21259 21260 21261 21262 21263 21264 21265 21266 21267 21268 21269 21270 21271 21272 21273 21274 21275 21276 21277 21278 21279 21280 21281 21282 21283 21284 21285 21286 21287 21288 21289 21290 21291 21292 21293 21294 21295 21296 21297 21298 21299 21300 21301 21302 21303 21304 21305 21306 21307 21308 21309 21310 21311 21312 21313 21314 21315 21316 21317 21318 21319 21320 21321 21322 21323 21324 21325 21326 21327 21328 21329 21330 21331 21332 21333 21334 21335 21336 21337 21338 21339 21340 21341 21342 21343 21344 21345 21346 21347 21348 21349 21350 | - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + |
}
static int regnode(regex_t *preg, int op)
{
reg_grow(preg, 2);
|
| ︙ | |||
21188 21189 21190 21191 21192 21193 21194 | 21377 21378 21379 21380 21381 21382 21383 21384 21385 21386 21387 21388 21389 21390 21391 21392 21393 21394 21395 21396 21397 21398 21399 21400 21401 21402 21403 | - + - + |
}
return -1;
}
static int reg_range_find(const int *range, int c)
{
while (*range) {
|
| ︙ | |||
21244 21245 21246 21247 21248 21249 21250 | 21433 21434 21435 21436 21437 21438 21439 21440 21441 21442 21443 21444 21445 21446 21447 21448 21449 21450 21451 21452 21453 21454 21455 21456 21457 21458 21459 21460 21461 21462 21463 21464 21465 21466 21467 21468 21469 21470 21471 21472 21473 21474 21475 21476 21477 21478 21479 21480 21481 21482 21483 21484 21485 21486 21487 21488 21489 21490 21491 21492 21493 21494 21495 21496 21497 21498 21499 21500 21501 21502 21503 21504 21505 21506 21507 21508 21509 21510 21511 21512 21513 21514 21515 21516 21517 21518 21519 21520 21521 21522 21523 21524 21525 21526 21527 21528 21529 21530 21531 21532 21533 21534 21535 21536 21537 21538 21539 21540 21541 21542 21543 21544 21545 21546 21547 21548 21549 21550 21551 21552 21553 21554 21555 21556 21557 21558 21559 21560 21561 21562 21563 21564 21565 21566 21567 21568 21569 21570 21571 21572 21573 21574 21575 21576 21577 21578 21579 21580 21581 21582 21583 21584 21585 21586 21587 21588 21589 21590 21591 21592 21593 21594 21595 21596 | - + - + - + - + - + - + - + - + - + - + - + - - + + - + - + - + - + - + - + - + - + - + |
}
save = preg->reginput;
no = regrepeat(preg, scan + 5, max);
if (no < min) {
return 0;
}
if (matchmin) {
|
| ︙ | |||
21433 21434 21435 21436 21437 21438 21439 | 21622 21623 21624 21625 21626 21627 21628 21629 21630 21631 21632 21633 21634 21635 21636 21637 21638 21639 21640 21641 21642 21643 21644 21645 21646 21647 21648 21649 21650 21651 21652 21653 21654 21655 21656 21657 21658 21659 21660 | - - + + - + - + | preg->reginput += n; break; case NOTHING: break; case BACK: break; case BRANCH: |
| ︙ | |||
21504 21505 21506 21507 21508 21509 21510 | 21693 21694 21695 21696 21697 21698 21699 21700 21701 21702 21703 21704 21705 21706 21707 | - + |
int ch;
int n;
scan = preg->reginput;
opnd = OPERAND(p);
switch (OP(preg, p)) {
case ANY:
|
| ︙ | |||
21540 21541 21542 21543 21544 21545 21546 | 21729 21730 21731 21732 21733 21734 21735 21736 21737 21738 21739 21740 21741 21742 21743 21744 21745 | - + - + |
if (reg_iseol(preg, ch) || reg_range_find(preg->program + opnd, ch) != 0) {
break;
}
count++;
scan += n;
}
break;
|
| ︙ | |||
21567 21568 21569 21570 21571 21572 21573 | 21756 21757 21758 21759 21760 21761 21762 21763 21764 21765 21766 21767 21768 21769 21770 | - + |
return(p-offset);
else
return(p+offset);
}
static int regopsize(regex_t *preg, int p )
{
|
| ︙ | |||
21688 21689 21690 21691 21692 21693 21694 | 21877 21878 21879 21880 21881 21882 21883 21884 21885 21886 21887 21888 21889 21890 21891 21892 21893 21894 21895 21896 21897 21898 21899 21900 21901 21902 21903 21904 21905 21906 | - + - + - + |
DIR *opendir(const char *name)
{
DIR *dir = 0;
if (name && name[0]) {
size_t base_length = strlen(name);
|
| ︙ | |||
21725 21726 21727 21728 21729 21730 21731 | 21914 21915 21916 21917 21918 21919 21920 21921 21922 21923 21924 21925 21926 21927 21928 | - + |
if (dir) {
if (dir->handle != -1)
result = _findclose(dir->handle);
Jim_Free(dir->name);
Jim_Free(dir);
}
|
| ︙ | |||
21808 21809 21810 21811 21812 21813 21814 | 21997 21998 21999 22000 22001 22002 22003 22004 22005 22006 22007 22008 22009 22010 22011 | - + |
linenoiseHistorySave(filename);
#endif
}
void Jim_HistoryShow(void)
{
#ifdef USE_LINENOISE
|
| ︙ | |||
21874 21875 21876 21877 21878 21879 21880 | 22063 22064 22065 22066 22067 22068 22069 22070 22071 22072 22073 22074 22075 22076 22077 22078 22079 22080 22081 22082 22083 22084 22085 22086 22087 22088 22089 | - + - + |
continue;
}
Jim_DecrRefCount(interp, scriptObjPtr);
retcode = JIM_OK;
goto out;
}
if (Jim_Length(scriptObjPtr) != 0) {
|
| ︙ | |||
21929 21930 21931 21932 21933 21934 21935 | 22118 22119 22120 22121 22122 22123 22124 22125 22126 22127 22128 22129 22130 22131 22132 | - + |
extern int Jim_initjimshInit(Jim_Interp *interp);
static void JimSetArgv(Jim_Interp *interp, int argc, char *const argv[])
{
int n;
Jim_Obj *listObj = Jim_NewListObj(interp, NULL, 0);
|
| ︙ | |||
21969 21970 21971 21972 21973 21974 21975 | 22158 22159 22160 22161 22162 22163 22164 22165 22166 22167 22168 22169 22170 22171 22172 22173 22174 22175 22176 22177 22178 22179 22180 22181 22182 22183 22184 22185 22186 22187 22188 22189 22190 22191 22192 22193 22194 22195 22196 22197 22198 22199 22200 22201 22202 22203 22204 22205 22206 22207 22208 | - + - + - + - + - + - + |
int main(int argc, char *const argv[])
{
int retcode;
Jim_Interp *interp;
char *const orig_argv0 = argv[0];
|
| ︙ |
Changes to autosetup/local.tcl.
| 1 2 3 4 5 6 7 8 9 10 | - - + + + |
|
| ︙ | |||
24 25 26 27 28 29 30 | 25 26 27 28 29 30 31 | - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
if {[regexp {^(TCL_[^=]*)=(.*)$} $line -> name value]} {
set value [regsub -all {\$\{.*\}} $value ""]
set tclconfig($name) [string trim $value ']
}
}
return [array get tclconfig]
}
|
Changes to autosetup/pkg-config.tcl.
| ︙ | |||
33 34 35 36 37 38 39 | 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 | - - + + + + + + | return [get-define HAVE_PKG_CONFIG] } set found 0 define PKG_CONFIG [get-env PKG_CONFIG pkg-config] msg-checking "Checking for pkg-config..." |
| ︙ | |||
68 69 70 71 72 73 74 | 72 73 74 75 76 77 78 79 80 81 82 83 84 85 | - - - - - - | # XXX: It's possible that these should be set only when invoking pkg-config global env set env(PKG_CONFIG_DIR) "" # Do we need to try /usr/local as well or instead? set env(PKG_CONFIG_LIBDIR) $sysroot/usr/lib/pkgconfig:$sysroot/usr/share/pkgconfig set env(PKG_CONFIG_SYSROOT_DIR) $sysroot } |
| ︙ | |||
105 106 107 108 109 110 111 | 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 | - - - - - - - - - - + + + + + + + + + + + + + - - - - - |
msg-checking "Checking for $module $args..."
if {!$ok} {
msg-result "no pkg-config"
return 0
}
|
Changes to autosetup/system.tcl.
1 2 3 4 5 6 7 8 9 10 11 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 | + + + + + + + + + + + + + - + - + - + | # Copyright (c) 2010 WorkWare Systems http://www.workware.net.au/ # All rights reserved # @synopsis: # # This module supports common system interrogation and options # such as --host, --build, --prefix, and setting srcdir, builddir, and EXEEXT # # It also support the 'feature' naming convention, where searching # for a feature such as sys/type.h defines HAVE_SYS_TYPES_H # # It defines the following variables, based on --prefix unless overridden by the user: # ## datadir ## sysconfdir ## sharedstatedir ## localstatedir ## infodir ## mandir ## includedir # Do "define defaultprefix myvalue" to set the default prefix *before* the first "use" set defaultprefix [get-define defaultprefix /usr/local] |
| ︙ | |||
215 216 217 218 219 220 221 | 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 | - - + |
set cross ""
} else {
define host [config_sub $host]
set cross $host-
}
define cross [get-env CROSS $cross]
|
| ︙ |
Changes to compat/zlib/CMakeLists.txt.
1 2 3 4 5 | 1 2 3 4 5 6 7 8 9 10 11 12 13 | - + | cmake_minimum_required(VERSION 2.4.4) set(CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS ON) project(zlib C) |
| ︙ |
Changes to compat/zlib/ChangeLog.
1 2 3 4 5 6 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 | + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + |
ChangeLog file for zlib
Changes in 1.2.11 (15 Jan 2017)
- Fix deflate stored bug when pulling last block from window
- Permit immediate deflateParams changes before any deflate input
Changes in 1.2.10 (2 Jan 2017)
- Avoid warnings on snprintf() return value
- Fix bug in deflate_stored() for zero-length input
- Fix bug in gzwrite.c that produced corrupt gzip files
- Remove files to be installed before copying them in Makefile.in
- Add warnings when compiling with assembler code
Changes in 1.2.9 (31 Dec 2016)
- Fix contrib/minizip to permit unzipping with desktop API [Zouzou]
- Improve contrib/blast to return unused bytes
- Assure that gzoffset() is correct when appending
- Improve compress() and uncompress() to support large lengths
- Fix bug in test/example.c where error code not saved
- Remedy Coverity warning [Randers-Pehrson]
- Improve speed of gzprintf() in transparent mode
- Fix inflateInit2() bug when windowBits is 16 or 32
- Change DEBUG macro to ZLIB_DEBUG
- Avoid uninitialized access by gzclose_w()
- Allow building zlib outside of the source directory
- Fix bug that accepted invalid zlib header when windowBits is zero
- Fix gzseek() problem on MinGW due to buggy _lseeki64 there
- Loop on write() calls in gzwrite.c in case of non-blocking I/O
- Add --warn (-w) option to ./configure for more compiler warnings
- Reject a window size of 256 bytes if not using the zlib wrapper
- Fix bug when level 0 used with Z_HUFFMAN or Z_RLE
- Add --debug (-d) option to ./configure to define ZLIB_DEBUG
- Fix bugs in creating a very large gzip header
- Add uncompress2() function, which returns the input size used
- Assure that deflateParams() will not switch functions mid-block
- Dramatically speed up deflation for level 0 (storing)
- Add gzfread(), duplicating the interface of fread()
- Add gzfwrite(), duplicating the interface of fwrite()
- Add deflateGetDictionary() function
- Use snprintf() for later versions of Microsoft C
- Fix *Init macros to use z_ prefix when requested
- Replace as400 with os400 for OS/400 support [Monnerat]
- Add crc32_z() and adler32_z() functions with size_t lengths
- Update Visual Studio project files [AraHaan]
Changes in 1.2.8 (28 Apr 2013)
- Update contrib/minizip/iowin32.c for Windows RT [Vollant]
- Do not force Z_CONST for C++
|
| ︙ | |||
30 31 32 33 34 35 36 | 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 | - + | - Fix configure check for veracity of compiler error return codes - Fix CMake compilation of static lib for MSVC2010 x64 - Remove unused variable in infback9.c - Fix argument checks in gzlog_compress() and gzlog_write() - Clean up the usage of z_const and respect const usage within zlib - Clean up examples/gzlog.[ch] comparisons of different types - Avoid shift equal to bits in type (caused endless loop) |
| ︙ | |||
190 191 192 193 194 195 196 | 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 | - + | - Update zconf.h.cmakein on make distclean - Merge vestigial vsnprintf determination from zutil.h to gzguts.h - Clarify how gzopen() appends in zlib.h comments - Correct documentation of gzdirect() since junk at end now ignored - Add a transparent write mode to gzopen() when 'T' is in the mode - Update python link in zlib man page - Get inffixed.h and MAKEFIXED result to match |
| ︙ | |||
560 561 562 563 564 565 566 | 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 | - + | Changes in 1.2.3.1 (16 August 2006) - Add watcom directory with OpenWatcom make files [Daniel] - Remove #undef of FAR in zconf.in.h for MVS [Fedtke] - Update make_vms.com [Zinser] - Use -fPIC for shared build in configure [Teredesai, Nicholson] - Use only major version number for libz.so on IRIX and OSF1 [Reinholdtsen] |
| ︙ | |||
1174 1175 1176 1177 1178 1179 1180 | 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 | - + |
- add EXPORT in all exported functions (for Windows DLL)
- added Makefile.nt (thanks to Stephen Williams)
- added the unsupported "contrib" directory:
contrib/asm386/ by Gilles Vollant <info@winimage.com>
386 asm code replacing longest_match().
contrib/iostream/ by Kevin Ruland <kevin@rodin.wustl.edu>
A C++ I/O streams interface to the zlib gz* functions
|
| ︙ | |||
1263 1264 1265 1266 1267 1268 1269 | 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 | - + | - updated Makefile.dj2 - added algorithm.doc Changes in 1.0.1 (20 May 96) [1.0 skipped to avoid confusion] - fix array overlay in deflate.c which sometimes caused bad compressed data - fix inflate bug with empty stored block - fix MSDOS medium model which was broken in 0.99 |
| ︙ |
Changes to compat/zlib/Makefile.in.
1 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 | - + - + - + + + + | # Makefile for zlib |
| ︙ | |||
109 110 111 112 113 114 115 | 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 | - - + + | if echo hello world | ./minigzip64 | ./minigzip64 -d && ./example64 $$TMP64; then \ echo ' *** zlib 64-bit test OK ***'; \ else \ echo ' *** zlib 64-bit test FAILED ***'; false; \ fi; \ rm -f $$TMP64 |
| ︙ | |||
136 137 138 139 140 141 142 | 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 | + + - - + + + + + + + + + + + + + + + + + + - - + + + + + + + + + + + + + + + + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + + + + + + + + + + + - + + + + + + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + | match.lo: match.S $(CPP) match.S > _match.s $(CC) -c -fPIC _match.s mv _match.o match.lo rm -f _match.s example.o: $(SRCDIR)test/example.c $(SRCDIR)zlib.h zconf.h $(CC) $(CFLAGS) $(ZINCOUT) -c -o $@ $(SRCDIR)test/example.c |
| ︙ | |||
186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 | 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 | + + + - + + + - + - - + + - + - - + + - - + + + - - - + + + + + - + - - - - - - - - - - - - - - + + + + + + + + + - - - - - - - - - + + + + + + + + + | install-libs: $(LIBS) -@if [ ! -d $(DESTDIR)$(exec_prefix) ]; then mkdir -p $(DESTDIR)$(exec_prefix); fi -@if [ ! -d $(DESTDIR)$(libdir) ]; then mkdir -p $(DESTDIR)$(libdir); fi -@if [ ! -d $(DESTDIR)$(sharedlibdir) ]; then mkdir -p $(DESTDIR)$(sharedlibdir); fi -@if [ ! -d $(DESTDIR)$(man3dir) ]; then mkdir -p $(DESTDIR)$(man3dir); fi -@if [ ! -d $(DESTDIR)$(pkgconfigdir) ]; then mkdir -p $(DESTDIR)$(pkgconfigdir); fi rm -f $(DESTDIR)$(libdir)/$(STATICLIB) cp $(STATICLIB) $(DESTDIR)$(libdir) chmod 644 $(DESTDIR)$(libdir)/$(STATICLIB) -@($(RANLIB) $(DESTDIR)$(libdir)/libz.a || true) >/dev/null 2>&1 -@if test -n "$(SHAREDLIBV)"; then \ rm -f $(DESTDIR)$(sharedlibdir)/$(SHAREDLIBV); \ cp $(SHAREDLIBV) $(DESTDIR)$(sharedlibdir); \ echo "cp $(SHAREDLIBV) $(DESTDIR)$(sharedlibdir)"; \ chmod 755 $(DESTDIR)$(sharedlibdir)/$(SHAREDLIBV); \ echo "chmod 755 $(DESTDIR)$(sharedlibdir)/$(SHAREDLIBV)"; \ rm -f $(DESTDIR)$(sharedlibdir)/$(SHAREDLIB) $(DESTDIR)$(sharedlibdir)/$(SHAREDLIBM); \ ln -s $(SHAREDLIBV) $(DESTDIR)$(sharedlibdir)/$(SHAREDLIB); \ ln -s $(SHAREDLIBV) $(DESTDIR)$(sharedlibdir)/$(SHAREDLIBM); \ ($(LDCONFIG) || true) >/dev/null 2>&1; \ fi rm -f $(DESTDIR)$(man3dir)/zlib.3 |
Changes to compat/zlib/README.
1 2 | 1 2 3 4 5 6 7 8 9 10 | - + | ZLIB DATA COMPRESSION LIBRARY |
| ︙ | |||
27 28 29 30 31 32 33 | 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 | - + | PLEASE read the zlib FAQ http://zlib.net/zlib_faq.html before asking for help. Mark Nelson <markn@ieee.org> wrote an article about zlib for the Jan. 1997 issue of Dr. Dobb's Journal; a copy of the article is available at http://marknelson.us/1997/01/01/zlib-engine/ . |
| ︙ | |||
80 81 82 83 84 85 86 | 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 | - + | The deflate format used by zlib was defined by Phil Katz. The deflate and zlib specifications were written by L. Peter Deutsch. Thanks to all the people who reported problems and suggested various improvements in zlib; they are too numerous to cite here. Copyright notice: |
| ︙ |
Changes to compat/zlib/adler32.c.
1 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | - + - - - + | /* adler32.c -- compute the Adler-32 checksum of a data stream |
| ︙ | |||
58 59 60 61 62 63 64 | 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 | - + - + | #else # define MOD(a) a %= BASE # define MOD28(a) a %= BASE # define MOD63(a) a %= BASE #endif /* ========================================================================= */ |
| ︙ | |||
127 128 129 130 131 132 133 134 135 136 137 138 139 140 | 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 | + + + + + + + + + |
MOD(adler);
MOD(sum2);
}
/* return recombined sums */
return adler | (sum2 << 16);
}
/* ========================================================================= */
uLong ZEXPORT adler32(adler, buf, len)
uLong adler;
const Bytef *buf;
uInt len;
{
return adler32_z(adler, buf, len);
}
/* ========================================================================= */
local uLong adler32_combine_(adler1, adler2, len2)
uLong adler1;
uLong adler2;
z_off64_t len2;
{
|
| ︙ | |||
152 153 154 155 156 157 158 | 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 | - + |
sum1 = adler1 & 0xffff;
sum2 = rem * sum1;
MOD(sum2);
sum1 += (adler2 & 0xffff) + BASE - 1;
sum2 += ((adler1 >> 16) & 0xffff) + ((adler2 >> 16) & 0xffff) + BASE - rem;
if (sum1 >= BASE) sum1 -= BASE;
if (sum1 >= BASE) sum1 -= BASE;
|
| ︙ |
Deleted compat/zlib/as400/bndsrc.
| - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
|
Deleted compat/zlib/as400/compile.clp.
| - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
|
Deleted compat/zlib/as400/readme.txt.
| - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
|
Deleted compat/zlib/as400/zlib.inc.
| - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
|
Changes to compat/zlib/compress.c.
1 | 1 2 3 4 5 6 7 8 9 | - + | /* compress.c -- compress a memory buffer |
| ︙ | |||
24 25 26 27 28 29 30 31 | 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 | + + - - - - - - - - - + + - - - - - - - - - + + + + + + + + + + + + + + + + + + + + |
uLongf *destLen;
const Bytef *source;
uLong sourceLen;
int level;
{
z_stream stream;
int err;
const uInt max = (uInt)-1;
uLong left;
|
| ︙ |
Changes to compat/zlib/configure.
| ︙ | |||
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 | 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 | + + + + + + + + + + + + - - - - + + + + |
# If you have problems, try without defining CC and CFLAGS before reporting
# an error.
# start off configure.log
echo -------------------- >> configure.log
echo $0 $* >> configure.log
date >> configure.log
# get source directory
SRCDIR=`dirname $0`
if test $SRCDIR = "."; then
ZINC=""
ZINCOUT="-I."
SRCDIR=""
else
ZINC='-include zconf.h'
ZINCOUT='-I. -I$(SRCDIR)'
SRCDIR="$SRCDIR/"
fi
# set command prefix for cross-compilation
if [ -n "${CHOST}" ]; then
uname="`echo "${CHOST}" | sed -e 's/^[^-]*-\([^-]*\)$/\1/' -e 's/^[^-]*-[^-]*-\([^-]*\)$/\1/' -e 's/^[^-]*-[^-]*-\([^-]*\)-.*$/\1/'`"
CROSS_PREFIX="${CHOST}-"
fi
# destination name for static library
STATICLIB=libz.a
# extract zlib version numbers from zlib.h
|
| ︙ | |||
69 70 71 72 73 74 75 76 77 78 79 80 81 82 | 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 | + + | shared=1 solo=0 cover=0 zprefix=0 zconst=0 build64=0 gcc=0 warn=0 debug=0 old_cc="$CC" old_cflags="$CFLAGS" OBJC='$(OBJZ) $(OBJG)' PIC_OBJC='$(PIC_OBJZ) $(PIC_OBJG)' # leave this script, optionally in a bad way leave() |
| ︙ | |||
117 118 119 120 121 122 123 124 125 126 127 128 129 130 | 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 | + + |
--cover) cover=1; shift ;;
-z* | --zprefix) zprefix=1; shift ;;
-6* | --64) build64=1; shift ;;
-a*=* | --archs=*) ARCHS=`echo $1 | sed 's/.*=//'`; shift ;;
--sysconfdir=*) echo "ignored option: --sysconfdir" | tee -a configure.log; shift ;;
--localstatedir=*) echo "ignored option: --localstatedir" | tee -a configure.log; shift ;;
-c* | --const) zconst=1; shift ;;
-w* | --warn) warn=1; shift ;;
-d* | --debug) debug=1; shift ;;
*)
echo "unknown option: $1" | tee -a configure.log
echo "$0 --help for help" | tee -a configure.log
leave 1;;
esac
done
|
| ︙ | |||
155 156 157 158 159 160 161 162 163 164 165 166 167 | 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 | + - + + + - + + - + + + + + - + - + | # to force the asm version use: CFLAGS="-O3 -DASMV" ./configure case "$cc" in *gcc*) gcc=1 ;; *clang*) gcc=1 ;; esac case `$cc -v 2>&1` in *gcc*) gcc=1 ;; *clang*) gcc=1 ;; esac show $cc -c $test.c if test "$gcc" -eq 1 && ($cc -c $test.c) >> configure.log 2>&1; then echo ... using gcc >> configure.log CC="$cc" |
| ︙ | |||
283 284 285 286 287 288 289 290 291 292 293 294 295 296 | 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 | + + + |
CFLAGS="$CFLAGS -xarch=amd64" ;;
*)
SFLAGS="$SFLAGS -xarch=v9"
CFLAGS="$CFLAGS -xarch=v9" ;;
esac
fi
fi
if test -n "$ZINC"; then
ZINC='-I- -I. -I$(SRCDIR)'
fi
;;
SunOS\ 4*) SFLAGS=${CFLAGS-"-O2 -PIC"}
CFLAGS=${CFLAGS-"-O2"}
LDSHARED=${LDSHARED-"ld"} ;;
SunStudio\ 9*) SFLAGS=${CFLAGS-"-fast -xcode=pic32 -xtarget=ultra3 -xarch=v9b"}
CFLAGS=${CFLAGS-"-fast -xtarget=ultra3 -xarch=v9b"}
LDSHARED=${LDSHARED-"cc -xarch=v9b"} ;;
|
| ︙ | |||
333 334 335 336 337 338 339 | 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 | - - - - - - - - - - + + + + + + + + + + |
try()
{
show $*
test "`( $* ) 2>&1 | tee -a configure.log`" = ""
}
echo - using any output from compiler to indicate an error >> configure.log
else
|
| ︙ | |||
418 419 420 421 422 423 424 425 426 427 428 429 430 431 | 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 | + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + |
else
echo Checking for underline in external names... Yes. | tee -a configure.log
fi ;;
esac
echo >> configure.log
# check for size_t
cat > $test.c <<EOF
#include <stdio.h>
#include <stdlib.h>
size_t dummy = 0;
EOF
if try $CC -c $CFLAGS $test.c; then
echo "Checking for size_t... Yes." | tee -a configure.log
need_sizet=0
else
echo "Checking for size_t... No." | tee -a configure.log
need_sizet=1
fi
echo >> configure.log
# find the size_t integer type, if needed
if test $need_sizet -eq 1; then
cat > $test.c <<EOF
long long dummy = 0;
EOF
if try $CC -c $CFLAGS $test.c; then
echo "Checking for long long... Yes." | tee -a configure.log
cat > $test.c <<EOF
#include <stdio.h>
int main(void) {
if (sizeof(void *) <= sizeof(int)) puts("int");
else if (sizeof(void *) <= sizeof(long)) puts("long");
else puts("z_longlong");
return 0;
}
EOF
else
echo "Checking for long long... No." | tee -a configure.log
cat > $test.c <<EOF
#include <stdio.h>
int main(void) {
if (sizeof(void *) <= sizeof(int)) puts("int");
else puts("long");
return 0;
}
EOF
fi
if try $CC $CFLAGS -o $test $test.c; then
sizet=`./$test`
echo "Checking for a pointer-size integer type..." $sizet"." | tee -a configure.log
else
echo "Failed to find a pointer-size integer type." | tee -a configure.log
leave 1
fi
fi
if test $need_sizet -eq 1; then
CFLAGS="${CFLAGS} -DNO_SIZE_T=${sizet}"
SFLAGS="${SFLAGS} -DNO_SIZE_T=${sizet}"
fi
echo >> configure.log
# check for large file support, and if none, check for fseeko()
cat > $test.c <<EOF
#include <sys/types.h>
off64_t dummy = 0;
EOF
if try $CC -c $CFLAGS -D_LARGEFILE64_SOURCE=1 $test.c; then
CFLAGS="${CFLAGS} -D_LARGEFILE64_SOURCE=1"
|
| ︙ | |||
466 467 468 469 470 471 472 | 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 | - + |
else
CFLAGS="${CFLAGS} -DNO_STRERROR"
SFLAGS="${SFLAGS} -DNO_STRERROR"
echo "Checking for strerror... No." | tee -a configure.log
fi
# copy clean zconf.h for subsequent edits
|
| ︙ | |||
760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 | 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 | + - + + + + - + | echo SHAREDLIB = $SHAREDLIB >> configure.log echo SHAREDLIBM = $SHAREDLIBM >> configure.log echo SHAREDLIBV = $SHAREDLIBV >> configure.log echo STATICLIB = $STATICLIB >> configure.log echo TEST = $TEST >> configure.log echo VER = $VER >> configure.log echo Z_U4 = $Z_U4 >> configure.log echo SRCDIR = $SRCDIR >> configure.log echo exec_prefix = $exec_prefix >> configure.log echo includedir = $includedir >> configure.log echo libdir = $libdir >> configure.log echo mandir = $mandir >> configure.log echo prefix = $prefix >> configure.log echo sharedlibdir = $sharedlibdir >> configure.log echo uname = $uname >> configure.log # udpate Makefile with the configure results |
| ︙ |
Changes to compat/zlib/contrib/README.contrib.
| ︙ | |||
34 35 36 37 38 39 40 | 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 | - + - + |
inflate86/ by Chris Anderson <christop@charm.net>
Tuned x86 gcc asm code to replace inflate_fast()
iostream/ by Kevin Ruland <kevin@rodin.wustl.edu>
A C++ I/O streams interface to the zlib gz* functions
|
| ︙ |
Changes to compat/zlib/contrib/ada/zlib-streams.ads.
| ︙ | |||
27 28 29 30 31 32 33 | 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 | - + |
Item : in Ada.Streams.Stream_Element_Array);
procedure Flush
(Stream : in out Stream_Type;
Mode : in Flush_Mode := Sync_Flush);
-- Flush the written data to the back stream,
-- all data placed to the compressor is flushing to the Back stream.
|
| ︙ | |||
93 94 95 96 97 98 99 | 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 | - + - + |
Mode : Stream_Mode;
Buffer : Buffer_Access;
Rest_First : Stream_Element_Offset;
Rest_Last : Stream_Element_Offset;
-- Buffer for Read operation.
-- We need to have this buffer in the record
|
Changes to compat/zlib/contrib/ada/zlib-thin.ads.
| ︙ | |||
432 433 434 435 436 437 438 | 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 | - + | pragma Import (C, compressBound, "compressBound"); pragma Import (C, deflateBound, "deflateBound"); pragma Import (C, gzungetc, "gzungetc"); pragma Import (C, zlibCompileFlags, "zlibCompileFlags"); pragma Import (C, inflateBackInit, "inflateBackInit_"); |
| ︙ |
Changes to compat/zlib/contrib/blast/blast.c.
1 | 1 2 3 4 5 6 7 8 9 10 11 | - + - + | /* blast.c |
| ︙ | |||
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 | 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 | + + + + | /* * Change history: * * 1.0 12 Feb 2003 - First version * 1.1 16 Feb 2003 - Fixed distance check for > 4 GB uncompressed data * 1.2 24 Oct 2012 - Add note about using binary mode in stdio * - Fix comparisons of differently signed integers * 1.3 24 Aug 2013 - Return unused input from blast() * - Fix test code to correctly report unused input * - Enable the provision of initial input to blast() */ #include <stddef.h> /* for NULL */ #include <setjmp.h> /* for setjmp(), longjmp(), and jmp_buf */ #include "blast.h" /* prototype for blast() */ #define local static /* for local function definitions */ #define MAXBITS 13 /* maximum code length */ #define MAXWIN 4096 /* maximum window size */ |
| ︙ | |||
252 253 254 255 256 257 258 | 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 | - + | * coded distance to represent a string that occurs earlier in the * uncompressed data that occurs again at the current location. * * - A bit preceding a literal or length/distance pair indicates which comes * next, 0 for literals, 1 for length/distance. * * - If literals are uncoded, then the next eight bits are the literal, in the |
| ︙ | |||
372 373 374 375 376 377 378 | 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 | - + + + + + + + - + + + + + + + |
}
}
} while (1);
return 0;
}
/* See comments in blast.h */
|
| ︙ | |||
425 426 427 428 429 430 431 | 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 | - + + + - - + + + - + - - - + + + + |
{
return fwrite(buf, 1, len, (FILE *)how) != len;
}
/* Decompress a PKWare Compression Library stream from stdin to stdout */
int main(void)
{
|
Changes to compat/zlib/contrib/blast/blast.h.
1 | 1 2 3 4 5 6 7 8 9 10 | - - + + | /* blast.h -- interface for blast.c |
| ︙ | |||
38 39 40 41 42 43 44 | 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 | - + + + + + + + + + | typedef unsigned (*blast_in)(void *how, unsigned char **buf); typedef int (*blast_out)(void *how, unsigned char *buf, unsigned len); /* Definitions for input/output functions passed to blast(). See below for * what the provided functions need to do. */ |
Changes to compat/zlib/contrib/delphi/ZLib.pas.
| ︙ | |||
148 149 150 151 152 153 154 | 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 | - + |
InBytes = number of bytes in InBuf
Out: OutBuf = ptr to user-allocated buffer to contain decompressed data
BufSize = number of bytes in OutBuf }
procedure DecompressToUserBuf(const InBuf: Pointer; InBytes: Integer;
const OutBuf: Pointer; BufSize: Integer);
const
|
| ︙ |
Changes to compat/zlib/contrib/dotzlib/DotZLib/UnitTests.cs.
| ︙ | |||
152 153 154 155 156 157 158 | 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 | - + |
public class InfoTests
{
#region Info tests
[Test]
public void Info_Version()
{
Info info = new Info();
|
| ︙ |
Changes to compat/zlib/contrib/infback9/inftree9.c.
1 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | - + - + | /* inftree9.c -- generate Huffman trees for efficient decoding |
| ︙ | |||
60 61 62 63 64 65 66 | 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 | - + |
static const unsigned short lbase[31] = { /* Length codes 257..285 base */
3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17,
19, 23, 27, 31, 35, 43, 51, 59, 67, 83, 99, 115,
131, 163, 195, 227, 3, 0, 0};
static const unsigned short lext[31] = { /* Length codes 257..285 extra */
128, 128, 128, 128, 128, 128, 128, 128, 129, 129, 129, 129,
130, 130, 130, 130, 131, 131, 131, 131, 132, 132, 132, 132,
|
| ︙ |
Changes to compat/zlib/contrib/minizip/configure.ac.
1 2 3 | 1 2 3 4 5 6 7 8 9 10 11 | - + | # -*- Autoconf -*- # Process this file with autoconf to produce a configure script. |
| ︙ |
Changes to compat/zlib/contrib/minizip/iowin32.c.
| ︙ | |||
22 23 24 25 26 27 28 29 | 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 | + - + | #endif #ifndef INVALID_SET_FILE_POINTER #define INVALID_SET_FILE_POINTER ((DWORD)-1) #endif // see Include/shared/winapifamily.h in the Windows Kit #if defined(WINAPI_FAMILY_PARTITION) && (!(defined(IOWIN32_USING_WINRT_API))) |
| ︙ | |||
239 240 241 242 243 244 245 | 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 | - + |
static BOOL MySetFilePointerEx(HANDLE hFile, LARGE_INTEGER pos, LARGE_INTEGER *newPos, DWORD dwMoveMethod)
{
#ifdef IOWIN32_USING_WINRT_API
return SetFilePointerEx(hFile, pos, newPos, dwMoveMethod);
#else
LONG lHigh = pos.HighPart;
|
| ︙ | |||
366 367 368 369 370 371 372 | 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 | - + |
default: return -1;
}
if (hFile)
{
LARGE_INTEGER pos;
pos.QuadPart = offset;
|
| ︙ |
Changes to compat/zlib/contrib/minizip/unzip.c.
| ︙ | |||
196 197 198 199 200 201 202 | 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 | - + |
#ifndef NOUNCRYPT
#include "crypt.h"
#endif
/* ===========================================================================
Read a byte from a gz_stream; update next_in and avail_in. Return EOF
for end of file.
|
| ︙ |
Changes to compat/zlib/contrib/minizip/zip.c.
| ︙ | |||
11 12 13 14 15 16 17 | 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | - + |
Changes
Oct-2009 - Mathias Svensson - Remove old C style function prototypes
Oct-2009 - Mathias Svensson - Added Zip64 Support when creating new file archives
Oct-2009 - Mathias Svensson - Did some code cleanup and refactoring to get better overview of some functions.
Oct-2009 - Mathias Svensson - Added zipRemoveExtraInfoBlock to strip extra field data from its ZIP64 data
It is used when recreting zip archive with RAW when deleting items from a zip.
|
| ︙ | |||
112 113 114 115 116 117 118 | 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 | - + |
#define SIZECENTRALHEADER (0x2e) /* 46 */
typedef struct linkedlist_datablock_internal_s
{
struct linkedlist_datablock_internal_s* next_datablock;
uLong avail_in_this_block;
uLong filled_in_this_block;
|
| ︙ | |||
167 168 169 170 171 172 173 | 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 | - + |
zlib_filefunc64_32_def z_filefunc;
voidpf filestream; /* io structore of the zipfile */
linkedlist_data central_dir;/* datablock with central dir in construction*/
int in_opened_file_inzip; /* 1 if a file in the zip is currently writ.*/
curfile64_info ci; /* info on the file curretly writing */
ZPOS64_T begin_pos; /* position of the beginning of the zipfile */
|
| ︙ | |||
803 804 805 806 807 808 809 | 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 | - + |
{
size_comment = ZREAD64(pziinit->z_filefunc, pziinit->filestream, pziinit->globalcomment,size_comment);
pziinit->globalcomment[size_comment]=0;
}
}
byte_before_the_zipfile = central_pos - (offset_central_dir+size_central_dir);
|
| ︙ | |||
871 872 873 874 875 876 877 | 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 | - + |
if (append == APPEND_STATUS_CREATEAFTER)
ZSEEK64(ziinit.z_filefunc,ziinit.filestream,0,SEEK_END);
ziinit.begin_pos = ZTELL64(ziinit.z_filefunc,ziinit.filestream);
ziinit.in_opened_file_inzip = 0;
ziinit.ci.stream_initialised = 0;
ziinit.number_entry = 0;
|
| ︙ | |||
1160 1161 1162 1163 1164 1165 1166 | 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 | - + |
zip64local_putValue_inmemory(zi->ci.central_header+38,(uLong)0,4);
else
zip64local_putValue_inmemory(zi->ci.central_header+38,(uLong)zipfi->external_fa,4);
if(zi->ci.pos_local_header >= 0xffffffff)
zip64local_putValue_inmemory(zi->ci.central_header+42,(uLong)0xffffffff,4);
else
|
| ︙ | |||
1751 1752 1753 1754 1755 1756 1757 | 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 | - + |
{
return zipCloseFileInZipRaw (file,0,0);
}
int Write_Zip64EndOfCentralDirectoryLocator(zip64_internal* zi, ZPOS64_T zip64eocd_pos_inzip)
{
int err = ZIP_OK;
|
| ︙ | |||
1804 1805 1806 1807 1808 1809 1810 | 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 | - + |
err = zip64local_putValue(&zi->z_filefunc, zi->filestream, zi->number_entry, 8);
if (err==ZIP_OK) /* size of the central directory */
err = zip64local_putValue(&zi->z_filefunc,zi->filestream,(ZPOS64_T)size_centraldir,8);
if (err==ZIP_OK) /* offset of start of central directory with respect to the starting disk number */
{
|
| ︙ | |||
1845 1846 1847 1848 1849 1850 1851 | 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 | - + - + |
}
if (err==ZIP_OK) /* size of the central directory */
err = zip64local_putValue(&zi->z_filefunc,zi->filestream,(uLong)size_centraldir,4);
if (err==ZIP_OK) /* offset of start of central directory with respect to the starting disk number */
{
|
| ︙ | |||
1917 1918 1919 1920 1921 1922 1923 | 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 | - + |
size_centraldir += ldi->filled_in_this_block;
ldi = ldi->next_datablock;
}
}
free_linkedlist(&(zi->central_dir));
|
| ︙ |
Changes to compat/zlib/contrib/pascal/zlibpas.pas.
1 2 3 4 5 6 7 8 9 10 11 12 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | - - + + | (* zlibpas -- Pascal interface to the zlib data compression library * * Copyright (C) 2003 Cosmin Truta. * Derived from original sources by Bob Dellaca. * For conditions of distribution and use, see copyright notice in readme.txt *) unit zlibpas; interface const |
| ︙ |
Changes to compat/zlib/contrib/puff/puff.c.
| ︙ | |||
13 14 15 16 17 18 19 | 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | - + | * around 4K on my machine (a PowerPC using GNU cc). If the faster decode() * function here is used, then puff() is only twice as slow as zlib's * inflate(). * * All dynamically allocated memory comes from the stack. The stack required * is less than 2K bytes. This code is compatible with 16-bit int's and * assumes that long's are at least 32 bits. puff.c uses the short data type, |
| ︙ |
Changes to compat/zlib/contrib/vstudio/readme.txt.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 | - + - + - + - + + + + + + + + + + + |
|
| ︙ | |||
59 60 61 62 63 64 65 | 69 70 71 72 73 74 75 76 77 78 | + + + | - There used to be a ZLIB_DLL macro in zlib 1.1.x, but now this symbol has a slightly different effect. To avoid compatibility problems, do not define it here. Gilles Vollant info@winimage.com Visual Studio 2013 and 2015 Projects from Sean Hunt seandhunt_7@yahoo.com |
Deleted compat/zlib/contrib/vstudio/vc10/miniunz.vcxproj.user.
| - - - |
|
Deleted compat/zlib/contrib/vstudio/vc10/minizip.vcxproj.user.
| - - - |
|
Deleted compat/zlib/contrib/vstudio/vc10/testzlib.vcxproj.user.
| - - - |
|
Deleted compat/zlib/contrib/vstudio/vc10/testzlibdll.vcxproj.user.
| - - - |
|
Changes to compat/zlib/contrib/vstudio/vc10/zlib.rc.
1 2 3 4 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 | - - + + - + - + | #include <windows.h> #define IDR_VERSION1 1 IDR_VERSION1 VERSIONINFO MOVEABLE IMPURE LOADONCALL DISCARDABLE |
Deleted compat/zlib/contrib/vstudio/vc10/zlibstat.vcxproj.user.
| - - - |
|
Changes to compat/zlib/contrib/vstudio/vc10/zlibvc.def.
1 2 3 | 1 2 3 4 5 6 7 8 9 10 11 | - + | LIBRARY ; zlib data compression and ZIP file I/O library |
| ︙ | |||
137 138 139 140 141 142 143 | 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 | + + + + + + + + + + |
; zlib1 v1.2.7 added:
gzopen_w @165
; zlib1 v1.2.8 added:
inflateGetDictionary @166
gzvprintf @167
; zlib1 v1.2.9 added:
inflateCodesUsed @168
inflateValidate @169
uncompress2 @170
gzfread @171
gzfwrite @172
deflateGetDictionary @173
adler32_z @174
crc32_z @175
|
Deleted compat/zlib/contrib/vstudio/vc10/zlibvc.vcxproj.user.
| - - - |
|
Changes to compat/zlib/contrib/vstudio/vc11/zlib.rc.
1 2 3 4 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 | - - + + - + - + | #include <windows.h> #define IDR_VERSION1 1 IDR_VERSION1 VERSIONINFO MOVEABLE IMPURE LOADONCALL DISCARDABLE |
Changes to compat/zlib/contrib/vstudio/vc11/zlibvc.def.
1 2 3 | 1 2 3 4 5 6 7 8 9 10 11 | - + | LIBRARY ; zlib data compression and ZIP file I/O library |
| ︙ | |||
137 138 139 140 141 142 143 | 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 | + + + + + + + + + + |
; zlib1 v1.2.7 added:
gzopen_w @165
; zlib1 v1.2.8 added:
inflateGetDictionary @166
gzvprintf @167
; zlib1 v1.2.9 added:
inflateCodesUsed @168
inflateValidate @169
uncompress2 @170
gzfread @171
gzfwrite @172
deflateGetDictionary @173
adler32_z @174
crc32_z @175
|
Added compat/zlib/contrib/vstudio/vc12/miniunz.vcxproj.