Changeset 21673 for src/Pugs/Embed/Perl5.hs
- Timestamp:
- 08/01/08 13:56:05 (5 months ago)
- Files:
-
- 1 modified
-
src/Pugs/Embed/Perl5.hs (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/Pugs/Embed/Perl5.hs
r16444 r21673 1 {-# OPTIONS_GHC -fglasgow-exts -cpp - fvia-C -optc-w #-}1 {-# OPTIONS_GHC -fglasgow-exts -cpp -optc-w #-} 2 2 3 3 #ifndef PUGS_HAVE_PERL5 … … 13 13 import System.Directory 14 14 import Pugs.Internals 15 import qualified UTF8 as Str15 import qualified Data.ByteString.UTF8 as Str 16 16 17 17 evalPCR :: FilePath -> String -> String -> [(String, String)] -> IO String … … 187 187 import Foreign.C.String 188 188 import {-# SOURCE #-} Pugs.AST.Internals 189 import qualified UTF8 as Str 189 import qualified Data.ByteString.UTF8 as Str 190 import qualified Data.ByteString.Char8 as Buf 190 191 import qualified Pugs.Val as Val 191 192 … … 296 297 297 298 vstrToSV :: String -> IO PerlSV 298 vstrToSV str = Str.useAsCStringLen (cast str) $ \(cstr, len) -> perl5_newSVpvn cstr (toEnum len)299 vstrToSV str = Buf.useAsCStringLen (cast str) $ \(cstr, len) -> perl5_newSVpvn cstr (toEnum len) 299 300 300 301 bufToSV :: ByteString -> IO PerlSV 301 bufToSV str = Str.useAsCStringLen str $ \(cstr, len) -> perl5_newSVpvn cstr (toEnum len)302 bufToSV str = Buf.useAsCStringLen str $ \(cstr, len) -> perl5_newSVpvn cstr (toEnum len) 302 303 303 304 vintToSV :: (Integral a) => a -> IO PerlSV … … 330 331 331 332 canPerl5 :: PerlSV -> ByteString -> IO Bool 332 canPerl5 sv meth = Str.useAsCString meth $ \cstr -> perl5_can sv cstr333 canPerl5 sv meth = Buf.useAsCString meth $ \cstr -> perl5_can sv cstr 333 334 334 335 mkSV :: IO PerlSV -> IO PerlSV … … 342 343 343 344 evalPerl5 :: String -> PugsEnv -> CInt -> IO PerlSV 344 evalPerl5 str env cxt = mkSV $ Str.useAsCString (cast str) $ \cstr -> perl5_eval cstr env cxt345 evalPerl5 str env cxt = mkSV $ Buf.useAsCString (cast str) $ \cstr -> perl5_eval cstr env cxt 345 346 346 347 freePerl5 :: PerlInterpreter -> IO ()
