more SWI compatibility changes.
This commit is contained in:
@@ -419,7 +419,6 @@ do_char_type(term_t chr, term_t class, control_t h, int how)
|
||||
default:
|
||||
succeed;
|
||||
}
|
||||
|
||||
if ( !(fid = PL_open_foreign_frame()) )
|
||||
goto error;
|
||||
|
||||
@@ -800,11 +799,11 @@ PRED_IMPL("setlocale", 3, setlocale, 0)
|
||||
*******************************/
|
||||
|
||||
BeginPredDefs(ctype)
|
||||
PRED_DEF("swi_char_type", 2, char_type, PL_FA_NONDETERMINISTIC)
|
||||
PRED_DEF("swi_code_type", 2, code_type, PL_FA_NONDETERMINISTIC)
|
||||
PRED_DEF("swi_setlocale", 3, setlocale, 0)
|
||||
PRED_DEF("swi_downcase_atom", 2, downcase_atom, 0)
|
||||
PRED_DEF("swi_upcase_atom", 2, upcase_atom, 0)
|
||||
PRED_DEF("char_type", 2, char_type, PL_FA_NONDETERMINISTIC)
|
||||
PRED_DEF("code_type", 2, code_type, PL_FA_NONDETERMINISTIC)
|
||||
PRED_DEF("setlocale", 3, setlocale, 0)
|
||||
PRED_DEF("downcase_atom", 2, downcase_atom, 0)
|
||||
PRED_DEF("upcase_atom", 2, upcase_atom, 0)
|
||||
PRED_DEF("swi_normalize_space", 2, normalize_space, 0)
|
||||
EndPredDefs
|
||||
|
||||
|
@@ -126,7 +126,7 @@ PL_get_text__LD(term_t l, PL_chars_t *text, int flags ARG_LD)
|
||||
{ word w = valHandle(l);
|
||||
|
||||
if ( (flags & CVT_ATOM) && isAtom(w) )
|
||||
{ if ( !get_atom_text(w, text) )
|
||||
{ if ( !get_atom_text(atomFromTerm(w), text) )
|
||||
goto maybe_write;
|
||||
} else if ( (flags & CVT_STRING) && isString(w) )
|
||||
{ if ( !get_string_text(w, text PASS_LD) )
|
||||
|
@@ -222,6 +222,9 @@ _PL_unify_atomic(term_t t, PL_atomic_t a)
|
||||
|
||||
word lookupAtom(const char *s, size_t len)
|
||||
{
|
||||
/* dirty trick to ensure s is null terminated */
|
||||
char *st = (char *)s;
|
||||
st[len] = '\0';
|
||||
if (len >= strlen(s)) {
|
||||
return (word)YAP_LookupAtom(s);
|
||||
} else {
|
||||
|
@@ -121,7 +121,8 @@ PL_blob_t* YAP_find_blob_type(YAP_Atom at);
|
||||
#define valReal(w) YAP_FloatOfTerm((w))
|
||||
#define valFloat(w) YAP_FloatOfTerm((w))
|
||||
#define AtomLength(w) YAP_AtomNameLength(w)
|
||||
#define atomValue(atom) YAP_AtomOfTerm(atom)
|
||||
#define atomValue(atom) YAP_AtomFromSWIAtom(atom)
|
||||
#define atomFromTerm(term) YAP_AtomOfTerm(term)
|
||||
#define atomName(atom) ((char *)YAP_AtomName(atom))
|
||||
#define nameOfAtom(atom) ((char *)YAP_AtomName(atom))
|
||||
#define atomLength(atom) YAP_AtomNameLength(atom)
|
||||
|
Reference in New Issue
Block a user