# Path: srcgen/api.py



from six.moves import zip
from .api import Component, basic
import sys
            n = len(t0) - len(t)
            p = n*short_type_spec_map['Pointer']
            l = []
            while t.endswith(']'):
                i = t.rfind('[')
                l.insert(0, t[i+1:-1])
                t = t[:i]
            s = 'j'.join(l)
            r = short_type_spec_map.get(t)
            if r is None and parents is not None:
                c = parents.find_component_with_view('type_spec', t)
                if c is not None:
                    r = c.get_view('short_type_spec', parents)
            if r is None:
                sys.stderr.write('warning: %r is not in short_type_spec map\n' % (t))
                r = t
            return p + r + s

def type_spec_first_str(joiner):
    new = type(joiner)(default='void')
    if joiner.keys:
        new.add(joiner.values[0], joiner.keys[0])
    return str(new)

def type_spec_rest_str(joiner):
    new = type(joiner)(default='void', separator=', ')
    for k, v in zip(joiner.keys[1:], joiner.values[1:]):
        new.add(v, k)
    return str(new)


# Path: srcgen/api.py



# Path: srcgen/c.py
from six.moves import zip
from .api import Component, basic
import sys

            n = len(t0) - len(t)
            p = n*short_type_spec_map['Pointer']
            l = []
            while t.endswith(']'):
                i = t.rfind('[')
                l.insert(0, t[i+1:-1])
                t = t[:i]
            s = 'j'.join(l)
            r = short_type_spec_map.get(t)
            if r is None and parents is not None:
                c = parents.find_component_with_view('type_spec', t)
                if c is not None:
                    r = c.get_view('short_type_spec', parents)
            if r is None:
                sys.stderr.write('warning: %r is not in short_type_spec map\n' % (t))
                r = t
            return p + r + s

def type_spec_first_str(joiner):
    new = type(joiner)(default='void')
    if joiner.keys:
        new.add(joiner.values[0], joiner.keys[0])
    return str(new)

def type_spec_rest_str(joiner):
    new = type(joiner)(default='void', separator=', ')
    for k, v in zip(joiner.keys[1:], joiner.values[1:]):
        new.add(v, k)
    return str(new)


class TypeDefBase(Component):