<s> """<STR_LIT>""" <EOL> import sys <EOL> if sys . platform == '<STR_LIT:win32>' : <EOL> raise ImportError ( "<STR_LIT>" ) <EOL> from ctypes_support import standard_c_lib as libc <EOL> from ctypes import c_int , c_char_p <EOL> from ctypes_configure . configure import ( configure , <EOL> ExternalCompilationInfo , ConstantInteger , DefinedConstantInteger ) <EOL> _CONSTANTS = ( <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> ) <EOL> _OPTIONAL_CONSTANTS = ( <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> ) <EOL> _ALIAS = ( <EOL> ( '<STR_LIT>' , '<STR_LIT>' ) , <EOL> ( '<STR_LIT>' , '<STR_LIT>' ) , <EOL> ( '<STR_LIT>' , '<STR_LIT>' ) , <EOL> ( '<STR_LIT>' , '<STR_LIT>' ) , <EOL> ) <EOL> class SyslogConfigure : <EOL> _compilation_info_ = ExternalCompilationInfo ( includes = [ '<STR_LIT>' ] ) <EOL> for key in _CONSTANTS : <EOL> setattr ( SyslogConfigure , key , ConstantInteger ( key ) ) <EOL> for key in _OPTIONAL_CONSTANTS : <EOL> setattr ( SyslogConfigure , key , DefinedConstantInteger ( key ) ) <EOL> config = configure ( SyslogConfigure ) <EOL> for key in _CONSTANTS : <EOL> globals ( ) [ key ] = config [ key ] <EOL> optional_constants = [ ] <EOL> for key in _OPTIONAL_CONSTANTS : <EOL> if config [ key ] is not None : <EOL> globals ( ) [ key ] = config [ key ] <EOL> optional_constants . append ( key ) <EOL> for alias , key in _ALIAS : <EOL> if alias in optional_constants : <EOL> continue <EOL> globals ( ) [ alias ] = globals ( ) [ key ] <EOL> optional_constants . append ( alias ) <EOL> del config <EOL> _syslog = libc . syslog <EOL> _syslog . argtypes = ( c_int , c_char_p , c_char_p ) <EOL> _syslog . restype = None <EOL> _openlog = libc . openlog <EOL> _openlog . argtypes = ( c_char_p , c_int , c_int ) <EOL> _openlog . restype = None <EOL> _closelog = libc . closelog <EOL> _closelog . argtypes = None <EOL> _closelog . restype = None <EOL> _setlogmask = libc . setlogmask <EOL> _setlogmask . argtypes = ( c_int , ) <EOL> _setlogmask . restype = c_int <EOL> def openlog ( ident , option , facility ) : <EOL> _openlog ( ident , option , facility ) <EOL> def syslog ( arg1 , arg2 = None ) : <EOL> if arg2 is not None : <EOL> priority , message = arg1 , arg2 <EOL> else : <EOL> priority , message = LOG_INFO , arg1 <EOL> _syslog ( priority , "<STR_LIT:%s>" , message ) <EOL> def closelog ( ) : <EOL> _closelog ( ) <EOL> def setlogmask ( mask ) : <EOL> return _setlogmask ( mask ) <EOL> def LOG_MASK ( pri ) : <EOL> return ( <NUM_LIT:1> << pri ) <EOL> def LOG_UPTO ( pri ) : <EOL> return ( <NUM_LIT:1> << ( pri + <NUM_LIT:1> ) ) - <NUM_LIT:1> <EOL> __all__ = _CONSTANTS + tuple ( optional_constants ) + ( <EOL> '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , <EOL> '<STR_LIT>' , '<STR_LIT>' ) <EOL> del optional_constants </s>
