Commit 06ddebbd authored by sof's avatar sof
Browse files

[project @ 1999-01-15 17:22:02 by sof]

Annotate the 'foreign import's with 'unsafe'.
parent 591ff1e0
......@@ -434,7 +434,7 @@ doesFileExist name = do
(getFileStatus name >>= \ st -> return (not (isDirectory st)))
(\ _ -> return False)
foreign import ccall "libHS_cbits.so" "const_F_OK" const_F_OK :: Int
foreign import ccall "libHS_cbits.so" "const_F_OK" unsafe const_F_OK :: Int
#ifndef __HUGS__
getModificationTime :: FilePath -> IO ClockTime
......@@ -520,7 +520,7 @@ modificationTime stat = do
(# s3#, frozen# #) ->
(# s3#, J# 1# 1# frozen# #)
foreign import ccall "libHS_cbits.so" "set_stat_st_mtime"
foreign import ccall "libHS_cbits.so" "set_stat_st_mtime" unsafe
setFileMode :: PrimMutableByteArray RealWorld -> FileStatus -> IO ()
#endif
......@@ -531,12 +531,13 @@ isDirectory stat = prim_S_ISDIR (fileMode stat) /= 0
isRegularFile :: FileStatus -> Bool
isRegularFile stat = prim_S_ISREG (fileMode stat) /= 0
foreign import ccall "libHS_cbits.so" "sizeof_stat" sizeof_stat :: Int
foreign import ccall "libHS_cbits.so" "prim_stat" primStat :: PrimByteArray -> PrimMutableByteArray RealWorld -> IO Int
foreign import ccall "libHS_cbits.so" "sizeof_stat" unsafe sizeof_stat :: Int
foreign import ccall "libHS_cbits.so" "prim_stat" unsafe
primStat :: PrimByteArray -> PrimMutableByteArray RealWorld -> IO Int
foreign import ccall "libHS_cbits.so" "get_stat_st_mode" fileMode :: FileStatus -> FileMode
foreign import ccall "libHS_cbits.so" "prim_S_ISDIR" prim_S_ISDIR :: FileMode -> Int
foreign import ccall "libHS_cbits.so" "prim_S_ISREG" prim_S_ISREG :: FileMode -> Int
foreign import ccall "libHS_cbits.so" "get_stat_st_mode" unsafe fileMode :: FileStatus -> FileMode
foreign import ccall "libHS_cbits.so" "prim_S_ISDIR" unsafe prim_S_ISDIR :: FileMode -> Int
foreign import ccall "libHS_cbits.so" "prim_S_ISREG" unsafe prim_S_ISREG :: FileMode -> Int
\end{code}
\begin{code}
......@@ -586,18 +587,18 @@ primNewByteArray :: Int -> IO (PrimMutableByteArray s)
primNewByteArray sz_in_bytes = stToIO (newCharArray (0,sz_in_bytes))
#endif
foreign import ccall "libHS_cbits.so" "createDirectory" primCreateDirectory :: CString -> IO Int
foreign import ccall "libHS_cbits.so" "removeDirectory" primRemoveDirectory :: CString -> IO Int
foreign import ccall "libHS_cbits.so" "removeFile" primRemoveFile :: CString -> IO Int
foreign import ccall "libHS_cbits.so" "renameDirectory" primRenameDirectory :: CString -> CString -> IO Int
foreign import ccall "libHS_cbits.so" "renameFile" primRenameFile :: CString -> CString -> IO Int
foreign import ccall "libHS_cbits.so" "openDir__" primOpenDir :: CString -> IO Addr
foreign import ccall "libHS_cbits.so" "readDir__" primReadDir :: Addr -> IO Addr
foreign import ccall "libHS_cbits.so" "get_dirent_d_name" primGetDirentDName :: Addr -> IO Addr
foreign import ccall "libHS_cbits.so" "setCurrentDirectory" primSetCurrentDirectory :: CString -> IO Int
foreign import ccall "libHS_cbits.so" "getCurrentDirectory" primGetCurrentDirectory :: IO Addr
foreign import ccall "libc.so.6" "free" primFree :: Addr -> IO ()
foreign import ccall "libc.so.6" "malloc" primMalloc :: Word -> IO Addr
foreign import ccall "libc.so.6" "chmod" primChmod :: CString -> Word -> IO Int
foreign import ccall "libHS_cbits.so" "createDirectory" unsafe primCreateDirectory :: CString -> IO Int
foreign import ccall "libHS_cbits.so" "removeDirectory" unsafe primRemoveDirectory :: CString -> IO Int
foreign import ccall "libHS_cbits.so" "removeFile" unsafe primRemoveFile :: CString -> IO Int
foreign import ccall "libHS_cbits.so" "renameDirectory" unsafe primRenameDirectory :: CString -> CString -> IO Int
foreign import ccall "libHS_cbits.so" "renameFile" unsafe primRenameFile :: CString -> CString -> IO Int
foreign import ccall "libHS_cbits.so" "openDir__" unsafe primOpenDir :: CString -> IO Addr
foreign import ccall "libHS_cbits.so" "readDir__" unsafe primReadDir :: Addr -> IO Addr
foreign import ccall "libHS_cbits.so" "get_dirent_d_name" unsafe primGetDirentDName :: Addr -> IO Addr
foreign import ccall "libHS_cbits.so" "setCurrentDirectory" unsafe primSetCurrentDirectory :: CString -> IO Int
foreign import ccall "libHS_cbits.so" "getCurrentDirectory" unsafe primGetCurrentDirectory :: IO Addr
foreign import ccall "libc.so.6" "free" unsafe primFree :: Addr -> IO ()
foreign import ccall "libc.so.6" "malloc" unsafe primMalloc :: Word -> IO Addr
foreign import ccall "libc.so.6" "chmod" unsafe primChmod :: CString -> Word -> IO Int
\end{code}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment