示例#1
0
    'RLIMIT_VMEM',
    'RUSAGE_BOTH',
    'RUSAGE_SELF',
    'RUSAGE_CHILDREN',
)


# Setup our configure
class ResourceConfigure:
    _compilation_info_ = ExternalCompilationInfo(includes=['sys/resource.h'])
    rlim_t = SimpleType('rlim_t')


for key in _CONSTANTS:
    setattr(ResourceConfigure, key, ConstantInteger(key))
for key in _OPTIONAL_CONSTANTS:
    setattr(ResourceConfigure, key, DefinedConstantInteger(key))

# Configure constants and types
config = configure(ResourceConfigure)
config['rlim_t_max'] = (1 << (sizeof(config['rlim_t']) * 8)) - 1
optional_constants = []
for key in _OPTIONAL_CONSTANTS:
    if config[key] is not None:
        optional_constants.append(key)
    else:
        del config[key]

config['ALL_CONSTANTS'] = _CONSTANTS + tuple(optional_constants)
dumpcache.dumpcache2('resource', config)
示例#2
0
        "D_T_FMT", "D_FMT", "T_FMT", "AM_STR", "PM_STR",
        "CODESET", "T_FMT_AMPM", "ERA", "ERA_D_FMT", "ERA_D_T_FMT",
        "ERA_T_FMT", "ALT_DIGITS", "YESEXPR", "NOEXPR", "_DATE_FMT",
        ]
    for i in range(1, 8):
        langinfo_names.append("DAY_%d" % i)
        langinfo_names.append("ABDAY_%d" % i)
    for i in range(1, 13):
        langinfo_names.append("MON_%d" % i)
        langinfo_names.append("ABMON_%d" % i)
    
    class LanginfoConfigure:
        _compilation_info_ = eci
        nl_item = SimpleType('nl_item')
    for key in langinfo_names:
        setattr(LanginfoConfigure, key, DefinedConstantInteger(key))

    langinfo_config = configure(LanginfoConfigure)
    for key, value in langinfo_config.items():
        if value is None:
            del langinfo_config[key]
            langinfo_names.remove(key)
    config.update(langinfo_config)
    _CONSTANTS += langinfo_names

# ____________________________________________________________

config['ALL_CONSTANTS'] = tuple(_CONSTANTS)
config['HAS_LANGINFO'] = HAS_LANGINFO
dumpcache.dumpcache2('locale', config)
示例#3
0
        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')

config = configure.configure(CConfigure)

dumpcache.dumpcache2('pyexpat', config)
示例#4
0
# Constant aliases if there are not defined
_ALIAS = (
    ('LOG_SYSLOG', 'LOG_DAEMON'),
    ('LOG_CRON', 'LOG_DAEMON'),
    ('LOG_NEWS', 'LOG_MAIL'),
    ('LOG_UUCP', 'LOG_MAIL'),
)


class SyslogConfigure:
    _compilation_info_ = ExternalCompilationInfo(includes=['sys/syslog.h'])


for key in _CONSTANTS:
    setattr(SyslogConfigure, key, ConstantInteger(key))
for key in _OPTIONAL_CONSTANTS:
    setattr(SyslogConfigure, key, DefinedConstantInteger(key))

config = configure(SyslogConfigure)
for key in _OPTIONAL_CONSTANTS:
    if config[key] is None:
        del config[key]
for alias, key in _ALIAS:
    config.setdefault(alias, config[key])

all_constants = config.keys()
all_constants.sort()
config['ALL_CONSTANTS'] = tuple(all_constants)
dumpcache.dumpcache2('syslog', config)
示例#5
0
    "LOG_LOCAL5",
    "LOG_LOCAL6",
    "LOG_LOCAL7",
)
_OPTIONAL_CONSTANTS = ("LOG_NOWAIT", "LOG_PERROR", "LOG_SYSLOG", "LOG_CRON", "LOG_UUCP", "LOG_NEWS")

# Constant aliases if there are not defined
_ALIAS = (("LOG_SYSLOG", "LOG_DAEMON"), ("LOG_CRON", "LOG_DAEMON"), ("LOG_NEWS", "LOG_MAIL"), ("LOG_UUCP", "LOG_MAIL"))


class SyslogConfigure:
    _compilation_info_ = ExternalCompilationInfo(includes=["sys/syslog.h"])


for key in _CONSTANTS:
    setattr(SyslogConfigure, key, ConstantInteger(key))
for key in _OPTIONAL_CONSTANTS:
    setattr(SyslogConfigure, key, DefinedConstantInteger(key))

config = configure(SyslogConfigure)
for key in _OPTIONAL_CONSTANTS:
    if config[key] is None:
        del config[key]
for alias, key in _ALIAS:
    config.setdefault(alias, config[key])

all_constants = config.keys()
all_constants.sort()
config["ALL_CONSTANTS"] = tuple(all_constants)
dumpcache.dumpcache2("syslog", config)
示例#6
0
    )

    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')


config = configure.configure(CConfigure)

dumpcache.dumpcache2('pyexpat', config)
示例#7
0
        "NOEXPR",
        "_DATE_FMT",
    ]
    for i in range(1, 8):
        langinfo_names.append("DAY_%d" % i)
        langinfo_names.append("ABDAY_%d" % i)
    for i in range(1, 13):
        langinfo_names.append("MON_%d" % i)
        langinfo_names.append("ABMON_%d" % i)

    class LanginfoConfigure:
        _compilation_info_ = eci
        nl_item = SimpleType('nl_item')

    for key in langinfo_names:
        setattr(LanginfoConfigure, key, DefinedConstantInteger(key))

    langinfo_config = configure(LanginfoConfigure)
    for key, value in langinfo_config.items():
        if value is None:
            del langinfo_config[key]
            langinfo_names.remove(key)
    config.update(langinfo_config)
    _CONSTANTS += langinfo_names

# ____________________________________________________________

config['ALL_CONSTANTS'] = tuple(_CONSTANTS)
config['HAS_LANGINFO'] = HAS_LANGINFO
dumpcache.dumpcache2('locale', config)
示例#8
0
    'RLIMIT_NICE',
    'RLIMIT_RTPRIO',
    'RLIMIT_VMEM',

    'RUSAGE_BOTH',
    'RUSAGE_SELF',
    'RUSAGE_CHILDREN',
)

# Setup our configure
class ResourceConfigure:
    _compilation_info_ = ExternalCompilationInfo(includes=['sys/resource.h'])
    rlim_t = SimpleType('rlim_t')
for key in _CONSTANTS:
    setattr(ResourceConfigure, key, ConstantInteger(key))
for key in _OPTIONAL_CONSTANTS:
    setattr(ResourceConfigure, key, DefinedConstantInteger(key))

# Configure constants and types
config = configure(ResourceConfigure)
config['rlim_t_max'] = (1<<(sizeof(config['rlim_t']) * 8)) - 1
optional_constants = []
for key in _OPTIONAL_CONSTANTS:
    if config[key] is not None:
        optional_constants.append(key)
    else:
        del config[key]

config['ALL_CONSTANTS'] = _CONSTANTS + tuple(optional_constants)
dumpcache.dumpcache2('resource', config)