diff options
author | Cyrille Bagard <nocbos@gmail.com> | 2015-09-11 20:40:24 (GMT) |
---|---|---|
committer | Cyrille Bagard <nocbos@gmail.com> | 2015-09-11 20:40:24 (GMT) |
commit | 18648e4e8763a3bc005d6fae51eae3d1528d7d29 (patch) | |
tree | 05feca5b6c5575b2a048b60130e3207b9f2c355a /src/common | |
parent | 9f8c79e3b272960b48bfd85a24f4b5cb5651df2d (diff) |
Created an interface from the original GBinContent object.
git-svn-id: svn://svn.gna.org/svn/chrysalide/trunk@576 abbe820e-26c8-41b2-8c08-b7b2b41f8b0a
Diffstat (limited to 'src/common')
-rwxr-xr-x | src/common/endianness.c | 6 | ||||
-rwxr-xr-x | src/common/endianness.h | 8 |
2 files changed, 6 insertions, 8 deletions
diff --git a/src/common/endianness.c b/src/common/endianness.c index 5e48b02..7dc5bc2 100755 --- a/src/common/endianness.c +++ b/src/common/endianness.c @@ -36,7 +36,6 @@ * pos = position courante dans ce flux. [OUT] * * end = limite des données à analyser. * * low = position éventuelle des 4 bits visés. [OUT] * -* endian = ordre des bits dans la source. * * * * Description : Lit un nombre non signé sur 4 bits. * * * @@ -46,7 +45,7 @@ * * ******************************************************************************/ -bool read_u4(uint8_t *target, const bin_t *data, off_t *pos, off_t end, bool *low, SourceEndian endian) +bool read_u4(uint8_t *target, const bin_t *data, off_t *pos, off_t end, bool *low) { if (*pos < 0) return false; if ((end - *pos) < 1) return false; @@ -74,7 +73,6 @@ bool read_u4(uint8_t *target, const bin_t *data, off_t *pos, off_t end, bool *lo * data = flux de données à analyser. * * pos = position courante dans ce flux. [OUT] * * end = limite des données à analyser. * -* endian = ordre des bits dans la source. * * * * Description : Lit un nombre non signé sur un octet. * * * @@ -84,7 +82,7 @@ bool read_u4(uint8_t *target, const bin_t *data, off_t *pos, off_t end, bool *lo * * ******************************************************************************/ -bool read_u8(uint8_t *target, const bin_t *data, off_t *pos, off_t end, SourceEndian endian) +bool read_u8(uint8_t *target, const bin_t *data, off_t *pos, off_t end) { if (*pos < 0) return false; if ((end - *pos) < 1) return false; diff --git a/src/common/endianness.h b/src/common/endianness.h index c573366..2764f66 100755 --- a/src/common/endianness.h +++ b/src/common/endianness.h @@ -43,10 +43,10 @@ typedef enum _SourceEndian /* Lit un nombre non signé sur 4 bits. */ -bool read_u4(uint8_t *, const bin_t *, off_t *, off_t, bool *, SourceEndian); +bool read_u4(uint8_t *, const bin_t *, off_t *, off_t, bool *); /* Lit un nombre non signé sur un octet. */ -bool read_u8(uint8_t *, const bin_t *, off_t *, off_t, SourceEndian); +bool read_u8(uint8_t *, const bin_t *, off_t *, off_t); /* Lit un nombre non signé sur deux octets. */ bool read_u16(uint16_t *, const bin_t *, off_t *, off_t, SourceEndian); @@ -58,8 +58,8 @@ bool read_u32(uint32_t *, const bin_t *, off_t *, off_t, SourceEndian); bool read_u64(uint64_t *, const bin_t *, off_t *, off_t, SourceEndian); -#define read_s4(target, data, pos, len, low, endian) read_u4((uint8_t *)target, data, pos, len, low, endian) -#define read_s8(target, data, pos, len, endian) read_u8((uint8_t *)target, data, pos, len, endian) +#define read_s4(target, data, pos, len, low) read_u4((uint8_t *)target, data, pos, len, low) +#define read_s8(target, data, pos, len) read_u8((uint8_t *)target, data, pos, len) #define read_s16(target, data, pos, len, endian) read_u16((uint16_t *)target, data, pos, len, endian) #define read_s32(target, data, pos, len, endian) read_u32((uint32_t *)target, data, pos, len, endian) #define read_s64(target, data, pos, len, endian) read_u64((uint64_t *)target, data, pos, len, endian) |