gzlog.c (muscle7.61) | : | gzlog.c (muscle7.62) | ||
---|---|---|---|---|
/* | /* | |||
* gzlog.c | * gzlog.c | |||
* Copyright (C) 2004, 2008, 2012 Mark Adler, all rights reserved | * Copyright (C) 2004, 2008, 2012, 2016 Mark Adler, all rights reserved | |||
* For conditions of distribution and use, see copyright notice in gzlog.h | * For conditions of distribution and use, see copyright notice in gzlog.h | |||
* version 2.2, 14 Aug 2012 | * version 2.2, 14 Aug 2012 | |||
*/ | */ | |||
/* | /* | |||
gzlog provides a mechanism for frequently appending short strings to a gzip | gzlog provides a mechanism for frequently appending short strings to a gzip | |||
file that is efficient both in execution time and compression ratio. The | file that is efficient both in execution time and compression ratio. The | |||
strategy is to write the short strings in an uncompressed form to the end of | strategy is to write the short strings in an uncompressed form to the end of | |||
the gzip file, only compressing when the amount of uncompressed data has | the gzip file, only compressing when the amount of uncompressed data has | |||
reached a given threshold. | reached a given threshold. | |||
skipping to change at line 246 | skipping to change at line 246 | |||
#include <sys/time.h> /* utimes */ | #include <sys/time.h> /* utimes */ | |||
#include "zlib.h" /* crc32 */ | #include "zlib.h" /* crc32 */ | |||
#include "gzlog.h" /* header for external access */ | #include "gzlog.h" /* header for external access */ | |||
#define local static | #define local static | |||
typedef unsigned int uint; | typedef unsigned int uint; | |||
typedef unsigned long ulong; | typedef unsigned long ulong; | |||
/* Macro for debugging to deterministically force recovery operations */ | /* Macro for debugging to deterministically force recovery operations */ | |||
#ifdef DEBUG | #ifdef GZLOG_DEBUG | |||
#include <setjmp.h> /* longjmp */ | #include <setjmp.h> /* longjmp */ | |||
jmp_buf gzlog_jump; /* where to go back to */ | jmp_buf gzlog_jump; /* where to go back to */ | |||
int gzlog_bail = 0; /* which point to bail at (1..8) */ | int gzlog_bail = 0; /* which point to bail at (1..8) */ | |||
int gzlog_count = -1; /* number of times through to wait */ | int gzlog_count = -1; /* number of times through to wait */ | |||
# define BAIL(n) do { if (n == gzlog_bail && gzlog_count-- == 0) \ | # define BAIL(n) do { if (n == gzlog_bail && gzlog_count-- == 0) \ | |||
longjmp(gzlog_jump, gzlog_bail); } while (0) | longjmp(gzlog_jump, gzlog_bail); } while (0) | |||
#else | #else | |||
# define BAIL(n) | # define BAIL(n) | |||
#endif | #endif | |||
End of changes. 2 change blocks. | ||||
2 lines changed or deleted | 2 lines changed or added |