24#ifndef LIBDPKG_BUFFER_H
25#define LIBDPKG_BUFFER_H
40#define DPKG_BUFFER_SIZE (32 * 1024)
42#define BUFFER_WRITE_VBUF 1
43#define BUFFER_WRITE_FD 2
44#define BUFFER_WRITE_NULL 3
46#define BUFFER_DIGEST_NULL 4
47#define BUFFER_DIGEST_MD5 5
49#define BUFFER_READ_FD 0
59# define buffer_md5(buf, hash, limit) \
60 buffer_digest(buf, hash, BUFFER_DIGEST_MD5, limit)
62# define fd_md5(fd, hash, limit, err) \
63 buffer_copy_IntPtr(fd, BUFFER_READ_FD, \
64 hash, BUFFER_DIGEST_MD5, \
65 NULL, BUFFER_WRITE_NULL, \
67# define fd_fd_copy(fd1, fd2, limit, err) \
68 buffer_copy_IntInt(fd1, BUFFER_READ_FD, \
69 NULL, BUFFER_DIGEST_NULL, \
70 fd2, BUFFER_WRITE_FD, \
72# define fd_fd_copy_and_md5(fd1, fd2, hash, limit, err) \
73 buffer_copy_IntInt(fd1, BUFFER_READ_FD, \
74 hash, BUFFER_DIGEST_MD5, \
75 fd2, BUFFER_WRITE_FD, \
77# define fd_vbuf_copy(fd, buf, limit, err) \
78 buffer_copy_IntPtr(fd, BUFFER_READ_FD, \
79 NULL, BUFFER_DIGEST_NULL, \
80 buf, BUFFER_WRITE_VBUF, \
82# define fd_skip(fd, limit, err) \
83 buffer_skip_Int(fd, BUFFER_READ_FD, limit, err)
87 void *f,
int typeDigest,
92 void *f,
int typeDigest,
98off_t
buffer_digest(
const void *buf,
void *hash,
int typeDigest, off_t length);
off_t buffer_skip_Int(int I, int T, off_t limit, struct dpkg_error *err) DPKG_ATTR_REQRET
Definition buffer.c:288
off_t buffer_copy_IntInt(int i1, int typeIn, void *f, int typeDigest, int i2, int typeOut, off_t limit, struct dpkg_error *err) DPKG_ATTR_REQRET
Definition buffer.c:237
off_t buffer_copy_IntPtr(int i, int typeIn, void *f, int typeDigest, void *p, int typeOut, off_t limit, struct dpkg_error *err) DPKG_ATTR_REQRET
Definition buffer.c:250
off_t buffer_digest(const void *buf, void *hash, int typeDigest, off_t length)
Definition buffer.c:164
#define DPKG_ATTR_REQRET
Definition macros.h:130
#define DPKG_BEGIN_DECLS
Definition macros.h:164
#define DPKG_END_DECLS
Definition macros.h:165
int i
Definition buffer.h:54
int type
Definition buffer.h:56
void * ptr
Definition buffer.h:53
union buffer_data::@0 arg