Exemplo n.º 1
0
class CConfigure:
    _compilation_info_ = configure.ExternalCompilationInfo(
        includes=['expat.h'],
        libraries=['expat'],
        pre_include_lines=[
            '#define XML_COMBINED_VERSION (10000*XML_MAJOR_VERSION+100*XML_MINOR_VERSION+XML_MICRO_VERSION)'
        ],
    )

    XML_Char = configure.SimpleType('XML_Char', c_char)
    XML_COMBINED_VERSION = configure.ConstantInteger('XML_COMBINED_VERSION')
    for name in [
            'XML_PARAM_ENTITY_PARSING_NEVER',
            'XML_PARAM_ENTITY_PARSING_UNLESS_STANDALONE',
            'XML_PARAM_ENTITY_PARSING_ALWAYS'
    ]:
        locals()[name] = configure.ConstantInteger(name)

    XML_Encoding = configure.Struct('XML_Encoding', [('data', c_void_p),
                                                     ('convert', c_void_p),
                                                     ('release', c_void_p),
                                                     ('map', c_int * 256)])
    XML_Content = configure.Struct('XML_Content', [
        ('numchildren', c_int),
        ('children', c_void_p),
        ('name', c_char_p),
        ('type', c_int),
        ('quant', c_int),
    ])
    # this is insanely stupid
    XML_FALSE = configure.ConstantInteger('XML_FALSE')
    XML_TRUE = configure.ConstantInteger('XML_TRUE')
Exemplo n.º 2
0
class CConfig:
    _compilation_info_ = configure.ExternalCompilationInfo(
        includes=['openssl/evp.h'],
        )
    EVP_MD = configure.Struct('EVP_MD',
                              [])
    EVP_MD_CTX = configure.Struct('EVP_MD_CTX',
                                  [('digest', c_void_p)])
Exemplo n.º 3
0
    class CConfig:
        _compilation_info_ = ExternalCompilationInfo(post_include_lines=[
            '/* a C comment */', '#define XYZZY 42', 'typedef int foo;',
            'struct s {', 'int i;', 'double f;'
            '};'
        ])

        s = configure.Struct('struct s', [('i', ctypes.c_int)], ifdef='XYZZY')
        z = configure.Struct('struct z', [('i', ctypes.c_int)], ifdef='FOOBAR')

        foo = configure.SimpleType('foo', ifdef='XYZZY')
        bar = configure.SimpleType('bar', ifdef='FOOBAR')
Exemplo n.º 4
0
class _CConfigure:
    _compilation_info_ = configure.ExternalCompilationInfo(
        includes=['signal.h', 'sys/types.h', 'unistd.h'], )

    pid_t = configure.SimpleType('pid_t', ctypes.c_int)

    SA_SIGINFO = configure.ConstantInteger('SA_SIGINFO')

    struct_sigaction = configure.Struct('struct sigaction',
                                        [('sa_flags', ctypes.c_int),
                                         ('sa_sigaction', sa_sigaction_t)])

    siginfo_t = configure.Struct('siginfo_t', [('si_signo', ctypes.c_int),
                                               ('si_value', sigval_t)])
Exemplo n.º 5
0
    class CConfig:
        _compilation_info_ = ExternalCompilationInfo(post_include_lines="""
            struct x {
            int foo;
            unsigned long bar;
            };
            struct y {
            char c;
            struct x x;
            };
            """.split("\n"))

        x = configure.Struct("struct x", [("bar", ctypes.c_short)])
        y = configure.Struct("struct y", [("x", x)])
Exemplo n.º 6
0
    class CConfig:
        _compilation_info_ = ExternalCompilationInfo(
            pre_include_lines=[
                "/* a C comment */", "#include <stdio.h>",
                "#include <test_ctypes_platform.h>"
            ],
            include_dirs=[str(configdir)])

        FILE = configure.Struct('FILE', [])
        ushort = configure.SimpleType('unsigned short')
        XYZZY = configure.ConstantInteger('XYZZY')
Exemplo n.º 7
0
class CConfigure:
    _compilation_info_ = configure.ExternalCompilationInfo(

        # all lines landing in C header before includes
        pre_include_lines=[],

        # list of .h files to include
        includes=['time.h', 'sys/time.h', 'unistd.h'],

        # list of directories to search for include files
        include_dirs=[],

        # all lines landing in C header after includes
        post_include_lines=[],

        # libraries to link with
        libraries=[],

        # library directories
        library_dirs=[],

        # additional C sources to compile with (that go to
        # created .c files)
        separate_module_sources=[],

        # additional existing C source file names
        separate_module_files=[],
    )

    # get real int type out of hint and name
    size_t = configure.SimpleType('size_t', ctypes.c_int)

    # grab value of numerical #define
    NULL = configure.ConstantInteger('NULL')

    # grab #define, whether it's defined or not
    EXISTANT = configure.Defined('NULL')
    NOT_EXISTANT = configure.Defined('XXXNOTNULL')

    # check for existance of C functions
    has_write = configure.Has('write')
    no_xxxwrite = configure.Has('xxxwrite')

    # check for size of type
    sizeof_size_t = configure.SizeOf('size_t')

    # structure, with given hints for interesting fields,
    # types does not need to be too specific.
    # all interesting fields would end up with right offset
    # size and order
    struct_timeval = configure.Struct('struct timeval',
                                      [('tv_sec', ctypes.c_int),
                                       ('tv_usec', ctypes.c_int)])
Exemplo n.º 8
0
    class CConfig:
        _compilation_info_ = ExternalCompilationInfo(
            pre_include_lines = ["/* a C comment */",
                                 "#include <stdio.h>",
                                 "#include <test_ctypes_platform2.h>"],
            include_dirs = [str(configdir)]
        )

        FILE = configure.Struct('FILE', [])
        ushort = configure.SimpleType('unsigned short')
        XYZZY = configure.ConstantInteger('XYZZY')
        XUZ = configure.Has('XUZ')
        large = configure.DefinedConstantInteger('large')
        undef = configure.Defined('really_undefined')