"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "examples/dict.c" between
lzo-2.09.tar.gz and lzo-2.10.tar.gz

About: LZO is a portable lossless data compression library written in ANSI C.

dict.c  (lzo-2.09):dict.c  (lzo-2.10)
/* dict.c -- example program: how to use preset dictionaries /* dict.c -- example program: how to use preset dictionaries
This file is part of the LZO real-time data compression library. This file is part of the LZO real-time data compression library.
Copyright (C) 1996-2015 Markus Franz Xaver Johannes Oberhumer Copyright (C) 1996-2017 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved. All Rights Reserved.
The LZO library is free software; you can redistribute it and/or The LZO library is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of published by the Free Software Foundation; either version 2 of
the License, or (at your option) any later version. the License, or (at your option) any later version.
The LZO library is distributed in the hope that it will be useful, The LZO library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
skipping to change at line 132 skipping to change at line 132
{ {
printf("%s: out of memory\n", progname); printf("%s: out of memory\n", progname);
exit(1); exit(1);
} }
in_len = (lzo_uint) lzo_fread(fp, in, in_len); in_len = (lzo_uint) lzo_fread(fp, in, in_len);
fclose(fp); fp = NULL; fclose(fp); fp = NULL;
/* /*
* Step 3: compress from 'in' to 'out' with LZO1X-999 * Step 3: compress from 'in' to 'out' with LZO1X-999
*/ */
r = lzo1x_999_compress_level(in,in_len,out,&out_len,wrkmem, r = lzo1x_999_compress_level(in, in_len, out, &out_len, wrkmem,
dict, dict_len, 0, compression_level); dict, dict_len, 0, compression_level);
if (r != LZO_E_OK) if (r != LZO_E_OK)
{ {
/* this should NEVER happen */ /* this should NEVER happen */
printf("internal error - compression failed: %d\n", r); printf("internal error - compression failed: %d\n", r);
return 1; return 1;
} }
print_info(in_name, in_len, out_len); print_info(in_name, in_len, out_len);
skipping to change at line 190 skipping to change at line 190
int r = 0; int r = 0;
const char *dict_name; const char *dict_name;
FILE *fp; FILE *fp;
time_t t_total; time_t t_total;
int compression_level = 7; int compression_level = 7;
lzo_wildargv(&argc, &argv); lzo_wildargv(&argc, &argv);
printf("\nLZO real-time data compression library (v%s, %s).\n", printf("\nLZO real-time data compression library (v%s, %s).\n",
lzo_version_string(), lzo_version_date()); lzo_version_string(), lzo_version_date());
printf("Copyright (C) 1996-2015 Markus Franz Xaver Johannes Oberhumer\nAll R ights Reserved.\n\n"); printf("Copyright (C) 1996-2017 Markus Franz Xaver Johannes Oberhumer\nAll R ights Reserved.\n\n");
progname = argv[0]; progname = argv[0];
if (i < argc && argv[i][0] == '-' && isdigit(argv[i][1])) if (i < argc && argv[i][0] == '-' && isdigit(argv[i][1]))
compression_level = atoi(&argv[i++][1]); compression_level = atoi(&argv[i++][1]);
if (i + 1 >= argc || compression_level < 1 || compression_level > 9) if (i + 1 >= argc || compression_level < 1 || compression_level > 9)
{ {
printf("usage: %s [-level] [ dictionary-file | -n ] file...\n", prognam e); printf("usage: %s [-level] [ dictionary-file | -n ] file...\n", prognam e);
exit(1); exit(1);
 End of changes. 3 change blocks. 
3 lines changed or deleted 3 lines changed or added

Home  |  About  |  All  |  Newest  |  Fossies Dox  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTPS