# Path: ctypeslib/codegen/config.py
# class CodegenConfig:
#     def __init__(self):
#     def parse_options(self, options):
#     def _init_types(self, _default="cdefstu"):
#     def _parse_options_types(self, options):
#     def _parse_options_modules(self, options):
#     def _parse_options_clang_opts(self, options):
#     def cross_arch(self):
# 
# Path: ctypeslib/codegen/typedesc.py
# class T(object):
# class Argument(T):
# class _HasArgs(T):
# class Alias(T):
# class Macro(T):
# class File(T):
# class Function(_HasArgs):
# class Ignored(_HasArgs):
# class OperatorFunction(_HasArgs):
# class FunctionType(_HasArgs):
# class Method(_HasArgs):
# class FundamentalType(T):
# class PointerType(T):
# class Typedef(T):
# class ArrayType(T):
# class StructureHead(T):
# class StructureBody(T):
# class _Struct_Union_Base(T):
# class Structure(_Struct_Union_Base):
# class Union(_Struct_Union_Base):
# class Field(T):
# class CvQualifiedType(T):
# class Enumeration(T):
# class EnumValue(T):
# class Variable(T):
# class UndefinedIdentifier(T):
#     def __repr__(self):
#     def __init__(self, name, _type):
#     def __init__(self):
#     def add_argument(self, arg):
#     def iterArgTypes(self):
#     def iterArgNames(self):
#     def fixup_argtypes(self, cb):
#     def __init__(self, name, alias, typ=None):
#     def __init__(self, name, args, body):
#     def __init__(self, name):
#     def __init__(self, name, returns, attributes, extern):
#     def __init__(self, name):
#     def __init__(self, name, returns):
#     def __init__(self, returns, attributes, name=''):
#     def __init__(self, name, returns):
#     def __init__(self, name, size, align):
#     def __init__(self, typ, size, align):
#     def __init__(self, name, typ):
#     def __init__(self, typ, size):
#     def __init__(self, struct):
#     def name(self):
#     def __init__(self, struct):
#     def name(self):
#     def get_body(self):
#     def get_head(self):
#     def __init__(self, name, align, members, bases, size, artificial=None,
#                  packed=False):
#     def __init__(self, name, align, members, bases, size, artificial=None,
#                  packed=False):
#     def __init__(self, name, typ, offset, bits, is_bitfield=False,
#                  is_anonymous=False, is_padding=False):
#     def __init__(self, typ, const, volatile):
#     def __init__(self, name, size, align):
#     def add_value(self, v):
#     def __init__(self, name, value, enumeration):
#     def __init__(self, name, typ, init=None, extern=False):
#     def __init__(self, name):
#     def __str__(self):
# def is_record(t):


import unittest
import io
import ctypeslib
from ctypeslib.codegen import config
from ctypeslib.codegen import typedesc
};        
        ''')
        py_namespace = ctypeslib.translate(input_io)
        self.assertIn("i", py_namespace)
        self.assertIn("c2", py_namespace)
        self.assertIn("struct_example_detail", py_namespace)
        self.assertIn("struct_example", py_namespace)
        self.assertEqual(py_namespace.i, 12)
        self.assertEqual(py_namespace.c2, ['a', 'b', 'c'])


class ConfigTest(unittest.TestCase):
    def setUp(self) -> None:
        self.input_io = io.StringIO('''
        struct example_1 {
            int first;
            int last;
        };

        union example_2 {
            int a;
            float f;
        };''')

    def test_no_config(self):
        py_namespace = ctypeslib.translate(self.input_io)
        self.assertIn("struct_example_1", py_namespace)
        self.assertIn("union_example_2", py_namespace)

    def test_config_default(self):

# Path: ctypeslib/codegen/config.py
# class CodegenConfig:
#     def __init__(self):
#     def parse_options(self, options):
#     def _init_types(self, _default="cdefstu"):
#     def _parse_options_types(self, options):
#     def _parse_options_modules(self, options):
#     def _parse_options_clang_opts(self, options):
#     def cross_arch(self):
# 
# Path: ctypeslib/codegen/typedesc.py
# class T(object):
# class Argument(T):
# class _HasArgs(T):
# class Alias(T):
# class Macro(T):
# class File(T):
# class Function(_HasArgs):
# class Ignored(_HasArgs):
# class OperatorFunction(_HasArgs):
# class FunctionType(_HasArgs):
# class Method(_HasArgs):
# class FundamentalType(T):
# class PointerType(T):
# class Typedef(T):
# class ArrayType(T):
# class StructureHead(T):
# class StructureBody(T):
# class _Struct_Union_Base(T):
# class Structure(_Struct_Union_Base):
# class Union(_Struct_Union_Base):
# class Field(T):
# class CvQualifiedType(T):
# class Enumeration(T):
# class EnumValue(T):
# class Variable(T):
# class UndefinedIdentifier(T):
#     def __repr__(self):
#     def __init__(self, name, _type):
#     def __init__(self):
#     def add_argument(self, arg):
#     def iterArgTypes(self):
#     def iterArgNames(self):
#     def fixup_argtypes(self, cb):
#     def __init__(self, name, alias, typ=None):
#     def __init__(self, name, args, body):
#     def __init__(self, name):
#     def __init__(self, name, returns, attributes, extern):
#     def __init__(self, name):
#     def __init__(self, name, returns):
#     def __init__(self, returns, attributes, name=''):
#     def __init__(self, name, returns):
#     def __init__(self, name, size, align):
#     def __init__(self, typ, size, align):
#     def __init__(self, name, typ):
#     def __init__(self, typ, size):
#     def __init__(self, struct):
#     def name(self):
#     def __init__(self, struct):
#     def name(self):
#     def get_body(self):
#     def get_head(self):
#     def __init__(self, name, align, members, bases, size, artificial=None,
#                  packed=False):
#     def __init__(self, name, align, members, bases, size, artificial=None,
#                  packed=False):
#     def __init__(self, name, typ, offset, bits, is_bitfield=False,
#                  is_anonymous=False, is_padding=False):
#     def __init__(self, typ, const, volatile):
#     def __init__(self, name, size, align):
#     def add_value(self, v):
#     def __init__(self, name, value, enumeration):
#     def __init__(self, name, typ, init=None, extern=False):
#     def __init__(self, name):
#     def __str__(self):
# def is_record(t):


# Path: test/test_api.py
import unittest
import io
import ctypeslib
from ctypeslib.codegen import config
from ctypeslib.codegen import typedesc

};        
        ''')
        py_namespace = ctypeslib.translate(input_io)
        self.assertIn("i", py_namespace)
        self.assertIn("c2", py_namespace)
        self.assertIn("struct_example_detail", py_namespace)
        self.assertIn("struct_example", py_namespace)
        self.assertEqual(py_namespace.i, 12)
        self.assertEqual(py_namespace.c2, ['a', 'b', 'c'])


class ConfigTest(unittest.TestCase):
    def setUp(self) -> None:
        self.input_io = io.StringIO('''
        struct example_1 {
            int first;
            int last;
        };

        union example_2 {
            int a;
            float f;
        };''')

    def test_no_config(self):
        py_namespace = ctypeslib.translate(self.input_io)
        self.assertIn("struct_example_1", py_namespace)
        self.assertIn("union_example_2", py_namespace)

    def test_config_default(self):

        cfg = config.CodegenConfig()