# Path: coolamqp/framing/base.py
# BASIC_TYPES = {u'bit': (None, None, "0", None),  # special case
#                u'octet': (1, 'B', "b'\\x00'", 1),
#                u'short': (2, 'H', "b'\\x00\\x00'", 2),
#                u'long': (4, 'I', "b'\\x00\\x00\\x00\\x00'", 4),
#                u'longlong': (
#                    8, 'Q', "b'\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00'", 8),
#                u'timestamp': (
#                    8, 'Q', "b'\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00'", 8),
#                u'table': (None, None, "b'\\x00\\x00\\x00\\x00'", 4),
#                # special case
#                u'longstr': (None, None, "b'\\x00\\x00\\x00\\x00'", 4),
#                # special case
#                u'shortstr': (None, None, "b'\\x00'", 1),  # special case
#                }
# 
# Path: coolamqp/framing/compilation/utilities.py
# @as_unicode
# def format_field_name(field):
#     if field in (u'global', u'type'):
#         field = field + '_'
#     return field.replace('-', '_')


import math
from coolamqp.framing.base import BASIC_TYPES
from coolamqp.framing.compilation.utilities import format_field_name
        fmts = u''.join(ffffmts)
        emit("%s, = STRUCT_%s.unpack_from(buf, offset)",
             u', '.join(fffnames), fmts)
        emit("offset += %s", ln['ln'])
        ln['ln'] = 0
        del to_struct[:]
        return {fmts: fmts}

    for field in fields:
        fieldname = prefix + format_field_name(field.name)

        if (len(bits) > 0) and (field.basic_type != u'bit'):
            emit_bits()

        if remark:
            print('Doing', fieldname, 'of type', field.basic_type)

        # offset is current start
        # length is length to read
        if BASIC_TYPES[field.basic_type][0] is not None:
            # static type shit has

            assert len(bits) == 0

            if field.reserved:
                to_struct.append(
                    (u'_', '%sx' % (BASIC_TYPES[field.basic_type][0],)))
            else:
                to_struct.append((fieldname, BASIC_TYPES[field.basic_type][1]))


# Path: coolamqp/framing/base.py
# BASIC_TYPES = {u'bit': (None, None, "0", None),  # special case
#                u'octet': (1, 'B', "b'\\x00'", 1),
#                u'short': (2, 'H', "b'\\x00\\x00'", 2),
#                u'long': (4, 'I', "b'\\x00\\x00\\x00\\x00'", 4),
#                u'longlong': (
#                    8, 'Q', "b'\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00'", 8),
#                u'timestamp': (
#                    8, 'Q', "b'\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00'", 8),
#                u'table': (None, None, "b'\\x00\\x00\\x00\\x00'", 4),
#                # special case
#                u'longstr': (None, None, "b'\\x00\\x00\\x00\\x00'", 4),
#                # special case
#                u'shortstr': (None, None, "b'\\x00'", 1),  # special case
#                }
# 
# Path: coolamqp/framing/compilation/utilities.py
# @as_unicode
# def format_field_name(field):
#     if field in (u'global', u'type'):
#         field = field + '_'
#     return field.replace('-', '_')


# Path: coolamqp/framing/compilation/textcode_fields.py
import math
from coolamqp.framing.base import BASIC_TYPES
from coolamqp.framing.compilation.utilities import format_field_name

        fmts = u''.join(ffffmts)
        emit("%s, = STRUCT_%s.unpack_from(buf, offset)",
             u', '.join(fffnames), fmts)
        emit("offset += %s", ln['ln'])
        ln['ln'] = 0
        del to_struct[:]
        return {fmts: fmts}

    for field in fields:
        fieldname = prefix + format_field_name(field.name)

        if (len(bits) > 0) and (field.basic_type != u'bit'):
            emit_bits()

        if remark:
            print('Doing', fieldname, 'of type', field.basic_type)

        # offset is current start
        # length is length to read
        if BASIC_TYPES[field.basic_type][0] is not None:
            # static type shit has

            assert len(bits) == 0

            if field.reserved:
                to_struct.append(
                    (u'_', '%sx' % (BASIC_TYPES[field.basic_type][0],)))
            else:
                to_struct.append((fieldname, BASIC_TYPES[field.basic_type][1]))


            ln['ln'] += BASIC_TYPES[field.basic_type][0]