-rw-r--r-- | src/eyetil.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/eyetil.h b/src/eyetil.h index 03b9ba8..7517ba6 100644 --- a/src/eyetil.h +++ b/src/eyetil.h @@ -50,32 +50,43 @@ struct md5_digester { update_iterator& operator=(const T& x) { d->update(x); return *this; } }; template<typename T> update_iterator<T> updater() { return update_iterator<T>(this); } }; template<> inline void md5_digester::update<binary_t>(const binary_t& x) { update((const unsigned char*)&(x.front()),x.size()); } +#pragma pack(1) +struct block512_t { + enum { words = 512 / sizeof(uint16_t) }; + uint16_t data[words]; + + inline uint8_t *dptr(size_t o) { return ((uint8_t*)this)+o; } + + static uint16_t tcpcksum(block512_t& data); +}; +#pragma pack() + class tmpdir_t { public: std::string dir; tmpdir_t(const std::string& dt); ~tmpdir_t(); std::string get_file(const std::string& f); }; class tarchive_t { public: struct archive *a; struct archive_entry *e; tarchive_t(void *p,size_t s); |