diff options
author | Liam Miller-Cushon <cushon@google.com> | 2015-12-03 18:23:09 +0000 |
---|---|---|
committer | Kristina Chodorow <kchodorow@google.com> | 2015-12-03 18:39:00 +0000 |
commit | 220be7a7362bb27f3a23b2328b36d1a55f6f9197 (patch) | |
tree | 559e6c9a458305c84b28c191265413cf2c5c2662 /third_party/ijar/common.h | |
parent | 188d8eb7838ecc8aeaa9ba146908e2ad2db7de03 (diff) |
Add zip64 support to ijar
This allows ijar to process jars with >65535 entries.
--
MOS_MIGRATED_REVID=109321374
Diffstat (limited to 'third_party/ijar/common.h')
-rw-r--r-- | third_party/ijar/common.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/third_party/ijar/common.h b/third_party/ijar/common.h index f7df14bb75..513e0019a9 100644 --- a/third_party/ijar/common.h +++ b/third_party/ijar/common.h @@ -59,6 +59,13 @@ inline u4 get_u4le(const u1 *&p) { return x; } +inline u8 get_u8le(const u1 *&p) { + u4 lo = get_u4le(p); + u4 hi = get_u4le(p); + u8 x = ((u8)hi << 32) | lo; + return x; +} + inline void put_u1(u1 *&p, u1 x) { *p++ = x; } @@ -87,6 +94,11 @@ inline void put_u4le(u1 *&p, u4 x) { *p++ = x >> 24; } +inline void put_u8le(u1 *&p, u8 x) { + put_u4le(p, x & 0xffffffff); + put_u4le(p, (x >> 32) & 0xffffffff); +} + // Copy n bytes from src to p, and advance p. inline void put_n(u1 *&p, const u1 *src, size_t n) { memcpy(p, src, n); |