API¶
Packers¶
Adapters¶
Numbers¶
Macros¶
-
construct3.macros.
AlignedStruct
(*members)[source]¶ Algorithm taken from http://en.wikipedia.org/wiki/Data_structure_alignment#Computing_padding
Example:
s = AlignedStruct( "a" / word8, # 0 # padding (1) # 1 "b" / word16, # 2-3 "c" / word16, # 4-5 # padding (2) # 6-7 "d" / word32, # 8-11 "e" / word8, # 12 "f" / BitStruct( # 13 "x" / nibble, "y" / nibble, ) # padding (2) # 14-15 # total size = 16 )