Rename "libz" to "zlib"

Change-Id: I12f92c983d587c2a4751428cdf299635090c9f0b
Reviewed-on: https://code.wireshark.org/review/14748
Reviewed-by: João Valverde <j@v6e.pt>
Petri-Dish: João Valverde <j@v6e.pt>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
This commit is contained in:
João Valverde 2016-04-01 01:32:56 +01:00 committed by Anders Broman
parent e005bc819c
commit 6f98a0fac3
20 changed files with 73 additions and 73 deletions

View File

@ -900,9 +900,9 @@ endif()
if(GTK2_FOUND OR GTK3_FOUND)
set(GTK_FOUND ON)
endif()
# That's the name autofoo uses
if(HAVE_LIBZLIB)
set(HAVE_LIBZ 1)
set(HAVE_ZLIB 1)
# Always include the "true" zlib includes first. This works around a
# bug in the Windows setup of GTK[23] which has a faulty zconf.h.
include_directories(BEFORE ${ZLIB_INCLUDE_DIRS})

View File

@ -458,7 +458,7 @@ config.h : config.h.win32 config.nmake
-e "s/@VERSION_FLAVOR@/$(VERSION_FLAVOR)/" \
-e "s/@HAVE_C_ARES@/$(C_ARES_CONFIG)/" \
-e "s/@HAVE_KFW@/$(KFW_CONFIG)/" \
-e "s/@HAVE_LIBZ@/$(ZLIB_CONFIG)/" \
-e "s/@HAVE_ZLIB@/$(ZLIB_CONFIG)/" \
-e "s/@HAVE_LIBPCAP@/$(WINPCAP_CONFIG)/" \
-e "s/@HAVE_PCAP_FINDALLDEVS@/$(PCAP_FINDALLDEVS_CONFIG)/" \
-e "s/@HAVE_PCAP_DATALINK_NAME_TO_VAL@/$(PCAP_DATALINK_NAME_TO_VAL_CONFIG)/" \

View File

