# Path: pyfive/core.py
# def _padded_size(size, padding_multipe=8):
#     """ Return the size of a field padded to be a multiple a give value. """
#     return int(ceil(size / padding_multipe) * padding_multipe)
# 
# def _structure_size(structure):
#     """ Return the size of a structure in bytes. """
#     fmt = '<' + ''.join(structure.values())
#     return struct.calcsize(fmt)
# 
# def _unpack_struct_from(structure, buf, offset=0):
#     """ Unpack a structure into an OrderedDict from a buffer of bytes. """
#     fmt = '<' + ''.join(structure.values())
#     values = struct.unpack_from(fmt, buf, offset=offset)
#     return OrderedDict(zip(structure.keys(), values))
# 
# Path: pyfive/core.py
# class InvalidHDF5File(Exception):
#     """ Exception raised when an invalid HDF5 file is detected. """
#     pass


from collections import OrderedDict
from .core import _padded_size, _structure_size, _unpack_struct_from
from .core import InvalidHDF5File
        padding_type = datatype_msg['class_bit_field_0'] >> 4  # bits 4-7
        character_set = datatype_msg['class_bit_field_1'] & 0x01
        return ('VLEN_STRING', padding_type, character_set)


# IV.A.2.d The Datatype Message

DATATYPE_MSG = OrderedDict((
    ('class_and_version', 'B'),
    ('class_bit_field_0', 'B'),
    ('class_bit_field_1', 'B'),
    ('class_bit_field_2', 'B'),
    ('size', 'I'),
))
DATATYPE_MSG_SIZE = _structure_size(DATATYPE_MSG)


COMPOUND_PROP_DESC_V1 = OrderedDict((
    ('offset', 'I'),
    ('dimensionality', 'B'),
    ('reserved_0', 'B'),
    ('reserved_1', 'B'),
    ('reserved_2', 'B'),
    ('permutation', 'I'),
    ('reserved_3', 'I'),
    ('dim_size_1', 'I'),
    ('dim_size_2', 'I'),
    ('dim_size_3', 'I'),
    ('dim_size_4', 'I'),
))

# Path: pyfive/core.py
# def _padded_size(size, padding_multipe=8):
#     """ Return the size of a field padded to be a multiple a give value. """
#     return int(ceil(size / padding_multipe) * padding_multipe)
# 
# def _structure_size(structure):
#     """ Return the size of a structure in bytes. """
#     fmt = '<' + ''.join(structure.values())
#     return struct.calcsize(fmt)
# 
# def _unpack_struct_from(structure, buf, offset=0):
#     """ Unpack a structure into an OrderedDict from a buffer of bytes. """
#     fmt = '<' + ''.join(structure.values())
#     values = struct.unpack_from(fmt, buf, offset=offset)
#     return OrderedDict(zip(structure.keys(), values))
# 
# Path: pyfive/core.py
# class InvalidHDF5File(Exception):
#     """ Exception raised when an invalid HDF5 file is detected. """
#     pass


# Path: pyfive/datatype_msg.py
from collections import OrderedDict
from .core import _padded_size, _structure_size, _unpack_struct_from
from .core import InvalidHDF5File

        padding_type = datatype_msg['class_bit_field_0'] >> 4  # bits 4-7
        character_set = datatype_msg['class_bit_field_1'] & 0x01
        return ('VLEN_STRING', padding_type, character_set)


# IV.A.2.d The Datatype Message

DATATYPE_MSG = OrderedDict((
    ('class_and_version', 'B'),
    ('class_bit_field_0', 'B'),
    ('class_bit_field_1', 'B'),
    ('class_bit_field_2', 'B'),
    ('size', 'I'),
))
DATATYPE_MSG_SIZE = _structure_size(DATATYPE_MSG)


COMPOUND_PROP_DESC_V1 = OrderedDict((
    ('offset', 'I'),
    ('dimensionality', 'B'),
    ('reserved_0', 'B'),
    ('reserved_1', 'B'),
    ('reserved_2', 'B'),
    ('permutation', 'I'),
    ('reserved_3', 'I'),
    ('dim_size_1', 'I'),
    ('dim_size_2', 'I'),
    ('dim_size_3', 'I'),
    ('dim_size_4', 'I'),
))

COMPOUND_PROP_DESC_V1_SIZE = _structure_size(COMPOUND_PROP_DESC_V1)