more fixes

This commit is contained in:
Vítor Santos Costa 2010-06-23 11:44:44 +01:00
parent d22cb9b6ab
commit 15546096fe
6 changed files with 26 additions and 5 deletions

View File

@ -4307,9 +4307,15 @@ BeginPredDefs(file)
EndPredDefs
#if __YAP_PROLOG__
static pl_Sgetc(IOSTREAM *s)
{
return Sgetc(s);
}
static void
init_yap_extras()
{
PL_YAP_InitSWIIO(FUNCTOR_dstream1, pl_Sgetc, Sputc, Sclose);
initCharTypes();
initFiles();
initGlob();

View File

@ -3458,3 +3458,4 @@ Scleanup(void)
*s = S__iob0[i]; /* re-initialise */
}
}

View File

@ -285,7 +285,6 @@ textToAtom(PL_chars_t *text)
}
#if __SWI_PROLOG__
word
textToString(PL_chars_t *text)
{ PL_canonise_text(text);
@ -296,7 +295,6 @@ textToString(PL_chars_t *text)
{ return globalWString(text->length, text->text.w);
}
}
#endif
int
@ -310,7 +308,6 @@ PL_unify_text(term_t term, term_t tail, PL_chars_t *text, int type)
return rval;
}
case PL_STRING:
#if __SWI_PROLOG__
{ word w = textToString(text);
if ( w )
@ -318,7 +315,6 @@ PL_unify_text(term_t term, term_t tail, PL_chars_t *text, int type)
else
return FALSE;
}
#endif
case PL_CODE_LIST:
case PL_CHAR_LIST:
{ if ( text->length == 0 )

View File

@ -72,6 +72,7 @@ extern void PL_save_text(PL_chars_t *text, int flags);
extern int PL_get_text__LD(term_t l, PL_chars_t *text, int flags ARG_LD);
extern atom_t textToAtom(PL_chars_t *text);
extern word textToString(PL_chars_t *text);
extern IOSTREAM * Sopen_text(PL_chars_t *text, const char *mode);
extern void PL_text_recode(PL_chars_t *text, IOENC encoding);

View File

@ -62,6 +62,20 @@ codeToAtom(int chrcode)
return a;
}
word
globalString(size_t size, char *s)
{
// return YAP_MkBlobStringTerm(s, size);
return 0L;
}
word
globalWString(size_t size, wchar_t *s)
{
// return YAP_MkBlobWideStringTerm(size, s);
return 0L;
}
int
PL_rethrow(void)
{ GET_LD

View File

@ -43,6 +43,9 @@ typedef uintptr_t PL_atomic_t; /* same a word */
extern atom_t codeToAtom(int chrcode);
extern word globalString(size_t size, char *s);
extern word globalWString(size_t size, wchar_t *s);
static inline word
INIT_SEQ_CODES(size_t n)
{
@ -61,7 +64,7 @@ EXTEND_SEQ_ATOMS(word gstore, int c) {
static inline int
CLOSE_SEQ_OF_CODES(word gstore, word lp, word arg2, word arg3, term_t l) {
if (arg3 == (word)ATOM_nil) {
if (arg2 == 0) {
if (!YAP_CloseList((YAP_Term)gstore, YAP_TermNil()))
return FALSE;
} else {