- length = mo.group(1)
- arg_type = 'Array(%s, "%s")' % (base_type, length)
- else:
- arg_type = 'OpaquePointer(%s)' % base_type
+ length = mo.group(1).strip()
+ if length == '':
+ try:
+ arg_type = self.string_typemap[base_type]
+ except KeyError:
+ pass
+ elif length == '1':
+ arg_type = 'Pointer(%s)' % base_type
+ elif length.find("COMPSIZE") == -1:
+ arg_type = 'Array(%s, "%s")' % (base_type, length)
+ else:
+ # XXX: Handle COMPSIZE better
+ length = length.replace("COMPSIZE", "__%s_size" % function_name)
+ length = length.replace("/", ",")
+ arg_type = 'Array(%s, "%s")' % (base_type, length)