Merge /Users/vsc/git/yap-6.3

This commit is contained in:
Vítor Santos Costa 2014-02-20 10:39:14 +00:00
commit f21823ea00
9 changed files with 50 additions and 22 deletions

View File

@ -575,7 +575,7 @@ putAtom(Atom atom, int Quote_illegal, struct write_globs *wglb)
wrf stream = wglb->stream;
if (IsBlob(atom)) {
wrputblob(RepAtom(atom),wglb->Quote_illegal,wglb);
wrputblob(RepAtom(atom),Quote_illegal,wglb);
return;
}
if (IsWideAtom(atom)) {
@ -621,6 +621,15 @@ putAtom(Atom atom, int Quote_illegal, struct write_globs *wglb)
}
}
void
Yap_WriteAtom(IOSTREAM *s, Atom atom)
{
struct write_globs wglb;
wglb.stream = s;
wglb.Quote_illegal = FALSE;
putAtom(atom, 0, &wglb);
}
static int
IsCodesTerm(Term string) /* checks whether this is a string */
{

View File

@ -36,6 +36,7 @@ extern IOENC Yap_DefaultEncoding(void);
extern void Yap_SetDefaultEncoding(IOENC);
extern void Yap_setCurrentSourceLocation( void *rd );
extern void *Yap_GetStreamHandle(Atom at);
extern void Yap_WriteAtom(IOSTREAM *s, Atom atom);
extern atom_t codeToAtom(int chrcode);

23
configure vendored
View File

@ -7170,10 +7170,11 @@ fi
INSTALL_DLLS="yes"
fi
CC="$CC -fstrict-aliasing -freorder-blocks -fsched-interblock -Wall"
DYNYAPLIB=libYap."$SO"
SONAMEFLAG=""
YAPLIB_LD="$CC -dynamiclib -Wl,-install_name,$prefix/lib/libYap.$SO"
DYNYAPLIB=libYap."$YAP_VERSION.$SO"
SONAMEFLAG="-Wl,-install_name,$prefix/lib/libYap.$YAP_MAJOR_VERSION.$SO -Wl,-compatibility_version,$YAP_MAJOR_VERSION.$YAP_MINOR_VERSION -Wl,-current_version,$YAP_VERSION"
YAPLIB_LD="$CC -dynamiclib"
PRE_INSTALL_ENV="DYLD_LIBRARY_PATH=\$(abs_top_builddir):\$(abs_top_builddir)/library/system:$DYLD_LIBRARY_PATH"
EXTRAYAPLIBS="libYap.$SO libYap.$YAP_MAJOR_VERSION.$SO"
;;
*netbsd*|*openbsd*|*freebsd*|*dragonfly*)
if echo __ELF__ | ${CC:-cc} -E - | grep -q __ELF__
@ -8963,7 +8964,7 @@ _ACEOF
fi
done
for ac_func in rename rint sbrk select setbuf
for ac_func in rename rint sbrk select setbuf setlinebuf
do :
as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
@ -12015,7 +12016,7 @@ else
JAVA_TEST=Test.java
CLASS_TEST=Test.class
cat << \EOF > $JAVA_TEST
/* #line 12018 "configure" */
/* #line 12019 "configure" */
public class Test {
}
EOF
@ -12191,7 +12192,7 @@ EOF
if uudecode$EXEEXT Test.uue; then
ac_cv_prog_uudecode_base64=yes
else
echo "configure: 12194: uudecode had trouble decoding base 64 file 'Test.uue'" >&5
echo "configure: 12195: uudecode had trouble decoding base 64 file 'Test.uue'" >&5
echo "configure: failed file was:" >&5
cat Test.uue >&5
ac_cv_prog_uudecode_base64=no
@ -12322,7 +12323,7 @@ else
JAVA_TEST=Test.java
CLASS_TEST=Test.class
cat << \EOF > $JAVA_TEST
/* #line 12325 "configure" */
/* #line 12326 "configure" */
public class Test {
}
EOF
@ -12357,7 +12358,7 @@ JAVA_TEST=Test.java
CLASS_TEST=Test.class
TEST=Test
cat << \EOF > $JAVA_TEST
/* [#]line 12360 "configure" */
/* [#]line 12361 "configure" */
public class Test {
public static void main (String args[]) {
System.exit (0);
@ -13008,6 +13009,12 @@ _ACEOF
if test $i_am_cross_compiling = yes
then
#mingw: we know where things are
JPLCFLAGS="-I \"$yap_cv_java\"/include -I \"$yap_cv_java\"/include/win32"
JAVALIBS="-L \"$yap_cv_java\"/jre/bin/server -L \"$yap_cv_java\"/jre/bin/client -ljvm"
fi

View File

@ -971,10 +971,11 @@ dnl Linux has both elf and a.out, in this case we found elf
INSTALL_DLLS="yes"
fi
CC="$CC -fstrict-aliasing -freorder-blocks -fsched-interblock -Wall"
DYNYAPLIB=libYap."$SO"
SONAMEFLAG=""
YAPLIB_LD="$CC -dynamiclib -Wl,-install_name,$prefix/lib/libYap.$SO"
DYNYAPLIB=libYap."$YAP_VERSION.$SO"
SONAMEFLAG="-Wl,-install_name,$prefix/lib/libYap.$YAP_MAJOR_VERSION.$SO -Wl,-compatibility_version,$YAP_MAJOR_VERSION.$YAP_MINOR_VERSION -Wl,-current_version,$YAP_VERSION"
YAPLIB_LD="$CC -dynamiclib"
PRE_INSTALL_ENV="DYLD_LIBRARY_PATH=\$(abs_top_builddir):\$(abs_top_builddir)/library/system:$DYLD_LIBRARY_PATH"
EXTRAYAPLIBS="libYap.$SO libYap.$YAP_MAJOR_VERSION.$SO"
;;
*netbsd*|*openbsd*|*freebsd*|*dragonfly*)
if echo __ELF__ | ${CC:-cc} -E - | grep -q __ELF__
@ -1538,7 +1539,7 @@ AC_CHECK_FUNCS(mbsnrtowcs)
AC_CHECK_FUNCS(memcpy memmove mkstemp mktemp)
AC_CHECK_FUNCS(nanosleep mktime opendir)
AC_CHECK_FUNCS(putenv rand random readlink regexec)
AC_CHECK_FUNCS(rename rint sbrk select setbuf)
AC_CHECK_FUNCS(rename rint sbrk select setbuf setlinebuf)
AC_CHECK_FUNCS(setitimer setlocale setsid setlinebuf sigaction)
AC_CHECK_FUNCS(siggetmask siginterrupt)
AC_CHECK_FUNCS(signal sigprocmask socket srand srandom stat)

View File

@ -1809,7 +1809,7 @@ PL_record_external
return NULL;
if ((nsz = Yap_ExportTerm(t, s, len, 0))) {
*sz = nsz;
return s;
return (record_t)s;
} else {
if (len < 16*1024)
len = len *2;

View File

@ -1448,7 +1448,11 @@ PRED_IMPL("with_output_to", 2, with_output_to, PL_FA_TRANSPARENT)
void
PL_write_prompt(int dowrite)
{ GET_LD
#if __YAP_PROLOG__
IOSTREAM *s = getStream(Suser_error);
#else
IOSTREAM *s = getStream(Suser_output);
#endif
if ( s )
{ if ( dowrite )
@ -1457,7 +1461,6 @@ PL_write_prompt(int dowrite)
if ( a )
writeAtomToStream(s, a);
}
Sflush(s);
releaseStream(s);
}
@ -2937,7 +2940,6 @@ PRED_IMPL("prompt", 2, prompt, 0)
void
prompt1(atom_t prompt)
{ GET_LD
if ( LD->prompt.first != prompt )
{ if ( LD->prompt.first )
PL_unregister_atom(LD->prompt.first);

View File

@ -415,7 +415,6 @@ Sread_readline(void *handle, char *buf, size_t size)
int fd = (int) h;
int ttymode = PL_ttymode(Suser_input); /* Not so nice */
int rval;
PL_write_prompt(ttymode == PL_NOTTY);
switch( ttymode )
@ -474,6 +473,9 @@ Sread_readline(void *handle, char *buf, size_t size)
reset_readline();
}
#if __YAP_PROLOG__
rl_outstream = stderr;
#endif
if ( in_readline++ )
{ int state = rl_readline_state;

View File

@ -2662,7 +2662,6 @@ Swrite_file(void *handle, char *buf, size_t size)
#else
bytes = write((int)h, buf, size);
#endif
if ( bytes == -1 && errno == EINTR )
{ if ( PL_handle_signals() < 0 )
{ errno = EPLEXCEPTION;
@ -3542,7 +3541,14 @@ SinitStreams(void)
if ( !isatty(i) && s->functions == &Sttyfunctions )
{ s->flags &= ~SIO_ISATTY;
s->functions = &Sfilefunctions; /* Check for pipe? */
#if HAVE_SETLINEBUF
/* make sure wwe buffer on new line for ttys, eg eclipse console */
} else if (i == 1) {
setlinebuf( stdout );
#endif
}
if ( s > 0)
s->newline = SIO_NL_DOS;
if ( s->encoding == ENC_ISO_LATIN_1 )
s->encoding = enc;
#ifdef O_PLMT

View File

@ -249,7 +249,7 @@ writeTopTerm(term_t t, int prec, write_options *options)
int
writeAtomToStream(IOSTREAM *s, atom_t atom)
{ Yap_plwrite(MkAtomTerm(YAP_AtomFromSWIAtom(atom)), s, 0, 0, 1200);
{ Yap_WriteAtom( s, YAP_AtomFromSWIAtom(atom));
return 1;
}