Mercurial > vba-linux
view src/win32/7zip/7z/C/Bra.h @ 2:3549bbe597ed
adding makefile.am
author | Robert McIntyre <rlm@mit.edu> |
---|---|
date | Sat, 03 Mar 2012 10:31:47 -0600 |
parents | f9f4f1b99eed |
children |
line wrap: on
line source
1 /* Bra.h -- Branch converters for executables2 2008-10-04 : Igor Pavlov : Public domain */4 #ifndef __BRA_H5 #define __BRA_H7 #include "Types.h"9 /*10 These functions convert relative addresses to absolute addresses11 in CALL instructions to increase the compression ratio.13 In:14 data - data buffer15 size - size of data16 ip - current virtual Instruction Pinter (IP) value17 state - state variable for x86 converter18 encoding - 0 (for decoding), 1 (for encoding)20 Out:21 state - state variable for x86 converter23 Returns:24 The number of processed bytes. If you call these functions with multiple calls,25 you must start next call with first byte after block of processed bytes.27 Type Endian Alignment LookAhead29 x86 little 1 430 ARMT little 2 231 ARM little 4 032 PPC big 4 033 SPARC big 4 034 IA64 little 16 036 size must be >= Alignment + LookAhead, if it's not last block.37 If (size < Alignment + LookAhead), converter returns 0.39 Example:41 UInt32 ip = 0;42 for ()43 {44 ; size must be >= Alignment + LookAhead, if it's not last block45 SizeT processed = Convert(data, size, ip, 1);46 data += processed;47 size -= processed;48 ip += processed;49 }50 */52 #define x86_Convert_Init(state) { state = 0; }53 SizeT x86_Convert(Byte *data, SizeT size, UInt32 ip, UInt32 *state, int encoding);54 SizeT ARM_Convert(Byte *data, SizeT size, UInt32 ip, int encoding);55 SizeT ARMT_Convert(Byte *data, SizeT size, UInt32 ip, int encoding);56 SizeT PPC_Convert(Byte *data, SizeT size, UInt32 ip, int encoding);57 SizeT SPARC_Convert(Byte *data, SizeT size, UInt32 ip, int encoding);58 SizeT IA64_Convert(Byte *data, SizeT size, UInt32 ip, int encoding);60 #endif