Changeset 8900 for src/Pugs/Embed
- Timestamp:
- 02/01/06 13:28:50 (3 years ago)
- Files:
-
- 1 modified
-
src/Pugs/Embed/Parrot.hsc (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/Pugs/Embed/Parrot.hsc
r8878 r8900 170 170 interp <- readIORef _ParrotInterp 171 171 if interp /= nullPtr then return interp else do 172 parrot_set_config_hash 172 173 interp <- parrot_new nullPtr 173 174 writeIORef _ParrotInterp interp … … 183 184 -- parrot_set_debug interp 0x20 184 185 parrot_imcc_init interp 186 187 pf <- parrot_packfile_new interp 0 188 parrot_loadbc interp pf 189 seg <- withCString "pugs" $ \p -> do 190 parrot_pf_create_default_segs interp p 1 191 set_pf_cur_cs pf seg 192 parrot_loadbc interp pf 193 185 194 callback <- mkCompileCallback compileToParrot 186 195 pugsStr <- withCString "Pugs" (const_string interp) 187 196 parrot_compreg interp pugsStr callback 188 197 189 pf <- parrot_packfile_new interp 0190 pf_dir <- get_pf_directory pf191 seg <- withCString "pugs" $ \p -> do192 parrot_packfile_segment_new_seg interp pf_dir 4 p 1193 set_pf_cur_cs pf seg194 parrot_loadbc interp pf195 198 modifyIORef _GlobalFinalizer (>> parrot_exit 0) 196 199 return interp … … 206 209 cwd <- getCurrentDirectory 207 210 setCurrentDirectory path 208 withCString "PGE.pbc" $ parrot_load_bytecode interp 209 withCString "PGE/Hs.pir" $ parrot_load_bytecode interp 211 pge_pbc <- withCString "PGE.pbc" $ const_string interp 212 pge_hs <- withCString "PGE/Hs.pir" $ const_string interp 213 parrot_load_bytecode interp pge_pbc 214 parrot_load_bytecode interp pge_hs 210 215 setCurrentDirectory cwd 211 216 loadPGE interp path … … 252 257 mkCompileCallback :: ParrotCompilerFunc -> IO (FunPtr ParrotCompilerFunc) 253 258 259 foreign import ccall "Parrot_set_config_hash" 260 parrot_set_config_hash :: IO () 261 254 262 foreign import ccall "Parrot_new" 255 263 parrot_new :: ParrotInterp -> IO ParrotInterp … … 276 284 parrot_packfile_segment_new_seg :: ParrotInterp -> ParrotPackFileDirectory -> CInt -> CString-> CInt -> IO ParrotPackFileByteCode 277 285 286 foreign import ccall "PF_create_default_segs" 287 parrot_pf_create_default_segs :: ParrotInterp -> CString -> CInt -> IO ParrotPackFileByteCode 288 278 289 foreign import ccall "dod_register_pmc" 279 290 parrot_dod_register_pmc :: ParrotInterp -> ParrotPMC -> IO () … … 286 297 287 298 foreign import ccall "Parrot_load_bytecode" 288 parrot_load_bytecode :: ParrotInterp -> CString -> IO ()299 parrot_load_bytecode :: ParrotInterp -> ParrotString -> IO () 289 300 290 301 foreign import ccall "Parrot_call_sub"
