~ubuntu-branches/ubuntu/maverick/clamav/maverick-backports

« back to all changes in this revision

Viewing changes to libclamav/fmap.h

  • Committer: Bazaar Package Importer
  • Author(s): Stephen Gran, Stephen Gran, Michael Tautschnig
  • Date: 2010-04-26 21:41:18 UTC
  • mfrom: (2.1.6 squeeze)
  • Revision ID: james.westby@ubuntu.com-20100426214118-i6lo606wnh7ywfj6
Tags: 0.96+dfsg-4
[ Stephen Gran ]
* Fixed typo in clamav-milter's postinst

[ Michael Tautschnig ]
* Fixed typo in clamav-freshclam's postinst (closes: #579271)
* Debconf translation updates
  - Portuguese (closes: #579068)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 *  Copyright (C) 2009 Sourcefire, Inc.
 
3
 *
 
4
 *  Authors: aCaB <acab@clamav.net>
 
5
 *
 
6
 *  This program is free software; you can redistribute it and/or modify
 
7
 *  it under the terms of the GNU General Public License version 2 as
 
8
 *  published by the Free Software Foundation.
 
9
 *
 
10
 *  This program is distributed in the hope that it will be useful,
 
11
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 
12
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
13
 *  GNU General Public License for more details.
 
14
 *
 
15
 *  You should have received a copy of the GNU General Public License
 
16
 *  along with this program; if not, write to the Free Software
 
17
 *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
 
18
 *  MA 02110-1301, USA.
 
19
 */
 
20
 
 
21
#ifndef __FMAP_H
 
22
#define __FMAP_H
 
23
 
 
24
#ifdef HAVE_UNISTD_H
 
25
#include <unistd.h>
 
26
#endif
 
27
 
 
28
#include <time.h>
 
29
#include "cltypes.h"
 
30
 
 
31
typedef struct {
 
32
    int fd;
 
33
    unsigned short dumb;
 
34
    unsigned short dont_cache_flag;
 
35
    time_t mtime;
 
36
    size_t offset;
 
37
    size_t len;
 
38
    unsigned int pages;
 
39
    unsigned int hdrsz;
 
40
    unsigned int pgsz;
 
41
    unsigned int paged;
 
42
#ifdef _WIN32
 
43
    HANDLE fh;
 
44
    HANDLE mh;
 
45
    void *data;
 
46
#endif
 
47
    uint32_t placeholder_for_bitmap;
 
48
} fmap_t;
 
49
 
 
50
fmap_t *fmap(int fd, off_t offset, size_t len);
 
51
void funmap(fmap_t *m);
 
52
void *fmap_need_off(fmap_t *m, size_t at, size_t len);
 
53
void *fmap_need_off_once(fmap_t *m, size_t at, size_t len);
 
54
void *fmap_need_ptr(fmap_t *m, void *ptr, size_t len);
 
55
void *fmap_need_ptr_once(fmap_t *m, void *ptr, size_t len);
 
56
void fmap_unneed_off(fmap_t *m, size_t at, size_t len);
 
57
void fmap_unneed_ptr(fmap_t *m, void *ptr, size_t len);
 
58
int fmap_readn(fmap_t *m, void *dst, size_t at, size_t len);
 
59
void *fmap_need_str(fmap_t *m, void *ptr, size_t len_hint);
 
60
void *fmap_need_offstr(fmap_t *m, size_t at, size_t len_hint);
 
61
void *fmap_gets(fmap_t *m, char *dst, size_t *at, size_t max_len);
 
62
#endif