[Pkg-clamav-commits] [SCM] Debian repository for ClamAV branch, debian/unstable, updated. debian/0.95+dfsg-1-6156-g094ec9b

aCaB acab at clamav.net
Sun Apr 4 01:06:54 UTC 2010


The following commit has been merged in the debian/unstable branch:
commit 49cc1e3c353932a86e747489ad2d05c73cf69f83
Author: aCaB <acab at clamav.net>
Date:   Fri Oct 2 18:09:31 2009 +0200

    s/struct F_MAP/fmap_t/

diff --git a/libclamav/binhex.c b/libclamav/binhex.c
index 931cc52..eb926c3 100644
--- a/libclamav/binhex.c
+++ b/libclamav/binhex.c
@@ -110,7 +110,7 @@ static	char	const	rcsid[] = "$Id: binhex.c,v 1.23 2007/02/12 20:46:08 njh Exp $"
 #include "fmap.h"
 
 int
-cli_binhex(const char *dir, struct F_MAP *map)
+cli_binhex(const char *dir, fmap_t *map)
 {
 	char *buf, *start, *line;
 	size_t size;
diff --git a/libclamav/binhex.h b/libclamav/binhex.h
index c06af62..2eafc8a 100644
--- a/libclamav/binhex.h
+++ b/libclamav/binhex.h
@@ -33,6 +33,6 @@
 #ifndef __BINHEX_H
 #define __BINHEX_H
 
-int cli_binhex(const char *dir, struct F_MAP *map);
+int cli_binhex(const char *dir, fmap_t *map);
 
 #endif
diff --git a/libclamav/chmunpack.c b/libclamav/chmunpack.c
index 3c4cd38..47fd17a 100644
--- a/libclamav/chmunpack.c
+++ b/libclamav/chmunpack.c
@@ -106,7 +106,7 @@ typedef struct lzx_content_tag {
 #define chm_endian_convert_64(x) le64_to_host(x)
 
 /* Read in a block of data from either the mmap area or the given fd */
-static int chm_read_data(struct F_MAP *map, char *dest, off_t offset, off_t len)
+static int chm_read_data(fmap_t *map, char *dest, off_t offset, off_t len)
 {
     void *src = fmap_need_off_once(map, offset, len);
     if(!src) return FALSE;
@@ -611,7 +611,7 @@ void cli_chm_close(chm_metadata_t *metadata)
 	if (metadata->ufd >= 0) {
 		close(metadata->ufd);
 	}
-	fmunmap(metadata->map);
+	funmap(metadata->map);
 }
 
 int cli_chm_extract_file(char *dirname, chm_metadata_t *metadata, cli_ctx *ctx)
@@ -742,6 +742,6 @@ int cli_chm_open(int fd, const char *dirname, chm_metadata_t *metadata, cli_ctx
 	return CL_SUCCESS;
 
 abort:
-	fmunmap(metadata->map);
+	funmap(metadata->map);
 	return CL_EFORMAT;
 }
diff --git a/libclamav/chmunpack.h b/libclamav/chmunpack.h
index 8bb844f..138e40b 100644
--- a/libclamav/chmunpack.h
+++ b/libclamav/chmunpack.h
@@ -111,7 +111,7 @@ typedef struct chm_metadata_tag {
 	char *chunk_data;
 	char *chunk_current;
 	char *chunk_end;
-	struct F_MAP *map;
+	fmap_t *map;
 	uint16_t chunk_entries;
 } chm_metadata_t;
 
diff --git a/libclamav/elf.c b/libclamav/elf.c
index 23c5c66..f47db3a 100644
--- a/libclamav/elf.c
+++ b/libclamav/elf.c
@@ -72,7 +72,7 @@ int cli_scanelf(cli_ctx *ctx)
 	uint32_t entry, fentry, shoff, phoff, i;
 	uint8_t conv = 0, err;
 	unsigned int format;
-	struct F_MAP *map = *ctx->fmap;
+	fmap_t *map = *ctx->fmap;
 
 
     cli_dbgmsg("in cli_scanelf\n");
@@ -455,7 +455,7 @@ int cli_scanelf(cli_ctx *ctx)
     return CL_CLEAN;
 }
 
-int cli_elfheader(struct F_MAP *map, struct cli_exe_info *elfinfo)
+int cli_elfheader(fmap_t *map, struct cli_exe_info *elfinfo)
 {
 	struct elf_file_hdr32 file_hdr;
 	struct elf_section_hdr32 *section_hdr;
diff --git a/libclamav/elf.h b/libclamav/elf.h
index 897f56d..ec59bfe 100644
--- a/libclamav/elf.h
+++ b/libclamav/elf.h
@@ -111,6 +111,6 @@ struct elf_section_hdr64 {
 
 int cli_scanelf(cli_ctx *ctx);
 
-int cli_elfheader(struct F_MAP *map, struct cli_exe_info *elfinfo);
+int cli_elfheader(fmap_t *map, struct cli_exe_info *elfinfo);
 
 #endif
diff --git a/libclamav/filetypes.c b/libclamav/filetypes.c
index 39e7625..d42d060 100644
--- a/libclamav/filetypes.c
+++ b/libclamav/filetypes.c
@@ -143,7 +143,7 @@ cli_file_t cli_filetype(const unsigned char *buf, size_t buflen, const struct cl
 
 int is_tar(unsigned char *buf, unsigned int nbytes);
 
-cli_file_t cli_filetype2(struct F_MAP *map, const struct cl_engine *engine)
+cli_file_t cli_filetype2(fmap_t *map, const struct cl_engine *engine)
 {
 	unsigned char *buff, *decoded;
 	int bread = MIN(map->len, MAGIC_BUFFER_SIZE), sret;
diff --git a/libclamav/filetypes.h b/libclamav/filetypes.h
index bf726b4..62c8198 100644
--- a/libclamav/filetypes.h
+++ b/libclamav/filetypes.h
@@ -106,7 +106,7 @@ struct cli_matched_type {
 cli_file_t cli_ftcode(const char *name);
 void cli_ftfree(const struct cl_engine *engine);
 cli_file_t cli_filetype(const unsigned char *buf, size_t buflen, const struct cl_engine *engine);
-cli_file_t cli_filetype2(struct F_MAP *map, const struct cl_engine *engine);
+cli_file_t cli_filetype2(fmap_t *map, const struct cl_engine *engine);
 int cli_addtypesigs(struct cl_engine *engine);
 
 #endif
diff --git a/libclamav/fmap.c b/libclamav/fmap.c
index d566415..c5fd677 100644
--- a/libclamav/fmap.c
+++ b/libclamav/fmap.c
@@ -71,16 +71,16 @@ static unsigned int fmap_align_to(unsigned int sz, unsigned int al) {
     return al * fmap_align_items(sz, al);
 }
 
-static unsigned int fmap_which_page(struct F_MAP *m, size_t at) {
+static unsigned int fmap_which_page(fmap_t *m, size_t at) {
     return at / m->pgsz;
 }
 
 
-struct F_MAP *fmap(int fd, off_t offset, size_t len) {
+fmap_t *fmap(int fd, off_t offset, size_t len) {
     unsigned int pages, mapsz, hdrsz, dumb = 1;
     int pgsz = cli_getpagesize();
     struct stat st;
-    struct F_MAP *m;
+    fmap_t *m;
 
     if(fstat(fd, &st)) {
 	cli_warnmsg("fmap: fstat failed\n");
@@ -100,18 +100,18 @@ struct F_MAP *fmap(int fd, off_t offset, size_t len) {
 	return NULL;
     }
     pages = fmap_align_items(len, pgsz);
-    hdrsz = fmap_align_to(sizeof(struct F_MAP) + pages * sizeof(uint32_t), pgsz);
+    hdrsz = fmap_align_to(sizeof(fmap_t) + pages * sizeof(uint32_t), pgsz);
     mapsz = pages * pgsz + hdrsz;
     pthread_mutex_lock(&fmap_mutex);
 #if HAVE_MMAP
-    if ((m = (struct F_MAP *)mmap(NULL, mapsz, PROT_READ | PROT_WRITE, MAP_PRIVATE|/*FIXME: MAP_POPULATE is ~8% faster but more memory intensive */ANONYMOUS_MAP, -1, 0)) == MAP_FAILED) {
+    if ((m = (fmap_t *)mmap(NULL, mapsz, PROT_READ | PROT_WRITE, MAP_PRIVATE|/*FIXME: MAP_POPULATE is ~8% faster but more memory intensive */ANONYMOUS_MAP, -1, 0)) == MAP_FAILED) {
 	m = NULL;
     } else {
 	dumb = 0;
 	madvise(m, mapsz, MADV_RANDOM|MADV_DONTFORK);
     }
 #else
-    m = (struct F_MAP *)cli_malloc(mapsz);
+    m = (fmap_t *)cli_malloc(mapsz);
 #endif
     if(!m) {
 	cli_warnmsg("fmap: map allocation failed\n");
@@ -141,7 +141,7 @@ struct F_MAP *fmap(int fd, off_t offset, size_t len) {
 }
 
 
-static void fmap_qsel(struct F_MAP *m, unsigned int *freeme, unsigned int left, unsigned int right) {
+static void fmap_qsel(fmap_t *m, unsigned int *freeme, unsigned int left, unsigned int right) {
     unsigned int i = left, j = right;
     unsigned int pivot = m->bitmap[freeme[(left + right) / 2]] & FM_MASK_COUNT;
 
@@ -166,7 +166,7 @@ static void fmap_qsel(struct F_MAP *m, unsigned int *freeme, unsigned int left,
 }
 
 
-static void fmap_aging(struct F_MAP *m) {
+static void fmap_aging(fmap_t *m) {
 #if HAVE_MMAP
     if(m->dumb) return;
     if(m->paged * m->pgsz > UNPAGE_THRSHLD_LO) { /* we alloc'd too much */
@@ -210,7 +210,7 @@ static void fmap_aging(struct F_MAP *m) {
 }
 
 
-static int fmap_readpage(struct F_MAP *m, unsigned int first_page, unsigned int count, unsigned int lock_count) {
+static int fmap_readpage(fmap_t *m, unsigned int first_page, unsigned int count, unsigned int lock_count) {
     size_t readsz = 0, got;
     char *pptr = NULL;
     uint32_t s;
@@ -315,7 +315,7 @@ static int fmap_readpage(struct F_MAP *m, unsigned int first_page, unsigned int
 }
 
 
-static void *fmap_need(struct F_MAP *m, size_t at, size_t len, int lock) {
+static void *fmap_need(fmap_t *m, size_t at, size_t len, int lock) {
     unsigned int first_page, last_page, lock_count;
     char *ret;
 
@@ -347,25 +347,25 @@ static void *fmap_need(struct F_MAP *m, size_t at, size_t len, int lock) {
     return (void *)ret;
 }
 
-void *fmap_need_off(struct F_MAP *m, size_t at, size_t len) {
+void *fmap_need_off(fmap_t *m, size_t at, size_t len) {
     return fmap_need(m, at, len, 1);
 }
-void *fmap_need_off_once(struct F_MAP *m, size_t at, size_t len) {
+void *fmap_need_off_once(fmap_t *m, size_t at, size_t len) {
     return fmap_need(m, at, len, 0);
 }
-void *fmap_need_ptr(struct F_MAP *m, void *ptr, size_t len) {
+void *fmap_need_ptr(fmap_t *m, void *ptr, size_t len) {
     return fmap_need_off(m, (char *)ptr - (char *)m - m->hdrsz, len);
 }
-void *fmap_need_ptr_once(struct F_MAP *m, void *ptr, size_t len) {
+void *fmap_need_ptr_once(fmap_t *m, void *ptr, size_t len) {
     return fmap_need_off_once(m, (char *)ptr - (char *)m - m->hdrsz, len);
 }
 
-void *fmap_need_str(struct F_MAP *m, void *ptr, size_t len_hint) {
+void *fmap_need_str(fmap_t *m, void *ptr, size_t len_hint) {
     size_t at = (char *)ptr - (char *)m - m->hdrsz;
     return fmap_need_offstr(m, at, len_hint);
 }
 
-static void fmap_unneed_page(struct F_MAP *m, unsigned int page) {
+static void fmap_unneed_page(fmap_t *m, unsigned int page) {
     uint32_t s = m->bitmap[page];
 
     if((s & (FM_MASK_PAGED | FM_MASK_LOCKED)) == (FM_MASK_PAGED | FM_MASK_LOCKED)) {
@@ -386,7 +386,7 @@ static void fmap_unneed_page(struct F_MAP *m, unsigned int page) {
     return;
 }
 
-void fmap_unneed_off(struct F_MAP *m, size_t at, size_t len) {
+void fmap_unneed_off(fmap_t *m, size_t at, size_t len) {
     unsigned int i, first_page, last_page;
     if(m->dumb) return;
     if(!len) {
@@ -409,12 +409,12 @@ void fmap_unneed_off(struct F_MAP *m, size_t at, size_t len) {
     }
 }
 
-void fmap_unneed_ptr(struct F_MAP *m, void *ptr, size_t len) {
+void fmap_unneed_ptr(fmap_t *m, void *ptr, size_t len) {
 //    cli_errmsg("FMAPDBG: unneed_ptr map %p at %p len %u\n", m, ptr, len);
     fmap_unneed_off(m, (char *)ptr - (char *)m - m->hdrsz, len);
 }
 
-int fmap_readn(struct F_MAP *m, void *dst, size_t at, size_t len) {
+int fmap_readn(fmap_t *m, void *dst, size_t at, size_t len) {
     char *src;
 
     if(at > m->len)
@@ -428,7 +428,7 @@ int fmap_readn(struct F_MAP *m, void *dst, size_t at, size_t len) {
     return len;
 }
 
-void fmunmap(struct F_MAP *m) {
+void funmap(fmap_t *m) {
 #ifdef FMAPDEBUG
   cli_errmsg("FMAPDEBUG: Needs:%u reads:%u locks:%u unlocks:%u unmaps:%u\n", m->page_needs, m->page_reads, m->page_locks, m->page_unlocks, m->page_unmaps);
 #endif
@@ -444,7 +444,7 @@ void fmunmap(struct F_MAP *m) {
 	free((void *)m);
 }
 
-void *fmap_need_offstr(struct F_MAP *m, size_t at, size_t len_hint) {
+void *fmap_need_offstr(fmap_t *m, size_t at, size_t len_hint) {
     unsigned int i, first_page, last_page;
     void *ptr = (void *)((char *)m + m->hdrsz + at);
 
@@ -486,7 +486,7 @@ void *fmap_need_offstr(struct F_MAP *m, size_t at, size_t len_hint) {
 }
 
 
-void *fmap_gets(struct F_MAP *m, char *dst, size_t *at, size_t max_len) {
+void *fmap_gets(fmap_t *m, char *dst, size_t *at, size_t max_len) {
     unsigned int i, first_page, last_page;
     char *src = (void *)((char *)m + m->hdrsz + *at), *endptr = NULL;
     size_t len = MIN(max_len-1, m->len - *at), fullen = len;
diff --git a/libclamav/fmap.h b/libclamav/fmap.h
index 9c13285..9686a79 100644
--- a/libclamav/fmap.h
+++ b/libclamav/fmap.h
@@ -23,9 +23,9 @@
 
 #include "cltypes.h"
 
-//#define FMAPDEBUG
+/* #define FMAPDEBUG */
 
-struct F_MAP {
+typedef struct {
     int fd;
     unsigned int dumb;
     time_t mtime;
@@ -36,25 +36,25 @@ struct F_MAP {
     unsigned int pgsz;
     unsigned int paged;
 #ifdef FMAPDEBUG
-  unsigned int page_needs;
-  unsigned int page_reads;
-  unsigned int page_locks;
-  unsigned int page_unlocks;
-  unsigned int page_unmaps;
+    unsigned int page_needs;
+    unsigned int page_reads;
+    unsigned int page_locks;
+    unsigned int page_unlocks;
+    unsigned int page_unmaps;
 #endif
     uint32_t bitmap[]; /* FIXME: do not use flexible arrays */
-};
+} fmap_t;
 
-struct F_MAP *fmap(int fd, off_t offset, size_t len);
-void fmunmap(struct F_MAP *m);
-void *fmap_need_off(struct F_MAP *m, size_t at, size_t len);
-void *fmap_need_off_once(struct F_MAP *m, size_t at, size_t len);
-void *fmap_need_ptr(struct F_MAP *m, void *ptr, size_t len);
-void *fmap_need_ptr_once(struct F_MAP *m, void *ptr, size_t len);
-void fmap_unneed_off(struct F_MAP *m, size_t at, size_t len);
-void fmap_unneed_ptr(struct F_MAP *m, void *ptr, size_t len);
-int fmap_readn(struct F_MAP *m, void *dst, size_t at, size_t len);
-void *fmap_need_str(struct F_MAP *m, void *ptr, size_t len_hint);
-void *fmap_need_offstr(struct F_MAP *m, size_t at, size_t len_hint);
-void *fmap_gets(struct F_MAP *m, char *dst, size_t *at, size_t max_len);
+fmap_t *fmap(int fd, off_t offset, size_t len);
+void funmap(fmap_t *m);
+void *fmap_need_off(fmap_t *m, size_t at, size_t len);
+void *fmap_need_off_once(fmap_t *m, size_t at, size_t len);
+void *fmap_need_ptr(fmap_t *m, void *ptr, size_t len);
+void *fmap_need_ptr_once(fmap_t *m, void *ptr, size_t len);
+void fmap_unneed_off(fmap_t *m, size_t at, size_t len);
+void fmap_unneed_ptr(fmap_t *m, void *ptr, size_t len);
+int fmap_readn(fmap_t *m, void *dst, size_t at, size_t len);
+void *fmap_need_str(fmap_t *m, void *ptr, size_t len_hint);
+void *fmap_need_offstr(fmap_t *m, size_t at, size_t len_hint);
+void *fmap_gets(fmap_t *m, char *dst, size_t *at, size_t max_len);
 #endif
diff --git a/libclamav/htmlnorm.c b/libclamav/htmlnorm.c
index 8da82cc..3a270d8 100644
--- a/libclamav/htmlnorm.c
+++ b/libclamav/htmlnorm.c
@@ -1710,7 +1710,7 @@ int html_normalise_mem(unsigned char *in_buff, off_t in_size, const char *dirnam
 	return cli_html_normalise(-1, &m_area, dirname, hrefs, dconf);
 }
 
-int html_normalise_map(struct F_MAP *map, const char *dirname, tag_arguments_t *hrefs,const struct cli_dconf* dconf)
+int html_normalise_map(fmap_t *map, const char *dirname, tag_arguments_t *hrefs,const struct cli_dconf* dconf)
 {
 	int retval=FALSE;
 	m_area_t m_area;
diff --git a/libclamav/htmlnorm.h b/libclamav/htmlnorm.h
index 1a8075c..6220c89 100644
--- a/libclamav/htmlnorm.h
+++ b/libclamav/htmlnorm.h
@@ -34,11 +34,11 @@ typedef struct m_area_tag {
 	unsigned char *buffer;
 	off_t length;
 	off_t offset;
-	struct F_MAP *map;
+	fmap_t *map;
 } m_area_t;
 
 int html_normalise_mem(unsigned char *in_buff, off_t in_size, const char *dirname, tag_arguments_t *hrefs,const struct cli_dconf* dconf);
-int html_normalise_map(struct F_MAP *map, const char *dirname, tag_arguments_t *hrefs, const struct cli_dconf* dconf);
+int html_normalise_map(fmap_t *map, const char *dirname, tag_arguments_t *hrefs, const struct cli_dconf* dconf);
 void html_tag_arg_free(tag_arguments_t *tags);
 int html_screnc_decode(int fd, const char *dirname);
 void html_tag_arg_add(tag_arguments_t *tags, const char *tag, char *value);
diff --git a/libclamav/ishield.c b/libclamav/ishield.c
index 76667ac..2346897 100644
--- a/libclamav/ishield.c
+++ b/libclamav/ishield.c
@@ -197,7 +197,7 @@ int cli_scanishield_msi(cli_ctx *ctx, off_t off) {
     uint8_t *buf;
     unsigned int fcount, scanned = 0;
     int ret;
-    struct F_MAP *map = *ctx->fmap;
+    fmap_t *map = *ctx->fmap;
 
     cli_dbgmsg("in ishield-msi\n");
     if(!(buf = fmap_need_off_once(map, off, 0x20))) {
@@ -343,7 +343,7 @@ int cli_scanishield(cli_ctx *ctx, off_t off, size_t sz) {
     long fsize;
     off_t coff = off;
     struct IS_CABSTUFF c = { NULL, -1, 0, 0 };
-    struct F_MAP *map = *ctx->fmap;
+    fmap_t *map = *ctx->fmap;
 
     while(ret == CL_CLEAN) {
 	fname = fmap_need_offstr(map, coff, 2048);
@@ -434,7 +434,7 @@ int cli_scanishield(cli_ctx *ctx, off_t off, size_t sz) {
 static int is_dump_and_scan(cli_ctx *ctx, off_t off, size_t fsize) {
     char *fname, *buf;
     int ofd, ret = CL_CLEAN;
-    struct F_MAP *map = *ctx->fmap;
+    fmap_t *map = *ctx->fmap;
 
     if(!fsize) {
 	cli_dbgmsg("ishield: skipping empty file\n");
@@ -480,7 +480,7 @@ static int is_parse_hdr(cli_ctx *ctx, struct IS_CABSTUFF *c) {
     unsigned int off, i, scanned = 0;
     int ret = CL_BREAK;
     char hash[33], *hdr;
-    struct F_MAP *map = *ctx->fmap;
+    fmap_t *map = *ctx->fmap;
     size_t mp_hdrsz;
 
     struct IS_HDR *h1;
@@ -501,7 +501,7 @@ static int is_parse_hdr(cli_ctx *ctx, struct IS_CABSTUFF *c) {
     objs = (struct IS_OBJECTS *)fmap_need_ptr(map, hdr + h1_data_off, sizeof(*objs));
     if(!objs) {
         cli_dbgmsg("is_parse_hdr: not enough room for OBJECTS\n");
-        fmunmap(map);
+        funmap(map);
         return CL_CLEAN;
     }
 
@@ -509,7 +509,7 @@ static int is_parse_hdr(cli_ctx *ctx, struct IS_CABSTUFF *c) {
                h1->magic, h1->unk1, h1->unk2, h1_data_off, h1->data_sz);
     if(le32_to_host(h1->magic) != 0x28635349) {
         cli_dbgmsg("is_parse_hdr: bad magic. wrong version?\n");
-        fmunmap(map);
+        funmap(map);
         return CL_CLEAN;
     }
 
@@ -680,7 +680,7 @@ static int is_extract_cab(cli_ctx *ctx, uint64_t off, uint64_t size, uint64_t cs
     z_stream z;
     uint64_t outsz = 0;
     int success = 0;
-    struct F_MAP *map = *ctx->fmap;
+    fmap_t *map = *ctx->fmap;
 
     if(!(outbuf = cli_malloc(IS_CABBUFSZ)))
 	return CL_EMEM;
diff --git a/libclamav/libclamav.map b/libclamav/libclamav.map
index 6eba55b..dba0127 100644
--- a/libclamav/libclamav.map
+++ b/libclamav/libclamav.map
@@ -156,7 +156,7 @@ CLAMAV_PRIVATE {
     cli_bytecode_context_getresult_int;
     cli_bytecode_context_clear;
     fmap;
-    fmunmap;
+    funmap;
   local:
     *;
 };
diff --git a/libclamav/macho.c b/libclamav/macho.c
index 218ef6f..5caeed6 100644
--- a/libclamav/macho.c
+++ b/libclamav/macho.c
@@ -213,7 +213,7 @@ int cli_scanmacho(cli_ctx *ctx, struct cli_exe_info *fileinfo)
 	unsigned int arch = 0, ep = 0, err;
 	struct cli_exe_section *sections = NULL;
 	char name[16];
-	struct F_MAP *map = *ctx->fmap;
+	fmap_t *map = *ctx->fmap;
 	ssize_t at;
 
     if(fileinfo)
@@ -501,7 +501,7 @@ int cli_scanmacho(cli_ctx *ctx, struct cli_exe_info *fileinfo)
     }
 }
 
-int cli_machoheader(struct F_MAP *map, struct cli_exe_info *fileinfo)
+int cli_machoheader(fmap_t *map, struct cli_exe_info *fileinfo)
 {
     cli_ctx ctx;
     ctx.fmap = &map;
@@ -516,7 +516,7 @@ int cli_scanmacho_unibin(cli_ctx *ctx)
 	int ret = CL_CLEAN;
 	struct stat sb;
 	off_t pos;
-	struct F_MAP *map = *ctx->fmap;
+	fmap_t *map = *ctx->fmap;
 	ssize_t at;
 
     if(fmap_readn(map, &fat_header, 0, sizeof(fat_header)) != sizeof(fat_header)) {
diff --git a/libclamav/macho.h b/libclamav/macho.h
index edf44f0..426ee1b 100644
--- a/libclamav/macho.h
+++ b/libclamav/macho.h
@@ -26,7 +26,7 @@
 #include "fmap.h"
 
 int cli_scanmacho(cli_ctx *ctx, struct cli_exe_info *fileinfo);
-int cli_machoheader(struct F_MAP *map, struct cli_exe_info *fileinfo);
+int cli_machoheader(fmap_t *map, struct cli_exe_info *fileinfo);
 int cli_scanmacho_unibin(cli_ctx *ctx);
 
 #endif
diff --git a/libclamav/matcher-ac.c b/libclamav/matcher-ac.c
index 7646195..5d0f64b 100644
--- a/libclamav/matcher-ac.c
+++ b/libclamav/matcher-ac.c
@@ -854,7 +854,7 @@ int cli_ac_initdata(struct cli_ac_data *data, uint32_t partsigs, uint32_t lsigs,
     return CL_SUCCESS;
 }
 
-int cli_ac_caloff(const struct cli_matcher *root, struct cli_ac_data *data, struct F_MAP *map)
+int cli_ac_caloff(const struct cli_matcher *root, struct cli_ac_data *data, fmap_t *map)
 {
 	int ret;
 	unsigned int i;
diff --git a/libclamav/matcher-ac.h b/libclamav/matcher-ac.h
index 90d9816..1bc5bab 100644
--- a/libclamav/matcher-ac.h
+++ b/libclamav/matcher-ac.h
@@ -87,7 +87,7 @@ void cli_ac_freedata(struct cli_ac_data *data);
 int cli_ac_scanbuff(const unsigned char *buffer, uint32_t length, const char **virname, void **customdata, struct cli_ac_result **res, const struct cli_matcher *root, struct cli_ac_data *mdata, uint32_t offset, cli_file_t ftype, struct cli_matched_type **ftoffset, unsigned int mode, const cli_ctx *ctx);
 int cli_ac_buildtrie(struct cli_matcher *root);
 int cli_ac_init(struct cli_matcher *root, uint8_t mindepth, uint8_t maxdepth);
-int cli_ac_caloff(const struct cli_matcher *root, struct cli_ac_data *data, struct F_MAP *map);
+int cli_ac_caloff(const struct cli_matcher *root, struct cli_ac_data *data, fmap_t *map);
 void cli_ac_free(struct cli_matcher *root);
 int cli_ac_addsig(struct cli_matcher *root, const char *virname, const char *hexsig, uint32_t sigid, uint16_t parts, uint16_t partno, uint16_t rtype, uint16_t type, uint32_t mindist, uint32_t maxdist, const char *offset, const uint32_t *lsigid, unsigned int options);
 
diff --git a/libclamav/matcher-bm.c b/libclamav/matcher-bm.c
index caf4972..b32727a 100644
--- a/libclamav/matcher-bm.c
+++ b/libclamav/matcher-bm.c
@@ -145,7 +145,7 @@ static int qcompare(const void *a, const void *b)
     return *(const uint32_t *)a - *(const uint32_t *)b;
 }
 
-int cli_bm_initoff(const struct cli_matcher *root, struct cli_bm_off *data, struct F_MAP *map)
+int cli_bm_initoff(const struct cli_matcher *root, struct cli_bm_off *data, fmap_t *map)
 {
 	int ret;
 	unsigned int i;
@@ -238,7 +238,7 @@ void cli_bm_free(struct cli_matcher *root)
     }
 }
 
-int cli_bm_scanbuff(const unsigned char *buffer, uint32_t length, const char **virname, const struct cli_matcher *root, uint32_t offset, struct F_MAP *map, struct cli_bm_off *offdata)
+int cli_bm_scanbuff(const unsigned char *buffer, uint32_t length, const char **virname, const struct cli_matcher *root, uint32_t offset, fmap_t *map, struct cli_bm_off *offdata)
 {
 	uint32_t i, j, off, off_min, off_max;
 	uint8_t found, pchain, shift;
diff --git a/libclamav/matcher-bm.h b/libclamav/matcher-bm.h
index b6a0059..a1ec133 100644
--- a/libclamav/matcher-bm.h
+++ b/libclamav/matcher-bm.h
@@ -42,9 +42,9 @@ struct cli_bm_off {
 
 int cli_bm_addpatt(struct cli_matcher *root, struct cli_bm_patt *pattern, const char *offset);
 int cli_bm_init(struct cli_matcher *root);
-int cli_bm_initoff(const struct cli_matcher *root, struct cli_bm_off *data, struct F_MAP *map);
+int cli_bm_initoff(const struct cli_matcher *root, struct cli_bm_off *data, fmap_t *map);
 void cli_bm_freeoff(struct cli_bm_off *data);
-int cli_bm_scanbuff(const unsigned char *buffer, uint32_t length, const char **virname, const struct cli_matcher *root, uint32_t offset, struct F_MAP *map, struct cli_bm_off *offdata);
+int cli_bm_scanbuff(const unsigned char *buffer, uint32_t length, const char **virname, const struct cli_matcher *root, uint32_t offset, fmap_t *map, struct cli_bm_off *offdata);
 void cli_bm_free(struct cli_matcher *root);
 
 #endif
diff --git a/libclamav/matcher.c b/libclamav/matcher.c
index d91cb3e..e2acdf4 100644
--- a/libclamav/matcher.c
+++ b/libclamav/matcher.c
@@ -105,9 +105,9 @@ int cli_scanbuff(const unsigned char *buffer, uint32_t length, uint32_t offset,
  * offdata[2]: max shift
  * offdata[3]: section number
  */
-int cli_caloff(const char *offstr, struct cli_target_info *info, struct F_MAP *map, unsigned int target, uint32_t *offdata, uint32_t *offset_min, uint32_t *offset_max)
+int cli_caloff(const char *offstr, struct cli_target_info *info, fmap_t *map, unsigned int target, uint32_t *offdata, uint32_t *offset_min, uint32_t *offset_max)
 {
-	int (*einfo)(struct F_MAP *, struct cli_exe_info *) = NULL;
+	int (*einfo)(fmap_t *, struct cli_exe_info *) = NULL;
 	char offcpy[65];
 	unsigned int n, val;
 	char *pt;
@@ -305,11 +305,11 @@ int cli_checkfp(int fd, cli_ctx *ctx)
 int cli_scandesc(int desc, cli_ctx *ctx, cli_file_t ftype, uint8_t ftonly, struct cli_matched_type **ftoffset, unsigned int acmode)
 {
     int ret = CL_EMEM;
-    struct F_MAP *map = *ctx->fmap;
+    fmap_t *map = *ctx->fmap;
 
     if((*ctx->fmap = fmap(desc, 0, 0))) {
 	ret = cli_fmap_scandesc(ctx, ftype, ftonly, ftoffset, acmode);
-	fmunmap(*ctx->fmap);
+	funmap(*ctx->fmap);
     }
     *ctx->fmap = map;
     return ret;
@@ -328,7 +328,7 @@ int cli_fmap_scandesc(cli_ctx *ctx, cli_file_t ftype, uint8_t ftonly, struct cli
 	cli_md5_ctx md5ctx;
 	unsigned char digest[16];
 	struct cli_matcher *groot = NULL, *troot = NULL;
-	struct F_MAP *map = *ctx->fmap;
+	fmap_t *map = *ctx->fmap;
 
     if(!ctx->engine) {
 	cli_errmsg("cli_scandesc: engine == NULL\n");
diff --git a/libclamav/matcher.h b/libclamav/matcher.h
index ff3d9e9..e9166c2 100644
--- a/libclamav/matcher.h
+++ b/libclamav/matcher.h
@@ -142,7 +142,7 @@ int cli_scanbuff(const unsigned char *buffer, uint32_t length, uint32_t offset,
 int cli_scandesc(int desc, cli_ctx *ctx, cli_file_t ftype, uint8_t ftonly, struct cli_matched_type **ftoffset, unsigned int acmode);
 int cli_fmap_scandesc(cli_ctx *ctx, cli_file_t ftype, uint8_t ftonly, struct cli_matched_type **ftoffset, unsigned int acmode);
 
-int cli_caloff(const char *offstr, struct cli_target_info *info, struct F_MAP *map, unsigned int target, uint32_t *offdata, uint32_t *offset_min, uint32_t *offset_max);
+int cli_caloff(const char *offstr, struct cli_target_info *info, fmap_t *map, unsigned int target, uint32_t *offdata, uint32_t *offset_min, uint32_t *offset_max);
 
 int cli_checkfp(int fd, cli_ctx *ctx);
 
diff --git a/libclamav/mbox.c b/libclamav/mbox.c
index 3b5ba57..de48063 100644
--- a/libclamav/mbox.c
+++ b/libclamav/mbox.c
@@ -218,7 +218,7 @@ typedef	struct	mbox_ctx {
 #endif
 
 static	int	cli_parse_mbox(const char *dir, int desc, cli_ctx *ctx);
-static	message	*parseEmailFile(struct F_MAP *map, size_t *at, const table_t *rfc821Table, const char *firstLine, const char *dir);
+static	message	*parseEmailFile(fmap_t *map, size_t *at, const table_t *rfc821Table, const char *firstLine, const char *dir);
 static	message	*parseEmailHeaders(message *m, const table_t *rfc821Table);
 static	int	parseEmailHeader(message *m, const char *line, const table_t *rfc821Table);
 static	mbox_status	parseEmailBody(message *messageIn, text *textIn, mbox_ctx *mctx, unsigned int recursion_level);
@@ -233,7 +233,7 @@ static	char	*rfc2047(const char *in);
 static	char	*rfc822comments(const char *in, char *out);
 static	int	rfc1341(message *m, const char *dir);
 static	bool	usefulHeader(int commandNumber, const char *cmd);
-static	char	*getline_from_mbox(char *buffer, size_t len, struct F_MAP *map, size_t *at);
+static	char	*getline_from_mbox(char *buffer, size_t len, fmap_t *map, size_t *at);
 static	bool	isBounceStart(mbox_ctx *mctx, const char *line);
 static	bool	exportBinhexMessage(mbox_ctx *mctx, message *m);
 static	int	exportBounceMessage(mbox_ctx *ctx, text *start);
@@ -370,7 +370,7 @@ cli_parse_mbox(const char *dir, int desc, cli_ctx *ctx)
 	mbox_ctx mctx;
 	static table_t *rfc821, *subtype;
 	size_t at = 0;
-	struct F_MAP *map = *ctx->fmap;
+	fmap_t *map = *ctx->fmap;
 
 	cli_dbgmsg("in mbox()\n");
 
@@ -597,7 +597,7 @@ cli_parse_mbox(const char *dir, int desc, cli_ctx *ctx)
  * handled ungracefully...
  */
 static message *
-parseEmailFile(struct F_MAP *map, size_t *at, const table_t *rfc821, const char *firstLine, const char *dir)
+parseEmailFile(fmap_t *map, size_t *at, const table_t *rfc821, const char *firstLine, const char *dir)
 {
 	bool inHeader = TRUE;
 	bool bodyIsEmpty = TRUE;
@@ -3261,7 +3261,7 @@ usefulHeader(int commandNumber, const char *cmd)
  * Like fgets but cope with end of line by "\n", "\r\n", "\n\r", "\r"
  */
 static char *
-getline_from_mbox(char *buffer, size_t len, struct F_MAP *map, size_t *at)
+getline_from_mbox(char *buffer, size_t len, fmap_t *map, size_t *at)
 {
     char *src, *cursrc, *curbuf;
     size_t i;
diff --git a/libclamav/nsis/nulsft.c b/libclamav/nsis/nulsft.c
index ec749c8..704121d 100644
--- a/libclamav/nsis/nulsft.c
+++ b/libclamav/nsis/nulsft.c
@@ -75,7 +75,7 @@ struct nsis_st {
 /*   z_stream z; */
   nsis_z_stream z;
   unsigned char *freeme;
-  struct F_MAP *map;
+  fmap_t *map;
   char ofn[1024];
 };
 
@@ -451,13 +451,13 @@ static int nsis_headers(struct nsis_st *n, cli_ctx *ctx) {
   /* Guess if solid */
   for (i=0, pos=0;pos < n->asz-4;i++) {
     int32_t nextsz;
-    if (!(buf = fmap_need_ptr_once(n->map, buf, 4))) return CL_EREAD;
+    if (!(buf = fmap_need_ptr_once(n->map, (void *)buf, 4))) return CL_EREAD;
     nextsz=cli_readint32(buf);
     if (!i) n->comp = nsis_detcomp(buf);
     buf += 4;
     if (nextsz&0x80000000) {
       nextsz&=~0x80000000;
-      if (!(buf = fmap_need_ptr_once(n->map, buf, 4))) return CL_EREAD;
+      if (!(buf = fmap_need_ptr_once(n->map, (void *)buf, 4))) return CL_EREAD;
       comps[nsis_detcomp(buf)]++;
       nextsz-=4;
       pos+=4;
@@ -537,7 +537,7 @@ int cli_scannulsft(int desc, cli_ctx *ctx, off_t offset) {
 	ret = CL_CLEAN;
 
     nsis_shutdown(&nsist);
-    fmunmap(nsist.map);
+    funmap(nsist.map);
 
     if(!ctx->engine->keeptmp)
         cli_rmdirs(nsist.dir);
diff --git a/libclamav/ole2_extract.c b/libclamav/ole2_extract.c
index b0c55c9..71ce49d 100644
--- a/libclamav/ole2_extract.c
+++ b/libclamav/ole2_extract.c
@@ -94,7 +94,7 @@ typedef struct ole2_header_tag
 	off_t m_length;
 	bitset_t *bitset;
 	struct uniq *U;
-	struct F_MAP *map;
+	fmap_t *map;
 	int has_vba;
 } ole2_header_t;
 
@@ -893,7 +893,7 @@ int cli_ole2_extract(const char *dirname, cli_ctx *ctx, struct uniq **vba)
 	/* size of header - size of other values in struct */
 	hdr_size = sizeof(struct ole2_header_tag) - sizeof(int32_t) - sizeof(uint32_t) -
 			sizeof(off_t) - sizeof(bitset_t *) -
-			sizeof(struct uniq *) - sizeof(int) - sizeof(struct F_MAP *);
+			sizeof(struct uniq *) - sizeof(int) - sizeof(fmap_t *);
 
 	if((*ctx->fmap)->len < hdr_size) {
 	    return CL_CLEAN;
diff --git a/libclamav/others.h b/libclamav/others.h
index 8ce23aa..b33e104 100644
--- a/libclamav/others.h
+++ b/libclamav/others.h
@@ -110,7 +110,7 @@ typedef struct {
     unsigned int found_possibly_unwanted;
     cli_file_t container_type; /* FIXME: to be made into a stack or array - see bb#1579 & bb#1293 */
     struct cli_dconf *dconf;
-    struct F_MAP **fmap;
+    fmap_t **fmap;
 } cli_ctx;
 
 struct cl_engine {
diff --git a/libclamav/pdf.c b/libclamav/pdf.c
index cca98f9..95e6a4e 100644
--- a/libclamav/pdf.c
+++ b/libclamav/pdf.c
@@ -81,7 +81,7 @@ cli_pdf(const char *dir, cli_ctx *ctx, off_t offset)
 	table_t *md5table;
 	int printed_predictor_message, printed_embedded_font_message, rc;
 	unsigned int files;
-	struct F_MAP *map = *ctx->fmap;
+	fmap_t *map = *ctx->fmap;
 	int opt_failed = 0;
 
 	cli_dbgmsg("in cli_pdf(%s)\n", dir);
diff --git a/libclamav/pe.c b/libclamav/pe.c
index c6a6189..6b8e467 100644
--- a/libclamav/pe.c
+++ b/libclamav/pe.c
@@ -290,7 +290,7 @@ static off_t cli_seeksect(int fd, struct cli_exe_section *s) {
     return ret+1;
 }
 
-static unsigned int cli_md5sect(struct F_MAP *map, struct cli_exe_section *s, unsigned char *digest) {
+static unsigned int cli_md5sect(fmap_t *map, struct cli_exe_section *s, unsigned char *digest) {
     void *hashme;
     cli_md5_ctx md5;
 
@@ -311,7 +311,7 @@ static unsigned int cli_md5sect(struct F_MAP *map, struct cli_exe_section *s, un
     return 1;
 }
 
-static void cli_parseres_special(uint32_t base, uint32_t rva, struct F_MAP *map, struct cli_exe_section *exe_sections, uint16_t nsections, size_t fsize, uint32_t hdr_size, unsigned int level, uint32_t type, unsigned int *maxres, struct swizz_stats *stats) {
+static void cli_parseres_special(uint32_t base, uint32_t rva, fmap_t *map, struct cli_exe_section *exe_sections, uint16_t nsections, size_t fsize, uint32_t hdr_size, unsigned int level, uint32_t type, unsigned int *maxres, struct swizz_stats *stats) {
     unsigned int err = 0, i;
     uint8_t *resdir;
     uint8_t *entry, *oentry;
@@ -428,7 +428,7 @@ int cli_scanpe(cli_ctx *ctx)
 	struct cli_matcher *md5_sect;
 	char timestr[32];
 	struct pe_image_data_dir *dirs;
-	struct F_MAP *map;
+	fmap_t *map;
 
 
     if(!ctx) {
@@ -2128,7 +2128,7 @@ int cli_scanpe(cli_ctx *ctx)
     return CL_CLEAN;
 }
 
-int cli_peheader(struct F_MAP *map, struct cli_exe_info *peinfo)
+int cli_peheader(fmap_t *map, struct cli_exe_info *peinfo)
 {
 	uint16_t e_magic; /* DOS signature ("MZ") */
 	uint32_t e_lfanew; /* address of new exe header */
diff --git a/libclamav/pe.h b/libclamav/pe.h
index 14a6b20..88209ac 100644
--- a/libclamav/pe.h
+++ b/libclamav/pe.h
@@ -131,6 +131,6 @@ struct pe_image_section_hdr {
 
 int cli_scanpe(cli_ctx *ctx);
 
-int cli_peheader(struct F_MAP *map, struct cli_exe_info *peinfo);
+int cli_peheader(fmap_t *map, struct cli_exe_info *peinfo);
 
 #endif
diff --git a/libclamav/scanners.c b/libclamav/scanners.c
index 8dd6f49..230659e 100644
--- a/libclamav/scanners.c
+++ b/libclamav/scanners.c
@@ -439,7 +439,7 @@ static int cli_scangzip(cli_ctx *ctx)
 	char *tmpname;
 	z_stream z;
 	size_t at = 0;
-	struct F_MAP *map = *ctx->fmap;
+	fmap_t *map = *ctx->fmap;
  	
     cli_dbgmsg("in cli_scangzip()\n");
 
@@ -904,7 +904,7 @@ static int cli_scanhtml(cli_ctx *ctx)
 {
 	char *tempname, fullname[1024];
 	int ret=CL_CLEAN, fd;
-	struct F_MAP *map = *ctx->fmap;
+	fmap_t *map = *ctx->fmap;
 
     cli_dbgmsg("in cli_scanhtml()\n");
 
@@ -985,7 +985,7 @@ static int cli_scanscript(cli_ctx *ctx)
 	struct cli_matcher *groot = ctx->engine->root[0];
 	struct cli_ac_data gmdata, tmdata;
 	struct cli_ac_data *mdata[2];
-	struct F_MAP *map = *ctx->fmap;
+	fmap_t *map = *ctx->fmap;
 	size_t at = 0;
 
 	cli_dbgmsg("in cli_scanscript()\n");
@@ -1069,7 +1069,7 @@ static int cli_scanhtml_utf16(cli_ctx *ctx)
 	char *tempname, *decoded, *buff;
 	int ret = CL_CLEAN, fd, bytes;
 	size_t at = 0;
-	struct F_MAP *map = *ctx->fmap;
+	fmap_t *map = *ctx->fmap;
 
     cli_dbgmsg("in cli_scanhtml_utf16()\n");
 
@@ -1110,7 +1110,7 @@ static int cli_scanhtml_utf16(cli_ctx *ctx)
     *ctx->fmap = fmap(fd, 0, 0);
     if(*ctx->fmap) {
 	ret = cli_scanhtml(ctx);
-	fmunmap(*ctx->fmap);
+	funmap(*ctx->fmap);
     } else
 	cli_errmsg("cli_scanhtml_utf16: fmap of %s failed\n", tempname);
 
@@ -1685,7 +1685,7 @@ static int cli_scanraw(cli_ctx *ctx, cli_file_t type, uint8_t typercg, cli_file_
 	uint32_t lastzip, lastrar;
 	struct cli_exe_info peinfo;
 	unsigned int acmode = AC_SCAN_VIR, break_loop = 0;
-	struct F_MAP *map = *ctx->fmap;
+	fmap_t *map = *ctx->fmap;
 
 
     if(ctx->engine->maxreclevel && ctx->recursion >= ctx->engine->maxreclevel)
@@ -1885,7 +1885,7 @@ int cli_magic_scandesc(int desc, cli_ctx *ctx)
 	    cli_dbgmsg("Raw mode: No support for special files\n");
 	if((ret = cli_fmap_scandesc(ctx, 0, 0, NULL, AC_SCAN_VIR)) == CL_VIRUS)
 	    cli_dbgmsg("%s found in descriptor %d\n", *ctx->virname, desc);
-	fmunmap(*ctx->fmap);
+	funmap(*ctx->fmap);
 	ctx->fmap--; 
 	return ret;
     }
@@ -1893,7 +1893,7 @@ int cli_magic_scandesc(int desc, cli_ctx *ctx)
     type = cli_filetype2(*ctx->fmap, ctx->engine); /* FIXMEFMAP: port to fmap */
     if(type == CL_TYPE_ERROR) {
 	cli_dbgmsg("cli_magic_scandesc: cli_filetype2 returned CL_TYPE_ERROR\n");
-	fmunmap(*ctx->fmap);
+	funmap(*ctx->fmap);
 	ctx->fmap--; 
 	return CL_EREAD;
     }
@@ -1901,7 +1901,7 @@ int cli_magic_scandesc(int desc, cli_ctx *ctx)
 
     if(type != CL_TYPE_IGNORED && ctx->engine->sdb) {
 	if((ret = cli_scanraw(ctx, type, 0, &dettype)) == CL_VIRUS) {
-	    fmunmap(*ctx->fmap);
+	    funmap(*ctx->fmap);
 	    ctx->fmap--; 
 	    return CL_VIRUS;
 	}
@@ -2108,7 +2108,7 @@ int cli_magic_scandesc(int desc, cli_ctx *ctx)
     ctx->container_type = current_container;
 
     if(ret == CL_VIRUS) {
-	fmunmap(*ctx->fmap);
+	funmap(*ctx->fmap);
 	ctx->fmap--; 
 	return CL_VIRUS;
     }
@@ -2123,7 +2123,7 @@ int cli_magic_scandesc(int desc, cli_ctx *ctx)
     /* CL_TYPE_HTML: raw HTML files are not scanned, unless safety measure activated via DCONF */
     if(type != CL_TYPE_IGNORED && (type != CL_TYPE_HTML || !(DCONF_DOC & DOC_CONF_HTML_SKIPRAW)) && !ctx->engine->sdb) {
 	if(cli_scanraw(ctx, type, typercg, &dettype) == CL_VIRUS) {
-	    fmunmap(*ctx->fmap);
+	    funmap(*ctx->fmap);
 	    ctx->fmap--; 
 	    return CL_VIRUS;
 	}
@@ -2155,7 +2155,7 @@ int cli_magic_scandesc(int desc, cli_ctx *ctx)
 	    break;
     }
     ctx->recursion--;
-    fmunmap(*ctx->fmap);
+    funmap(*ctx->fmap);
     ctx->fmap--;
 
     switch(ret) {
@@ -2183,7 +2183,7 @@ int cl_scandesc(int desc, const char **virname, unsigned long int *scanned, cons
     ctx.found_possibly_unwanted = 0;
     ctx.container_type = 0;
     ctx.dconf = (struct cli_dconf *) engine->dconf;
-    ctx.fmap = cli_calloc(sizeof(struct F_MAP *), ctx.engine->maxreclevel + 1);
+    ctx.fmap = cli_calloc(sizeof(fmap_t *), ctx.engine->maxreclevel + 1);
     if(!ctx.fmap)
 	return CL_EMEM;
     ctx.fmap--;
diff --git a/libclamav/unzip.c b/libclamav/unzip.c
index 2f9697e..ff670f7 100644
--- a/libclamav/unzip.c
+++ b/libclamav/unzip.c
@@ -303,7 +303,7 @@ static int unz(uint8_t *src, uint32_t csize, uint32_t usize, uint16_t method, ui
   return ret;
 }
 
-static unsigned int lhdr(struct F_MAP *map, uint32_t loff,uint32_t zsize, unsigned int *fu, unsigned int fc, uint8_t *ch, int *ret, cli_ctx *ctx, char *tmpd) {
+static unsigned int lhdr(fmap_t *map, uint32_t loff,uint32_t zsize, unsigned int *fu, unsigned int fc, uint8_t *ch, int *ret, cli_ctx *ctx, char *tmpd) {
   uint8_t *lh, *zip;
   char name[256];
   uint32_t csize, usize;
@@ -438,7 +438,7 @@ static unsigned int lhdr(struct F_MAP *map, uint32_t loff,uint32_t zsize, unsign
 }
 
 
-static unsigned int chdr(struct F_MAP *map, uint32_t coff, uint32_t zsize, unsigned int *fu, unsigned int fc, int *ret, cli_ctx *ctx, char *tmpd) {
+static unsigned int chdr(fmap_t *map, uint32_t coff, uint32_t zsize, unsigned int *fu, unsigned int fc, int *ret, cli_ctx *ctx, char *tmpd) {
   char name[256];
   int last = 0;
   int8_t *ch;
@@ -491,7 +491,7 @@ int cli_unzip(cli_ctx *ctx) {
   unsigned int fc=0, fu=0;
   int ret=CL_CLEAN;
   uint32_t fsize, lhoff = 0, coff = 0;
-  struct F_MAP *map = *ctx->fmap;
+  fmap_t *map = *ctx->fmap;
   char *tmpd, *ptr;
 
   cli_dbgmsg("in cli_unzip\n");
@@ -556,7 +556,7 @@ int cli_unzip_single(cli_ctx *ctx, off_t lhoffl) {
   int ret=CL_CLEAN;
   unsigned int fu=0;
   uint32_t fsize;
-  struct F_MAP *map = *ctx->fmap;
+  fmap_t *map = *ctx->fmap;
 
   cli_dbgmsg("in cli_unzip_single\n");
   fsize = (uint32_t)(map->len - lhoffl);
diff --git a/libclamav/uuencode.c b/libclamav/uuencode.c
index 5c61d28..d679762 100644
--- a/libclamav/uuencode.c
+++ b/libclamav/uuencode.c
@@ -50,7 +50,7 @@ static	char	const	rcsid[] = "$Id: uuencode.c,v 1.8 2006/12/11 11:55:11 njh Exp $
 #define	RFC2821LENGTH	1000
 
 int
-cli_uuencode(const char *dir, struct F_MAP *map)
+cli_uuencode(const char *dir, fmap_t *map)
 {
 	int i;
 	message *m;
@@ -89,7 +89,7 @@ cli_uuencode(const char *dir, struct F_MAP *map)
  * Return < 0 for failure
  */
 int
-uudecodeFile(message *m, const char *firstline, const char *dir, struct F_MAP *map, size_t *at)
+uudecodeFile(message *m, const char *firstline, const char *dir, fmap_t *map, size_t *at)
 {
 	fileblob *fb;
 	char buffer[RFC2821LENGTH + 1];
diff --git a/libclamav/uuencode.h b/libclamav/uuencode.h
index a60a8d8..7c95a6c 100644
--- a/libclamav/uuencode.h
+++ b/libclamav/uuencode.h
@@ -23,7 +23,7 @@
 
 #include "fmap.h"
 
-int	cli_uuencode(const char *dir, struct F_MAP *map);
-int	uudecodeFile(message *m, const char *firstline, const char *dir, struct F_MAP *map, size_t *at);
+int	cli_uuencode(const char *dir, fmap_t *map);
+int	uudecodeFile(message *m, const char *firstline, const char *dir, fmap_t *map, size_t *at);
 
 #endif
diff --git a/sigtool/sigtool.c b/sigtool/sigtool.c
index b260035..e3e5ce5 100644
--- a/sigtool/sigtool.c
+++ b/sigtool/sigtool.c
@@ -183,7 +183,7 @@ static int md5sig(const struct optstruct *opts, unsigned int mdb)
 static int htmlnorm(const struct optstruct *opts)
 {
 	int fd;
-	struct F_MAP *map;
+	fmap_t *map;
 
     if((fd = open(optget(opts, "html-normalise")->strarg, O_RDONLY)) == -1) {
 	mprintf("!htmlnorm: Can't open file %s\n", optget(opts, "html-normalise")->strarg);
@@ -192,7 +192,7 @@ static int htmlnorm(const struct optstruct *opts)
 
     if((map = fmap(fd, 0, 0))) {
 	html_normalise_map(map, ".", NULL, NULL);
-	fmunmap(map);
+	funmap(map);
     } else
 	mprintf("!fmap failed\n");
 	
diff --git a/sigtool/vba.c b/sigtool/vba.c
index 2c9b4d0..1b6a5da 100644
--- a/sigtool/vba.c
+++ b/sigtool/vba.c
@@ -1030,7 +1030,7 @@ static int sigtool_scandir (const char *dirname, int hex_output)
 				    sigtool_vba_scandir (dir, hex_output, vba);
 				cli_rmdirs (dir);
 				free (dir);
-				fmunmap(*ctx.fmap);
+				funmap(*ctx.fmap);
 				free(ctx.fmap);
 				close(desc);
 			    }
diff --git a/unit_tests/check_htmlnorm.c b/unit_tests/check_htmlnorm.c
index 902f3f7..24edd7f 100644
--- a/unit_tests/check_htmlnorm.c
+++ b/unit_tests/check_htmlnorm.c
@@ -137,7 +137,7 @@ START_TEST (test_htmlnorm_api)
 	fail_unless(cli_rmdirs(dir) == 0, "rmdirs failed");
 	html_tag_arg_free(&hrefs);
 
-	fmunmap(map);
+	funmap(map);
 
 	close(fd);
 }

-- 
Debian repository for ClamAV



More information about the Pkg-clamav-commits mailing list