view release on metacpan or search on metacpan
hugs98-Nov2003/fptools/libraries/unix/System/Posix.hs view on Meta::CPAN
sys/stat.h System.Posix.Files
sys/times.h System.Posix.Process
sys/types.h System.Posix.Types (with exceptions...)
sys/utsname.h System.Posix.Unistd
sys/wait.h System.Posix.Process
termios.h System.Posix.Terminal (check exceptions)
unistd.h System.Posix.*
utime.h System.Posix.Files
pwd.h System.Posix.User
grp.h System.Posix.User
stdlib.h: System.Posix.Env (getenv()/setenv()/unsetenv())
System.Posix.Temp (mkstemp())
sys/resource.h: System.Posix.Resource (get/setrlimit() only)
network package:
arpa/inet.h
net/if.h
netinet/in.h
netinet/tcp.h
sys/socket.h
hugs98-Nov2003/fptools/libraries/unix/System/Posix.hs view on Meta::CPAN
semaphore.h
setjmp.h
spawn.h
stdarg.h
stdbool.h
stddef.h
stdint.h
stdio.h except: popen()
stdlib.h except: exit(): System.Posix.Process
free()/malloc(): Foreign.Marshal.Alloc
getenv()/setenv(): ?? System.Environment
rand() etc.: System.Random
string.h
strings.h
stropts.h
sys/ipc.h
sys/msg.h
sys/sem.h
sys/shm.h
sys/timeb.h
sys/uio.h
hugs98-Nov2003/fptools/libraries/unix/System/Posix/Env.hsc view on Meta::CPAN
-- list of @(key,value)@ pairs.
getEnvironment :: IO [(String,String)]
getEnvironment = do
env <- getEnvironmentPrim
return $ map (dropEq.(break ((==) '='))) env
where
dropEq (x,'=':ys) = (x,ys)
dropEq (x,_) = error $ "getEnvironment: insane variable " ++ x
-- |The 'unsetenv' function deletes all instances of the variable name
-- from the environment.
unsetEnv :: String -> IO ()
#ifdef HAVE_UNSETENV
unsetEnv name = withCString name c_unsetenv
foreign import ccall unsafe "unsetenv"
c_unsetenv :: CString -> IO ()
#else
unsetEnv name = putEnv (name ++ "=")
#endif
-- |'putEnv' function takes an argument of the form @name=value@
-- and is equivalent to @setEnv(key,value,True{-overwrite-})@.
putEnv :: String -> IO ()
putEnv keyvalue = withCString keyvalue $ \s ->
throwErrnoIfMinus1_ "putenv" (c_putenv s)
foreign import ccall unsafe "putenv"
c_putenv :: CString -> IO CInt
{- |The 'setenv' function inserts or resets the environment variable name in
the current environment list. If the variable @name@ does not exist in the
list, it is inserted with the given value. If the variable does exist,
the argument @overwrite@ is tested; if @overwrite@ is @False@, the variable is
not reset, otherwise it is reset to the given value.
-}
setEnv :: String -> String -> Bool {-overwrite-} -> IO ()
#ifdef HAVE_SETENV
setEnv key value ovrwrt = do
withCString key $ \ keyP ->
withCString value $ \ valueP ->
throwErrnoIfMinus1_ "putenv" $
c_setenv keyP valueP (fromIntegral (fromEnum ovrwrt))
foreign import ccall unsafe "setenv"
c_setenv :: CString -> CString -> CInt -> IO CInt
#else
setEnv key value True = putEnv (key++"="++value)
setEnv key value False = do
res <- getEnv key
case res of
Just _ -> return ()
Nothing -> putEnv (key++"="++value)
#endif
hugs98-Nov2003/fptools/libraries/unix/System/Posix/Env_hsc_make.c view on Meta::CPAN
"-- list of @(key,value)@ pairs.\n"
"\n"
"getEnvironment :: IO [(String,String)]\n"
"getEnvironment = do\n"
" env <- getEnvironmentPrim\n"
" return $ map (dropEq.(break ((==) \'=\'))) env\n"
" where\n"
" dropEq (x,\'=\':ys) = (x,ys)\n"
" dropEq (x,_) = error $ \"getEnvironment: insane variable \" ++ x\n"
"\n"
"-- |The \'unsetenv\' function deletes all instances of the variable name\n"
"-- from the environment.\n"
"\n"
"unsetEnv :: String -> IO ()\n"
"", stdout);
#line 80 "Env.hsc"
#ifdef HAVE_UNSETENV
fputs ("\n"
"", stdout);
hsc_line (81, "Env.hsc");
fputs ("\n"
"unsetEnv name = withCString name c_unsetenv\n"
"\n"
"foreign import ccall unsafe \"unsetenv\"\n"
" c_unsetenv :: CString -> IO ()\n"
"", stdout);
#line 86 "Env.hsc"
#else
fputs ("\n"
"", stdout);
hsc_line (87, "Env.hsc");
fputs ("unsetEnv name = putEnv (name ++ \"=\")\n"
"", stdout);
#line 88 "Env.hsc"
#endif
hugs98-Nov2003/fptools/libraries/unix/System/Posix/Env_hsc_make.c view on Meta::CPAN
"-- |\'putEnv\' function takes an argument of the form @name=value@\n"
"-- and is equivalent to @setEnv(key,value,True{-overwrite-})@.\n"
"\n"
"putEnv :: String -> IO ()\n"
"putEnv keyvalue = withCString keyvalue $ \\s ->\n"
" throwErrnoIfMinus1_ \"putenv\" (c_putenv s)\n"
"\n"
"foreign import ccall unsafe \"putenv\"\n"
" c_putenv :: CString -> IO CInt\n"
"\n"
"{- |The \'setenv\' function inserts or resets the environment variable name in\n"
" the current environment list. If the variable @name@ does not exist in the\n"
" list, it is inserted with the given value. If the variable does exist,\n"
" the argument @overwrite@ is tested; if @overwrite@ is @False@, the variable is\n"
" not reset, otherwise it is reset to the given value.\n"
"-}\n"
"\n"
"setEnv :: String -> String -> Bool {-overwrite-} -> IO ()\n"
"", stdout);
#line 108 "Env.hsc"
#ifdef HAVE_SETENV
fputs ("\n"
"", stdout);
hsc_line (109, "Env.hsc");
fputs ("setEnv key value ovrwrt = do\n"
" withCString key $ \\ keyP ->\n"
" withCString value $ \\ valueP ->\n"
" throwErrnoIfMinus1_ \"putenv\" $\n"
"\tc_setenv keyP valueP (fromIntegral (fromEnum ovrwrt))\n"
"\n"
"foreign import ccall unsafe \"setenv\"\n"
" c_setenv :: CString -> CString -> CInt -> IO CInt\n"
"", stdout);
#line 117 "Env.hsc"
#else
fputs ("\n"
"", stdout);
hsc_line (118, "Env.hsc");
fputs ("setEnv key value True = putEnv (key++\"=\"++value)\n"
"setEnv key value False = do\n"
" res <- getEnv key\n"
" case res of\n"
hugs98-Nov2003/src/config.h.in view on Meta::CPAN
/* Define if you have the realpath function. */
#undef HAVE_REALPATH
/* Define if you have the rindex function. */
#undef HAVE_RINDEX
/* Define if you have the select function. */
#undef HAVE_SELECT
/* Define if you have the setenv function. */
#undef HAVE_SETENV
/* Define if you have the sigpoll function. */
#undef HAVE_SIGPOLL
/* Define if you have the sigprocmask function. */
#undef HAVE_SIGPROCMASK
/* Define if you have the snprintf function. */
#undef HAVE_SNPRINTF
hugs98-Nov2003/src/config.h.in view on Meta::CPAN
/* Define if you have the strrchr function. */
#undef HAVE_STRRCHR
/* Define if you have the time function. */
#undef HAVE_TIME
/* Define if you have the times function. */
#undef HAVE_TIMES
/* Define if you have the unsetenv function. */
#undef HAVE_UNSETENV
/* Define if you have the valloc function. */
#undef HAVE_VALLOC
/* Define if you have the vsnprintf function. */
#undef HAVE_VSNPRINTF
/* Define if you have the <Files.h> header file. */
#undef HAVE_FILES_H
hugs98-Nov2003/src/msc/config.h view on Meta::CPAN
/* Define if you have the realpath function. */
/* #undef HAVE_REALPATH */
/* Define if you have the rindex function. */
/* #undef HAVE_RINDEX */
/* Define if you have the select function. */
/* #undef HAVE_SELECT */
/* Define if you have the setenv function. */
/* #undef HAVE_SETENV */
/* Define if you have the sigprocmask function. */
/* #undef HAVE_SIGPROCMASK */
/* Define if you have the snprintf function. */
/* #undef HAVE_SNPRINTF */
/* Define if you have the stime function. */
/* #undef HAVE_STIME */
hugs98-Nov2003/src/msc/config.h view on Meta::CPAN
/* Define if you have the strrchr function. */
#define HAVE_STRRCHR 1
/* Define if you have the time function. */
#define HAVE_TIME 1
/* Define if you have the times function. */
/* #undef HAVE_TIMES */
/* Define if you have the unsetenv function. */
/* #undef HAVE_UNSETENV */
/* Define if you have the valloc function. */
/* #undef HAVE_VALLOC */
/* Define if you have the vsnprintf function. */
/* #undef HAVE_VSNPRINTF */
/* Define if you have the <arpa/inet.h> header file. */
/* #undef HAVE_ARPA_INET_H */
hugs98-Nov2003/src/unix/autom4te.cache/output.0 view on Meta::CPAN
if test `eval echo '${'$as_ac_var'}'` = yes; then
cat >>confdefs.h <<_ACEOF
@%:@define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
_ACEOF
fi
done
for ac_func in setenv unsetenv
do
as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
echo "$as_me:$LINENO: checking for $ac_func" >&5
echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
if eval "test \"\${$as_ac_var+set}\" = set"; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
hugs98-Nov2003/src/unix/autom4te.cache/traces.0 view on Meta::CPAN
m4trace:configure.in:628: -1- AC_CHECK_FUNCS([popen _popen ])
m4trace:configure.in:628: -1- AH_OUTPUT([HAVE_POPEN], [/* Define to 1 if you have the `popen\' function. */
#undef HAVE_POPEN])
m4trace:configure.in:628: -1- AH_OUTPUT([HAVE__POPEN], [/* Define to 1 if you have the `_popen\' function. */
#undef HAVE__POPEN])
m4trace:configure.in:629: -1- AC_CHECK_FUNCS([pclose _pclose ])
m4trace:configure.in:629: -1- AH_OUTPUT([HAVE_PCLOSE], [/* Define to 1 if you have the `pclose\' function. */
#undef HAVE_PCLOSE])
m4trace:configure.in:629: -1- AH_OUTPUT([HAVE__PCLOSE], [/* Define to 1 if you have the `_pclose\' function. */
#undef HAVE__PCLOSE])
m4trace:configure.in:630: -1- AC_CHECK_FUNCS([setenv unsetenv])
m4trace:configure.in:630: -1- AH_OUTPUT([HAVE_SETENV], [/* Define to 1 if you have the `setenv\' function. */
#undef HAVE_SETENV])
m4trace:configure.in:630: -1- AH_OUTPUT([HAVE_UNSETENV], [/* Define to 1 if you have the `unsetenv\' function. */
#undef HAVE_UNSETENV])
m4trace:configure.in:631: -1- AC_CHECK_FUNCS([sigprocmask])
m4trace:configure.in:631: -1- AH_OUTPUT([HAVE_SIGPROCMASK], [/* Define to 1 if you have the `sigprocmask\' function. */
#undef HAVE_SIGPROCMASK])
m4trace:configure.in:632: -1- AC_CHECK_FUNCS([getrusage])
m4trace:configure.in:632: -1- AH_OUTPUT([HAVE_GETRUSAGE], [/* Define to 1 if you have the `getrusage\' function. */
#undef HAVE_GETRUSAGE])
m4trace:configure.in:633: -1- AC_CHECK_FUNCS([times])
m4trace:configure.in:633: -1- AH_OUTPUT([HAVE_TIMES], [/* Define to 1 if you have the `times\' function. */
#undef HAVE_TIMES])
hugs98-Nov2003/src/unix/configure view on Meta::CPAN
if test `eval echo '${'$as_ac_var'}'` = yes; then
cat >>confdefs.h <<_ACEOF
#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
_ACEOF
fi
done
for ac_func in setenv unsetenv
do
as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
echo "$as_me:$LINENO: checking for $ac_func" >&5
echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
if eval "test \"\${$as_ac_var+set}\" = set"; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
hugs98-Nov2003/src/unix/configure.in view on Meta::CPAN
AC_CHECK_FUNCS(strcmp)
AC_CHECK_FUNCS(rindex)
AC_CHECK_FUNCS(strrchr)
AC_CHECK_FUNCS(canonicalize_file_name realpath _fullpath)
AC_CHECK_FUNCS(PBHSetVolSync macsystem)
AC_CHECK_FUNCS(fgetpos fsetpos fseek ftell)
AC_CHECK_FUNCS(vsnprintf _vsnprintf)
AC_CHECK_FUNCS(snprintf _snprintf )
AC_CHECK_FUNCS(popen _popen )
AC_CHECK_FUNCS(pclose _pclose )
AC_CHECK_FUNCS(setenv unsetenv)
AC_CHECK_FUNCS(sigprocmask)
AC_CHECK_FUNCS(getrusage)
AC_CHECK_FUNCS(times)
AC_CHECK_FUNCS(isatty)
AC_CHECK_FUNCS(fstat lstat)
AC_CHECK_FUNCS(select)
AC_CHECK_FUNCS(getclock)
AC_CHECK_FUNCS(gettimeofday)
AC_CHECK_FUNCS(ftime)
AC_CHECK_FUNCS(time)
hugs98-Nov2003/src/winhugs/config.h view on Meta::CPAN
/* Define if you have the realpath function. */
/* #undef HAVE_REALPATH */
/* Define if you have the rindex function. */
/* #undef HAVE_RINDEX */
/* Define if you have the select function. */
/* #undef HAVE_SELECT */
/* Define if you have the setenv function. */
/* #undef HAVE_SETENV */
/* Define if you have the sigprocmask function. */
/* #undef HAVE_SIGPROCMASK */
/* Define if you have the snprintf function. */
/* #undef HAVE_SNPRINTF */
/* Define if you have the stime function. */
/* #undef HAVE_STIME */
hugs98-Nov2003/src/winhugs/config.h view on Meta::CPAN
/* Define if you have the strrchr function. */
#define HAVE_STRRCHR 1
/* Define if you have the time function. */
#define HAVE_TIME 1
/* Define if you have the times function. */
/* #undef HAVE_TIMES */
/* Define if you have the unsetenv function. */
/* #undef HAVE_UNSETENV */
/* Define if you have the valloc function. */
/* #undef HAVE_VALLOC */
/* Define if you have the vsnprintf function. */
/* #undef HAVE_VSNPRINTF */
/* Define if you have the <arpa/inet.h> header file. */
/* #undef HAVE_ARPA_INET_H */