# 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
        code.append(fmt)
        code.append('\n')

    formats = []
    format_args = []
    bits = []

    def emit_bits():
        p = []
        formats.append('B')
        if all(bit_name == 'False' for bit_name in bits):
            format_args.append('0')
        else:
            for bit_name, modif in zip(bits, range(8)):
                if bit_name != 'False':
                    p.append('(' + bit_name + ' << %s)' % (
                        modif,))  # yes you can << bools
            format_args.append(u' | '.join(p))
        del bits[:]

    def emit_single_struct_pack():
        formats_str = u''.join(formats)
        if formats_str not in structers:
            structers[formats_str] = formats_str
        emit("buf.write(STRUCT_%s.pack(%s))", formats_str,
             u', '.join(format_args))
        del formats[:]
        del format_args[:]

    for field in fields:

# 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

        code.append(fmt)
        code.append('\n')

    formats = []
    format_args = []
    bits = []

    def emit_bits():
        p = []
        formats.append('B')
        if all(bit_name == 'False' for bit_name in bits):
            format_args.append('0')
        else:
            for bit_name, modif in zip(bits, range(8)):
                if bit_name != 'False':
                    p.append('(' + bit_name + ' << %s)' % (
                        modif,))  # yes you can << bools
            format_args.append(u' | '.join(p))
        del bits[:]

    def emit_single_struct_pack():
        formats_str = u''.join(formats)
        if formats_str not in structers:
            structers[formats_str] = formats_str
        emit("buf.write(STRUCT_%s.pack(%s))", formats_str,
             u', '.join(format_args))
        del formats[:]
        del format_args[:]

    for field in fields:

        nam = prefix + format_field_name(field.name)