Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
U
unix
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Rinat Striungis
unix
Commits
3e32e391
Commit
3e32e391
authored
9 years ago
by
Herbert Valerio Riedel
Browse files
Options
Downloads
Patches
Plain Diff
Replace `__hscore_mk{dtemp,stemp,stemps}` wrappers with CApiFFI
parent
36460403
No related branches found
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
System/Posix/Temp.hsc
+4
-3
4 additions, 3 deletions
System/Posix/Temp.hsc
System/Posix/Temp/ByteString.hsc
+4
-3
4 additions, 3 deletions
System/Posix/Temp/ByteString.hsc
cbits/HsUnix.c
+0
-16
0 additions, 16 deletions
cbits/HsUnix.c
include/HsUnix.h
+0
-10
0 additions, 10 deletions
include/HsUnix.h
with
8 additions
and
32 deletions
System/Posix/Temp.hsc
+
4
−
3
View file @
3e32e391
{-# LANGUAGE CApiFFI #-}
#if __GLASGOW_HASKELL__ >= 709
#if __GLASGOW_HASKELL__ >= 709
{-# LANGUAGE Safe #-}
{-# LANGUAGE Safe #-}
#else
#else
...
@@ -33,7 +34,7 @@ import System.Posix.IO
...
@@ -33,7 +34,7 @@ import System.Posix.IO
import System.Posix.Types
import System.Posix.Types
import System.Posix.Internals (withFilePath, peekFilePath)
import System.Posix.Internals (withFilePath, peekFilePath)
foreign import c
call
unsafe "HsUnix.h
__hscore_
mkstemp"
foreign import c
api
unsafe "HsUnix.h mkstemp"
c_mkstemp :: CString -> IO CInt
c_mkstemp :: CString -> IO CInt
-- | Make a unique filename and open it for reading\/writing. The returned
-- | Make a unique filename and open it for reading\/writing. The returned
...
@@ -53,7 +54,7 @@ mkstemp template' = do
...
@@ -53,7 +54,7 @@ mkstemp template' = do
return (name, h)
return (name, h)
#if HAVE_MKSTEMPS
#if HAVE_MKSTEMPS
foreign import c
call
unsafe "HsUnix.h
__hscore_
mkstemps"
foreign import c
api
unsafe "HsUnix.h mkstemps"
c_mkstemps :: CString -> CInt -> IO CInt
c_mkstemps :: CString -> CInt -> IO CInt
#endif
#endif
...
@@ -81,7 +82,7 @@ mkstemps = error "System.Posix.Temp.mkstemps: not available on this platform"
...
@@ -81,7 +82,7 @@ mkstemps = error "System.Posix.Temp.mkstemps: not available on this platform"
#endif
#endif
#if HAVE_MKDTEMP
#if HAVE_MKDTEMP
foreign import c
call
unsafe "HsUnix.h
__hscore_
mkdtemp"
foreign import c
api
unsafe "HsUnix.h mkdtemp"
c_mkdtemp :: CString -> IO CString
c_mkdtemp :: CString -> IO CString
#endif
#endif
...
...
This diff is collapsed.
Click to expand it.
System/Posix/Temp/ByteString.hsc
+
4
−
3
View file @
3e32e391
{-# LANGUAGE CApiFFI #-}
#if __GLASGOW_HASKELL__ >= 709
#if __GLASGOW_HASKELL__ >= 709
{-# LANGUAGE Safe #-}
{-# LANGUAGE Safe #-}
#else
#else
...
@@ -38,7 +39,7 @@ import System.Posix.Directory (createDirectory)
...
@@ -38,7 +39,7 @@ import System.Posix.Directory (createDirectory)
import System.Posix.IO
import System.Posix.IO
import System.Posix.Types
import System.Posix.Types
foreign import c
call
unsafe "HsUnix.h
__hscore_
mkstemp"
foreign import c
api
unsafe "HsUnix.h mkstemp"
c_mkstemp :: CString -> IO CInt
c_mkstemp :: CString -> IO CInt
-- | Make a unique filename and open it for reading\/writing. The returned
-- | Make a unique filename and open it for reading\/writing. The returned
...
@@ -58,7 +59,7 @@ mkstemp template' = do
...
@@ -58,7 +59,7 @@ mkstemp template' = do
return (name, h)
return (name, h)
#if HAVE_MKSTEMPS
#if HAVE_MKSTEMPS
foreign import c
call
unsafe "HsUnix.h
__hscore_
mkstemps"
foreign import c
api
unsafe "HsUnix.h mkstemps"
c_mkstemps :: CString -> CInt -> IO CInt
c_mkstemps :: CString -> CInt -> IO CInt
#endif
#endif
...
@@ -82,7 +83,7 @@ mkstemps = error "System.Posix.Temp.mkstemps: not available on this platform"
...
@@ -82,7 +83,7 @@ mkstemps = error "System.Posix.Temp.mkstemps: not available on this platform"
#endif
#endif
#if HAVE_MKDTEMP
#if HAVE_MKDTEMP
foreign import c
call
unsafe "HsUnix.h
__hscore_
mkdtemp"
foreign import c
api
unsafe "HsUnix.h mkdtemp"
c_mkdtemp :: CString -> IO CString
c_mkdtemp :: CString -> IO CString
#endif
#endif
...
...
This diff is collapsed.
Click to expand it.
cbits/HsUnix.c
+
0
−
16
View file @
3e32e391
...
@@ -65,22 +65,6 @@ int __hsunix_push_module(int fd, const char *module)
...
@@ -65,22 +65,6 @@ int __hsunix_push_module(int fd, const char *module)
#endif
#endif
}
}
int
__hscore_mkstemp
(
char
*
filetemplate
)
{
return
(
mkstemp
(
filetemplate
));
}
#if HAVE_MKSTEMPS
int
__hscore_mkstemps
(
char
*
filetemplate
,
int
suffixlen
)
{
return
(
mkstemps
(
filetemplate
,
suffixlen
));
}
#endif
#if HAVE_MKDTEMP
char
*
__hscore_mkdtemp
(
char
*
filetemplate
)
{
return
(
mkdtemp
(
filetemplate
));
}
#endif
#ifdef HAVE_UNSETENV
#ifdef HAVE_UNSETENV
int
__hsunix_unsetenv
(
const
char
*
name
)
int
__hsunix_unsetenv
(
const
char
*
name
)
{
{
...
...
This diff is collapsed.
Click to expand it.
include/HsUnix.h
+
0
−
10
View file @
3e32e391
...
@@ -134,16 +134,6 @@ int __hsunix_unlockpt(int fd);
...
@@ -134,16 +134,6 @@ int __hsunix_unlockpt(int fd);
// push a SVR4 STREAMS module; do nothing if STREAMS not available
// push a SVR4 STREAMS module; do nothing if STREAMS not available
int
__hsunix_push_module
(
int
fd
,
const
char
*
module
);
int
__hsunix_push_module
(
int
fd
,
const
char
*
module
);
int
__hscore_mkstemp
(
char
*
filetemplate
);
#if HAVE_MKSTEMPS
int
__hscore_mkstemps
(
char
*
filetemplate
,
int
suffixlen
);
#endif
#if HAVE_MKDTEMP
char
*
__hscore_mkdtemp
(
char
*
filetemplate
);
#endif
int
__hsunix_unsetenv
(
const
char
*
name
);
int
__hsunix_unsetenv
(
const
char
*
name
);
/* A size that will contain many path names, but not necessarily all
/* A size that will contain many path names, but not necessarily all
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment