# Path: ctypeslib/library.py
# class Library(metaclass=LibraryMeta):
# 
#     def __init__(self, filepath, nm):
#         self._filepath = filepath
#         self._name = os.path.basename(self._filepath)
#         self.__symbols = {}
#         self._get_symbols(nm)
# 
#     # nm will print lines like this:
#     # <addr> <kind> <name>
#     def _get_symbols(self, nm):
#         cmd = [nm, "--dynamic", "--defined-only", self._filepath]
#         output = subprocess.check_output(cmd, universal_newlines=True)
#         for line in output.split('\n'):
#             fields = line.split(' ', 2)
#             if len(fields) >= 3 and fields[1] in ("T", "D", "G", "R", "S"):
#                 self.__symbols[fields[2]] = fields[0]
# 
#     def __getattr__(self, name):
#         try:
#             return self.__symbols[name]
#         except KeyError:
#             pass
#         raise AttributeError(name)
# 
# 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 re
from ctypeslib.library import Library
from ctypeslib.codegen import typedesc
    filter_location: bool = True
    # dll to be loaded before all others (to resolve symbols)
    preloaded_dlls: list = []
    # kind of type descriptions to include
    types: list = []
    # the host's triplet
    local_platform_triple: str = None
    #
    known_symbols: dict = {}
    #
    searched_dlls: list = []
    # clang preprocessor options
    clang_opts: list = []

    def __init__(self):
        self._init_types()
        pass

    def parse_options(self, options):
        self.symbols = options.symbols
        self.expressions = options.expressions
        if options.expressions:
            self.expressions = map(re.compile, options.expressions)
        self.verbose = options.verbose
        self.generate_comments = options.generate_comments
        self.generate_docstrings = options.generate_docstrings
        self.generate_locations = options.generate_locations
        self.filter_location = not options.generate_includes
        self.preloaded_dlls = options.preload
        # List exported symbols from libraries

# Path: ctypeslib/library.py
# class Library(metaclass=LibraryMeta):
# 
#     def __init__(self, filepath, nm):
#         self._filepath = filepath
#         self._name = os.path.basename(self._filepath)
#         self.__symbols = {}
#         self._get_symbols(nm)
# 
#     # nm will print lines like this:
#     # <addr> <kind> <name>
#     def _get_symbols(self, nm):
#         cmd = [nm, "--dynamic", "--defined-only", self._filepath]
#         output = subprocess.check_output(cmd, universal_newlines=True)
#         for line in output.split('\n'):
#             fields = line.split(' ', 2)
#             if len(fields) >= 3 and fields[1] in ("T", "D", "G", "R", "S"):
#                 self.__symbols[fields[2]] = fields[0]
# 
#     def __getattr__(self, name):
#         try:
#             return self.__symbols[name]
#         except KeyError:
#             pass
#         raise AttributeError(name)
# 
# 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: ctypeslib/codegen/config.py
import re
from ctypeslib.library import Library
from ctypeslib.codegen import typedesc

    filter_location: bool = True
    # dll to be loaded before all others (to resolve symbols)
    preloaded_dlls: list = []
    # kind of type descriptions to include
    types: list = []
    # the host's triplet
    local_platform_triple: str = None
    #
    known_symbols: dict = {}
    #
    searched_dlls: list = []
    # clang preprocessor options
    clang_opts: list = []

    def __init__(self):
        self._init_types()
        pass

    def parse_options(self, options):
        self.symbols = options.symbols
        self.expressions = options.expressions
        if options.expressions:
            self.expressions = map(re.compile, options.expressions)
        self.verbose = options.verbose
        self.generate_comments = options.generate_comments
        self.generate_docstrings = options.generate_docstrings
        self.generate_locations = options.generate_locations
        self.filter_location = not options.generate_includes
        self.preloaded_dlls = options.preload
        # List exported symbols from libraries

        self.searched_dlls = [Library(name, nm=options.nm) for name in options.dll]