<s> import sys <EOL> from pypy . rpython . lltypesystem import lltype , rffi <EOL> from pypy . rpython . tool import rffi_platform as platform <EOL> from pypy . translator . tool . cbuild import ExternalCompilationInfo <EOL> from pypy . rlib . rsdl import RSDL <EOL> if sys . platform == '<STR_LIT>' : <EOL> eci = ExternalCompilationInfo ( <EOL> includes = [ '<STR_LIT>' ] , <EOL> frameworks = [ '<STR_LIT>' ] , <EOL> include_dirs = [ '<STR_LIT>' ] <EOL> ) <EOL> else : <EOL> eci = ExternalCompilationInfo ( <EOL> includes = [ '<STR_LIT>' ] , <EOL> libraries = [ '<STR_LIT>' ] , <EOL> ) <EOL> eci = eci . merge ( RSDL . eci ) <EOL> eci = eci . merge ( eci ) <EOL> eci = eci . merge ( eci ) <EOL> ChunkPtr = lltype . Ptr ( lltype . ForwardReference ( ) ) <EOL> class CConfig : <EOL> _compilation_info_ = eci <EOL> Chunk = platform . Struct ( '<STR_LIT>' , [ ( '<STR_LIT>' , rffi . INT ) , <EOL> ( '<STR_LIT>' , RSDL . Uint8P ) , <EOL> ( '<STR_LIT>' , RSDL . Uint32 ) , <EOL> ( '<STR_LIT>' , RSDL . Uint8 ) ] ) <EOL> globals ( ) . update ( platform . configure ( CConfig ) ) <EOL> ChunkPtr . TO . become ( Chunk ) <EOL> Buffer = rffi . CArray ( RSDL . Uint8 ) <EOL> def external ( name , args , result ) : <EOL> return rffi . llexternal ( name , args , result , compilation_info = eci ) <EOL> OpenAudio = external ( '<STR_LIT>' , <EOL> [ rffi . INT , RSDL . Uint16 , rffi . INT , rffi . INT ] , <EOL> rffi . INT ) <EOL> CloseAudio = external ( '<STR_LIT>' , [ ] , lltype . Void ) <EOL> LoadWAV_RW = external ( '<STR_LIT>' , <EOL> [ RSDL . RWopsPtr , rffi . INT ] , <EOL> ChunkPtr ) <EOL> def LoadWAV ( filename_ccharp ) : <EOL> return LoadWAV_RW ( RSDL . RWFromFile ( filename_ccharp , rffi . str2charp ( '<STR_LIT:rb>' ) ) , <NUM_LIT:1> ) <EOL> PlayChannelTimed = external ( '<STR_LIT>' , <EOL> [ rffi . INT , ChunkPtr , rffi . INT , rffi . INT ] , <EOL> rffi . INT ) <EOL> def PlayChannel ( channel , chunk , loops ) : <EOL> return PlayChannelTimed ( channel , chunk , loops , - <NUM_LIT:1> ) <EOL> """<STR_LIT>""" <EOL> ChannelPlaying = external ( '<STR_LIT>' , [ rffi . INT ] ) </s>
