aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/widget-zcat.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/widget-zcat.c')
-rw-r--r--src/widget-zcat.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/src/widget-zcat.c b/src/widget-zcat.c
index dc36826..ec9a24a 100644
--- a/src/widget-zcat.c
+++ b/src/widget-zcat.c
@@ -63,7 +63,7 @@
63#include <bzlib.h> 63#include <bzlib.h>
64#endif 64#endif
65 65
66#ifdef USE_XZ 66#ifdef USE_LZMA
67#include <lzma.h> 67#include <lzma.h>
68#endif 68#endif
69 69
@@ -79,7 +79,7 @@ const uint8_t scm_magic_gz[2] = { 0x1f, 0x8b }; // ta
79const uint8_t scm_magic_lz4[4] = { 0x04, 0x22, 0x4d, 0x18 }; // tar.lz4 79const uint8_t scm_magic_lz4[4] = { 0x04, 0x22, 0x4d, 0x18 }; // tar.lz4
80const uint8_t scm_magic_z_lzw[2] = { 0x1f, 0x9d }; // tar.Z 80const uint8_t scm_magic_z_lzw[2] = { 0x1f, 0x9d }; // tar.Z
81const uint8_t scm_magic_z_lzh[2] = { 0x1f, 0xa0 }; // tar.Z 81const uint8_t scm_magic_z_lzh[2] = { 0x1f, 0xa0 }; // tar.Z
82const uint8_t scm_magic_xz[6] = { 0xfd, 0x37, 0x7a, 0x58, 0x5a, 0x00 }; // tar.xz 82const uint8_t scm_magic_lzma[6] = { 0xfd, 0x37, 0x7a, 0x58, 0x5a, 0x00 }; // tar.xz
83 83
84 84
85////////////////// 85//////////////////
@@ -91,8 +91,8 @@ const uint8_t scm_magic_xz[6] = { 0xfd, 0x37, 0x7a, 0x58, 0x5a, 0x00 }; // ta
91#pragma mark - 91#pragma mark -
92#endif 92#endif
93 93
94#ifdef USE_XZ 94#ifdef USE_LZMA
95int scu_widget_zcat_xz_perror(scu_config * cnf, lzma_ret ret); 95int scu_widget_zcat_lzma_perror(scu_config * cnf, lzma_ret ret);
96#endif 96#endif
97 97
98 98
@@ -226,9 +226,9 @@ int scu_widget_zcat(scu_config * cnf)
226 return(scu_widget_zcat_bz2(cnf)); 226 return(scu_widget_zcat_bz2(cnf));
227#endif 227#endif
228 228
229#ifdef USE_XZ 229#ifdef USE_LZMA
230 if (!( memcmp(magic, scm_magic_xz, sizeof(scm_magic_xz)) )) 230 if (!( memcmp(magic, scm_magic_lzma, sizeof(scm_magic_lzma)) ))
231 return(scu_widget_zcat_xz(cnf)); 231 return(scu_widget_zcat_lzma(cnf));
232#endif 232#endif
233 233
234#ifdef USE_Z 234#ifdef USE_Z
@@ -351,8 +351,8 @@ void scu_widget_zcat_usage(scu_config * cnf)
351} 351}
352 352
353 353
354#ifdef USE_XZ 354#ifdef USE_LZMA
355int scu_widget_zcat_xz(scu_config * cnf) 355int scu_widget_zcat_lzma(scu_config * cnf)
356{ 356{
357 int fd; 357 int fd;
358 lzma_ret ret; 358 lzma_ret ret;
@@ -377,7 +377,7 @@ int scu_widget_zcat_xz(scu_config * cnf)
377 377
378 if ((ret = lzma_stream_decoder(&strm, UINT64_MAX, LZMA_CONCATENATED)) != LZMA_OK) 378 if ((ret = lzma_stream_decoder(&strm, UINT64_MAX, LZMA_CONCATENATED)) != LZMA_OK)
379 { 379 {
380 scu_widget_zcat_xz_perror(cnf, ret); 380 scu_widget_zcat_lzma_perror(cnf, ret);
381 close(fd); 381 close(fd);
382 return(1); 382 return(1);
383 }; 383 };
@@ -406,7 +406,7 @@ int scu_widget_zcat_xz(scu_config * cnf)
406 { 406 {
407 if (ret != LZMA_STREAM_END) 407 if (ret != LZMA_STREAM_END)
408 { 408 {
409 scu_widget_zcat_xz_perror(cnf, ret); 409 scu_widget_zcat_lzma_perror(cnf, ret);
410 close(fd); 410 close(fd);
411 return(1); 411 return(1);
412 }; 412 };
@@ -434,7 +434,7 @@ int scu_widget_zcat_xz(scu_config * cnf)
434 { 434 {
435 if (ret != LZMA_STREAM_END) 435 if (ret != LZMA_STREAM_END)
436 { 436 {
437 scu_widget_zcat_xz_perror(cnf, ret); 437 scu_widget_zcat_lzma_perror(cnf, ret);
438 return(1); 438 return(1);
439 }; 439 };
440 }; 440 };
@@ -455,7 +455,7 @@ int scu_widget_zcat_xz(scu_config * cnf)
455} 455}
456 456
457 457
458int scu_widget_zcat_xz_perror(scu_config * cnf, lzma_ret ret) 458int scu_widget_zcat_lzma_perror(scu_config * cnf, lzma_ret ret)
459{ 459{
460 switch(ret) 460 switch(ret)
461 { 461 {
@@ -468,7 +468,7 @@ int scu_widget_zcat_xz_perror(scu_config * cnf, lzma_ret ret)
468 return(1); 468 return(1);
469 469
470 case LZMA_FORMAT_ERROR: 470 case LZMA_FORMAT_ERROR:
471 fprintf(stderr, "%s: %s: invalid .xz format\n", cnf->prog_name, cnf->widget->name); 471 fprintf(stderr, "%s: %s: invalid LZMA format\n", cnf->prog_name, cnf->widget->name);
472 return(1); 472 return(1);
473 473
474 case LZMA_MEM_ERROR: 474 case LZMA_MEM_ERROR: