Skip to content

Commit 6030354

Browse files
committed
FEAT: optional LZW compression method
1 parent f8f5510 commit 6030354

File tree

4 files changed

+726
-0
lines changed

4 files changed

+726
-0
lines changed

make/rebol3.nest

+6
Original file line numberDiff line numberDiff line change
@@ -656,6 +656,11 @@ include-lzma-compression: [
656656
core-files: %core/u-lzma.c
657657
]
658658

659+
include-lzw-compression: [
660+
config: INCLUDE_LZW
661+
core-files: %core/u-lzw.c
662+
]
663+
659664
include-crush-compression: [
660665
config: INCLUDE_CRUSH
661666
core-files: %core/u-crush.c
@@ -792,6 +797,7 @@ include-rebol-bulk: [
792797
:include-optional-checksums
793798
:include-image-natives
794799
:include-lzma-compression
800+
:include-lzw-compression
795801
:include-crush-compression
796802
:include-base36-encoding
797803
:include-base85-encoding

src/core/n-strings.c

+14
Original file line numberDiff line numberDiff line change
@@ -349,6 +349,13 @@ static struct digest {
349349
Set_Binary(D_RET, CompressLzma(ser, index, (REBINT)len, ref_level ? VAL_INT32(level) : -1));
350350
#else
351351
Trap0(RE_FEATURE_NA);
352+
#endif
353+
break;
354+
case SYM_LZW:
355+
#ifdef INCLUDE_LZW
356+
Set_Binary(D_RET, CompressLzw(ser, index, (REBINT)len, ref_level ? VAL_INT32(level) : -1));
357+
#else
358+
Trap0(RE_FEATURE_NA);
352359
#endif
353360
break;
354361
case SYM_CRUSH:
@@ -415,6 +422,13 @@ static struct digest {
415422
Set_Binary(D_RET, DecompressLzma(VAL_SERIES(data), VAL_INDEX(data), (REBINT)len, limit));
416423
#else
417424
Trap0(RE_FEATURE_NA);
425+
#endif
426+
break;
427+
case SYM_LZW:
428+
#ifdef INCLUDE_LZW
429+
Set_Binary(D_RET, DecompressLzw(VAL_SERIES(data), VAL_INDEX(data), (REBINT)len, limit));
430+
#else
431+
Trap0(RE_FEATURE_NA);
418432
#endif
419433
break;
420434
case SYM_CRUSH:

0 commit comments

Comments
 (0)