slots
This commit is contained in:
parent
35e9d432c1
commit
7d6082d39a
37
C/write.c
37
C/write.c
@ -1,20 +1,20 @@
|
||||
|
||||
/*************************************************************************
|
||||
* *
|
||||
* YAP Prolog *
|
||||
* *
|
||||
* Yap Prolog was developed at NCCUP - Universidade do Porto *
|
||||
* *
|
||||
* Copyright L.Damas, V.S.Costa and Universidade do Porto 1985-1997 *
|
||||
* *
|
||||
**************************************************************************
|
||||
* *
|
||||
* File: write.c *
|
||||
* Last rev: *
|
||||
* mods: *
|
||||
* comments: Writing a Prolog Term *
|
||||
* *
|
||||
*************************************************************************/
|
||||
* *
|
||||
* YAP Prolog *
|
||||
* *
|
||||
* Yap Prolog was developed at NCCUP - Universidade do Porto *
|
||||
* *
|
||||
* Copyright L.Damas, V.S.Costa and Universidade do Porto 1985-1997 *
|
||||
* *
|
||||
**************************************************************************
|
||||
* *
|
||||
* File: write.c *
|
||||
* Last rev: *
|
||||
* mods: *
|
||||
* comments: Writing a Prolog Term *
|
||||
* *
|
||||
*************************************************************************/
|
||||
#ifdef SCCS
|
||||
static char SccsId[] = "%W% %G%";
|
||||
#endif
|
||||
@ -325,7 +325,7 @@ static void wrputf(Float f, struct write_globs *wglb) /* writes a float */
|
||||
int found_dot = FALSE;
|
||||
char *pt = s;
|
||||
int ch;
|
||||
/* always use C locale for writing numbers */
|
||||
/* always use C locale for writing numbers */
|
||||
#if O_LOCALE
|
||||
const unsigned char *decimalpoint =
|
||||
(unsigned char *)localeconv()->decimal_point;
|
||||
@ -605,7 +605,7 @@ static void putAtom(Atom atom, int Quote_illegal, struct write_globs *wglb) {
|
||||
return;
|
||||
}
|
||||
s = (unsigned char *)RepAtom(atom)->StrOfAE;
|
||||
/* #define CRYPT_FOR_STEVE 1*/
|
||||
/* #define CRYPT_FOR_STEVE 1*/
|
||||
#ifdef CRYPT_FOR_STEVE
|
||||
if (Yap_GetValue(AtomCryptAtoms) != TermNil &&
|
||||
Yap_GetAProp(atom, OpProperty) == NIL) {
|
||||
@ -1274,7 +1274,6 @@ void Yap_plwrite(Term t, StreamDesc *mywrite, int max_depth, int flags,
|
||||
char *Yap_TermToString(Term t, size_t *lengthp, encoding_t enc, int flags) {
|
||||
CACHE_REGS
|
||||
int sno = Yap_open_buf_write_stream(enc, flags);
|
||||
int old_output_stream = LOCAL_c_output_stream;
|
||||
const char *sf;
|
||||
|
||||
if (sno < 0)
|
||||
@ -1285,9 +1284,9 @@ char *Yap_TermToString(Term t, size_t *lengthp, encoding_t enc, int flags) {
|
||||
else
|
||||
GLOBAL_Stream[sno].encoding = LOCAL_encoding;
|
||||
Yap_plwrite(t, GLOBAL_Stream + sno, 0, flags, GLOBAL_MaxPriority);
|
||||
|
||||
sf = Yap_MemExportStreamPtr(sno);
|
||||
Yap_CloseStream(sno);
|
||||
LOCAL_c_output_stream = old_output_stream;
|
||||
if (Yap_HasException())
|
||||
return NULL;
|
||||
return (char *)sf;
|
||||
|
Reference in New Issue
Block a user