cleanups.

This commit is contained in:
ubu32
2011-02-15 06:43:28 -08:00
parent 57f5ef8cfc
commit 185bb1b3f0
6 changed files with 57 additions and 1430 deletions

View File

@@ -2781,6 +2781,9 @@ Yap_TermToString(Term t, char *s, unsigned int sz, int flags)
return out;
}
extern atom_t fileNameStream(IOSTREAM *s);
extern Atom Yap_FileName(IOSTREAM *s);
Atom
Yap_FileName(IOSTREAM *s)
{
@@ -2788,6 +2791,36 @@ Yap_FileName(IOSTREAM *s)
return SWIAtomToAtom(a);
}
extern void closeFiles(int);
void
Yap_CloseStreams(int loud)
{
closeFiles(FALSE);
}
int Yap_StreamToFileNo(Term t) {
IOSTREAM *s;
int rc;
if ( (rc=PL_get_stream_handle(Yap_InitSlot(t), &s)) ) {
return Sfileno(s);
}
return -1;
}
FILE *Yap_FileDescriptorFromStream(Term t)
{
IOSTREAM *s;
int rc;
if ( (rc=PL_get_stream_handle(Yap_InitSlot(t), &s)) ) {
fprintf(stderr,"Unimplemented\n");
// return Sfileno(s);
}
return -1;
}
#ifdef _WIN32
#include <windows.h>