~louis/ubuntu/trusty/clamav/lp799623_fix_logrotate

« back to all changes in this revision

Viewing changes to libclamav/c++/llvm/include/llvm/Support/MemoryObject.h

  • Committer: Bazaar Package Importer
  • Author(s): Scott Kitterman
  • Date: 2010-03-12 11:30:04 UTC
  • mfrom: (0.41.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20100312113004-b0fop4bkycszdd0z
Tags: 0.96~rc1+dfsg-0ubuntu1
* New upstream RC - FFE (LP: #537636):
  - Add OfficialDatabaseOnly option to clamav-base.postinst.in
  - Add LocalSocketGroup option to clamav-base.postinst.in
  - Add LocalSocketMode option to clamav-base.postinst.in
  - Add CrossFilesystems option to clamav-base.postinst.in
  - Add ClamukoScannerCount option to clamav-base.postinst.in
  - Add BytecodeSecurity opiton to clamav-base.postinst.in
  - Add DetectionStatsHostID option to clamav-freshclam.postinst.in
  - Add Bytecode option to clamav-freshclam.postinst.in
  - Add MilterSocketGroup option to clamav-milter.postinst.in
  - Add MilterSocketMode option to clamav-milter.postinst.in
  - Add ReportHostname option to clamav-milter.postinst.in
  - Bump libclamav SO version to 6.1.0 in libclamav6.install
  - Drop clamdmon from clamav.examples (no longer shipped by upstream)
  - Drop libclamav.a from libclamav-dev.install (not built by upstream)
  - Update SO version for lintian override for libclamav6
  - Add new Bytecode Testing Tool, usr/bin/clambc, to clamav.install
  - Add build-depends on python and python-setuptools for new test suite
  - Update debian/copyright for the embedded copy of llvm (using the system
    llvm is not currently feasible)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
//===- MemoryObject.h - Abstract memory interface ---------------*- C++ -*-===//
 
2
//
 
3
//                     The LLVM Compiler Infrastructure
 
4
//
 
5
// This file is distributed under the University of Illinois Open Source
 
6
// License. See LICENSE.TXT for details.
 
7
//
 
8
//===----------------------------------------------------------------------===//
 
9
 
 
10
#ifndef MEMORYOBJECT_H
 
11
#define MEMORYOBJECT_H
 
12
 
 
13
#include "llvm/System/DataTypes.h"
 
14
 
 
15
namespace llvm {
 
16
 
 
17
/// MemoryObject - Abstract base class for contiguous addressable memory.
 
18
///   Necessary for cases in which the memory is in another process, in a
 
19
///   file, or on a remote machine.
 
20
///   All size and offset parameters are uint64_ts, to allow 32-bit processes
 
21
///   access to 64-bit address spaces.
 
22
class MemoryObject {
 
23
public:
 
24
  /// Destructor      - Override as necessary.
 
25
  virtual ~MemoryObject();
 
26
  
 
27
  /// getBase         - Returns the lowest valid address in the region.
 
28
  ///
 
29
  /// @result         - The lowest valid address.
 
30
  virtual uint64_t getBase() const = 0;
 
31
  
 
32
  /// getExtent       - Returns the size of the region in bytes.  (The region is
 
33
  ///                   contiguous, so the highest valid address of the region 
 
34
  ///                   is getBase() + getExtent() - 1).
 
35
  ///
 
36
  /// @result         - The size of the region.
 
37
  virtual uint64_t getExtent() const = 0;
 
38
  
 
39
  /// readByte        - Tries to read a single byte from the region.
 
40
  ///
 
41
  /// @param address  - The address of the byte, in the same space as getBase().
 
42
  /// @param ptr      - A pointer to a byte to be filled in.  Must be non-NULL.
 
43
  /// @result         - 0 if successful; -1 if not.  Failure may be due to a
 
44
  ///                   bounds violation or an implementation-specific error.
 
45
  virtual int readByte(uint64_t address, uint8_t* ptr) const = 0;
 
46
  
 
47
  /// readBytes       - Tries to read a contiguous range of bytes from the
 
48
  ///                   region, up to the end of the region.
 
49
  ///                   You should override this function if there is a quicker
 
50
  ///                   way than going back and forth with individual bytes.
 
51
  ///
 
52
  /// @param address  - The address of the first byte, in the same space as 
 
53
  ///                   getBase().
 
54
  /// @param size     - The maximum number of bytes to copy.
 
55
  /// @param buf      - A pointer to a buffer to be filled in.  Must be non-NULL
 
56
  ///                   and large enough to hold size bytes.
 
57
  /// @param copied   - A pointer to a nunber that is filled in with the number
 
58
  ///                   of bytes actually read.  May be NULL.
 
59
  /// @result         - 0 if successful; -1 if not.  Failure may be due to a
 
60
  ///                   bounds violation or an implementation-specific error.
 
61
  virtual int readBytes(uint64_t address,
 
62
                        uint64_t size,
 
63
                        uint8_t* buf,
 
64
                        uint64_t* copied) const;
 
65
};
 
66
 
 
67
}
 
68
 
 
69
#endif
 
70