fix datime/1, system/2 and declaration for p_stream.
git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@40 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
This commit is contained in:
parent
59fdfadfa9
commit
c0ef937614
@ -4522,8 +4522,8 @@ StreamToFileNo(Term t)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
static Int
|
||||||
p_stream(Term t)
|
p_stream(void)
|
||||||
{
|
{
|
||||||
Term in = Deref(ARG1);
|
Term in = Deref(ARG1);
|
||||||
if (IsVarTerm(in))
|
if (IsVarTerm(in))
|
||||||
|
@ -282,7 +282,7 @@ shell(Command, Status) :-
|
|||||||
system(Command, Status) :-
|
system(Command, Status) :-
|
||||||
G = system(Command, Status),
|
G = system(Command, Status),
|
||||||
check_command(Command, G),
|
check_command(Command, G),
|
||||||
do_system(Status, Status).
|
do_system(Command, Status).
|
||||||
|
|
||||||
sleep(Interval) :- var(Interval), !,
|
sleep(Interval) :- var(Interval), !,
|
||||||
throw(error(instantiation_error,sleep(Interval))).
|
throw(error(instantiation_error,sleep(Interval))).
|
||||||
|
@ -80,8 +80,8 @@ datime(void)
|
|||||||
if (loc == NULL) {
|
if (loc == NULL) {
|
||||||
return(unify(ARG2, MkIntTerm(errno)));
|
return(unify(ARG2, MkIntTerm(errno)));
|
||||||
}
|
}
|
||||||
out[0] = MkIntTerm(loc->tm_year);
|
out[0] = MkIntTerm(1900+loc->tm_year);
|
||||||
out[1] = MkIntTerm(loc->tm_mon);
|
out[1] = MkIntTerm(1+loc->tm_mon);
|
||||||
out[2] = MkIntTerm(loc->tm_mday);
|
out[2] = MkIntTerm(loc->tm_mday);
|
||||||
out[3] = MkIntTerm(loc->tm_hour);
|
out[3] = MkIntTerm(loc->tm_hour);
|
||||||
out[4] = MkIntTerm(loc->tm_min);
|
out[4] = MkIntTerm(loc->tm_min);
|
||||||
@ -389,7 +389,7 @@ shell(void)
|
|||||||
|
|
||||||
/* execute a command as a detached process */
|
/* execute a command as a detached process */
|
||||||
static int
|
static int
|
||||||
p_system(void)
|
do_system(void)
|
||||||
{
|
{
|
||||||
char *command = AtomName(AtomOfTerm(ARG1));
|
char *command = AtomName(AtomOfTerm(ARG1));
|
||||||
int sys = system(command);
|
int sys = system(command);
|
||||||
@ -543,7 +543,7 @@ init_sys(void)
|
|||||||
UserCPredicate("p_environ", p_environ, 2);
|
UserCPredicate("p_environ", p_environ, 2);
|
||||||
UserCPredicate("exec_command", execute_command, 6);
|
UserCPredicate("exec_command", execute_command, 6);
|
||||||
UserCPredicate("do_shell", shell, 2);
|
UserCPredicate("do_shell", shell, 2);
|
||||||
UserCPredicate("do_system", p_system, 2);
|
UserCPredicate("do_system", do_system, 2);
|
||||||
UserCPredicate("popen", p_popen, 4);
|
UserCPredicate("popen", p_popen, 4);
|
||||||
UserCPredicate("wait", p_wait, 3);
|
UserCPredicate("wait", p_wait, 3);
|
||||||
UserCPredicate("host_name", host_name, 2);
|
UserCPredicate("host_name", host_name, 2);
|
||||||
|
Reference in New Issue
Block a user