@ -507,7 +507,7 @@ AC_DEFUN([AC_WIRESHARK_ZLIB_CHECK],
AC_WIRESHARK_ADD_DASH_L(WS_LDFLAGS, $zlib_dir/lib)
fi
LIBS="-lz $LIBS"
AC_DEFINE(HAVE_LIBZ, 1, [Define to use libz library])
AC_DEFINE(HAVE_ZLIB, 1, [Define to use zlib library])
#
# Check for "inflatePrime()" in zlib, which we need
# in order to read compressed capture files.

View File

@ -157,8 +157,8 @@
/* Define to 1 if you have the `smi' library (-lsmi). */
#cmakedefine HAVE_LIBSMI 1
/* Define to use libz library */
#cmakedefine HAVE_LIBZ 1
/* Define to use zlib library */
#cmakedefine HAVE_ZLIB 1
/* Define to 1 if you have the <linux/sockios.h> header file. */
#cmakedefine HAVE_LINUX_SOCKIOS_H 1

View File

@ -157,8 +157,8 @@
/* #define INTTYPES_H_DEFINES_FORMATS */
/* Define if you have the z library (-lz). */
@HAVE_LIBZ@
#ifdef HAVE_LIBZ
@HAVE_ZLIB@
#ifdef HAVE_ZLIB
#define HAVE_INFLATEPRIME 1
#endif

View File

@ -1599,7 +1599,7 @@ ZLIB_CFLAGS=/I$(ZLIB_DIR)
ZLIB_LIBS=$(ZLIB_DIR)\lib\zdll.lib
ZLIB_DLL=$(ZLIB_DIR)\zlib1.dll
# Nmake uses carets to escape special characters
ZLIB_CONFIG=^#define HAVE_LIBZ 1
ZLIB_CONFIG=^#define HAVE_ZLIB 1
!else
ZLIB_CFLAGS=
ZLIB_LIBS=

View File

@ -1447,7 +1447,7 @@ dissect_gadu_gadu_userlist_xml_compressed(tvbuff_t *tvb, packet_info *pinfo, pro
/* XXX add DTD (pinfo->match_string) */
call_dissector_only(xml_handle, uncomp_tvb, pinfo, tree, NULL);
} else
proto_tree_add_bytes_format_value(tree, hfi_gadu_gadu_userlist.id, tvb, offset, remain, NULL, "[Error: Decompression failed] (or no libz)");
proto_tree_add_bytes_format_value(tree, hfi_gadu_gadu_userlist.id, tvb, offset, remain, NULL, "[Error: Decompression failed] (or no zlib)");
offset += remain;

View File

@ -256,7 +256,7 @@ static gboolean http_dechunk_body = TRUE;
/*
* Decompression of zlib encoded entities.
*/
#ifdef HAVE_LIBZ
#ifdef HAVE_ZLIB
static gboolean http_decompress_body = TRUE;
#else
static gboolean http_decompress_body = FALSE;
@ -3456,7 +3456,7 @@ proto_register_http(void)
"Whether to reassemble bodies of entities that are transferred "
"using the \"Transfer-Encoding: chunked\" method",
&http_dechunk_body);
#ifdef HAVE_LIBZ
#ifdef HAVE_ZLIB
prefs_register_bool_preference(http_module, "decompress_body",
"Uncompress entity bodies",
"Whether to uncompress entity bodies that are compressed "

View File

@ -685,7 +685,7 @@ dissect_ldss_transfer (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void
? "Gzip compressed data: %d bytes"
: "File data: %d bytes",
tvb_captured_length(tvb));
#ifdef HAVE_LIBZ
#ifdef HAVE_ZLIB
/* Be nice and uncompress the file data. */
if (compression == COMPRESSION_GZIP) {
tvbuff_t *uncomp_tvb;

View File

@ -121,7 +121,7 @@ static expert_field ei_slsk_zlib_decompression_failed = EI_INIT;
/* desegmentation of SoulSeek Message over TCP */
static gboolean slsk_desegment = TRUE;
#ifdef HAVE_LIBZ
#ifdef HAVE_ZLIB
static gboolean slsk_decompress = TRUE;
#else
static gboolean slsk_decompress = FALSE;
@ -2616,7 +2616,7 @@ proto_register_slsk(void)
"Whether the SoulSeek dissector should reassemble messages spanning multiple TCP segments."
" To use this option, you must also enable \"Allow subdissectors to reassemble TCP streams\" in the TCP protocol settings.",
&slsk_desegment);
#ifdef HAVE_LIBZ
#ifdef HAVE_ZLIB
prefs_register_bool_preference(slsk_module, "decompress",
"Decompress zlib compressed packets inside SoulSeek messages",
"Whether the SoulSeek dissector should decompress all zlib compressed packets inside messages",

View File

@ -41,7 +41,7 @@
#include "packet-tcp.h"
#include "packet-ssl.h"
#ifdef HAVE_LIBZ
#ifdef HAVE_ZLIB
#define ZLIB_CONST
#include <zlib.h>
#endif
@ -58,7 +58,7 @@ void proto_reg_handoff_spdy(void);
* entities and for decompressing request & reply header blocks.
*/
typedef struct _spdy_conv_t {
#ifdef HAVE_LIBZ
#ifdef HAVE_ZLIB
z_streamp rqst_decompressor;
z_streamp rply_decompressor;
uLong dictionary_id;
@ -248,7 +248,7 @@ static gboolean spdy_assemble_entity_bodies = TRUE;
/*
* Decompression of zlib encoded entities.
*/
#ifdef HAVE_LIBZ
#ifdef HAVE_ZLIB
static gboolean spdy_decompress_body = TRUE;
static gboolean spdy_decompress_headers = TRUE;
#else
@ -437,7 +437,7 @@ static const char spdy_dictionary[] = {
0x2c, 0x65, 0x6e, 0x71, 0x3d, 0x30, 0x2e /* - e n q - 0 - */
};
#ifdef HAVE_LIBZ
#ifdef HAVE_ZLIB
/* callback function used at the end of file-scope to cleanup zlib's inflate
* streams to avoid memory leaks.
* XXX: can we be more aggressive and call this sooner for finished streams?
@ -467,7 +467,7 @@ spdy_init_protocol(void)
static spdy_conv_t * get_or_create_spdy_conversation_data(packet_info *pinfo) {
conversation_t *conversation;
spdy_conv_t *conv_data;
#ifdef HAVE_LIBZ
#ifdef HAVE_ZLIB
int retcode;
#endif
@ -481,7 +481,7 @@ static spdy_conv_t * get_or_create_spdy_conversation_data(packet_info *pinfo) {
conv_data->streams = NULL;
if (spdy_decompress_headers) {
#ifdef HAVE_LIBZ
#ifdef HAVE_ZLIB
conv_data->rqst_decompressor = wmem_new0(wmem_file_scope(), z_stream);
conv_data->rply_decompressor = wmem_new0(wmem_file_scope(), z_stream);
retcode = inflateInit(conv_data->rqst_decompressor);
@ -942,7 +942,7 @@ body_dissected:
return frame->length;
}
#ifdef HAVE_LIBZ
#ifdef HAVE_ZLIB
/*
* Performs header decompression.
*
@ -1153,7 +1153,7 @@ static int dissect_spdy_header_payload(
if (header_info == NULL) {
guint8 *uncomp_ptr = NULL;
guint uncomp_length = 0;
#ifdef HAVE_LIBZ
#ifdef HAVE_ZLIB
z_streamp decomp;
/* Get our decompressor. */

View File

@ -1197,7 +1197,7 @@ dissect_ImageJPEG(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, const gui
return JPEG_Size + 4;
}
#ifdef HAVE_LIBZ
#ifdef HAVE_ZLIB
static void
dissect_ImageZLIB_GLZ_stream(tvbuff_t *tvb, proto_tree *ZLIB_GLZ_tree, packet_info *pinfo,
guint32 offset, guint32 ZLIB_GLZSize, guint32 ZLIB_uncompSize)

View File

@ -26,7 +26,7 @@
#include "config.h"
#ifdef HAVE_LIBZ
#ifdef HAVE_ZLIB
#define ZLIB_CONST
#include <zlib.h>
#endif
@ -1233,7 +1233,7 @@ static const ssl_alpn_protocol_t ssl_alpn_protocols[] = {
*/
struct _SslDecompress {
gint compression;
#ifdef HAVE_LIBZ
#ifdef HAVE_ZLIB
z_stream istream;
#endif
};
@ -2613,7 +2613,7 @@ ssl_decrypt_record(SslDecryptSession*ssl, SslDecoder* decoder, gint ct,
#ifdef HAVE_LIBGCRYPT
/* Record Decompression (after decryption) {{{ */
#ifdef HAVE_LIBZ
#ifdef HAVE_ZLIB
/* memory allocation functions for zlib initialization */
static void* ssl_zalloc(void* opaque _U_, unsigned int no, unsigned int size)
{
@ -2629,7 +2629,7 @@ static SslDecompress*
ssl_create_decompressor(gint compression)
{
SslDecompress *decomp;
#ifdef HAVE_LIBZ
#ifdef HAVE_ZLIB
int err;
#endif
@ -2638,7 +2638,7 @@ ssl_create_decompressor(gint compression)
decomp = (SslDecompress *)wmem_alloc(wmem_file_scope(), sizeof(SslDecompress));
decomp->compression = compression;
switch (decomp->compression) {
#ifdef HAVE_LIBZ
#ifdef HAVE_ZLIB
case 1: /* DEFLATE */
decomp->istream.zalloc = ssl_zalloc;
decomp->istream.zfree = ssl_zfree;
@ -2661,7 +2661,7 @@ ssl_create_decompressor(gint compression)
return decomp;
}
#ifdef HAVE_LIBZ
#ifdef HAVE_ZLIB
static int
ssl_decompress_record(SslDecompress* decomp, const guchar* in, guint inl, StringInfo* out_str, guint* outl)
{

View File

@ -2938,7 +2938,7 @@ vnc_h264_encoding(tvbuff_t *tvb, gint *offset, proto_tree *tree)
return 0; /* bytes_needed */
}
#ifdef HAVE_LIBZ
#ifdef HAVE_ZLIB
static guint
vnc_zrle_encoding(tvbuff_t *tvb, packet_info *pinfo, gint *offset,
proto_tree *tree, const guint16 width, const guint16 height)
@ -2949,7 +2949,7 @@ vnc_zrle_encoding(tvbuff_t *tvb, packet_info *pinfo _U_, gint *offset,
#endif
{
guint32 data_len;
#ifdef HAVE_LIBZ
#ifdef HAVE_ZLIB
guint8 palette_size;
guint8 bytes_per_cpixel = vnc_get_bytes_per_pixel(pinfo);
gint uncomp_offset = 0;
@ -2972,7 +2972,7 @@ vnc_zrle_encoding(tvbuff_t *tvb, packet_info *pinfo _U_, gint *offset,
proto_tree_add_item(tree, hf_vnc_zrle_data, tvb, *offset,
data_len, ENC_NA);
#ifdef HAVE_LIBZ
#ifdef HAVE_ZLIB
uncomp_tvb = tvb_child_uncompress(tvb, tvb, *offset, data_len);
if(uncomp_tvb != NULL) {
@ -3020,7 +3020,7 @@ vnc_zrle_encoding(tvbuff_t *tvb, packet_info *pinfo _U_, gint *offset,
} else {
proto_tree_add_expert(tree, pinfo, &ei_vnc_zrle_failed, tvb, *offset, data_len);
}
#endif /* HAVE_LIBZ */
#endif /* HAVE_ZLIB */
*offset += data_len;

View File

@ -27,14 +27,14 @@
#include <string.h>
#ifdef HAVE_LIBZ
#ifdef HAVE_ZLIB
#define ZLIB_CONST
#include <zlib.h>
#endif
#include "tvbuff.h"
#ifdef HAVE_LIBZ
#ifdef HAVE_ZLIB
/*
* Uncompresses a zlib compressed packet inside a message of tvb at offset with
* length comprlen. Returns an uncompressed tvbuffer if uncompression

View File

@ -1206,7 +1206,7 @@ WSLUA_METHOD TvbRange_uncompress(lua_State* L) {
/* Obtain an uncompressed TvbRange from a TvbRange */
#define WSLUA_ARG_TvbRange_uncompress_NAME 2 /* The name to be given to the new data-source. */
TvbRange tvbr = checkTvbRange(L,1);
#ifdef HAVE_LIBZ
#ifdef HAVE_ZLIB
const gchar* name = luaL_optstring(L,WSLUA_ARG_TvbRange_uncompress_NAME,"Uncompressed");
tvbuff_t *uncompr_tvb;
#endif
@ -1218,7 +1218,7 @@ WSLUA_METHOD TvbRange_uncompress(lua_State* L) {
return 0;
}
#ifdef HAVE_LIBZ
#ifdef HAVE_ZLIB
uncompr_tvb = tvb_child_uncompress(tvbr->tvb->ws_tvb, tvbr->tvb->ws_tvb, tvbr->offset, tvbr->len);
if (uncompr_tvb) {
add_new_data_source (lua_pinfo, uncompr_tvb, name);

View File

@ -2080,7 +2080,7 @@ wtap_dump_can_open(int file_type_subtype)
return TRUE;
}
#ifdef HAVE_LIBZ
#ifdef HAVE_ZLIB
gboolean
wtap_dump_can_compress(int file_type_subtype)
{
@ -2503,7 +2503,7 @@ wtap_dump(wtap_dumper *wdh, const struct wtap_pkthdr *phdr,
void
wtap_dump_flush(wtap_dumper *wdh)
{
#ifdef HAVE_LIBZ
#ifdef HAVE_ZLIB
if(wdh->compressed) {
gzwfile_flush((GZWFILE_T)wdh->fh);
} else
@ -2563,7 +2563,7 @@ wtap_dump_set_addrinfo_list(wtap_dumper *wdh, addrinfo_lists_t *addrinfo_lists)
}
/* internally open a file for writing (compressed or not) */
#ifdef HAVE_LIBZ
#ifdef HAVE_ZLIB
static WFILE_T
wtap_dump_file_open(wtap_dumper *wdh, const char *filename)
{
@ -2582,7 +2582,7 @@ wtap_dump_file_open(wtap_dumper *wdh _U_, const char *filename)
#endif
/* internally open a file for writing (compressed or not) */
#ifdef HAVE_LIBZ
#ifdef HAVE_ZLIB
static WFILE_T
wtap_dump_file_fdopen(wtap_dumper *wdh, int fd)
{
@ -2606,7 +2606,7 @@ wtap_dump_file_write(wtap_dumper *wdh, const void *buf, size_t bufsize, int *err
{
size_t nwritten;
#ifdef HAVE_LIBZ
#ifdef HAVE_ZLIB
if (wdh->compressed) {
nwritten = gzwfile_write((GZWFILE_T)wdh->fh, buf, (unsigned int) bufsize);
/*
@ -2640,7 +2640,7 @@ wtap_dump_file_write(wtap_dumper *wdh, const void *buf, size_t bufsize, int *err
static int
wtap_dump_file_close(wtap_dumper *wdh)
{
#ifdef HAVE_LIBZ
#ifdef HAVE_ZLIB
if(wdh->compressed) {
/*
* Tell gzwfile_close() whether to close the descriptor
@ -2664,7 +2664,7 @@ wtap_dump_file_close(wtap_dumper *wdh)
gint64
wtap_dump_file_seek(wtap_dumper *wdh, gint64 offset, int whence, int *err)
{
#ifdef HAVE_LIBZ
#ifdef HAVE_ZLIB
if(wdh->compressed) {
*err = WTAP_ERR_CANT_SEEK_COMPRESSED;
return -1;
@ -2685,7 +2685,7 @@ gint64
wtap_dump_file_tell(wtap_dumper *wdh, int *err)
{
gint64 rval;
#ifdef HAVE_LIBZ
#ifdef HAVE_ZLIB
if(wdh->compressed) {
*err = WTAP_ERR_CANT_SEEK_COMPRESSED;
return -1;

View File

@ -48,10 +48,10 @@
#include <wsutil/ws_diag_control.h>
#include <wsutil/file_util.h>
#ifdef HAVE_LIBZ
#ifdef HAVE_ZLIB
#define ZLIB_CONST
#include <zlib.h>
#endif /* HAVE_LIBZ */
#endif /* HAVE_ZLIB */
/*
* See RFC 1952 for a description of the gzip file format.
@ -70,7 +70,7 @@
* compression types.
*/
const char *compressed_file_extension_table[] = {
#ifdef HAVE_LIBZ
#ifdef HAVE_ZLIB
"gz",
#endif
NULL
@ -83,7 +83,7 @@ const char *compressed_file_extension_table[] = {
typedef enum {
UNKNOWN, /* unknown - look for a gzip header */
UNCOMPRESSED, /* uncompressed - copy input directly */
#ifdef HAVE_LIBZ
#ifdef HAVE_ZLIB
ZLIB, /* decompress a zlib stream */
GZIP_AFTER_HEADER
#endif
@ -113,7 +113,7 @@ struct wtap_reader {
guint avail_in; /* number of bytes available at next_in */
unsigned char *next_in; /* next input byte */
#ifdef HAVE_LIBZ
#ifdef HAVE_ZLIB
/* zlib inflate stream */
z_stream strm; /* stream structure in-place (not a pointer) */
gboolean dont_check_crc; /* TRUE if we aren't supposed to check the CRC */
@ -234,13 +234,13 @@ fast_seek_header(FILE_T file, gint64 in_pos, gint64 out_pos,
static void
fast_seek_reset(
#ifdef HAVE_LIBZ
#ifdef HAVE_ZLIB
FILE_T state)
#else
FILE_T state _U_)
#endif
{
#ifdef HAVE_LIBZ
#ifdef HAVE_ZLIB
if (state->compression == ZLIB && state->fast_seek_cur) {
struct zlib_cur_seek_point *cur = (struct zlib_cur_seek_point *) state->fast_seek_cur;
@ -249,7 +249,7 @@ fast_seek_reset(
#endif
}
#ifdef HAVE_LIBZ
#ifdef HAVE_ZLIB
/* Get next byte from input, or -1 if end or error.
*
@ -573,7 +573,7 @@ gz_head(FILE_T state)
}
/* look for the gzip magic header bytes 31 and 139 */
#ifdef HAVE_LIBZ
#ifdef HAVE_ZLIB
if (state->next_in[0] == 31) {
state->avail_in--;
state->next_in++;
@ -706,7 +706,7 @@ fill_out_buffer(FILE_T state)
return -1;
state->next = state->out;
}
#ifdef HAVE_LIBZ
#ifdef HAVE_ZLIB
else if (state->compression == ZLIB) { /* decompress */
zlib_read(state, state->out, state->size << 1);
}
@ -825,7 +825,7 @@ file_fdopen(int fd)
return NULL;
}
#ifdef HAVE_LIBZ
#ifdef HAVE_ZLIB
/* allocate inflate memory */
state->strm.zalloc = Z_NULL;
state->strm.zfree = Z_NULL;
@ -852,7 +852,7 @@ file_open(const char *path)
{
int fd;
FILE_T ft;
#ifdef HAVE_LIBZ
#ifdef HAVE_ZLIB
const char *suffixp;
#endif
@ -875,7 +875,7 @@ file_open(const char *path)
return NULL;
}
#ifdef HAVE_LIBZ
#ifdef HAVE_ZLIB
/*
* If this file's name ends in ".caz", it's probably a compressed
* Windows Sniffer file. The compression is gzip, but if we
@ -991,7 +991,7 @@ file_seek(FILE_T file, gint64 offset, int whence, int *err)
* has been called on this file, which should never be the case
* for a pipe.
*/
#ifdef HAVE_LIBZ
#ifdef HAVE_ZLIB
if (here->compression == ZLIB) {
#ifdef HAVE_INFLATEPRIME
off = here->in - (here->data.zlib.bits ? 1 : 0);
@ -1023,7 +1023,7 @@ file_seek(FILE_T file, gint64 offset, int whence, int *err)
file->err_info = NULL;
file->avail_in = 0;
#ifdef HAVE_LIBZ
#ifdef HAVE_ZLIB
if (here->compression == ZLIB) {
z_stream *strm = &file->strm;
@ -1444,7 +1444,7 @@ file_close(FILE_T file)
/* free memory and close file */
if (file->size) {
#ifdef HAVE_LIBZ
#ifdef HAVE_ZLIB
inflateEnd(&(file->strm));
#endif
g_free(file->out);
@ -1463,7 +1463,7 @@ file_close(FILE_T file)
ws_close(fd);
}
#ifdef HAVE_LIBZ
#ifdef HAVE_ZLIB
/* internal gzip file state data structure for writing */
struct wtap_writer {
int fd; /* file descriptor */

View File

@ -46,7 +46,7 @@ extern void file_fdclose(FILE_T file);
extern int file_fdreopen(FILE_T file, const char *path);
extern void file_close(FILE_T file);
#ifdef HAVE_LIBZ
#ifdef HAVE_ZLIB
typedef struct wtap_writer *GZWFILE_T;
extern GZWFILE_T gzwfile_open(const char *path);
@ -55,6 +55,6 @@ extern guint gzwfile_write(GZWFILE_T state, const void *buf, guint len);
extern int gzwfile_flush(GZWFILE_T state);
extern int gzwfile_close(GZWFILE_T state, gboolean is_stdout);
extern int gzwfile_geterr(GZWFILE_T state);
#endif /* HAVE_LIBZ */
#endif /* HAVE_ZLIB */
#endif /* __FILE_H__ */

View File

@ -33,7 +33,7 @@
#include <glib.h>
#ifdef HAVE_LIBZ
#ifdef HAVE_ZLIB
#include <zlib.h>
#endif
@ -78,15 +78,15 @@ end_string(GString *str)
static const gchar *
get_zlib_compiled_version_info(void)
{
#ifdef HAVE_LIBZ
#ifdef HAVE_ZLIB
#ifdef ZLIB_VERSION
return "with libz "ZLIB_VERSION;
return "with zlib "ZLIB_VERSION;
#else
return "with libz (version unknown)";
return "with zlib (version unknown)";
#endif /* ZLIB_VERSION */
#else
return "without libz";
#endif /* HAVE_LIBZ */
return "without zlib";
#endif /* HAVE_ZLIB */
}
/*
@ -355,8 +355,8 @@ get_runtime_version_info(void (*additional_info)(GString *))
(*additional_info)(str);
/* zlib */
#if defined(HAVE_LIBZ) && !defined(_WIN32)
g_string_append_printf(str, ", with libz %s", zlibVersion());
#if defined(HAVE_ZLIB) && !defined(_WIN32)
g_string_append_printf(str, ", with zlib %s", zlibVersion());
#endif
g_string_append(str, ".");