swig fixes for Android compatibility

This commit is contained in:
Vítor Santos Costa 2014-06-22 17:35:05 +01:00
parent 1f301ded89
commit 5b19ccf6a8
36 changed files with 2053 additions and 1861 deletions

View File

@ -2298,16 +2298,13 @@ YAP_EnterGoal(PredEntry *pe, Term *ptr, YAP_dogoalinfo *dgi)
Yap_PrepGoal(pe->ArityOfPE, ptr, B PASS_REGS);
P = pe->CodeOfPred;
dgi->b = LCL0-(CELL*)B;
{ CACHE_REGS __android_log_print(ANDROID_LOG_ERROR, __FUNCTION__, "EMUL IN Yap_regp=%p LCL0=(%p) %x", &Yap_REGS, LCL0, LCL0[-15]) ; }
out = run_emulator(dgi PASS_REGS);
//{ CACHE_REGS __android_log_print(ANDROID_LOG_ERROR, __FUNCTION__, "EMUL DONE Yap_regp=%p LCL0=(%p) %x", &Yap_REGS, LCL0, LCL0[-15]) ; }
RECOVER_MACHINE_REGS();
if (out) {
Yap_StartSlots( PASS_REGS1 );
} else {
LOCAL_CurSlot = dgi->CurSlot; // ignore any slots created within the called goal
}
{ __android_log_print(ANDROID_LOG_ERROR, __FUNCTION__, "EMUL DONE %d", out) ; }
return out;
}
@ -2991,7 +2988,6 @@ YAP_Init(YAP_init_args *yap_init)
if (initialised)
return YAP_BOOT_DONE_BEFOREHAND;
initialised = TRUE;
__android_log_print(ANDROID_LOG_INFO, "c_interface.c", "entered init %p", yap_init);
Yap_InitPageSize(); /* init memory page size, required by later functions */
#if defined(YAPOR_COPY) || defined(YAPOR_COW) || defined(YAPOR_SBA)
@ -3071,7 +3067,6 @@ YAP_Init(YAP_init_args *yap_init)
if (restore_result == FAIL_RESTORE) {
yap_init->ErrorNo = LOCAL_Error_TYPE;
yap_init->ErrorCause = LOCAL_ErrorMessage;
__android_log_print(ANDROID_LOG_INFO, __FILE__, "restore failed, %s ", LOCAL_ErrorMessage);
/* shouldn't RECOVER_MACHINE_REGS(); be here ??? */
return YAP_BOOT_ERROR;
}
@ -3108,7 +3103,6 @@ YAP_Init(YAP_init_args *yap_init)
#endif /* YAPOR */
RECOVER_MACHINE_REGS();
}
__android_log_print(ANDROID_LOG_INFO, __FILE__, "after loading startup %p", yap_init);
/* make sure we do this after restore */
if (yap_init->MaxStackSize) {
GLOBAL_AllowLocalExpansion = FALSE;
@ -3133,7 +3127,6 @@ YAP_Init(YAP_init_args *yap_init)
*/
yap_flags[HALT_AFTER_CONSULT_FLAG] = yap_init->HaltAfterConsult;
}
__android_log_print(ANDROID_LOG_INFO, __FILE__, "after loading startup %s",yap_init->YapPrologRCFile);
if (yap_init->YapPrologTopLevelGoal) {
Yap_PutValue(AtomTopLevelGoal, MkAtomTerm(Yap_LookupAtom(yap_init->YapPrologTopLevelGoal)));
}
@ -3146,7 +3139,6 @@ YAP_Init(YAP_init_args *yap_init)
if (yap_init->QuietMode) {
yap_flags[QUIET_MODE_FLAG] = TRUE;
}
__android_log_print(ANDROID_LOG_INFO, __FILE__, "after setting startup ");
if (BOOT_FROM_SAVED_STATE && !do_bootstrap) {
if (restore_result == FAIL_RESTORE) {
yap_init->ErrorNo = LOCAL_Error_TYPE;
@ -3162,11 +3154,9 @@ YAP_Init(YAP_init_args *yap_init)
if (restore_result == DO_ONLY_CODE) {
/* first, initialise the saved state */
Term t_goal = MkAtomTerm(AtomInitProlog);
__android_log_print(ANDROID_LOG_INFO, __FILE__, "restore init goal ");
YAP_RunGoalOnce(t_goal);
Yap_InitYaamRegs( 0 );
__android_log_print(ANDROID_LOG_INFO, __FILE__, "restore done, loaded startup ");
return YAP_BOOT_FROM_SAVED_CODE;
return YAP_BOOT_FROM_SAVED_CODE;
} else {
return YAP_BOOT_FROM_SAVED_STACKS;
}

View File

@ -789,7 +789,6 @@ PL_unify_wchars_diff(term_t t, term_t tail, int flags,
if ( len == (size_t)-1 )
len = wcslen(s);
text.text.w = (pl_wchar_t *)s;
text.encoding = ENC_WCHAR;
text.storage = PL_CHARS_HEAP;
@ -916,7 +915,6 @@ Yap_TermToString(Term t, char *s, size_t sz, size_t *length, int *encoding, int
char *
Yap_HandleToString(term_t l, size_t sz, size_t *length, int *encoding, int flags)
{
CACHE_REGS
char *r, buf[4096];
@ -926,12 +924,10 @@ Yap_HandleToString(term_t l, size_t sz, size_t *length, int *encoding, int flags
r = buf;
fd = Sopenmem(&r, &sz, "w");
fd->encoding = ENC_UTF8;
{ __android_log_print(ANDROID_LOG_ERROR, __FUNCTION__, "I %d LCL0+%s=(%p) %p", l, buf, LCL0, &LCL0 ); }
if ( PL_write_term(fd, l, 1200, flags) &&
Sputcode(EOS, fd) >= 0 &&
Sflush(fd) >= 0 )
{
{ __android_log_print(ANDROID_LOG_ERROR, __FUNCTION__, "I LCL0+%s=(%p) %p", buf, LCL0, &LCL0 ); }
size = Stell64(fd);
*length = size-1;
char *bf = malloc(*length+1);

View File

@ -828,7 +828,6 @@ ReadHash(IOSTREAM *stream)
static void
read_clauses(IOSTREAM *stream, PredEntry *pp, UInt nclauses, UInt flags) {
CACHE_REGS
__android_log_print(ANDROID_LOG_ERROR, __FUNCTION__ , " ? read_uint %p %d %p", pp, nclauses, stream);
if (pp->PredFlags & LogUpdatePredFlag) {
/* first, clean up whatever was there */
if (pp->cs.p_code.NOfClauses) {
@ -1005,17 +1004,14 @@ read_module(IOSTREAM *stream) {
InitHash();
read_header(stream);
ReadHash(stream);
__android_log_print(ANDROID_LOG_ERROR, __FUNCTION__ , " after read_hash %p", stream);
while ((x = read_tag(stream)) == QLY_START_MODULE) {
Term mod = (Term)read_uint(stream);
__android_log_print(ANDROID_LOG_ERROR, __FUNCTION__ , " after read_uint %x %p", mod, stream);
mod = MkAtomTerm(AtomAdjust(AtomOfTerm(mod)));
if (mod)
while ((x = read_tag(stream)) == QLY_START_PREDICATE) {
read_pred(stream, mod);
}
}
__android_log_print(ANDROID_LOG_ERROR, __FUNCTION__ , " %p", stream);
read_ops(stream);
CloseHash();
}
@ -1086,12 +1082,10 @@ Yap_Restore(char *s, char *lib_dir)
IOSTREAM *stream = Yap_OpenRestore(s, lib_dir);
if (!stream)
return -1;
__android_log_print(ANDROID_LOG_INFO, "qlyr.c", "loading startup %p", stream);
GLOBAL_RestoreFile = s;
read_module(stream);
Sclose( stream );
GLOBAL_RestoreFile = NULL;
__android_log_print(ANDROID_LOG_INFO, "qlyr.c", "loading startup %p, done", stream);
return DO_ONLY_CODE;
}

View File

@ -250,12 +250,10 @@ open_file(char *my_file, int flag)
#if __ANDROID__
if (strstr(my_file, "/assets/") == my_file) {
if (flag == O_RDONLY) {
extern AAssetManager *assetManager;
my_file += strlen("/assets/");
AAsset* asset = AAssetManager_open(assetManager, my_file, AASSET_MODE_UNKNOWN);
AAsset* asset = AAssetManager_open(GLOBAL_assetManager, my_file, AASSET_MODE_UNKNOWN);
if (!asset)
return -1;
__android_log_print(ANDROID_LOG_ERROR, __FUNCTION__ , " %p", asset);
AAsset_close( asset );
return 0; // usually the file will be compressed, so there is no point in actually trying to open it.
}
@ -1472,7 +1470,6 @@ OpenRestore(char *inpf, char *YapLibDir, CELL *Astate, CELL *ATrail, CELL *AStac
if (!inpf)
inpf = YAPSTARTUP;
#endif
__android_log_print(ANDROID_LOG_ERROR, "save.c", "saved state %s", inpf);
save_buffer[0] = '\0';
// LOCAL_ErrorMessage = NULL;
if (inpf == NULL) {
@ -1499,7 +1496,6 @@ OpenRestore(char *inpf, char *YapLibDir, CELL *Astate, CELL *ATrail, CELL *AStac
!((splfild = open_file(inpf, O_RDONLY)) < 0))
{
if ((mode = try_open(inpf,Astate,ATrail,AStack,AHeap,save_buffer,streamp)) != FAIL_RESTORE) {
__android_log_print(ANDROID_LOG_ERROR, "save.c", "saved state %p", *streamp);
return mode;
}
}
@ -1605,7 +1601,6 @@ Yap_OpenRestore(char *inpf, char *YapLibDir)
IOSTREAM *stream = NULL;
OpenRestore(inpf, YapLibDir, NULL, NULL, NULL, NULL, &stream);
__android_log_print(ANDROID_LOG_ERROR, "save.c", "saved state %p", stream);
return stream;
}

View File

@ -134,7 +134,6 @@ Yap_WinError(char *yap_error)
static int
is_directory(char *FileName)
{
__android_log_print(ANDROID_LOG_INFO, __FUNCTION__, " %s ",FileName);
#ifdef _WIN32
char s[YAP_FILENAME_MAX+1];
char *s0 = FileName;
@ -2735,6 +2734,34 @@ p_yap_paths( USES_REGS1 ) {
Yap_unify(out3,ARG3));
}
static Int
p_log_event( USES_REGS1 ) {
Term in = Deref(ARG1);
Atom at;
if (IsVarTerm(in))
return FALSE;
if (!IsAtomTerm(in))
return FALSE;
at = AtomOfTerm( in );
#if DEBUG
if (IsWideAtom(at) )
fprintf(stderr, "LOG %S\n", RepAtom(at)->WStrOfAE);
else if (IsBlob(at))
return FALSE;
else
fprintf(stderr, "LOG %s\n", RepAtom(at)->StrOfAE);
#endif
if (IsWideAtom(at) || IsBlob(at))
return FALSE;
#if __ANDROID__
__android_log_print(ANDROID_LOG_INFO, "YAP", " %s ",RepAtom(at)->StrOfAE);
#endif
return TRUE;
}
static Int
p_env_separator( USES_REGS1 ) {
#if defined(_WIN32)
@ -3065,6 +3092,7 @@ Yap_InitSysPreds(void)
Yap_InitCPred ("set_random_state", 2, p_set_random_state, SafePredFlag);
Yap_InitCPred ("release_random_state", 1, p_release_random_state, SafePredFlag);
#endif
Yap_InitCPred ("log_event", 1, p_log_event, SafePredFlag|SyncPredFlag);
Yap_InitCPred ("sh", 0, p_sh, SafePredFlag|SyncPredFlag);
Yap_InitCPred ("$shell", 1, p_shell, SafePredFlag|SyncPredFlag|UserCPredFlag);
Yap_InitCPred ("system", 1, p_system, SafePredFlag|SyncPredFlag|UserCPredFlag);

View File

@ -574,7 +574,6 @@ putAtom(Atom atom, int Quote_illegal, struct write_globs *wglb)
wtype atom_or_symbol;
wrf stream = wglb->stream;
{ CACHE_REGS __android_log_print(ANDROID_LOG_ERROR, __FUNCTION__, "AA LCL0=(%p) %p", LCL0, &LCL0 ); }
if (IsBlob(atom)) {
wrputblob(RepAtom(atom),Quote_illegal,wglb);
return;
@ -594,11 +593,7 @@ putAtom(Atom atom, int Quote_illegal, struct write_globs *wglb)
}
return;
}
{ CACHE_REGS __android_log_print(ANDROID_LOG_ERROR, __FUNCTION__, "AB LCL0=(%p) %p", LCL0, &LCL0 ); }
{ CACHE_REGS __android_log_print(ANDROID_LOG_ERROR, __FUNCTION__, "AB LCL0=(%p) %p", LCL0, RepAtom(atom)->StrOfAE ); }
{ CACHE_REGS __android_log_print(ANDROID_LOG_ERROR, __FUNCTION__, "AB LCL0=(%p) %c", LCL0, RepAtom(atom)->StrOfAE[0]); }
s = (unsigned char *)RepAtom(atom)->StrOfAE;
{ CACHE_REGS __android_log_print(ANDROID_LOG_ERROR, __FUNCTION__, "AC %s LCL0=(%p) %p", s, LCL0, &LCL0 ); }
/* #define CRYPT_FOR_STEVE 1*/
#ifdef CRYPT_FOR_STEVE
if (Yap_GetValue(AtomCryptAtoms) != TermNil && Yap_GetAProp(atom, OpProperty) == NIL) {
@ -891,16 +886,12 @@ writeTerm(Term t, int p, int depth, int rinfixarg, struct write_globs *wglb, str
if (EX)
return;
t = Deref(t);
{ CACHE_REGS __android_log_print(ANDROID_LOG_ERROR, __FUNCTION__, "I %d LCL0=(%p) %p", t, LCL0, &LCL0 ); }
if (IsVarTerm(t)) {
{ CACHE_REGS __android_log_print(ANDROID_LOG_ERROR, __FUNCTION__, "V %d LCL0=(%p) %p", t, LCL0, &LCL0 ); }
write_var((CELL *)t, wglb, &nrwt);
} else if (IsIntTerm(t)) {
{ CACHE_REGS __android_log_print(ANDROID_LOG_ERROR, __FUNCTION__, "I %d LCL0=(%p) %p", t, LCL0, &LCL0 ); }
wrputn((Int) IntOfTerm(t),wglb);
} else if (IsAtomTerm(t)) {
{ CACHE_REGS __android_log_print(ANDROID_LOG_ERROR, __FUNCTION__, "A %d LCL0=(%p) %p", t, LCL0, &LCL0 ); }
putAtom(AtomOfTerm(t), wglb->Quote_illegal, wglb);
} else if (IsPairTerm(t)) {
if (wglb->Ignore_ops) {
@ -933,18 +924,14 @@ writeTerm(Term t, int p, int depth, int rinfixarg, struct write_globs *wglb, str
if (yap_flags[WRITE_QUOTED_STRING_FLAG] && IsCodesTerm(t)) {
putString(t, wglb);
} else {
{ CACHE_REGS __android_log_print(ANDROID_LOG_ERROR, __FUNCTION__, "I %d LCL0=(%p) %p", t, LCL0, &LCL0 ); }
wrputc('[', wglb->stream);
lastw = separator;
/* we assume t was already saved in the stack */
{ CACHE_REGS __android_log_print(ANDROID_LOG_ERROR, __FUNCTION__, "II %d LCL0=(%p) %p", t, LCL0, &LCL0 ); }
write_list(t, 0, depth, wglb, rwt);
wrputc(']', wglb->stream);
{ CACHE_REGS __android_log_print(ANDROID_LOG_ERROR, __FUNCTION__, "III II%d LCL0=(%p) %p", t, LCL0, &LCL0 ); }
lastw = separator;
}
} else { /* compound term */
{ CACHE_REGS __android_log_print(ANDROID_LOG_ERROR, __FUNCTION__, "I %d LCL0=(%p) %p", t, LCL0, &LCL0 ); }
Functor functor = FunctorOfTerm(t);
int Arity;
Atom atom;
@ -1101,8 +1088,7 @@ writeTerm(Term t, int p, int depth, int rinfixarg, struct write_globs *wglb, str
} else if (!wglb->Ignore_ops &&
Arity == 2 && Yap_IsInfixOp(atom, &op, &lp,
&rp) ) {
{ CACHE_REGS __android_log_print(ANDROID_LOG_ERROR, __FUNCTION__, "II %d LCL0=(%p) %p", t, LCL0, &LCL0 ); }
Term tleft = ArgOfTerm(1, t);
Term tleft = ArgOfTerm(1, t);
Term tright = ArgOfTerm(2, t);
int bracket_left =
!IsVarTerm(tleft) && IsAtomTerm(tleft) &&
@ -1119,9 +1105,7 @@ writeTerm(Term t, int p, int depth, int rinfixarg, struct write_globs *wglb, str
if (bracket_left) {
wropen_bracket(wglb, TRUE);
}
{ CACHE_REGS __android_log_print(ANDROID_LOG_ERROR, __FUNCTION__, "III %d LCL0=(%p) %p", t, LCL0, &LCL0 ); }
writeTerm(from_pointer(RepAppl(t)+1, &nrwt, wglb), lp, depth + 1, rinfixarg, wglb, &nrwt);
{ CACHE_REGS __android_log_print(ANDROID_LOG_ERROR, __FUNCTION__, "IV %d LCL0=(%p) %p", t, LCL0, &LCL0 ); }
t = AbsAppl(restore_from_write(&nrwt, wglb)-1);
if (bracket_left) {
wrclose_bracket(wglb, TRUE);
@ -1256,7 +1240,6 @@ Yap_plwrite(Term t, void *mywrite, int max_depth, int flags, int priority)
wglb.Ignore_ops = flags & Ignore_ops_f;
wglb.Write_strings = flags & BackQuote_String_f;
/* protect slots for portray */
{ CACHE_REGS __android_log_print(ANDROID_LOG_ERROR, __FUNCTION__, "I %d LCL0=(%p) %p", t, LCL0, &LCL0 ); }
writeTerm(from_pointer(&t, &rwt, &wglb), priority, 1, FALSE, &wglb, &rwt);
restore_from_write(&rwt, &wglb);
}

View File

@ -256,7 +256,7 @@ bool YAPTerm::variant(YAPTerm t1) {
return out;
}
intptr_t YAPTerm::hash(size_t sz, size_t depth, bool variant) {
intptr_t YAPTerm::hashTerm(size_t sz, size_t depth, bool variant) {
intptr_t out;
BACKUP_MACHINE_REGS();
@ -374,12 +374,14 @@ char *YAPAtom::getName(void) {
}
YAPPredicate::YAPPredicate(const char *s, Term **outp, term_t &vnames) {
YAPPredicate::YAPPredicate(const char *s, Term **outp, term_t &vnames) throw (int) {
CACHE_REGS
vnames = Yap_NewSlots(1 PASS_REGS);
Term t = Yap_StringToTerm(s, strlen(s)+1, vnames);
if (t == 0L)
throw YAPError::SYNTAX_ERROR;
ap = getPred( t, outp );
{ CACHE_REGS __android_log_print(ANDROID_LOG_ERROR, __FUNCTION__, "OUT vnames=%d ap=%p LCL0=%p", vnames, ap, LCL0) ; }
//{ CACHE_REGS __android_log_print(ANDROID_LOG_ERROR, __FUNCTION__, "OUT vnames=%d ap=%p LCL0=%p", vnames, ap, LCL0) ; }
}
YAPPredicate::YAPPredicate(YAPAtom at) {
@ -477,7 +479,6 @@ YAPQuery::YAPQuery(YAPPredicate p, YAPTerm t[]): YAPPredicate(p.ap)
}
YAPListTerm YAPQuery::namedVars() {
{ CACHE_REGS __android_log_print(ANDROID_LOG_ERROR, __FUNCTION__, "vnames=%d LCL0=%p %x", vnames, LCL0, LCL0[vnames]) ; }
CACHE_REGS
Term o = Yap_GetFromSlot( vnames PASS_REGS );
return YAPListTerm( o );
@ -487,7 +488,6 @@ bool YAPQuery::next()
{
CACHE_REGS
int result;
{ CACHE_REGS __android_log_print(ANDROID_LOG_ERROR, __FUNCTION__, " CALL vnames=%d ap=%p LCL0=%p %x", vnames, ap, LCL0, LCL0[vnames]) ; }
if (this->q_open != 1) return false;
if (setjmp(((YAPQuery *)LOCAL_execution)->q_env))
return false;
@ -501,12 +501,10 @@ bool YAPQuery::next()
result = (bool)YAP_RetryGoal(&this->q_h);
}
this->q_state = 1;
{ CACHE_REGS __android_log_print(ANDROID_LOG_ERROR, __FUNCTION__, "FAIL vnames=%d %d LCL0=(%p) %x", vnames, result, LCL0, LCL0[vnames]) ; }
if (!result) {
YAP_LeaveGoal(FALSE, &this->q_h);
this->q_open = 0;
}
{ CACHE_REGS __android_log_print(ANDROID_LOG_ERROR, __FUNCTION__, "SUCCESS vnames=%d ap=%p LCL0=(%p) %x", vnames, ap, LCL0, LCL0[vnames]) ; }
return result;
}
@ -599,7 +597,7 @@ YAPEngine::YAPEngine( char *savedState,
YAPCallback *cb): _callback(0)
{ // a single engine can be active
#if __ANDROID__
if (assetManager == (AAssetManager *)NULL)
if (GLOBAL_assetManager == (AAssetManager *)NULL)
return;
Yap_DisplayWithJava = displayWithJava;
Yap_AndroidBufp = (char *)malloc(Yap_AndroidMax = 4096);

View File

@ -18,6 +18,10 @@
*/
#include <stdlib.h>
// Bad export from Python
#ifdef HAVE_STAT
#undef HAVE_STAT
#endif
#include <config.h>
extern "C" {
@ -90,6 +94,8 @@ class YAPApplTerm;
class YAPPairTerm;
class YAPQuery;
#include "yapie.hh"
class TypeError {};
/**
@ -126,7 +132,7 @@ public:
bool unify(YAPTerm t1); /// t = t1
bool unifiable(YAPTerm t1); /// we can unify t and t1
bool variant(YAPTerm t1); /// t =@= t1, the two terms are equal up to variable renaming
intptr_t hash(size_t sz, size_t depth, bool variant); /// term hash,
intptr_t hashTerm(size_t sz, size_t depth, bool variant); /// term hash,
bool isVar() { return IsVarTerm( gt() ); } /// type check for unbound
bool isAtom() { return IsAtomTerm( gt() ); } /// type check for atom
bool isInteger() { return IsIntegerTerm( gt() ); } /// type check for integer
@ -356,7 +362,7 @@ private:
///
/// It also communicates the array of arguments t[] abd the array of variables
/// back to yapquery
YAPPredicate(const char *s, Term **outp, yhandle_t& vnames );
YAPPredicate(const char *s, Term **outp, yhandle_t& vnames ) throw (int);
/// Term constructor for predicates
///
@ -415,9 +421,11 @@ public:
/// String constructor for predicates.
///
/// String is a Prolog term, we extract the main functor after considering the module qualifiers.
inline YAPPredicate(char *s) {
inline YAPPredicate(char *s) throw (int) {
Term t, tp;
t = YAP_ReadBuffer(s,&tp);
if (t == 0L)
throw YAPError::SYNTAX_ERROR;
ap = getPred( t, (Term **)NULL );
}
@ -425,9 +433,11 @@ public:
/// String constructor for predicates, also keeps arguments in tp[]
///
/// String is a Prolog term, we extract the main functor after considering the module qualifiers.
inline YAPPredicate(char *s, Term **outp) {
inline YAPPredicate(char *s, Term **outp) throw (int) {
Term t, tp;
t = YAP_ReadBuffer(s,&tp);
if (t == 0L)
throw YAPError::SYNTAX_ERROR;
ap = getPred( t, (Term **)NULL );
}

View File

@ -37,6 +37,10 @@
#error THREADS only works with YAPOR_THREADS
#endif /* THREADS && (YAPOR_COW || YAPOR_SBA || YAPOR_COPY) */
// Bad export from Python
#ifdef HAVE_STAT
#undef HAVE_STAT
#endif
#include "config.h"
#define FunAdr(X) X

View File

@ -1,119 +1,123 @@
/* This file, dglobals.h, was generated automatically by "yap -L misc/buildlocalglobal"
please do not update, update misc/GLOBALS instead */
#define GLOBAL_Initialised Yap_global->Initialised_
#define GLOBAL_InitialisedFromPL Yap_global->InitialisedFromPL_
#define GLOBAL_PL_Argc Yap_global->PL_Argc_
#define GLOBAL_PL_Argv Yap_global->PL_Argv_
#define GLOBAL_HaltHooks Yap_global->HaltHooks_
#define GLOBAL_AllowLocalExpansion Yap_global->AllowLocalExpansion_
#define GLOBAL_AllowGlobalExpansion Yap_global->AllowGlobalExpansion_
#define GLOBAL_AllowTrailExpansion Yap_global->AllowTrailExpansion_
#define GLOBAL_SizeOfOverflow Yap_global->SizeOfOverflow_
#define GLOBAL_AGcThreshold Yap_global->AGcThreshold_
#define GLOBAL_AGCHook Yap_global->AGCHook_
#if THREADS
#define GLOBAL_NOfThreads Yap_global->NOfThreads_
#define GLOBAL_NOfThreadsCreated Yap_global->NOfThreadsCreated_
#define GLOBAL_ThreadsTotalTime Yap_global->ThreadsTotalTime_
#define GLOBAL_ThreadHandlesLock Yap_global->ThreadHandlesLock_
#endif
#if defined(YAPOR) || defined(THREADS)
#define GLOBAL_BGL Yap_global->BGL_
#endif
#if defined(YAPOR) || defined(TABLING)
#define GLOBAL_optyap_data Yap_global->optyap_data_
#endif /* YAPOR || TABLING */
#define GLOBAL_PrologShouldHandleInterrupts Yap_global->PrologShouldHandleInterrupts_
#if defined(THREADS)
#define GLOBAL_master_thread Yap_global->master_thread_
#endif /* THREADS */
#define GLOBAL_stdout Yap_global->stdout_
#define GLOBAL_stderr Yap_global->stderr_
#define GLOBAL_argv Yap_global->argv_
#define GLOBAL_argc Yap_global->argc_
#ifdef COROUTINING
#define GLOBAL_attas Yap_global->attas_
#endif
#define GLOBAL_agc_calls Yap_global->agc_calls_
#define GLOBAL_agc_collected Yap_global->agc_collected_
#define GLOBAL_tot_agc_time Yap_global->tot_agc_time_
#define GLOBAL_tot_agc_recovered Yap_global->tot_agc_recovered_
#if HAVE_MMAP
#define GLOBAL_mmap_arrays Yap_global->mmap_arrays_
#endif
#ifdef DEBUG
#define GLOBAL_Option Yap_global->Option_
#define GLOBAL_logfile Yap_global->logfile_
#endif
#if defined(COFF) || defined(A_OUT)
#define GLOBAL_Executable Yap_global->Executable_
#endif
#define GLOBAL_OpaqueHandlersCount Yap_global->OpaqueHandlersCount_
#define GLOBAL_OpaqueHandlers Yap_global->OpaqueHandlers_
#if __simplescalar__
#define GLOBAL_pwd Yap_global->pwd_
#endif
#define GLOBAL_RestoreFile Yap_global->RestoreFile_
#define GLOBAL_ProfCalls Yap_global->ProfCalls_
#define GLOBAL_ProfGCs Yap_global->ProfGCs_
#define GLOBAL_ProfHGrows Yap_global->ProfHGrows_
#define GLOBAL_ProfSGrows Yap_global->ProfSGrows_
#define GLOBAL_ProfMallocs Yap_global->ProfMallocs_
#define GLOBAL_ProfIndexing Yap_global->ProfIndexing_
#define GLOBAL_ProfOn Yap_global->ProfOn_
#define GLOBAL_ProfOns Yap_global->ProfOns_
#define GLOBAL_ProfilerRoot Yap_global->ProfilerRoot_
#define GLOBAL_ProfilerNil Yap_global->ProfilerNil_
#define GLOBAL_DIRNAME Yap_global->DIRNAME_
#if LOW_PROF
#define GLOBAL_ProfilerOn Yap_global->ProfilerOn_
#define GLOBAL_FProf Yap_global->FProf_
#define GLOBAL_FPreds Yap_global->FPreds_
#endif /* LOW_PROF */
/* This file, dglobals.h, was generated automatically by "yap -L misc/buildlocalglobal"
please do not update, update misc/GLOBALS instead */
#define GLOBAL_Initialised Yap_global->Initialised_
#define GLOBAL_InitialisedFromPL Yap_global->InitialisedFromPL_
#define GLOBAL_PL_Argc Yap_global->PL_Argc_
#define GLOBAL_PL_Argv Yap_global->PL_Argv_
#define GLOBAL_HaltHooks Yap_global->HaltHooks_
#define GLOBAL_AllowLocalExpansion Yap_global->AllowLocalExpansion_
#define GLOBAL_AllowGlobalExpansion Yap_global->AllowGlobalExpansion_
#define GLOBAL_AllowTrailExpansion Yap_global->AllowTrailExpansion_
#define GLOBAL_SizeOfOverflow Yap_global->SizeOfOverflow_
#define GLOBAL_AGcThreshold Yap_global->AGcThreshold_
#define GLOBAL_AGCHook Yap_global->AGCHook_
#if __ANDROID__
#define GLOBAL_assetManager Yap_global->assetManager_
#endif
#if THREADS
#define GLOBAL_NOfThreads Yap_global->NOfThreads_
#define GLOBAL_NOfThreadsCreated Yap_global->NOfThreadsCreated_
#define GLOBAL_ThreadsTotalTime Yap_global->ThreadsTotalTime_
#define GLOBAL_ThreadHandlesLock Yap_global->ThreadHandlesLock_
#endif
#if defined(YAPOR) || defined(THREADS)
#define GLOBAL_BGL Yap_global->BGL_
#endif
#if defined(YAPOR) || defined(TABLING)
#define GLOBAL_optyap_data Yap_global->optyap_data_
#endif /* YAPOR || TABLING */
#define GLOBAL_PrologShouldHandleInterrupts Yap_global->PrologShouldHandleInterrupts_
#if defined(THREADS)
#define GLOBAL_master_thread Yap_global->master_thread_
#endif /* THREADS */
#define GLOBAL_stdout Yap_global->stdout_
#define GLOBAL_stderr Yap_global->stderr_
#define GLOBAL_argv Yap_global->argv_
#define GLOBAL_argc Yap_global->argc_
#ifdef COROUTINING
#define GLOBAL_attas Yap_global->attas_
#endif
#define GLOBAL_agc_calls Yap_global->agc_calls_
#define GLOBAL_agc_collected Yap_global->agc_collected_
#define GLOBAL_tot_agc_time Yap_global->tot_agc_time_
#define GLOBAL_tot_agc_recovered Yap_global->tot_agc_recovered_
#if HAVE_MMAP
#define GLOBAL_mmap_arrays Yap_global->mmap_arrays_
#endif
#ifdef DEBUG
#define GLOBAL_Option Yap_global->Option_
#define GLOBAL_logfile Yap_global->logfile_
#endif
#if defined(COFF) || defined(A_OUT)
#define GLOBAL_Executable Yap_global->Executable_
#endif
#define GLOBAL_OpaqueHandlersCount Yap_global->OpaqueHandlersCount_
#define GLOBAL_OpaqueHandlers Yap_global->OpaqueHandlers_
#if __simplescalar__
#define GLOBAL_pwd Yap_global->pwd_
#endif
#define GLOBAL_RestoreFile Yap_global->RestoreFile_
#define GLOBAL_ProfCalls Yap_global->ProfCalls_
#define GLOBAL_ProfGCs Yap_global->ProfGCs_
#define GLOBAL_ProfHGrows Yap_global->ProfHGrows_
#define GLOBAL_ProfSGrows Yap_global->ProfSGrows_
#define GLOBAL_ProfMallocs Yap_global->ProfMallocs_
#define GLOBAL_ProfIndexing Yap_global->ProfIndexing_
#define GLOBAL_ProfOn Yap_global->ProfOn_
#define GLOBAL_ProfOns Yap_global->ProfOns_
#define GLOBAL_ProfilerRoot Yap_global->ProfilerRoot_
#define GLOBAL_ProfilerNil Yap_global->ProfilerNil_
#define GLOBAL_DIRNAME Yap_global->DIRNAME_
#if LOW_PROF
#define GLOBAL_ProfilerOn Yap_global->ProfilerOn_
#define GLOBAL_FProf Yap_global->FProf_
#define GLOBAL_FPreds Yap_global->FPreds_
#endif /* LOW_PROF */

View File

@ -1,428 +1,435 @@
/* This file, dlocals.h, was generated automatically by "yap -L misc/buildlocalglobal"
please do not update, update misc/LOCALS instead */
#define LOCAL_c_input_stream LOCAL->c_input_stream_
#define REMOTE_c_input_stream(wid) REMOTE(wid)->c_input_stream_
#define LOCAL_c_output_stream LOCAL->c_output_stream_
#define REMOTE_c_output_stream(wid) REMOTE(wid)->c_output_stream_
#define LOCAL_c_error_stream LOCAL->c_error_stream_
#define REMOTE_c_error_stream(wid) REMOTE(wid)->c_error_stream_
#define LOCAL_OldASP LOCAL->OldASP_
#define REMOTE_OldASP(wid) REMOTE(wid)->OldASP_
#define LOCAL_OldLCL0 LOCAL->OldLCL0_
#define REMOTE_OldLCL0(wid) REMOTE(wid)->OldLCL0_
#define LOCAL_OldTR LOCAL->OldTR_
#define REMOTE_OldTR(wid) REMOTE(wid)->OldTR_
#define LOCAL_OldGlobalBase LOCAL->OldGlobalBase_
#define REMOTE_OldGlobalBase(wid) REMOTE(wid)->OldGlobalBase_
#define LOCAL_OldH LOCAL->OldH_
#define REMOTE_OldH(wid) REMOTE(wid)->OldH_
#define LOCAL_OldH0 LOCAL->OldH0_
#define REMOTE_OldH0(wid) REMOTE(wid)->OldH0_
#define LOCAL_OldTrailBase LOCAL->OldTrailBase_
#define REMOTE_OldTrailBase(wid) REMOTE(wid)->OldTrailBase_
#define LOCAL_OldTrailTop LOCAL->OldTrailTop_
#define REMOTE_OldTrailTop(wid) REMOTE(wid)->OldTrailTop_
#define LOCAL_OldHeapBase LOCAL->OldHeapBase_
#define REMOTE_OldHeapBase(wid) REMOTE(wid)->OldHeapBase_
#define LOCAL_OldHeapTop LOCAL->OldHeapTop_
#define REMOTE_OldHeapTop(wid) REMOTE(wid)->OldHeapTop_
#define LOCAL_ClDiff LOCAL->ClDiff_
#define REMOTE_ClDiff(wid) REMOTE(wid)->ClDiff_
#define LOCAL_GDiff LOCAL->GDiff_
#define REMOTE_GDiff(wid) REMOTE(wid)->GDiff_
#define LOCAL_HDiff LOCAL->HDiff_
#define REMOTE_HDiff(wid) REMOTE(wid)->HDiff_
#define LOCAL_GDiff0 LOCAL->GDiff0_
#define REMOTE_GDiff0(wid) REMOTE(wid)->GDiff0_
#define LOCAL_GSplit LOCAL->GSplit_
#define REMOTE_GSplit(wid) REMOTE(wid)->GSplit_
#define LOCAL_LDiff LOCAL->LDiff_
#define REMOTE_LDiff(wid) REMOTE(wid)->LDiff_
#define LOCAL_TrDiff LOCAL->TrDiff_
#define REMOTE_TrDiff(wid) REMOTE(wid)->TrDiff_
#define LOCAL_XDiff LOCAL->XDiff_
#define REMOTE_XDiff(wid) REMOTE(wid)->XDiff_
#define LOCAL_DelayDiff LOCAL->DelayDiff_
#define REMOTE_DelayDiff(wid) REMOTE(wid)->DelayDiff_
#define LOCAL_BaseDiff LOCAL->BaseDiff_
#define REMOTE_BaseDiff(wid) REMOTE(wid)->BaseDiff_
#define LOCAL_ReductionsCounter LOCAL->ReductionsCounter_
#define REMOTE_ReductionsCounter(wid) REMOTE(wid)->ReductionsCounter_
#define LOCAL_PredEntriesCounter LOCAL->PredEntriesCounter_
#define REMOTE_PredEntriesCounter(wid) REMOTE(wid)->PredEntriesCounter_
#define LOCAL_RetriesCounter LOCAL->RetriesCounter_
#define REMOTE_RetriesCounter(wid) REMOTE(wid)->RetriesCounter_
#define LOCAL_ReductionsCounterOn LOCAL->ReductionsCounterOn_
#define REMOTE_ReductionsCounterOn(wid) REMOTE(wid)->ReductionsCounterOn_
#define LOCAL_PredEntriesCounterOn LOCAL->PredEntriesCounterOn_
#define REMOTE_PredEntriesCounterOn(wid) REMOTE(wid)->PredEntriesCounterOn_
#define LOCAL_RetriesCounterOn LOCAL->RetriesCounterOn_
#define REMOTE_RetriesCounterOn(wid) REMOTE(wid)->RetriesCounterOn_
#define LOCAL_ConsultSp LOCAL->ConsultSp_
#define REMOTE_ConsultSp(wid) REMOTE(wid)->ConsultSp_
#define LOCAL_ConsultCapacity LOCAL->ConsultCapacity_
#define REMOTE_ConsultCapacity(wid) REMOTE(wid)->ConsultCapacity_
#define LOCAL_ConsultBase LOCAL->ConsultBase_
#define REMOTE_ConsultBase(wid) REMOTE(wid)->ConsultBase_
#define LOCAL_ConsultLow LOCAL->ConsultLow_
#define REMOTE_ConsultLow(wid) REMOTE(wid)->ConsultLow_
#define LOCAL_GlobalArena LOCAL->GlobalArena_
#define REMOTE_GlobalArena(wid) REMOTE(wid)->GlobalArena_
#define LOCAL_GlobalArenaOverflows LOCAL->GlobalArenaOverflows_
#define REMOTE_GlobalArenaOverflows(wid) REMOTE(wid)->GlobalArenaOverflows_
#define LOCAL_ArenaOverflows LOCAL->ArenaOverflows_
#define REMOTE_ArenaOverflows(wid) REMOTE(wid)->ArenaOverflows_
#define LOCAL_DepthArenas LOCAL->DepthArenas_
#define REMOTE_DepthArenas(wid) REMOTE(wid)->DepthArenas_
#define LOCAL_ArithError LOCAL->ArithError_
#define REMOTE_ArithError(wid) REMOTE(wid)->ArithError_
#define LOCAL_LastAssertedPred LOCAL->LastAssertedPred_
#define REMOTE_LastAssertedPred(wid) REMOTE(wid)->LastAssertedPred_
#define LOCAL_ScannerStack LOCAL->ScannerStack_
#define REMOTE_ScannerStack(wid) REMOTE(wid)->ScannerStack_
#define LOCAL_ScannerExtraBlocks LOCAL->ScannerExtraBlocks_
#define REMOTE_ScannerExtraBlocks(wid) REMOTE(wid)->ScannerExtraBlocks_
#define LOCAL_BallTerm LOCAL->BallTerm_
#define REMOTE_BallTerm(wid) REMOTE(wid)->BallTerm_
#define LOCAL_ActiveSignals LOCAL->ActiveSignals_
#define REMOTE_ActiveSignals(wid) REMOTE(wid)->ActiveSignals_
#define LOCAL_MaxActiveSignals LOCAL->MaxActiveSignals_
#define REMOTE_MaxActiveSignals(wid) REMOTE(wid)->MaxActiveSignals_
#define LOCAL_FirstActiveSignal LOCAL->FirstActiveSignal_
#define REMOTE_FirstActiveSignal(wid) REMOTE(wid)->FirstActiveSignal_
#define LOCAL_LastActiveSignal LOCAL->LastActiveSignal_
#define REMOTE_LastActiveSignal(wid) REMOTE(wid)->LastActiveSignal_
#define LOCAL_IPredArity LOCAL->IPredArity_
#define REMOTE_IPredArity(wid) REMOTE(wid)->IPredArity_
#define LOCAL_ProfEnd LOCAL->ProfEnd_
#define REMOTE_ProfEnd(wid) REMOTE(wid)->ProfEnd_
#define LOCAL_UncaughtThrow LOCAL->UncaughtThrow_
#define REMOTE_UncaughtThrow(wid) REMOTE(wid)->UncaughtThrow_
#define LOCAL_DoingUndefp LOCAL->DoingUndefp_
#define REMOTE_DoingUndefp(wid) REMOTE(wid)->DoingUndefp_
#define LOCAL_StartLine LOCAL->StartLine_
#define REMOTE_StartLine(wid) REMOTE(wid)->StartLine_
#define LOCAL_ScratchPad LOCAL->ScratchPad_
#define REMOTE_ScratchPad(wid) REMOTE(wid)->ScratchPad_
#ifdef COROUTINING
#define LOCAL_WokenGoals LOCAL->WokenGoals_
#define REMOTE_WokenGoals(wid) REMOTE(wid)->WokenGoals_
#define LOCAL_AttsMutableList LOCAL->AttsMutableList_
#define REMOTE_AttsMutableList(wid) REMOTE(wid)->AttsMutableList_
#endif
#define LOCAL_GcGeneration LOCAL->GcGeneration_
#define REMOTE_GcGeneration(wid) REMOTE(wid)->GcGeneration_
#define LOCAL_GcPhase LOCAL->GcPhase_
#define REMOTE_GcPhase(wid) REMOTE(wid)->GcPhase_
#define LOCAL_GcCurrentPhase LOCAL->GcCurrentPhase_
#define REMOTE_GcCurrentPhase(wid) REMOTE(wid)->GcCurrentPhase_
#define LOCAL_GcCalls LOCAL->GcCalls_
#define REMOTE_GcCalls(wid) REMOTE(wid)->GcCalls_
#define LOCAL_TotGcTime LOCAL->TotGcTime_
#define REMOTE_TotGcTime(wid) REMOTE(wid)->TotGcTime_
#define LOCAL_TotGcRecovered LOCAL->TotGcRecovered_
#define REMOTE_TotGcRecovered(wid) REMOTE(wid)->TotGcRecovered_
#define LOCAL_LastGcTime LOCAL->LastGcTime_
#define REMOTE_LastGcTime(wid) REMOTE(wid)->LastGcTime_
#define LOCAL_LastSSTime LOCAL->LastSSTime_
#define REMOTE_LastSSTime(wid) REMOTE(wid)->LastSSTime_
#define LOCAL_OpenArray LOCAL->OpenArray_
#define REMOTE_OpenArray(wid) REMOTE(wid)->OpenArray_
#define LOCAL_total_marked LOCAL->total_marked_
#define REMOTE_total_marked(wid) REMOTE(wid)->total_marked_
#define LOCAL_total_oldies LOCAL->total_oldies_
#define REMOTE_total_oldies(wid) REMOTE(wid)->total_oldies_
#define LOCAL_current_B LOCAL->current_B_
#define REMOTE_current_B(wid) REMOTE(wid)->current_B_
#define LOCAL_prev_HB LOCAL->prev_HB_
#define REMOTE_prev_HB(wid) REMOTE(wid)->prev_HB_
#define LOCAL_HGEN LOCAL->HGEN_
#define REMOTE_HGEN(wid) REMOTE(wid)->HGEN_
#define LOCAL_iptop LOCAL->iptop_
#define REMOTE_iptop(wid) REMOTE(wid)->iptop_
#if defined(GC_NO_TAGS)
#define LOCAL_bp LOCAL->bp_
#define REMOTE_bp(wid) REMOTE(wid)->bp_
#endif
#define LOCAL_sTR LOCAL->sTR_
#define REMOTE_sTR(wid) REMOTE(wid)->sTR_
#define LOCAL_sTR0 LOCAL->sTR0_
#define REMOTE_sTR0(wid) REMOTE(wid)->sTR0_
#define LOCAL_new_TR LOCAL->new_TR_
#define REMOTE_new_TR(wid) REMOTE(wid)->new_TR_
#define LOCAL_cont_top0 LOCAL->cont_top0_
#define REMOTE_cont_top0(wid) REMOTE(wid)->cont_top0_
#define LOCAL_cont_top LOCAL->cont_top_
#define REMOTE_cont_top(wid) REMOTE(wid)->cont_top_
#define LOCAL_discard_trail_entries LOCAL->discard_trail_entries_
#define REMOTE_discard_trail_entries(wid) REMOTE(wid)->discard_trail_entries_
#define LOCAL_gc_ma_hash_table LOCAL->gc_ma_hash_table_
#define REMOTE_gc_ma_hash_table(wid) REMOTE(wid)->gc_ma_hash_table_
#define LOCAL_gc_ma_h_top LOCAL->gc_ma_h_top_
#define REMOTE_gc_ma_h_top(wid) REMOTE(wid)->gc_ma_h_top_
#define LOCAL_gc_ma_h_list LOCAL->gc_ma_h_list_
#define REMOTE_gc_ma_h_list(wid) REMOTE(wid)->gc_ma_h_list_
#define LOCAL_gc_timestamp LOCAL->gc_timestamp_
#define REMOTE_gc_timestamp(wid) REMOTE(wid)->gc_timestamp_
#define LOCAL_db_vec LOCAL->db_vec_
#define REMOTE_db_vec(wid) REMOTE(wid)->db_vec_
#define LOCAL_db_vec0 LOCAL->db_vec0_
#define REMOTE_db_vec0(wid) REMOTE(wid)->db_vec0_
#define LOCAL_db_root LOCAL->db_root_
#define REMOTE_db_root(wid) REMOTE(wid)->db_root_
#define LOCAL_db_nil LOCAL->db_nil_
#define REMOTE_db_nil(wid) REMOTE(wid)->db_nil_
#define LOCAL_gc_restore LOCAL->gc_restore_
#define REMOTE_gc_restore(wid) REMOTE(wid)->gc_restore_
#define LOCAL_extra_gc_cells LOCAL->extra_gc_cells_
#define REMOTE_extra_gc_cells(wid) REMOTE(wid)->extra_gc_cells_
#define LOCAL_extra_gc_cells_base LOCAL->extra_gc_cells_base_
#define REMOTE_extra_gc_cells_base(wid) REMOTE(wid)->extra_gc_cells_base_
#define LOCAL_extra_gc_cells_top LOCAL->extra_gc_cells_top_
#define REMOTE_extra_gc_cells_top(wid) REMOTE(wid)->extra_gc_cells_top_
#define LOCAL_extra_gc_cells_size LOCAL->extra_gc_cells_size_
#define REMOTE_extra_gc_cells_size(wid) REMOTE(wid)->extra_gc_cells_size_
#define LOCAL_DynamicArrays LOCAL->DynamicArrays_
#define REMOTE_DynamicArrays(wid) REMOTE(wid)->DynamicArrays_
#define LOCAL_StaticArrays LOCAL->StaticArrays_
#define REMOTE_StaticArrays(wid) REMOTE(wid)->StaticArrays_
#define LOCAL_GlobalVariables LOCAL->GlobalVariables_
#define REMOTE_GlobalVariables(wid) REMOTE(wid)->GlobalVariables_
#define LOCAL_AllowRestart LOCAL->AllowRestart_
#define REMOTE_AllowRestart(wid) REMOTE(wid)->AllowRestart_
#define LOCAL_CMemFirstBlock LOCAL->CMemFirstBlock_
#define REMOTE_CMemFirstBlock(wid) REMOTE(wid)->CMemFirstBlock_
#define LOCAL_CMemFirstBlockSz LOCAL->CMemFirstBlockSz_
#define REMOTE_CMemFirstBlockSz(wid) REMOTE(wid)->CMemFirstBlockSz_
#define LOCAL_nperm LOCAL->nperm_
#define REMOTE_nperm(wid) REMOTE(wid)->nperm_
#define LOCAL_LabelFirstArray LOCAL->LabelFirstArray_
#define REMOTE_LabelFirstArray(wid) REMOTE(wid)->LabelFirstArray_
#define LOCAL_LabelFirstArraySz LOCAL->LabelFirstArraySz_
#define REMOTE_LabelFirstArraySz(wid) REMOTE(wid)->LabelFirstArraySz_
#define LOCAL_PL_local_data_p LOCAL->PL_local_data_p_
#define REMOTE_PL_local_data_p(wid) REMOTE(wid)->PL_local_data_p_
#ifdef THREADS
#define LOCAL_ThreadHandle LOCAL->ThreadHandle_
#define REMOTE_ThreadHandle(wid) REMOTE(wid)->ThreadHandle_
#endif /* THREADS */
#if defined(YAPOR) || defined(TABLING)
#define LOCAL_optyap_data LOCAL->optyap_data_
#define REMOTE_optyap_data(wid) REMOTE(wid)->optyap_data_
#endif /* YAPOR || TABLING */
#define LOCAL_InterruptsDisabled LOCAL->InterruptsDisabled_
#define REMOTE_InterruptsDisabled(wid) REMOTE(wid)->InterruptsDisabled_
#define LOCAL_execution LOCAL->execution_
#define REMOTE_execution(wid) REMOTE(wid)->execution_
#if LOW_LEVEL_TRACER
#define LOCAL_total_choicepoints LOCAL->total_choicepoints_
#define REMOTE_total_choicepoints(wid) REMOTE(wid)->total_choicepoints_
#endif
#define LOCAL_consult_level LOCAL->consult_level_
#define REMOTE_consult_level(wid) REMOTE(wid)->consult_level_
#if defined(YAPOR) || defined(THREADS)
#define LOCAL_SignalLock LOCAL->SignalLock_
#define REMOTE_SignalLock(wid) REMOTE(wid)->SignalLock_
#endif
#define LOCAL_LocalBase LOCAL->LocalBase_
#define REMOTE_LocalBase(wid) REMOTE(wid)->LocalBase_
#define LOCAL_GlobalBase LOCAL->GlobalBase_
#define REMOTE_GlobalBase(wid) REMOTE(wid)->GlobalBase_
#define LOCAL_TrailBase LOCAL->TrailBase_
#define REMOTE_TrailBase(wid) REMOTE(wid)->TrailBase_
#define LOCAL_TrailTop LOCAL->TrailTop_
#define REMOTE_TrailTop(wid) REMOTE(wid)->TrailTop_
#define LOCAL_ErrorMessage LOCAL->ErrorMessage_
#define REMOTE_ErrorMessage(wid) REMOTE(wid)->ErrorMessage_
#define LOCAL_Error_Term LOCAL->Error_Term_
#define REMOTE_Error_Term(wid) REMOTE(wid)->Error_Term_
#ifdef THREADS
#define LOCAL_Error_TYPE LOCAL->Error_TYPE_
#define REMOTE_Error_TYPE(wid) REMOTE(wid)->Error_TYPE_
#else
#define LOCAL_Error_TYPE LOCAL->Error_TYPE_
#define REMOTE_Error_TYPE(wid) REMOTE(wid)->Error_TYPE_
#endif
#define LOCAL_Error_Size LOCAL->Error_Size_
#define REMOTE_Error_Size(wid) REMOTE(wid)->Error_Size_
#define LOCAL_ErrorSay LOCAL->ErrorSay_
#define REMOTE_ErrorSay(wid) REMOTE(wid)->ErrorSay_
#define LOCAL_IOBotch LOCAL->IOBotch_
#define REMOTE_IOBotch(wid) REMOTE(wid)->IOBotch_
#define LOCAL_tokptr LOCAL->tokptr_
#define REMOTE_tokptr(wid) REMOTE(wid)->tokptr_
#define LOCAL_toktide LOCAL->toktide_
#define REMOTE_toktide(wid) REMOTE(wid)->toktide_
#define LOCAL_VarTable LOCAL->VarTable_
#define REMOTE_VarTable(wid) REMOTE(wid)->VarTable_
#define LOCAL_AnonVarTable LOCAL->AnonVarTable_
#define REMOTE_AnonVarTable(wid) REMOTE(wid)->AnonVarTable_
#define LOCAL_Comments LOCAL->Comments_
#define REMOTE_Comments(wid) REMOTE(wid)->Comments_
#define LOCAL_CommentsTail LOCAL->CommentsTail_
#define REMOTE_CommentsTail(wid) REMOTE(wid)->CommentsTail_
#define LOCAL_CommentsNextChar LOCAL->CommentsNextChar_
#define REMOTE_CommentsNextChar(wid) REMOTE(wid)->CommentsNextChar_
#define LOCAL_CommentsBuff LOCAL->CommentsBuff_
#define REMOTE_CommentsBuff(wid) REMOTE(wid)->CommentsBuff_
#define LOCAL_CommentsBuffPos LOCAL->CommentsBuffPos_
#define REMOTE_CommentsBuffPos(wid) REMOTE(wid)->CommentsBuffPos_
#define LOCAL_CommentsBuffLim LOCAL->CommentsBuffLim_
#define REMOTE_CommentsBuffLim(wid) REMOTE(wid)->CommentsBuffLim_
#define LOCAL_RestartEnv LOCAL->RestartEnv_
#define REMOTE_RestartEnv(wid) REMOTE(wid)->RestartEnv_
#define LOCAL_FileNameBuf LOCAL->FileNameBuf_
#define REMOTE_FileNameBuf(wid) REMOTE(wid)->FileNameBuf_
#define LOCAL_FileNameBuf2 LOCAL->FileNameBuf2_
#define REMOTE_FileNameBuf2(wid) REMOTE(wid)->FileNameBuf2_
#define LOCAL_PrologMode LOCAL->PrologMode_
#define REMOTE_PrologMode(wid) REMOTE(wid)->PrologMode_
#define LOCAL_CritLocks LOCAL->CritLocks_
#define REMOTE_CritLocks(wid) REMOTE(wid)->CritLocks_
#ifdef ANALYST
#define LOCAL_opcount LOCAL->opcount_
#define REMOTE_opcount(wid) REMOTE(wid)->opcount_
#define LOCAL_2opcount LOCAL->2opcount_
#define REMOTE_2opcount(wid) REMOTE(wid)->2opcount_
#endif /* ANALYST */
#define LOCAL_s_dbg LOCAL->s_dbg_
#define REMOTE_s_dbg(wid) REMOTE(wid)->s_dbg_
#define LOCAL_matherror LOCAL->matherror_
#define REMOTE_matherror(wid) REMOTE(wid)->matherror_
#define LOCAL_CurrentError LOCAL->CurrentError_
#define REMOTE_CurrentError(wid) REMOTE(wid)->CurrentError_
#define LOCAL_heap_overflows LOCAL->heap_overflows_
#define REMOTE_heap_overflows(wid) REMOTE(wid)->heap_overflows_
#define LOCAL_total_heap_overflow_time LOCAL->total_heap_overflow_time_
#define REMOTE_total_heap_overflow_time(wid) REMOTE(wid)->total_heap_overflow_time_
#define LOCAL_stack_overflows LOCAL->stack_overflows_
#define REMOTE_stack_overflows(wid) REMOTE(wid)->stack_overflows_
#define LOCAL_total_stack_overflow_time LOCAL->total_stack_overflow_time_
#define REMOTE_total_stack_overflow_time(wid) REMOTE(wid)->total_stack_overflow_time_
#define LOCAL_delay_overflows LOCAL->delay_overflows_
#define REMOTE_delay_overflows(wid) REMOTE(wid)->delay_overflows_
#define LOCAL_total_delay_overflow_time LOCAL->total_delay_overflow_time_
#define REMOTE_total_delay_overflow_time(wid) REMOTE(wid)->total_delay_overflow_time_
#define LOCAL_trail_overflows LOCAL->trail_overflows_
#define REMOTE_trail_overflows(wid) REMOTE(wid)->trail_overflows_
#define LOCAL_total_trail_overflow_time LOCAL->total_trail_overflow_time_
#define REMOTE_total_trail_overflow_time(wid) REMOTE(wid)->total_trail_overflow_time_
#define LOCAL_atom_table_overflows LOCAL->atom_table_overflows_
#define REMOTE_atom_table_overflows(wid) REMOTE(wid)->atom_table_overflows_
#define LOCAL_total_atom_table_overflow_time LOCAL->total_atom_table_overflow_time_
#define REMOTE_total_atom_table_overflow_time(wid) REMOTE(wid)->total_atom_table_overflow_time_
#ifdef LOAD_DYLD
#define LOCAL_dl_errno LOCAL->dl_errno_
#define REMOTE_dl_errno(wid) REMOTE(wid)->dl_errno_
#endif
#ifdef LOW_LEVEL_TRACER
#define LOCAL_do_trace_primitives LOCAL->do_trace_primitives_
#define REMOTE_do_trace_primitives(wid) REMOTE(wid)->do_trace_primitives_
#endif
#define LOCAL_ExportAtomHashChain LOCAL->ExportAtomHashChain_
#define REMOTE_ExportAtomHashChain(wid) REMOTE(wid)->ExportAtomHashChain_
#define LOCAL_ExportAtomHashTableSize LOCAL->ExportAtomHashTableSize_
#define REMOTE_ExportAtomHashTableSize(wid) REMOTE(wid)->ExportAtomHashTableSize_
#define LOCAL_ExportAtomHashTableNum LOCAL->ExportAtomHashTableNum_
#define REMOTE_ExportAtomHashTableNum(wid) REMOTE(wid)->ExportAtomHashTableNum_
#define LOCAL_ExportFunctorHashChain LOCAL->ExportFunctorHashChain_
#define REMOTE_ExportFunctorHashChain(wid) REMOTE(wid)->ExportFunctorHashChain_
#define LOCAL_ExportFunctorHashTableSize LOCAL->ExportFunctorHashTableSize_
#define REMOTE_ExportFunctorHashTableSize(wid) REMOTE(wid)->ExportFunctorHashTableSize_
#define LOCAL_ExportFunctorHashTableNum LOCAL->ExportFunctorHashTableNum_
#define REMOTE_ExportFunctorHashTableNum(wid) REMOTE(wid)->ExportFunctorHashTableNum_
#define LOCAL_ExportPredEntryHashChain LOCAL->ExportPredEntryHashChain_
#define REMOTE_ExportPredEntryHashChain(wid) REMOTE(wid)->ExportPredEntryHashChain_
#define LOCAL_ExportPredEntryHashTableSize LOCAL->ExportPredEntryHashTableSize_
#define REMOTE_ExportPredEntryHashTableSize(wid) REMOTE(wid)->ExportPredEntryHashTableSize_
#define LOCAL_ExportPredEntryHashTableNum LOCAL->ExportPredEntryHashTableNum_
#define REMOTE_ExportPredEntryHashTableNum(wid) REMOTE(wid)->ExportPredEntryHashTableNum_
#define LOCAL_ExportDBRefHashChain LOCAL->ExportDBRefHashChain_
#define REMOTE_ExportDBRefHashChain(wid) REMOTE(wid)->ExportDBRefHashChain_
#define LOCAL_ExportDBRefHashTableSize LOCAL->ExportDBRefHashTableSize_
#define REMOTE_ExportDBRefHashTableSize(wid) REMOTE(wid)->ExportDBRefHashTableSize_
#define LOCAL_ExportDBRefHashTableNum LOCAL->ExportDBRefHashTableNum_
#define REMOTE_ExportDBRefHashTableNum(wid) REMOTE(wid)->ExportDBRefHashTableNum_
#define LOCAL_ImportAtomHashChain LOCAL->ImportAtomHashChain_
#define REMOTE_ImportAtomHashChain(wid) REMOTE(wid)->ImportAtomHashChain_
#define LOCAL_ImportAtomHashTableSize LOCAL->ImportAtomHashTableSize_
#define REMOTE_ImportAtomHashTableSize(wid) REMOTE(wid)->ImportAtomHashTableSize_
#define LOCAL_ImportAtomHashTableNum LOCAL->ImportAtomHashTableNum_
#define REMOTE_ImportAtomHashTableNum(wid) REMOTE(wid)->ImportAtomHashTableNum_
#define LOCAL_ImportFunctorHashChain LOCAL->ImportFunctorHashChain_
#define REMOTE_ImportFunctorHashChain(wid) REMOTE(wid)->ImportFunctorHashChain_
#define LOCAL_ImportFunctorHashTableSize LOCAL->ImportFunctorHashTableSize_
#define REMOTE_ImportFunctorHashTableSize(wid) REMOTE(wid)->ImportFunctorHashTableSize_
#define LOCAL_ImportFunctorHashTableNum LOCAL->ImportFunctorHashTableNum_
#define REMOTE_ImportFunctorHashTableNum(wid) REMOTE(wid)->ImportFunctorHashTableNum_
#define LOCAL_ImportOPCODEHashChain LOCAL->ImportOPCODEHashChain_
#define REMOTE_ImportOPCODEHashChain(wid) REMOTE(wid)->ImportOPCODEHashChain_
#define LOCAL_ImportOPCODEHashTableSize LOCAL->ImportOPCODEHashTableSize_
#define REMOTE_ImportOPCODEHashTableSize(wid) REMOTE(wid)->ImportOPCODEHashTableSize_
#define LOCAL_ImportPredEntryHashChain LOCAL->ImportPredEntryHashChain_
#define REMOTE_ImportPredEntryHashChain(wid) REMOTE(wid)->ImportPredEntryHashChain_
#define LOCAL_ImportPredEntryHashTableSize LOCAL->ImportPredEntryHashTableSize_
#define REMOTE_ImportPredEntryHashTableSize(wid) REMOTE(wid)->ImportPredEntryHashTableSize_
#define LOCAL_ImportPredEntryHashTableNum LOCAL->ImportPredEntryHashTableNum_
#define REMOTE_ImportPredEntryHashTableNum(wid) REMOTE(wid)->ImportPredEntryHashTableNum_
#define LOCAL_ImportDBRefHashChain LOCAL->ImportDBRefHashChain_
#define REMOTE_ImportDBRefHashChain(wid) REMOTE(wid)->ImportDBRefHashChain_
#define LOCAL_ImportDBRefHashTableSize LOCAL->ImportDBRefHashTableSize_
#define REMOTE_ImportDBRefHashTableSize(wid) REMOTE(wid)->ImportDBRefHashTableSize_
#define LOCAL_ImportDBRefHashTableNum LOCAL->ImportDBRefHashTableNum_
#define REMOTE_ImportDBRefHashTableNum(wid) REMOTE(wid)->ImportDBRefHashTableNum_
#define LOCAL_ImportFAILCODE LOCAL->ImportFAILCODE_
#define REMOTE_ImportFAILCODE(wid) REMOTE(wid)->ImportFAILCODE_
#define LOCAL_FunctorVar LOCAL->FunctorVar_
#define REMOTE_FunctorVar(wid) REMOTE(wid)->FunctorVar_
#define LOCAL_ibnds LOCAL->ibnds_
#define REMOTE_ibnds(wid) REMOTE(wid)->ibnds_
#define LOCAL_exo_it LOCAL->exo_it_
#define REMOTE_exo_it(wid) REMOTE(wid)->exo_it_
#define LOCAL_exo_base LOCAL->exo_base_
#define REMOTE_exo_base(wid) REMOTE(wid)->exo_base_
#define LOCAL_exo_arity LOCAL->exo_arity_
#define REMOTE_exo_arity(wid) REMOTE(wid)->exo_arity_
#define LOCAL_exo_arg LOCAL->exo_arg_
#define REMOTE_exo_arg(wid) REMOTE(wid)->exo_arg_
#define LOCAL_search_atoms LOCAL->search_atoms_
#define REMOTE_search_atoms(wid) REMOTE(wid)->search_atoms_
#define LOCAL_CurSlot LOCAL->CurSlot_
#define REMOTE_CurSlot(wid) REMOTE(wid)->CurSlot_
#define LOCAL_SourceModule LOCAL->SourceModule_
#define REMOTE_SourceModule(wid) REMOTE(wid)->SourceModule_
#define LOCAL_MAX_SIZE LOCAL->MAX_SIZE_
#define REMOTE_MAX_SIZE(wid) REMOTE(wid)->MAX_SIZE_
/* This file, dlocals.h, was generated automatically by "yap -L misc/buildlocalglobal"
please do not update, update misc/LOCALS instead */
#define LOCAL_c_input_stream LOCAL->c_input_stream_
#define REMOTE_c_input_stream(wid) REMOTE(wid)->c_input_stream_
#define LOCAL_c_output_stream LOCAL->c_output_stream_
#define REMOTE_c_output_stream(wid) REMOTE(wid)->c_output_stream_
#define LOCAL_c_error_stream LOCAL->c_error_stream_
#define REMOTE_c_error_stream(wid) REMOTE(wid)->c_error_stream_
#define LOCAL_OldASP LOCAL->OldASP_
#define REMOTE_OldASP(wid) REMOTE(wid)->OldASP_
#define LOCAL_OldLCL0 LOCAL->OldLCL0_
#define REMOTE_OldLCL0(wid) REMOTE(wid)->OldLCL0_
#define LOCAL_OldTR LOCAL->OldTR_
#define REMOTE_OldTR(wid) REMOTE(wid)->OldTR_
#define LOCAL_OldGlobalBase LOCAL->OldGlobalBase_
#define REMOTE_OldGlobalBase(wid) REMOTE(wid)->OldGlobalBase_
#define LOCAL_OldH LOCAL->OldH_
#define REMOTE_OldH(wid) REMOTE(wid)->OldH_
#define LOCAL_OldH0 LOCAL->OldH0_
#define REMOTE_OldH0(wid) REMOTE(wid)->OldH0_
#define LOCAL_OldTrailBase LOCAL->OldTrailBase_
#define REMOTE_OldTrailBase(wid) REMOTE(wid)->OldTrailBase_
#define LOCAL_OldTrailTop LOCAL->OldTrailTop_
#define REMOTE_OldTrailTop(wid) REMOTE(wid)->OldTrailTop_
#define LOCAL_OldHeapBase LOCAL->OldHeapBase_
#define REMOTE_OldHeapBase(wid) REMOTE(wid)->OldHeapBase_
#define LOCAL_OldHeapTop LOCAL->OldHeapTop_
#define REMOTE_OldHeapTop(wid) REMOTE(wid)->OldHeapTop_
#define LOCAL_ClDiff LOCAL->ClDiff_
#define REMOTE_ClDiff(wid) REMOTE(wid)->ClDiff_
#define LOCAL_GDiff LOCAL->GDiff_
#define REMOTE_GDiff(wid) REMOTE(wid)->GDiff_
#define LOCAL_HDiff LOCAL->HDiff_
#define REMOTE_HDiff(wid) REMOTE(wid)->HDiff_
#define LOCAL_GDiff0 LOCAL->GDiff0_
#define REMOTE_GDiff0(wid) REMOTE(wid)->GDiff0_
#define LOCAL_GSplit LOCAL->GSplit_
#define REMOTE_GSplit(wid) REMOTE(wid)->GSplit_
#define LOCAL_LDiff LOCAL->LDiff_
#define REMOTE_LDiff(wid) REMOTE(wid)->LDiff_
#define LOCAL_TrDiff LOCAL->TrDiff_
#define REMOTE_TrDiff(wid) REMOTE(wid)->TrDiff_
#define LOCAL_XDiff LOCAL->XDiff_
#define REMOTE_XDiff(wid) REMOTE(wid)->XDiff_
#define LOCAL_DelayDiff LOCAL->DelayDiff_
#define REMOTE_DelayDiff(wid) REMOTE(wid)->DelayDiff_
#define LOCAL_BaseDiff LOCAL->BaseDiff_
#define REMOTE_BaseDiff(wid) REMOTE(wid)->BaseDiff_
#define LOCAL_ReductionsCounter LOCAL->ReductionsCounter_
#define REMOTE_ReductionsCounter(wid) REMOTE(wid)->ReductionsCounter_
#define LOCAL_PredEntriesCounter LOCAL->PredEntriesCounter_
#define REMOTE_PredEntriesCounter(wid) REMOTE(wid)->PredEntriesCounter_
#define LOCAL_RetriesCounter LOCAL->RetriesCounter_
#define REMOTE_RetriesCounter(wid) REMOTE(wid)->RetriesCounter_
#define LOCAL_ReductionsCounterOn LOCAL->ReductionsCounterOn_
#define REMOTE_ReductionsCounterOn(wid) REMOTE(wid)->ReductionsCounterOn_
#define LOCAL_PredEntriesCounterOn LOCAL->PredEntriesCounterOn_
#define REMOTE_PredEntriesCounterOn(wid) REMOTE(wid)->PredEntriesCounterOn_
#define LOCAL_RetriesCounterOn LOCAL->RetriesCounterOn_
#define REMOTE_RetriesCounterOn(wid) REMOTE(wid)->RetriesCounterOn_
#define LOCAL_ConsultSp LOCAL->ConsultSp_
#define REMOTE_ConsultSp(wid) REMOTE(wid)->ConsultSp_
#define LOCAL_ConsultCapacity LOCAL->ConsultCapacity_
#define REMOTE_ConsultCapacity(wid) REMOTE(wid)->ConsultCapacity_
#define LOCAL_ConsultBase LOCAL->ConsultBase_
#define REMOTE_ConsultBase(wid) REMOTE(wid)->ConsultBase_
#define LOCAL_ConsultLow LOCAL->ConsultLow_
#define REMOTE_ConsultLow(wid) REMOTE(wid)->ConsultLow_
#define LOCAL_GlobalArena LOCAL->GlobalArena_
#define REMOTE_GlobalArena(wid) REMOTE(wid)->GlobalArena_
#define LOCAL_GlobalArenaOverflows LOCAL->GlobalArenaOverflows_
#define REMOTE_GlobalArenaOverflows(wid) REMOTE(wid)->GlobalArenaOverflows_
#define LOCAL_ArenaOverflows LOCAL->ArenaOverflows_
#define REMOTE_ArenaOverflows(wid) REMOTE(wid)->ArenaOverflows_
#define LOCAL_DepthArenas LOCAL->DepthArenas_
#define REMOTE_DepthArenas(wid) REMOTE(wid)->DepthArenas_
#define LOCAL_ArithError LOCAL->ArithError_
#define REMOTE_ArithError(wid) REMOTE(wid)->ArithError_
#define LOCAL_LastAssertedPred LOCAL->LastAssertedPred_
#define REMOTE_LastAssertedPred(wid) REMOTE(wid)->LastAssertedPred_
#define LOCAL_ScannerStack LOCAL->ScannerStack_
#define REMOTE_ScannerStack(wid) REMOTE(wid)->ScannerStack_
#define LOCAL_ScannerExtraBlocks LOCAL->ScannerExtraBlocks_
#define REMOTE_ScannerExtraBlocks(wid) REMOTE(wid)->ScannerExtraBlocks_
#define LOCAL_BallTerm LOCAL->BallTerm_
#define REMOTE_BallTerm(wid) REMOTE(wid)->BallTerm_
#define LOCAL_MaxActiveSignals LOCAL->MaxActiveSignals_
#define REMOTE_MaxActiveSignals(wid) REMOTE(wid)->MaxActiveSignals_
#define LOCAL_FirstActiveSignal LOCAL->FirstActiveSignal_
#define REMOTE_FirstActiveSignal(wid) REMOTE(wid)->FirstActiveSignal_
#define LOCAL_LastActiveSignal LOCAL->LastActiveSignal_
#define REMOTE_LastActiveSignal(wid) REMOTE(wid)->LastActiveSignal_
#define LOCAL_ActiveSignals LOCAL->ActiveSignals_
#define REMOTE_ActiveSignals(wid) REMOTE(wid)->ActiveSignals_
#define LOCAL_IPredArity LOCAL->IPredArity_
#define REMOTE_IPredArity(wid) REMOTE(wid)->IPredArity_
#define LOCAL_ProfEnd LOCAL->ProfEnd_
#define REMOTE_ProfEnd(wid) REMOTE(wid)->ProfEnd_
#define LOCAL_UncaughtThrow LOCAL->UncaughtThrow_
#define REMOTE_UncaughtThrow(wid) REMOTE(wid)->UncaughtThrow_
#define LOCAL_DoingUndefp LOCAL->DoingUndefp_
#define REMOTE_DoingUndefp(wid) REMOTE(wid)->DoingUndefp_
#define LOCAL_StartLine LOCAL->StartLine_
#define REMOTE_StartLine(wid) REMOTE(wid)->StartLine_
#define LOCAL_ScratchPad LOCAL->ScratchPad_
#define REMOTE_ScratchPad(wid) REMOTE(wid)->ScratchPad_
#ifdef COROUTINING
#define LOCAL_WokenGoals LOCAL->WokenGoals_
#define REMOTE_WokenGoals(wid) REMOTE(wid)->WokenGoals_
#define LOCAL_AttsMutableList LOCAL->AttsMutableList_
#define REMOTE_AttsMutableList(wid) REMOTE(wid)->AttsMutableList_
#endif
#define LOCAL_GcGeneration LOCAL->GcGeneration_
#define REMOTE_GcGeneration(wid) REMOTE(wid)->GcGeneration_
#define LOCAL_GcPhase LOCAL->GcPhase_
#define REMOTE_GcPhase(wid) REMOTE(wid)->GcPhase_
#define LOCAL_GcCurrentPhase LOCAL->GcCurrentPhase_
#define REMOTE_GcCurrentPhase(wid) REMOTE(wid)->GcCurrentPhase_
#define LOCAL_GcCalls LOCAL->GcCalls_
#define REMOTE_GcCalls(wid) REMOTE(wid)->GcCalls_
#define LOCAL_TotGcTime LOCAL->TotGcTime_
#define REMOTE_TotGcTime(wid) REMOTE(wid)->TotGcTime_
#define LOCAL_TotGcRecovered LOCAL->TotGcRecovered_
#define REMOTE_TotGcRecovered(wid) REMOTE(wid)->TotGcRecovered_
#define LOCAL_LastGcTime LOCAL->LastGcTime_
#define REMOTE_LastGcTime(wid) REMOTE(wid)->LastGcTime_
#define LOCAL_LastSSTime LOCAL->LastSSTime_
#define REMOTE_LastSSTime(wid) REMOTE(wid)->LastSSTime_
#define LOCAL_OpenArray LOCAL->OpenArray_
#define REMOTE_OpenArray(wid) REMOTE(wid)->OpenArray_
#define LOCAL_total_marked LOCAL->total_marked_
#define REMOTE_total_marked(wid) REMOTE(wid)->total_marked_
#define LOCAL_total_oldies LOCAL->total_oldies_
#define REMOTE_total_oldies(wid) REMOTE(wid)->total_oldies_
#define LOCAL_current_B LOCAL->current_B_
#define REMOTE_current_B(wid) REMOTE(wid)->current_B_
#define LOCAL_prev_HB LOCAL->prev_HB_
#define REMOTE_prev_HB(wid) REMOTE(wid)->prev_HB_
#define LOCAL_HGEN LOCAL->HGEN_
#define REMOTE_HGEN(wid) REMOTE(wid)->HGEN_
#define LOCAL_iptop LOCAL->iptop_
#define REMOTE_iptop(wid) REMOTE(wid)->iptop_
#if defined(GC_NO_TAGS)
#define LOCAL_bp LOCAL->bp_
#define REMOTE_bp(wid) REMOTE(wid)->bp_
#endif
#define LOCAL_sTR LOCAL->sTR_
#define REMOTE_sTR(wid) REMOTE(wid)->sTR_
#define LOCAL_sTR0 LOCAL->sTR0_
#define REMOTE_sTR0(wid) REMOTE(wid)->sTR0_
#define LOCAL_new_TR LOCAL->new_TR_
#define REMOTE_new_TR(wid) REMOTE(wid)->new_TR_
#define LOCAL_cont_top0 LOCAL->cont_top0_
#define REMOTE_cont_top0(wid) REMOTE(wid)->cont_top0_
#define LOCAL_cont_top LOCAL->cont_top_
#define REMOTE_cont_top(wid) REMOTE(wid)->cont_top_
#define LOCAL_discard_trail_entries LOCAL->discard_trail_entries_
#define REMOTE_discard_trail_entries(wid) REMOTE(wid)->discard_trail_entries_
#define LOCAL_gc_ma_hash_table LOCAL->gc_ma_hash_table_
#define REMOTE_gc_ma_hash_table(wid) REMOTE(wid)->gc_ma_hash_table_
#define LOCAL_gc_ma_h_top LOCAL->gc_ma_h_top_
#define REMOTE_gc_ma_h_top(wid) REMOTE(wid)->gc_ma_h_top_
#define LOCAL_gc_ma_h_list LOCAL->gc_ma_h_list_
#define REMOTE_gc_ma_h_list(wid) REMOTE(wid)->gc_ma_h_list_
#define LOCAL_gc_timestamp LOCAL->gc_timestamp_
#define REMOTE_gc_timestamp(wid) REMOTE(wid)->gc_timestamp_
#define LOCAL_db_vec LOCAL->db_vec_
#define REMOTE_db_vec(wid) REMOTE(wid)->db_vec_
#define LOCAL_db_vec0 LOCAL->db_vec0_
#define REMOTE_db_vec0(wid) REMOTE(wid)->db_vec0_
#define LOCAL_db_root LOCAL->db_root_
#define REMOTE_db_root(wid) REMOTE(wid)->db_root_
#define LOCAL_db_nil LOCAL->db_nil_
#define REMOTE_db_nil(wid) REMOTE(wid)->db_nil_
#define LOCAL_gc_restore LOCAL->gc_restore_
#define REMOTE_gc_restore(wid) REMOTE(wid)->gc_restore_
#define LOCAL_extra_gc_cells LOCAL->extra_gc_cells_
#define REMOTE_extra_gc_cells(wid) REMOTE(wid)->extra_gc_cells_
#define LOCAL_extra_gc_cells_base LOCAL->extra_gc_cells_base_
#define REMOTE_extra_gc_cells_base(wid) REMOTE(wid)->extra_gc_cells_base_
#define LOCAL_extra_gc_cells_top LOCAL->extra_gc_cells_top_
#define REMOTE_extra_gc_cells_top(wid) REMOTE(wid)->extra_gc_cells_top_
#define LOCAL_extra_gc_cells_size LOCAL->extra_gc_cells_size_
#define REMOTE_extra_gc_cells_size(wid) REMOTE(wid)->extra_gc_cells_size_
#define LOCAL_DynamicArrays LOCAL->DynamicArrays_
#define REMOTE_DynamicArrays(wid) REMOTE(wid)->DynamicArrays_
#define LOCAL_StaticArrays LOCAL->StaticArrays_
#define REMOTE_StaticArrays(wid) REMOTE(wid)->StaticArrays_
#define LOCAL_GlobalVariables LOCAL->GlobalVariables_
#define REMOTE_GlobalVariables(wid) REMOTE(wid)->GlobalVariables_
#define LOCAL_AllowRestart LOCAL->AllowRestart_
#define REMOTE_AllowRestart(wid) REMOTE(wid)->AllowRestart_
#define LOCAL_CMemFirstBlock LOCAL->CMemFirstBlock_
#define REMOTE_CMemFirstBlock(wid) REMOTE(wid)->CMemFirstBlock_
#define LOCAL_CMemFirstBlockSz LOCAL->CMemFirstBlockSz_
#define REMOTE_CMemFirstBlockSz(wid) REMOTE(wid)->CMemFirstBlockSz_
#define LOCAL_nperm LOCAL->nperm_
#define REMOTE_nperm(wid) REMOTE(wid)->nperm_
#define LOCAL_LabelFirstArray LOCAL->LabelFirstArray_
#define REMOTE_LabelFirstArray(wid) REMOTE(wid)->LabelFirstArray_
#define LOCAL_LabelFirstArraySz LOCAL->LabelFirstArraySz_
#define REMOTE_LabelFirstArraySz(wid) REMOTE(wid)->LabelFirstArraySz_
#define LOCAL_PL_local_data_p LOCAL->PL_local_data_p_
#define REMOTE_PL_local_data_p(wid) REMOTE(wid)->PL_local_data_p_
#ifdef THREADS
#define LOCAL_ThreadHandle LOCAL->ThreadHandle_
#define REMOTE_ThreadHandle(wid) REMOTE(wid)->ThreadHandle_
#endif /* THREADS */
#if defined(YAPOR) || defined(TABLING)
#define LOCAL_optyap_data LOCAL->optyap_data_
#define REMOTE_optyap_data(wid) REMOTE(wid)->optyap_data_
#endif /* YAPOR || TABLING */
#define LOCAL_InterruptsDisabled LOCAL->InterruptsDisabled_
#define REMOTE_InterruptsDisabled(wid) REMOTE(wid)->InterruptsDisabled_
#define LOCAL_execution LOCAL->execution_
#define REMOTE_execution(wid) REMOTE(wid)->execution_
#if LOW_LEVEL_TRACER
#define LOCAL_total_choicepoints LOCAL->total_choicepoints_
#define REMOTE_total_choicepoints(wid) REMOTE(wid)->total_choicepoints_
#endif
#define LOCAL_consult_level LOCAL->consult_level_
#define REMOTE_consult_level(wid) REMOTE(wid)->consult_level_
#if defined(YAPOR) || defined(THREADS)
#define LOCAL_SignalLock LOCAL->SignalLock_
#define REMOTE_SignalLock(wid) REMOTE(wid)->SignalLock_
#endif
#define LOCAL_LocalBase LOCAL->LocalBase_
#define REMOTE_LocalBase(wid) REMOTE(wid)->LocalBase_
#define LOCAL_GlobalBase LOCAL->GlobalBase_
#define REMOTE_GlobalBase(wid) REMOTE(wid)->GlobalBase_
#define LOCAL_TrailBase LOCAL->TrailBase_
#define REMOTE_TrailBase(wid) REMOTE(wid)->TrailBase_
#define LOCAL_TrailTop LOCAL->TrailTop_
#define REMOTE_TrailTop(wid) REMOTE(wid)->TrailTop_
#define LOCAL_ErrorMessage LOCAL->ErrorMessage_
#define REMOTE_ErrorMessage(wid) REMOTE(wid)->ErrorMessage_
#define LOCAL_Error_Term LOCAL->Error_Term_
#define REMOTE_Error_Term(wid) REMOTE(wid)->Error_Term_
#ifdef THREADS
#define LOCAL_Error_TYPE LOCAL->Error_TYPE_
#define REMOTE_Error_TYPE(wid) REMOTE(wid)->Error_TYPE_
#else
#define LOCAL_Error_TYPE LOCAL->Error_TYPE_
#define REMOTE_Error_TYPE(wid) REMOTE(wid)->Error_TYPE_
#endif
#define LOCAL_Error_Size LOCAL->Error_Size_
#define REMOTE_Error_Size(wid) REMOTE(wid)->Error_Size_
#define LOCAL_ErrorSay LOCAL->ErrorSay_
#define REMOTE_ErrorSay(wid) REMOTE(wid)->ErrorSay_
#define LOCAL_IOBotch LOCAL->IOBotch_
#define REMOTE_IOBotch(wid) REMOTE(wid)->IOBotch_
#define LOCAL_tokptr LOCAL->tokptr_
#define REMOTE_tokptr(wid) REMOTE(wid)->tokptr_
#define LOCAL_toktide LOCAL->toktide_
#define REMOTE_toktide(wid) REMOTE(wid)->toktide_
#define LOCAL_VarTable LOCAL->VarTable_
#define REMOTE_VarTable(wid) REMOTE(wid)->VarTable_
#define LOCAL_AnonVarTable LOCAL->AnonVarTable_
#define REMOTE_AnonVarTable(wid) REMOTE(wid)->AnonVarTable_
#define LOCAL_Comments LOCAL->Comments_
#define REMOTE_Comments(wid) REMOTE(wid)->Comments_
#define LOCAL_CommentsTail LOCAL->CommentsTail_
#define REMOTE_CommentsTail(wid) REMOTE(wid)->CommentsTail_
#define LOCAL_CommentsNextChar LOCAL->CommentsNextChar_
#define REMOTE_CommentsNextChar(wid) REMOTE(wid)->CommentsNextChar_
#define LOCAL_CommentsBuff LOCAL->CommentsBuff_
#define REMOTE_CommentsBuff(wid) REMOTE(wid)->CommentsBuff_
#define LOCAL_CommentsBuffPos LOCAL->CommentsBuffPos_
#define REMOTE_CommentsBuffPos(wid) REMOTE(wid)->CommentsBuffPos_
#define LOCAL_CommentsBuffLim LOCAL->CommentsBuffLim_
#define REMOTE_CommentsBuffLim(wid) REMOTE(wid)->CommentsBuffLim_
#define LOCAL_RestartEnv LOCAL->RestartEnv_
#define REMOTE_RestartEnv(wid) REMOTE(wid)->RestartEnv_
#define LOCAL_FileNameBuf LOCAL->FileNameBuf_
#define REMOTE_FileNameBuf(wid) REMOTE(wid)->FileNameBuf_
#define LOCAL_FileNameBuf2 LOCAL->FileNameBuf2_
#define REMOTE_FileNameBuf2(wid) REMOTE(wid)->FileNameBuf2_
#define LOCAL_PrologMode LOCAL->PrologMode_
#define REMOTE_PrologMode(wid) REMOTE(wid)->PrologMode_
#define LOCAL_CritLocks LOCAL->CritLocks_
#define REMOTE_CritLocks(wid) REMOTE(wid)->CritLocks_
#ifdef ANALYST
#define LOCAL_opcount LOCAL->opcount_
#define REMOTE_opcount(wid) REMOTE(wid)->opcount_
#define LOCAL_2opcount LOCAL->2opcount_
#define REMOTE_2opcount(wid) REMOTE(wid)->2opcount_
#endif /* ANALYST */
#define LOCAL_s_dbg LOCAL->s_dbg_
#define REMOTE_s_dbg(wid) REMOTE(wid)->s_dbg_
#define LOCAL_matherror LOCAL->matherror_
#define REMOTE_matherror(wid) REMOTE(wid)->matherror_
#define LOCAL_CurrentError LOCAL->CurrentError_
#define REMOTE_CurrentError(wid) REMOTE(wid)->CurrentError_
#define LOCAL_heap_overflows LOCAL->heap_overflows_
#define REMOTE_heap_overflows(wid) REMOTE(wid)->heap_overflows_
#define LOCAL_total_heap_overflow_time LOCAL->total_heap_overflow_time_
#define REMOTE_total_heap_overflow_time(wid) REMOTE(wid)->total_heap_overflow_time_
#define LOCAL_stack_overflows LOCAL->stack_overflows_
#define REMOTE_stack_overflows(wid) REMOTE(wid)->stack_overflows_
#define LOCAL_total_stack_overflow_time LOCAL->total_stack_overflow_time_
#define REMOTE_total_stack_overflow_time(wid) REMOTE(wid)->total_stack_overflow_time_
#define LOCAL_delay_overflows LOCAL->delay_overflows_
#define REMOTE_delay_overflows(wid) REMOTE(wid)->delay_overflows_
#define LOCAL_total_delay_overflow_time LOCAL->total_delay_overflow_time_
#define REMOTE_total_delay_overflow_time(wid) REMOTE(wid)->total_delay_overflow_time_
#define LOCAL_trail_overflows LOCAL->trail_overflows_
#define REMOTE_trail_overflows(wid) REMOTE(wid)->trail_overflows_
#define LOCAL_total_trail_overflow_time LOCAL->total_trail_overflow_time_
#define REMOTE_total_trail_overflow_time(wid) REMOTE(wid)->total_trail_overflow_time_
#define LOCAL_atom_table_overflows LOCAL->atom_table_overflows_
#define REMOTE_atom_table_overflows(wid) REMOTE(wid)->atom_table_overflows_
#define LOCAL_total_atom_table_overflow_time LOCAL->total_atom_table_overflow_time_
#define REMOTE_total_atom_table_overflow_time(wid) REMOTE(wid)->total_atom_table_overflow_time_
#ifdef LOAD_DYLD
#define LOCAL_dl_errno LOCAL->dl_errno_
#define REMOTE_dl_errno(wid) REMOTE(wid)->dl_errno_
#endif
#ifdef LOW_LEVEL_TRACER
#define LOCAL_do_trace_primitives LOCAL->do_trace_primitives_
#define REMOTE_do_trace_primitives(wid) REMOTE(wid)->do_trace_primitives_
#endif
#define LOCAL_ExportAtomHashChain LOCAL->ExportAtomHashChain_
#define REMOTE_ExportAtomHashChain(wid) REMOTE(wid)->ExportAtomHashChain_
#define LOCAL_ExportAtomHashTableSize LOCAL->ExportAtomHashTableSize_
#define REMOTE_ExportAtomHashTableSize(wid) REMOTE(wid)->ExportAtomHashTableSize_
#define LOCAL_ExportAtomHashTableNum LOCAL->ExportAtomHashTableNum_
#define REMOTE_ExportAtomHashTableNum(wid) REMOTE(wid)->ExportAtomHashTableNum_
#define LOCAL_ExportFunctorHashChain LOCAL->ExportFunctorHashChain_
#define REMOTE_ExportFunctorHashChain(wid) REMOTE(wid)->ExportFunctorHashChain_
#define LOCAL_ExportFunctorHashTableSize LOCAL->ExportFunctorHashTableSize_
#define REMOTE_ExportFunctorHashTableSize(wid) REMOTE(wid)->ExportFunctorHashTableSize_
#define LOCAL_ExportFunctorHashTableNum LOCAL->ExportFunctorHashTableNum_
#define REMOTE_ExportFunctorHashTableNum(wid) REMOTE(wid)->ExportFunctorHashTableNum_
#define LOCAL_ExportPredEntryHashChain LOCAL->ExportPredEntryHashChain_
#define REMOTE_ExportPredEntryHashChain(wid) REMOTE(wid)->ExportPredEntryHashChain_
#define LOCAL_ExportPredEntryHashTableSize LOCAL->ExportPredEntryHashTableSize_
#define REMOTE_ExportPredEntryHashTableSize(wid) REMOTE(wid)->ExportPredEntryHashTableSize_
#define LOCAL_ExportPredEntryHashTableNum LOCAL->ExportPredEntryHashTableNum_
#define REMOTE_ExportPredEntryHashTableNum(wid) REMOTE(wid)->ExportPredEntryHashTableNum_
#define LOCAL_ExportDBRefHashChain LOCAL->ExportDBRefHashChain_
#define REMOTE_ExportDBRefHashChain(wid) REMOTE(wid)->ExportDBRefHashChain_
#define LOCAL_ExportDBRefHashTableSize LOCAL->ExportDBRefHashTableSize_
#define REMOTE_ExportDBRefHashTableSize(wid) REMOTE(wid)->ExportDBRefHashTableSize_
#define LOCAL_ExportDBRefHashTableNum LOCAL->ExportDBRefHashTableNum_
#define REMOTE_ExportDBRefHashTableNum(wid) REMOTE(wid)->ExportDBRefHashTableNum_
#define LOCAL_ImportAtomHashChain LOCAL->ImportAtomHashChain_
#define REMOTE_ImportAtomHashChain(wid) REMOTE(wid)->ImportAtomHashChain_
#define LOCAL_ImportAtomHashTableSize LOCAL->ImportAtomHashTableSize_
#define REMOTE_ImportAtomHashTableSize(wid) REMOTE(wid)->ImportAtomHashTableSize_
#define LOCAL_ImportAtomHashTableNum LOCAL->ImportAtomHashTableNum_
#define REMOTE_ImportAtomHashTableNum(wid) REMOTE(wid)->ImportAtomHashTableNum_
#define LOCAL_ImportFunctorHashChain LOCAL->ImportFunctorHashChain_
#define REMOTE_ImportFunctorHashChain(wid) REMOTE(wid)->ImportFunctorHashChain_
#define LOCAL_ImportFunctorHashTableSize LOCAL->ImportFunctorHashTableSize_
#define REMOTE_ImportFunctorHashTableSize(wid) REMOTE(wid)->ImportFunctorHashTableSize_
#define LOCAL_ImportFunctorHashTableNum LOCAL->ImportFunctorHashTableNum_
#define REMOTE_ImportFunctorHashTableNum(wid) REMOTE(wid)->ImportFunctorHashTableNum_
#define LOCAL_ImportOPCODEHashChain LOCAL->ImportOPCODEHashChain_
#define REMOTE_ImportOPCODEHashChain(wid) REMOTE(wid)->ImportOPCODEHashChain_
#define LOCAL_ImportOPCODEHashTableSize LOCAL->ImportOPCODEHashTableSize_
#define REMOTE_ImportOPCODEHashTableSize(wid) REMOTE(wid)->ImportOPCODEHashTableSize_
#define LOCAL_ImportPredEntryHashChain LOCAL->ImportPredEntryHashChain_
#define REMOTE_ImportPredEntryHashChain(wid) REMOTE(wid)->ImportPredEntryHashChain_
#define LOCAL_ImportPredEntryHashTableSize LOCAL->ImportPredEntryHashTableSize_
#define REMOTE_ImportPredEntryHashTableSize(wid) REMOTE(wid)->ImportPredEntryHashTableSize_
#define LOCAL_ImportPredEntryHashTableNum LOCAL->ImportPredEntryHashTableNum_
#define REMOTE_ImportPredEntryHashTableNum(wid) REMOTE(wid)->ImportPredEntryHashTableNum_
#define LOCAL_ImportDBRefHashChain LOCAL->ImportDBRefHashChain_
#define REMOTE_ImportDBRefHashChain(wid) REMOTE(wid)->ImportDBRefHashChain_
#define LOCAL_ImportDBRefHashTableSize LOCAL->ImportDBRefHashTableSize_
#define REMOTE_ImportDBRefHashTableSize(wid) REMOTE(wid)->ImportDBRefHashTableSize_
#define LOCAL_ImportDBRefHashTableNum LOCAL->ImportDBRefHashTableNum_
#define REMOTE_ImportDBRefHashTableNum(wid) REMOTE(wid)->ImportDBRefHashTableNum_
#define LOCAL_ImportFAILCODE LOCAL->ImportFAILCODE_
#define REMOTE_ImportFAILCODE(wid) REMOTE(wid)->ImportFAILCODE_
#define LOCAL_FunctorVar LOCAL->FunctorVar_
#define REMOTE_FunctorVar(wid) REMOTE(wid)->FunctorVar_
#if __ANDROID__
#define LOCAL_assetManager LOCAL->assetManager_
#define REMOTE_assetManager(wid) REMOTE(wid)->assetManager_
#define LOCAL_InAssetDir LOCAL->InAssetDir_
#define REMOTE_InAssetDir(wid) REMOTE(wid)->InAssetDir_
#endif
#define LOCAL_ibnds LOCAL->ibnds_
#define REMOTE_ibnds(wid) REMOTE(wid)->ibnds_
#define LOCAL_exo_it LOCAL->exo_it_
#define REMOTE_exo_it(wid) REMOTE(wid)->exo_it_
#define LOCAL_exo_base LOCAL->exo_base_
#define REMOTE_exo_base(wid) REMOTE(wid)->exo_base_
#define LOCAL_exo_arity LOCAL->exo_arity_
#define REMOTE_exo_arity(wid) REMOTE(wid)->exo_arity_
#define LOCAL_exo_arg LOCAL->exo_arg_
#define REMOTE_exo_arg(wid) REMOTE(wid)->exo_arg_
#define LOCAL_search_atoms LOCAL->search_atoms_
#define REMOTE_search_atoms(wid) REMOTE(wid)->search_atoms_
#define LOCAL_CurSlot LOCAL->CurSlot_
#define REMOTE_CurSlot(wid) REMOTE(wid)->CurSlot_
#define LOCAL_SourceModule LOCAL->SourceModule_
#define REMOTE_SourceModule(wid) REMOTE(wid)->SourceModule_
#define LOCAL_MAX_SIZE LOCAL->MAX_SIZE_
#define REMOTE_MAX_SIZE(wid) REMOTE(wid)->MAX_SIZE_

View File

@ -1,119 +1,123 @@
/* This file, hglobals.h, was generated automatically by "yap -L misc/buildlocalglobal"
please do not update, update misc/GLOBALS instead */
typedef struct global_data {
int Initialised_;
int InitialisedFromPL_;
int PL_Argc_;
char** PL_Argv_;
struct halt_hook* HaltHooks_;
int AllowLocalExpansion_;
int AllowGlobalExpansion_;
int AllowTrailExpansion_;
UInt SizeOfOverflow_;
UInt AGcThreshold_;
Agc_hook AGCHook_;
#if THREADS
UInt NOfThreads_;
UInt NOfThreadsCreated_;
UInt ThreadsTotalTime_;
lockvar ThreadHandlesLock_;
#endif
#if defined(YAPOR) || defined(THREADS)
lockvar BGL_;
#endif
#if defined(YAPOR) || defined(TABLING)
struct global_optyap_data optyap_data_;
#endif /* YAPOR || TABLING */
int PrologShouldHandleInterrupts_;
#if defined(THREADS)
pthread_t master_thread_;
#endif /* THREADS */
struct io_stream* stdout_;
struct io_stream* stderr_;
char** argv_;
int argc_;
#ifdef COROUTINING
ext_op attas_[attvars_ext+1];
#endif
int agc_calls_;
YAP_ULONG_LONG agc_collected_;
Int tot_agc_time_;
Int tot_agc_recovered_;
#if HAVE_MMAP
struct MMAP_ARRAY_BLOCK* mmap_arrays_;
#endif
#ifdef DEBUG
char Option_[20];
YP_FILE* logfile_;
#endif
#if defined(COFF) || defined(A_OUT)
char Executable_[YAP_FILENAME_MAX];
#endif
int OpaqueHandlersCount_;
struct opaque_handler_struct* OpaqueHandlers_;
#if __simplescalar__
char pwd_[YAP_FILENAME_MAX];
#endif
char* RestoreFile_;
Int ProfCalls_;
Int ProfGCs_;
Int ProfHGrows_;
Int ProfSGrows_;
Int ProfMallocs_;
Int ProfIndexing_;
Int ProfOn_;
Int ProfOns_;
struct RB_red_blk_node* ProfilerRoot_;
struct RB_red_blk_node* ProfilerNil_;
char* DIRNAME_;
#if LOW_PROF
int ProfilerOn_;
FILE* FProf_;
FILE* FPreds_;
#endif /* LOW_PROF */
} w_shared;
/* This file, hglobals.h, was generated automatically by "yap -L misc/buildlocalglobal"
please do not update, update misc/GLOBALS instead */
typedef struct global_data {
int Initialised_;
int InitialisedFromPL_;
int PL_Argc_;
char** PL_Argv_;
struct halt_hook* HaltHooks_;
int AllowLocalExpansion_;
int AllowGlobalExpansion_;
int AllowTrailExpansion_;
UInt SizeOfOverflow_;
UInt AGcThreshold_;
Agc_hook AGCHook_;
#if __ANDROID__
struct AAssetManager* assetManager_;
#endif
#if THREADS
UInt NOfThreads_;
UInt NOfThreadsCreated_;
UInt ThreadsTotalTime_;
lockvar ThreadHandlesLock_;
#endif
#if defined(YAPOR) || defined(THREADS)
lockvar BGL_;
#endif
#if defined(YAPOR) || defined(TABLING)
struct global_optyap_data optyap_data_;
#endif /* YAPOR || TABLING */
int PrologShouldHandleInterrupts_;
#if defined(THREADS)
pthread_t master_thread_;
#endif /* THREADS */
struct io_stream* stdout_;
struct io_stream* stderr_;
char** argv_;
int argc_;
#ifdef COROUTINING
ext_op attas_[attvars_ext+1];
#endif
int agc_calls_;
YAP_ULONG_LONG agc_collected_;
Int tot_agc_time_;
Int tot_agc_recovered_;
#if HAVE_MMAP
struct MMAP_ARRAY_BLOCK* mmap_arrays_;
#endif
#ifdef DEBUG
char Option_[20];
YP_FILE* logfile_;
#endif
#if defined(COFF) || defined(A_OUT)
char Executable_[YAP_FILENAME_MAX];
#endif
int OpaqueHandlersCount_;
struct opaque_handler_struct* OpaqueHandlers_;
#if __simplescalar__
char pwd_[YAP_FILENAME_MAX];
#endif
char* RestoreFile_;
Int ProfCalls_;
Int ProfGCs_;
Int ProfHGrows_;
Int ProfSGrows_;
Int ProfMallocs_;
Int ProfIndexing_;
Int ProfOn_;
Int ProfOns_;
struct RB_red_blk_node* ProfilerRoot_;
struct RB_red_blk_node* ProfilerNil_;
char* DIRNAME_;
#if LOW_PROF
int ProfilerOn_;
FILE* FProf_;
FILE* FPreds_;
#endif /* LOW_PROF */
} w_shared;

View File

@ -1,242 +1,247 @@
/* This file, hlocals.h, was generated automatically by "yap -L misc/buildlocalglobal"
please do not update, update misc/LOCALS instead */
typedef struct worker_local {
int c_input_stream_;
int c_output_stream_;
int c_error_stream_;
CELL* OldASP_;
CELL* OldLCL0_;
tr_fr_ptr OldTR_;
CELL* OldGlobalBase_;
CELL* OldH_;
CELL* OldH0_;
ADDR OldTrailBase_;
ADDR OldTrailTop_;
ADDR OldHeapBase_;
ADDR OldHeapTop_;
Int ClDiff_;
Int GDiff_;
Int HDiff_;
Int GDiff0_;
CELL* GSplit_;
Int LDiff_;
Int TrDiff_;
Int XDiff_;
Int DelayDiff_;
Int BaseDiff_;
YAP_ULONG_LONG ReductionsCounter_;
YAP_ULONG_LONG PredEntriesCounter_;
YAP_ULONG_LONG RetriesCounter_;
int ReductionsCounterOn_;
int PredEntriesCounterOn_;
int RetriesCounterOn_;
union CONSULT_OBJ* ConsultSp_;
UInt ConsultCapacity_;
union CONSULT_OBJ* ConsultBase_;
union CONSULT_OBJ* ConsultLow_;
Term GlobalArena_;
UInt GlobalArenaOverflows_;
Int ArenaOverflows_;
Int DepthArenas_;
int ArithError_;
struct pred_entry* LastAssertedPred_;
char* ScannerStack_;
struct scanner_extra_alloc* ScannerExtraBlocks_;
struct DB_TERM* BallTerm_;
UInt* ActiveSignals_;
UInt MaxActiveSignals_;
UInt FirstActiveSignal_;
UInt LastActiveSignal_;
UInt IPredArity_;
yamop* ProfEnd_;
int UncaughtThrow_;
int DoingUndefp_;
Int StartLine_;
scratch_block ScratchPad_;
#ifdef COROUTINING
Term WokenGoals_;
Term AttsMutableList_;
#endif
Term GcGeneration_;
Term GcPhase_;
UInt GcCurrentPhase_;
UInt GcCalls_;
Int TotGcTime_;
YAP_ULONG_LONG TotGcRecovered_;
Int LastGcTime_;
Int LastSSTime_;
CELL* OpenArray_;
Int total_marked_;
Int total_oldies_;
struct choicept* current_B_;
CELL* prev_HB_;
CELL* HGEN_;
CELL** iptop_;
#if defined(GC_NO_TAGS)
char* bp_;
#endif
tr_fr_ptr sTR_;
tr_fr_ptr sTR0_;
tr_fr_ptr new_TR_;
struct gc_mark_continuation* cont_top0_;
struct gc_mark_continuation* cont_top_;
int discard_trail_entries_;
gc_ma_hash_entry gc_ma_hash_table_[GC_MAVARS_HASH_SIZE];
gc_ma_hash_entry* gc_ma_h_top_;
gc_ma_hash_entry* gc_ma_h_list_;
UInt gc_timestamp_;
ADDR db_vec_;
ADDR db_vec0_;
struct RB_red_blk_node* db_root_;
struct RB_red_blk_node* db_nil_;
sigjmp_buf gc_restore_;
CELL* extra_gc_cells_;
CELL* extra_gc_cells_base_;
CELL* extra_gc_cells_top_;
UInt extra_gc_cells_size_;
struct array_entry* DynamicArrays_;
struct static_array_entry* StaticArrays_;
struct global_entry* GlobalVariables_;
int AllowRestart_;
struct mem_blk* CMemFirstBlock_;
UInt CMemFirstBlockSz_;
int nperm_;
Int* LabelFirstArray_;
UInt LabelFirstArraySz_;
struct PL_local_data* PL_local_data_p_;
#ifdef THREADS
struct thandle ThreadHandle_;
#endif /* THREADS */
#if defined(YAPOR) || defined(TABLING)
struct local_optyap_data optyap_data_;
#endif /* YAPOR || TABLING */
int InterruptsDisabled_;
struct open_query_struct* execution_;
#if LOW_LEVEL_TRACER
Int total_choicepoints_;
#endif
int consult_level_;
#if defined(YAPOR) || defined(THREADS)
lockvar SignalLock_;
#endif
ADDR LocalBase_;
ADDR GlobalBase_;
ADDR TrailBase_;
ADDR TrailTop_;
char* ErrorMessage_;
Term Error_Term_;
#ifdef THREADS
Term Error_TYPE_;
#else
yap_error_number Error_TYPE_;
#endif
UInt Error_Size_;
char ErrorSay_[MAX_ERROR_MSG_SIZE];
jmp_buf IOBotch_;
TokEntry* tokptr_;
TokEntry* toktide_;
VarEntry* VarTable_;
VarEntry* AnonVarTable_;
Term Comments_;
CELL* CommentsTail_;
CELL* CommentsNextChar_;
wchar_t* CommentsBuff_;
size_t CommentsBuffPos_;
size_t CommentsBuffLim_;
sigjmp_buf RestartEnv_;
char FileNameBuf_[YAP_FILENAME_MAX];
char FileNameBuf2_[YAP_FILENAME_MAX];
Int PrologMode_;
int CritLocks_;
#ifdef ANALYST
YAP_ULONG_LONG opcount_[_std_top+1];
YAP_ULONG_LONG 2opcount[_std_top+1][_std_top+1]_;
#endif /* ANALYST */
struct db_globs* s_dbg_;
yap_error_number matherror_;
yap_error_number CurrentError_;
int heap_overflows_;
Int total_heap_overflow_time_;
int stack_overflows_;
Int total_stack_overflow_time_;
int delay_overflows_;
Int total_delay_overflow_time_;
int trail_overflows_;
Int total_trail_overflow_time_;
int atom_table_overflows_;
Int total_atom_table_overflow_time_;
#ifdef LOAD_DYLD
int dl_errno_;
#endif
#ifdef LOW_LEVEL_TRACER
int do_trace_primitives_;
#endif
struct export_atom_hash_entry_struct *ExportAtomHashChain_;
UInt ExportAtomHashTableSize_;
UInt ExportAtomHashTableNum_;
struct export_functor_hash_entry_struct *ExportFunctorHashChain_;
UInt ExportFunctorHashTableSize_;
UInt ExportFunctorHashTableNum_;
struct export_pred_entry_hash_entry_struct *ExportPredEntryHashChain_;
UInt ExportPredEntryHashTableSize_;
UInt ExportPredEntryHashTableNum_;
struct export_dbref_hash_entry_struct *ExportDBRefHashChain_;
UInt ExportDBRefHashTableSize_;
UInt ExportDBRefHashTableNum_;
struct import_atom_hash_entry_struct **ImportAtomHashChain_;
UInt ImportAtomHashTableSize_;
UInt ImportAtomHashTableNum_;
struct import_functor_hash_entry_struct **ImportFunctorHashChain_;
UInt ImportFunctorHashTableSize_;
UInt ImportFunctorHashTableNum_;
struct import_opcode_hash_entry_struct **ImportOPCODEHashChain_;
UInt ImportOPCODEHashTableSize_;
struct import_pred_entry_hash_entry_struct **ImportPredEntryHashChain_;
UInt ImportPredEntryHashTableSize_;
UInt ImportPredEntryHashTableNum_;
struct import_dbref_hash_entry_struct **ImportDBRefHashChain_;
UInt ImportDBRefHashTableSize_;
UInt ImportDBRefHashTableNum_;
yamop *ImportFAILCODE_;
Functor FunctorVar_;
UInt ibnds_[256];
struct index_t* exo_it_;
CELL* exo_base_;
UInt exo_arity_;
UInt exo_arg_;
struct scan_atoms* search_atoms_;
Int CurSlot_;
Term SourceModule_;
size_t MAX_SIZE_;
} w_local;
/* This file, hlocals.h, was generated automatically by "yap -L misc/buildlocalglobal"
please do not update, update misc/LOCALS instead */
typedef struct worker_local {
int c_input_stream_;
int c_output_stream_;
int c_error_stream_;
CELL* OldASP_;
CELL* OldLCL0_;
tr_fr_ptr OldTR_;
CELL* OldGlobalBase_;
CELL* OldH_;
CELL* OldH0_;
ADDR OldTrailBase_;
ADDR OldTrailTop_;
ADDR OldHeapBase_;
ADDR OldHeapTop_;
Int ClDiff_;
Int GDiff_;
Int HDiff_;
Int GDiff0_;
CELL* GSplit_;
Int LDiff_;
Int TrDiff_;
Int XDiff_;
Int DelayDiff_;
Int BaseDiff_;
YAP_ULONG_LONG ReductionsCounter_;
YAP_ULONG_LONG PredEntriesCounter_;
YAP_ULONG_LONG RetriesCounter_;
int ReductionsCounterOn_;
int PredEntriesCounterOn_;
int RetriesCounterOn_;
union CONSULT_OBJ* ConsultSp_;
UInt ConsultCapacity_;
union CONSULT_OBJ* ConsultBase_;
union CONSULT_OBJ* ConsultLow_;
Term GlobalArena_;
UInt GlobalArenaOverflows_;
Int ArenaOverflows_;
Int DepthArenas_;
int ArithError_;
struct pred_entry* LastAssertedPred_;
char* ScannerStack_;
struct scanner_extra_alloc* ScannerExtraBlocks_;
struct DB_TERM* BallTerm_;
UInt MaxActiveSignals_;
UInt FirstActiveSignal_;
UInt LastActiveSignal_;
UInt* ActiveSignals_;
UInt IPredArity_;
yamop* ProfEnd_;
int UncaughtThrow_;
int DoingUndefp_;
Int StartLine_;
scratch_block ScratchPad_;
#ifdef COROUTINING
Term WokenGoals_;
Term AttsMutableList_;
#endif
Term GcGeneration_;
Term GcPhase_;
UInt GcCurrentPhase_;
UInt GcCalls_;
Int TotGcTime_;
YAP_ULONG_LONG TotGcRecovered_;
Int LastGcTime_;
Int LastSSTime_;
CELL* OpenArray_;
Int total_marked_;
Int total_oldies_;
struct choicept* current_B_;
CELL* prev_HB_;
CELL* HGEN_;
CELL** iptop_;
#if defined(GC_NO_TAGS)
char* bp_;
#endif
tr_fr_ptr sTR_;
tr_fr_ptr sTR0_;
tr_fr_ptr new_TR_;
struct gc_mark_continuation* cont_top0_;
struct gc_mark_continuation* cont_top_;
int discard_trail_entries_;
gc_ma_hash_entry gc_ma_hash_table_[GC_MAVARS_HASH_SIZE];
gc_ma_hash_entry* gc_ma_h_top_;
gc_ma_hash_entry* gc_ma_h_list_;
UInt gc_timestamp_;
ADDR db_vec_;
ADDR db_vec0_;
struct RB_red_blk_node* db_root_;
struct RB_red_blk_node* db_nil_;
sigjmp_buf gc_restore_;
CELL* extra_gc_cells_;
CELL* extra_gc_cells_base_;
CELL* extra_gc_cells_top_;
UInt extra_gc_cells_size_;
struct array_entry* DynamicArrays_;
struct static_array_entry* StaticArrays_;
struct global_entry* GlobalVariables_;
int AllowRestart_;
struct mem_blk* CMemFirstBlock_;
UInt CMemFirstBlockSz_;
int nperm_;
Int* LabelFirstArray_;
UInt LabelFirstArraySz_;
struct PL_local_data* PL_local_data_p_;
#ifdef THREADS
struct thandle ThreadHandle_;
#endif /* THREADS */
#if defined(YAPOR) || defined(TABLING)
struct local_optyap_data optyap_data_;
#endif /* YAPOR || TABLING */
int InterruptsDisabled_;
struct open_query_struct* execution_;
#if LOW_LEVEL_TRACER
Int total_choicepoints_;
#endif
int consult_level_;
#if defined(YAPOR) || defined(THREADS)
lockvar SignalLock_;
#endif
ADDR LocalBase_;
ADDR GlobalBase_;
ADDR TrailBase_;
ADDR TrailTop_;
char* ErrorMessage_;
Term Error_Term_;
#ifdef THREADS
Term Error_TYPE_;
#else
yap_error_number Error_TYPE_;
#endif
UInt Error_Size_;
char ErrorSay_[MAX_ERROR_MSG_SIZE];
jmp_buf IOBotch_;
TokEntry* tokptr_;
TokEntry* toktide_;
VarEntry* VarTable_;
VarEntry* AnonVarTable_;
Term Comments_;
CELL* CommentsTail_;
CELL* CommentsNextChar_;
wchar_t* CommentsBuff_;
size_t CommentsBuffPos_;
size_t CommentsBuffLim_;
sigjmp_buf RestartEnv_;
char FileNameBuf_[YAP_FILENAME_MAX];
char FileNameBuf2_[YAP_FILENAME_MAX];
Int PrologMode_;
int CritLocks_;
#ifdef ANALYST
YAP_ULONG_LONG opcount_[_std_top+1];
YAP_ULONG_LONG 2opcount[_std_top+1][_std_top+1]_;
#endif /* ANALYST */
struct db_globs* s_dbg_;
yap_error_number matherror_;
yap_error_number CurrentError_;
int heap_overflows_;
Int total_heap_overflow_time_;
int stack_overflows_;
Int total_stack_overflow_time_;
int delay_overflows_;
Int total_delay_overflow_time_;
int trail_overflows_;
Int total_trail_overflow_time_;
int atom_table_overflows_;
Int total_atom_table_overflow_time_;
#ifdef LOAD_DYLD
int dl_errno_;
#endif
#ifdef LOW_LEVEL_TRACER
int do_trace_primitives_;
#endif
struct export_atom_hash_entry_struct *ExportAtomHashChain_;
UInt ExportAtomHashTableSize_;
UInt ExportAtomHashTableNum_;
struct export_functor_hash_entry_struct *ExportFunctorHashChain_;
UInt ExportFunctorHashTableSize_;
UInt ExportFunctorHashTableNum_;
struct export_pred_entry_hash_entry_struct *ExportPredEntryHashChain_;
UInt ExportPredEntryHashTableSize_;
UInt ExportPredEntryHashTableNum_;
struct export_dbref_hash_entry_struct *ExportDBRefHashChain_;
UInt ExportDBRefHashTableSize_;
UInt ExportDBRefHashTableNum_;
struct import_atom_hash_entry_struct **ImportAtomHashChain_;
UInt ImportAtomHashTableSize_;
UInt ImportAtomHashTableNum_;
struct import_functor_hash_entry_struct **ImportFunctorHashChain_;
UInt ImportFunctorHashTableSize_;
UInt ImportFunctorHashTableNum_;
struct import_opcode_hash_entry_struct **ImportOPCODEHashChain_;
UInt ImportOPCODEHashTableSize_;
struct import_pred_entry_hash_entry_struct **ImportPredEntryHashChain_;
UInt ImportPredEntryHashTableSize_;
UInt ImportPredEntryHashTableNum_;
struct import_dbref_hash_entry_struct **ImportDBRefHashChain_;
UInt ImportDBRefHashTableSize_;
UInt ImportDBRefHashTableNum_;
yamop *ImportFAILCODE_;
Functor FunctorVar_;
#if __ANDROID__
struct AAssetManager* assetManager_;
char* InAssetDir_;
#endif
UInt ibnds_[256];
struct index_t* exo_it_;
CELL* exo_base_;
UInt exo_arity_;
UInt exo_arg_;
struct scan_atoms* search_atoms_;
yhandle_t CurSlot_;
Term SourceModule_;
size_t MAX_SIZE_;
} w_local;

View File

@ -1,119 +1,123 @@
/* This file, iglobals.h, was generated automatically by "yap -L misc/buildlocalglobal"
please do not update, update misc/GLOBALS instead */
static void InitGlobal(void) {
GLOBAL_Initialised = FALSE;
GLOBAL_InitialisedFromPL = FALSE;
GLOBAL_PL_Argc = 0;
GLOBAL_PL_Argv = NULL;
GLOBAL_HaltHooks = NULL;
GLOBAL_AllowLocalExpansion = TRUE;
GLOBAL_AllowGlobalExpansion = TRUE;
GLOBAL_AllowTrailExpansion = TRUE;
GLOBAL_SizeOfOverflow = 0;
GLOBAL_AGcThreshold = 10000;
GLOBAL_AGCHook = NULL;
#if THREADS
GLOBAL_NOfThreads = 1;
GLOBAL_NOfThreadsCreated = 1;
GLOBAL_ThreadsTotalTime = 0L;
INIT_LOCK(GLOBAL_ThreadHandlesLock);
#endif
#if defined(YAPOR) || defined(THREADS)
INIT_LOCK(GLOBAL_BGL);
#endif
#if defined(YAPOR) || defined(TABLING)
#endif /* YAPOR || TABLING */
#if defined(THREADS)
#endif /* THREADS */
GLOBAL_stdout = Soutput;
GLOBAL_stderr = Serror;
#ifdef COROUTINING
#endif
GLOBAL_tot_agc_time = 0;
GLOBAL_tot_agc_recovered = 0;
#if HAVE_MMAP
GLOBAL_mmap_arrays = NULL;
#endif
#ifdef DEBUG
#endif
#if defined(COFF) || defined(A_OUT)
#endif
GLOBAL_OpaqueHandlersCount = 0;
GLOBAL_OpaqueHandlers = NULL;
#if __simplescalar__
#endif
GLOBAL_DIRNAME = NULL;
#if LOW_PROF
GLOBAL_ProfilerOn = FALSE;
GLOBAL_FProf = NULL;
GLOBAL_FPreds = NULL;
#endif /* LOW_PROF */
}
/* This file, iglobals.h, was generated automatically by "yap -L misc/buildlocalglobal"
please do not update, update misc/GLOBALS instead */
static void InitGlobal(void) {
GLOBAL_Initialised = FALSE;
GLOBAL_InitialisedFromPL = FALSE;
GLOBAL_PL_Argc = 0;
GLOBAL_PL_Argv = NULL;
GLOBAL_HaltHooks = NULL;
GLOBAL_AllowLocalExpansion = TRUE;
GLOBAL_AllowGlobalExpansion = TRUE;
GLOBAL_AllowTrailExpansion = TRUE;
GLOBAL_SizeOfOverflow = 0;
GLOBAL_AGcThreshold = 10000;
GLOBAL_AGCHook = NULL;
#if __ANDROID__
GLOBAL_assetManager = GLOBAL_assetManager;
#endif
#if THREADS
GLOBAL_NOfThreads = 1;
GLOBAL_NOfThreadsCreated = 1;
GLOBAL_ThreadsTotalTime = 0L;
INIT_LOCK(GLOBAL_ThreadHandlesLock);
#endif
#if defined(YAPOR) || defined(THREADS)
INIT_LOCK(GLOBAL_BGL);
#endif
#if defined(YAPOR) || defined(TABLING)
#endif /* YAPOR || TABLING */
#if defined(THREADS)
#endif /* THREADS */
GLOBAL_stdout = Soutput;
GLOBAL_stderr = Serror;
#ifdef COROUTINING
#endif
GLOBAL_tot_agc_time = 0;
GLOBAL_tot_agc_recovered = 0;
#if HAVE_MMAP
GLOBAL_mmap_arrays = NULL;
#endif
#ifdef DEBUG
#endif
#if defined(COFF) || defined(A_OUT)
#endif
GLOBAL_OpaqueHandlersCount = 0;
GLOBAL_OpaqueHandlers = NULL;
#if __simplescalar__
#endif
GLOBAL_DIRNAME = NULL;
#if LOW_PROF
GLOBAL_ProfilerOn = FALSE;
GLOBAL_FProf = NULL;
GLOBAL_FPreds = NULL;
#endif /* LOW_PROF */
}

View File

@ -1,242 +1,247 @@
/* This file, ilocals.h, was generated automatically by "yap -L misc/buildlocalglobal"
please do not update, update misc/LOCALS instead */
static void InitWorker(int wid) {
REMOTE_c_input_stream(wid) = 0;
REMOTE_c_output_stream(wid) = 1;
REMOTE_c_error_stream(wid) = 2;
REMOTE_OldASP(wid) = NULL;
REMOTE_OldLCL0(wid) = NULL;
REMOTE_OldTR(wid) = NULL;
REMOTE_OldGlobalBase(wid) = NULL;
REMOTE_OldH(wid) = NULL;
REMOTE_OldH0(wid) = NULL;
REMOTE_OldTrailBase(wid) = NULL;
REMOTE_OldTrailTop(wid) = NULL;
REMOTE_OldHeapBase(wid) = NULL;
REMOTE_OldHeapTop(wid) = NULL;
REMOTE_ClDiff(wid) = 0L;
REMOTE_GDiff(wid) = 0L;
REMOTE_HDiff(wid) = 0L;
REMOTE_GDiff0(wid) = 0L;
REMOTE_GSplit(wid) = NULL;
REMOTE_LDiff(wid) = 0L;
REMOTE_TrDiff(wid) = 0L;
REMOTE_XDiff(wid) = 0L;
REMOTE_DelayDiff(wid) = 0L;
REMOTE_BaseDiff(wid) = 0L;
REMOTE_ReductionsCounter(wid) = 0L;
REMOTE_PredEntriesCounter(wid) = 0L;
REMOTE_RetriesCounter(wid) = 0L;
REMOTE_ReductionsCounterOn(wid) = 0L;
REMOTE_PredEntriesCounterOn(wid) = 0L;
REMOTE_RetriesCounterOn(wid) = 0L;
REMOTE_ConsultSp(wid) = NULL;
REMOTE_ConsultBase(wid) = NULL;
REMOTE_ConsultLow(wid) = NULL;
REMOTE_GlobalArena(wid) = 0L;
REMOTE_GlobalArenaOverflows(wid) = 0L;
REMOTE_ArenaOverflows(wid) = 0L;
REMOTE_DepthArenas(wid) = 0;
REMOTE_ArithError(wid) = FALSE;
REMOTE_LastAssertedPred(wid) = NULL;
REMOTE_ScannerStack(wid) = NULL;
REMOTE_ScannerExtraBlocks(wid) = NULL;
REMOTE_BallTerm(wid) = NULL;
REMOTE_MaxActiveSignals(wid) = 64L;
REMOTE_FirstActiveSignal(wid) = 0L;
REMOTE_LastActiveSignal(wid) = 0L;
REMOTE_ActiveSignals(wid) = Yap_InitSignals(wid);
REMOTE_IPredArity(wid) = 0L;
REMOTE_ProfEnd(wid) = NULL;
REMOTE_UncaughtThrow(wid) = FALSE;
REMOTE_DoingUndefp(wid) = FALSE;
REMOTE_StartLine(wid) = 0L;
InitScratchPad(wid);
#ifdef COROUTINING
REMOTE_WokenGoals(wid) = 0L;
REMOTE_AttsMutableList(wid) = 0L;
#endif
REMOTE_GcGeneration(wid) = 0L;
REMOTE_GcPhase(wid) = 0L;
REMOTE_GcCurrentPhase(wid) = 0L;
REMOTE_GcCalls(wid) = 0L;
REMOTE_TotGcTime(wid) = 0L;
REMOTE_TotGcRecovered(wid) = 0L;
REMOTE_LastGcTime(wid) = 0L;
REMOTE_LastSSTime(wid) = 0L;
REMOTE_OpenArray(wid) = NULL;
REMOTE_total_marked(wid) = 0L;
REMOTE_total_oldies(wid) = 0L;
REMOTE_current_B(wid) = NULL;
REMOTE_prev_HB(wid) = NULL;
REMOTE_HGEN(wid) = NULL;
REMOTE_iptop(wid) = NULL;
#if defined(GC_NO_TAGS)
REMOTE_bp(wid) = NULL;
#endif
REMOTE_sTR(wid) = NULL;
REMOTE_sTR0(wid) = NULL;
REMOTE_new_TR(wid) = NULL;
REMOTE_cont_top0(wid) = NULL;
REMOTE_cont_top(wid) = NULL;
REMOTE_discard_trail_entries(wid) = 0;
REMOTE_gc_ma_h_top(wid) = NULL;
REMOTE_gc_ma_h_list(wid) = NULL;
REMOTE_gc_timestamp(wid) = 0L;
REMOTE_db_vec(wid) = NULL;
REMOTE_db_vec0(wid) = NULL;
REMOTE_db_root(wid) = NULL;
REMOTE_db_nil(wid) = NULL;
REMOTE_extra_gc_cells_size(wid) = 256;
REMOTE_DynamicArrays(wid) = NULL;
REMOTE_StaticArrays(wid) = NULL;
REMOTE_GlobalVariables(wid) = NULL;
REMOTE_AllowRestart(wid) = FALSE;
REMOTE_CMemFirstBlock(wid) = NULL;
REMOTE_CMemFirstBlockSz(wid) = 0L;
REMOTE_nperm(wid) = 0L;
REMOTE_LabelFirstArray(wid) = NULL;
REMOTE_LabelFirstArraySz(wid) = 0L;
REMOTE_PL_local_data_p(wid) = Yap_InitThreadIO(wid);
#ifdef THREADS
InitThreadHandle(wid);
#endif /* THREADS */
#if defined(YAPOR) || defined(TABLING)
Yap_init_local_optyap_data(wid);
#endif /* YAPOR || TABLING */
REMOTE_InterruptsDisabled(wid) = FALSE;
REMOTE_execution(wid) = NULL;
#if LOW_LEVEL_TRACER
REMOTE_total_choicepoints(wid) = 0;
#endif
REMOTE_consult_level(wid) = 0;
#if defined(YAPOR) || defined(THREADS)
INIT_LOCK(REMOTE_SignalLock(wid));
#endif
#ifdef THREADS
#else
#endif
REMOTE_PrologMode(wid) = BootMode;
REMOTE_CritLocks(wid) = 0;
#ifdef ANALYST
#endif /* ANALYST */
REMOTE_matherror(wid) = YAP_NO_ERROR;
REMOTE_CurrentError(wid) = YAP_NO_ERROR;
REMOTE_heap_overflows(wid) = 0;
REMOTE_total_heap_overflow_time(wid) = 0;
REMOTE_stack_overflows(wid) = 0;
REMOTE_total_stack_overflow_time(wid) = 0;
REMOTE_delay_overflows(wid) = 0;
REMOTE_total_delay_overflow_time(wid) = 0;
REMOTE_trail_overflows(wid) = 0;
REMOTE_total_trail_overflow_time(wid) = 0;
REMOTE_atom_table_overflows(wid) = 0;
REMOTE_total_atom_table_overflow_time(wid) = 0;
#ifdef LOAD_DYLD
REMOTE_dl_errno(wid) = 0;
#endif
#ifdef LOW_LEVEL_TRACER
REMOTE_do_trace_primitives(wid) = TRUE;
#endif
REMOTE_ExportAtomHashChain(wid) = NULL;
REMOTE_ExportAtomHashTableSize(wid) = 0;
REMOTE_ExportAtomHashTableNum(wid) = 0;
REMOTE_ExportFunctorHashChain(wid) = NULL;
REMOTE_ExportFunctorHashTableSize(wid) = 0;
REMOTE_ExportFunctorHashTableNum(wid) = 0;
REMOTE_ExportPredEntryHashChain(wid) = NULL;
REMOTE_ExportPredEntryHashTableSize(wid) = 0;
REMOTE_ExportPredEntryHashTableNum(wid) = 0;
REMOTE_ExportDBRefHashChain(wid) = NULL;
REMOTE_ExportDBRefHashTableSize(wid) = 0;
REMOTE_ExportDBRefHashTableNum(wid) = 0;
REMOTE_ImportAtomHashChain(wid) = NULL;
REMOTE_ImportAtomHashTableSize(wid) = 0;
REMOTE_ImportAtomHashTableNum(wid) = 0;
REMOTE_ImportFunctorHashChain(wid) = NULL;
REMOTE_ImportFunctorHashTableSize(wid) = 0;
REMOTE_ImportFunctorHashTableNum(wid) = 0;
REMOTE_ImportOPCODEHashChain(wid) = NULL;
REMOTE_ImportOPCODEHashTableSize(wid) = 0;
REMOTE_ImportPredEntryHashChain(wid) = NULL;
REMOTE_ImportPredEntryHashTableSize(wid) = 0;
REMOTE_ImportPredEntryHashTableNum(wid) = 0;
REMOTE_ImportDBRefHashChain(wid) = NULL;
REMOTE_ImportDBRefHashTableSize(wid) = 0;
REMOTE_ImportDBRefHashTableNum(wid) = 0;
REMOTE_ImportFAILCODE(wid) = NULL;
REMOTE_FunctorVar(wid) = FunctorVar;
REMOTE_exo_it(wid) = NULL;
REMOTE_exo_base(wid) = NULL;
REMOTE_exo_arity(wid) = 0;
REMOTE_exo_arg(wid) = 0;
REMOTE_CurSlot(wid) = 0;
REMOTE_SourceModule(wid) = 0;
REMOTE_MAX_SIZE(wid) = 1024L;
}
/* This file, ilocals.h, was generated automatically by "yap -L misc/buildlocalglobal"
please do not update, update misc/LOCALS instead */
static void InitWorker(int wid) {
REMOTE_c_input_stream(wid) = 0;
REMOTE_c_output_stream(wid) = 1;
REMOTE_c_error_stream(wid) = 2;
REMOTE_OldASP(wid) = NULL;
REMOTE_OldLCL0(wid) = NULL;
REMOTE_OldTR(wid) = NULL;
REMOTE_OldGlobalBase(wid) = NULL;
REMOTE_OldH(wid) = NULL;
REMOTE_OldH0(wid) = NULL;
REMOTE_OldTrailBase(wid) = NULL;
REMOTE_OldTrailTop(wid) = NULL;
REMOTE_OldHeapBase(wid) = NULL;
REMOTE_OldHeapTop(wid) = NULL;
REMOTE_ClDiff(wid) = 0L;
REMOTE_GDiff(wid) = 0L;
REMOTE_HDiff(wid) = 0L;
REMOTE_GDiff0(wid) = 0L;
REMOTE_GSplit(wid) = NULL;
REMOTE_LDiff(wid) = 0L;
REMOTE_TrDiff(wid) = 0L;
REMOTE_XDiff(wid) = 0L;
REMOTE_DelayDiff(wid) = 0L;
REMOTE_BaseDiff(wid) = 0L;
REMOTE_ReductionsCounter(wid) = 0L;
REMOTE_PredEntriesCounter(wid) = 0L;
REMOTE_RetriesCounter(wid) = 0L;
REMOTE_ReductionsCounterOn(wid) = 0L;
REMOTE_PredEntriesCounterOn(wid) = 0L;
REMOTE_RetriesCounterOn(wid) = 0L;
REMOTE_ConsultSp(wid) = NULL;
REMOTE_ConsultBase(wid) = NULL;
REMOTE_ConsultLow(wid) = NULL;
REMOTE_GlobalArena(wid) = 0L;
REMOTE_GlobalArenaOverflows(wid) = 0L;
REMOTE_ArenaOverflows(wid) = 0L;
REMOTE_DepthArenas(wid) = 0;
REMOTE_ArithError(wid) = FALSE;
REMOTE_LastAssertedPred(wid) = NULL;
REMOTE_ScannerStack(wid) = NULL;
REMOTE_ScannerExtraBlocks(wid) = NULL;
REMOTE_BallTerm(wid) = NULL;
REMOTE_MaxActiveSignals(wid) = 64L;
REMOTE_FirstActiveSignal(wid) = 0L;
REMOTE_LastActiveSignal(wid) = 0L;
REMOTE_ActiveSignals(wid) = Yap_InitSignals(wid);
REMOTE_IPredArity(wid) = 0L;
REMOTE_ProfEnd(wid) = NULL;
REMOTE_UncaughtThrow(wid) = FALSE;
REMOTE_DoingUndefp(wid) = FALSE;
REMOTE_StartLine(wid) = 0L;
InitScratchPad(wid);
#ifdef COROUTINING
REMOTE_WokenGoals(wid) = 0L;
REMOTE_AttsMutableList(wid) = 0L;
#endif
REMOTE_GcGeneration(wid) = 0L;
REMOTE_GcPhase(wid) = 0L;
REMOTE_GcCurrentPhase(wid) = 0L;
REMOTE_GcCalls(wid) = 0L;
REMOTE_TotGcTime(wid) = 0L;
REMOTE_TotGcRecovered(wid) = 0L;
REMOTE_LastGcTime(wid) = 0L;
REMOTE_LastSSTime(wid) = 0L;
REMOTE_OpenArray(wid) = NULL;
REMOTE_total_marked(wid) = 0L;
REMOTE_total_oldies(wid) = 0L;
REMOTE_current_B(wid) = NULL;
REMOTE_prev_HB(wid) = NULL;
REMOTE_HGEN(wid) = NULL;
REMOTE_iptop(wid) = NULL;
#if defined(GC_NO_TAGS)
REMOTE_bp(wid) = NULL;
#endif
REMOTE_sTR(wid) = NULL;
REMOTE_sTR0(wid) = NULL;
REMOTE_new_TR(wid) = NULL;
REMOTE_cont_top0(wid) = NULL;
REMOTE_cont_top(wid) = NULL;
REMOTE_discard_trail_entries(wid) = 0;
REMOTE_gc_ma_h_top(wid) = NULL;
REMOTE_gc_ma_h_list(wid) = NULL;
REMOTE_gc_timestamp(wid) = 0L;
REMOTE_db_vec(wid) = NULL;
REMOTE_db_vec0(wid) = NULL;
REMOTE_db_root(wid) = NULL;
REMOTE_db_nil(wid) = NULL;
REMOTE_extra_gc_cells_size(wid) = 256;
REMOTE_DynamicArrays(wid) = NULL;
REMOTE_StaticArrays(wid) = NULL;
REMOTE_GlobalVariables(wid) = NULL;
REMOTE_AllowRestart(wid) = FALSE;
REMOTE_CMemFirstBlock(wid) = NULL;
REMOTE_CMemFirstBlockSz(wid) = 0L;
REMOTE_nperm(wid) = 0L;
REMOTE_LabelFirstArray(wid) = NULL;
REMOTE_LabelFirstArraySz(wid) = 0L;
REMOTE_PL_local_data_p(wid) = Yap_InitThreadIO(wid);
#ifdef THREADS
InitThreadHandle(wid);
#endif /* THREADS */
#if defined(YAPOR) || defined(TABLING)
Yap_init_local_optyap_data(wid);
#endif /* YAPOR || TABLING */
REMOTE_InterruptsDisabled(wid) = FALSE;
REMOTE_execution(wid) = NULL;
#if LOW_LEVEL_TRACER
REMOTE_total_choicepoints(wid) = 0;
#endif
REMOTE_consult_level(wid) = 0;
#if defined(YAPOR) || defined(THREADS)
INIT_LOCK(REMOTE_SignalLock(wid));
#endif
#ifdef THREADS
#else
#endif
REMOTE_PrologMode(wid) = BootMode;
REMOTE_CritLocks(wid) = 0;
#ifdef ANALYST
#endif /* ANALYST */
REMOTE_matherror(wid) = YAP_NO_ERROR;
REMOTE_CurrentError(wid) = YAP_NO_ERROR;
REMOTE_heap_overflows(wid) = 0;
REMOTE_total_heap_overflow_time(wid) = 0;
REMOTE_stack_overflows(wid) = 0;
REMOTE_total_stack_overflow_time(wid) = 0;
REMOTE_delay_overflows(wid) = 0;
REMOTE_total_delay_overflow_time(wid) = 0;
REMOTE_trail_overflows(wid) = 0;
REMOTE_total_trail_overflow_time(wid) = 0;
REMOTE_atom_table_overflows(wid) = 0;
REMOTE_total_atom_table_overflow_time(wid) = 0;
#ifdef LOAD_DYLD
REMOTE_dl_errno(wid) = 0;
#endif
#ifdef LOW_LEVEL_TRACER
REMOTE_do_trace_primitives(wid) = TRUE;
#endif
REMOTE_ExportAtomHashChain(wid) = NULL;
REMOTE_ExportAtomHashTableSize(wid) = 0;
REMOTE_ExportAtomHashTableNum(wid) = 0;
REMOTE_ExportFunctorHashChain(wid) = NULL;
REMOTE_ExportFunctorHashTableSize(wid) = 0;
REMOTE_ExportFunctorHashTableNum(wid) = 0;
REMOTE_ExportPredEntryHashChain(wid) = NULL;
REMOTE_ExportPredEntryHashTableSize(wid) = 0;
REMOTE_ExportPredEntryHashTableNum(wid) = 0;
REMOTE_ExportDBRefHashChain(wid) = NULL;
REMOTE_ExportDBRefHashTableSize(wid) = 0;
REMOTE_ExportDBRefHashTableNum(wid) = 0;
REMOTE_ImportAtomHashChain(wid) = NULL;
REMOTE_ImportAtomHashTableSize(wid) = 0;
REMOTE_ImportAtomHashTableNum(wid) = 0;
REMOTE_ImportFunctorHashChain(wid) = NULL;
REMOTE_ImportFunctorHashTableSize(wid) = 0;
REMOTE_ImportFunctorHashTableNum(wid) = 0;
REMOTE_ImportOPCODEHashChain(wid) = NULL;
REMOTE_ImportOPCODEHashTableSize(wid) = 0;
REMOTE_ImportPredEntryHashChain(wid) = NULL;
REMOTE_ImportPredEntryHashTableSize(wid) = 0;
REMOTE_ImportPredEntryHashTableNum(wid) = 0;
REMOTE_ImportDBRefHashChain(wid) = NULL;
REMOTE_ImportDBRefHashTableSize(wid) = 0;
REMOTE_ImportDBRefHashTableNum(wid) = 0;
REMOTE_ImportFAILCODE(wid) = NULL;
REMOTE_FunctorVar(wid) = FunctorVar;
#if __ANDROID__
REMOTE_assetManager(wid) = GLOBAL_assetManager;
REMOTE_InAssetDir(wid) = NULL;
#endif
REMOTE_exo_it(wid) = NULL;
REMOTE_exo_base(wid) = NULL;
REMOTE_exo_arity(wid) = 0;
REMOTE_exo_arg(wid) = 0;
REMOTE_CurSlot(wid) = 0;
REMOTE_SourceModule(wid) = 0;
REMOTE_MAX_SIZE(wid) = 1024L;
}

View File

@ -1,119 +1,123 @@
/* This file, rglobals.h, was generated automatically by "yap -L misc/buildlocalglobal"
please do not update, update misc/GLOBALS instead */
static void RestoreGlobal(void) {
#if THREADS
REINIT_LOCK(GLOBAL_ThreadHandlesLock);
#endif
#if defined(YAPOR) || defined(THREADS)
REINIT_LOCK(GLOBAL_BGL);
#endif
#if defined(YAPOR) || defined(TABLING)
#endif /* YAPOR || TABLING */
#if defined(THREADS)
#endif /* THREADS */
#ifdef COROUTINING
#endif
#if HAVE_MMAP
#endif
#ifdef DEBUG
#endif
#if defined(COFF) || defined(A_OUT)
#endif
#if __simplescalar__
#endif
#if LOW_PROF
#endif /* LOW_PROF */
}
/* This file, rglobals.h, was generated automatically by "yap -L misc/buildlocalglobal"
please do not update, update misc/GLOBALS instead */
static void RestoreGlobal(void) {
#if __ANDROID__
#endif
#if THREADS
REINIT_LOCK(GLOBAL_ThreadHandlesLock);
#endif
#if defined(YAPOR) || defined(THREADS)
REINIT_LOCK(GLOBAL_BGL);
#endif
#if defined(YAPOR) || defined(TABLING)
#endif /* YAPOR || TABLING */
#if defined(THREADS)
#endif /* THREADS */
#ifdef COROUTINING
#endif
#if HAVE_MMAP
#endif
#ifdef DEBUG
#endif
#if defined(COFF) || defined(A_OUT)
#endif
#if __simplescalar__
#endif
#if LOW_PROF
#endif /* LOW_PROF */
}

View File

@ -1,242 +1,247 @@
/* This file, rlocals.h, was generated automatically by "yap -L misc/buildlocalglobal"
please do not update, update misc/LOCALS instead */
static void RestoreWorker(int wid USES_REGS) {
REMOTE_GlobalArena(wid) = TermToGlobalOrAtomAdjust(REMOTE_GlobalArena(wid));
RestoreBallTerm(wid);
#ifdef COROUTINING
REMOTE_WokenGoals(wid) = TermToGlobalAdjust(REMOTE_WokenGoals(wid));
REMOTE_AttsMutableList(wid) = TermToGlobalAdjust(REMOTE_AttsMutableList(wid));
#endif
REMOTE_GcGeneration(wid) = TermToGlobalAdjust(REMOTE_GcGeneration(wid));
REMOTE_GcPhase(wid) = TermToGlobalAdjust(REMOTE_GcPhase(wid));
#if defined(GC_NO_TAGS)
#endif
REMOTE_DynamicArrays(wid) = PtoArrayEAdjust(REMOTE_DynamicArrays(wid));
REMOTE_StaticArrays(wid) = PtoArraySAdjust(REMOTE_StaticArrays(wid));
REMOTE_GlobalVariables(wid) = PtoGlobalEAdjust(REMOTE_GlobalVariables(wid));
#ifdef THREADS
#endif /* THREADS */
#if defined(YAPOR) || defined(TABLING)
#endif /* YAPOR || TABLING */
#if LOW_LEVEL_TRACER
#endif
#if defined(YAPOR) || defined(THREADS)
REINIT_LOCK(REMOTE_SignalLock(wid));
#endif
#ifdef THREADS
#else
#endif
#ifdef ANALYST
#endif /* ANALYST */
#ifdef LOAD_DYLD
#endif
#ifdef LOW_LEVEL_TRACER
#endif
}
/* This file, rlocals.h, was generated automatically by "yap -L misc/buildlocalglobal"
please do not update, update misc/LOCALS instead */
static void RestoreWorker(int wid USES_REGS) {
REMOTE_GlobalArena(wid) = TermToGlobalOrAtomAdjust(REMOTE_GlobalArena(wid));
RestoreBallTerm(wid);
#ifdef COROUTINING
REMOTE_WokenGoals(wid) = TermToGlobalAdjust(REMOTE_WokenGoals(wid));
REMOTE_AttsMutableList(wid) = TermToGlobalAdjust(REMOTE_AttsMutableList(wid));
#endif
REMOTE_GcGeneration(wid) = TermToGlobalAdjust(REMOTE_GcGeneration(wid));
REMOTE_GcPhase(wid) = TermToGlobalAdjust(REMOTE_GcPhase(wid));
#if defined(GC_NO_TAGS)
#endif
REMOTE_DynamicArrays(wid) = PtoArrayEAdjust(REMOTE_DynamicArrays(wid));
REMOTE_StaticArrays(wid) = PtoArraySAdjust(REMOTE_StaticArrays(wid));
REMOTE_GlobalVariables(wid) = PtoGlobalEAdjust(REMOTE_GlobalVariables(wid));
#ifdef THREADS
#endif /* THREADS */
#if defined(YAPOR) || defined(TABLING)
#endif /* YAPOR || TABLING */
#if LOW_LEVEL_TRACER
#endif
#if defined(YAPOR) || defined(THREADS)
REINIT_LOCK(REMOTE_SignalLock(wid));
#endif
#ifdef THREADS
#else
#endif
#ifdef ANALYST
#endif /* ANALYST */
#ifdef LOAD_DYLD
#endif
#ifdef LOW_LEVEL_TRACER
#endif
#if __ANDROID__
#endif
}

View File

@ -26,17 +26,17 @@ extern int Yap_page_size;
/* #define SHMMAX 0x800000 - 8 Mbytes: shmget limit for Solaris (?) */
#if SIZEOF_INT_P == 4
#define ALIGN 3
#define OPTYAP_ALIGN 3
#define ALIGNMASK 0xfffffffc
#elif SIZEOF_INT_P == 8
#define ALIGN 7
#define OPTYAP_ALIGN 7
#define ALIGNMASK 0xfffffff8
#else
#define ALIGN OOOOPPS!!! Unknown Pointer Sizeof
#define ALIGNMASK OOOOPPS!!! Unknown Pointer Sizeof
#endif /* SIZEOF_INT_P */
#define ADJUST_SIZE(SIZE) ((SIZE + ALIGN) & ALIGNMASK)
#define ADJUST_SIZE(SIZE) ((SIZE + OPTYAP_ALIGN) & ALIGNMASK)
#define ADJUST_SIZE_TO_PAGE(SIZE) ((SIZE) - (SIZE) % Yap_page_size + Yap_page_size)
#define PAGE_HEADER(STR) (pg_hd_ptr)((unsigned long int)STR - (unsigned long int)STR % Yap_page_size)
#define STRUCT_NEXT(STR) ((STR)->next)

View File

@ -36,6 +36,10 @@ UInt SizeOfOverflow =0
UInt AGcThreshold =10000
Agc_hook AGCHook =NULL
#if __ANDROID__
// no need to perform initialization, it is done before we start the Prolog engine.
struct AAssetManager* assetManager =GLOBAL_assetManager
#endif
/* multi-thread support */
#if THREADS

View File

@ -257,6 +257,13 @@ yamop *ImportFAILCODE =NULL
Functor FunctorVar =FunctorVar
#if __ANDROID__
// current virtual directory.
struct AAssetManager* assetManager =GLOBAL_assetManager
char* InAssetDir =NULL
#endif
// exo indexing
UInt ibnds[256] void
@ -269,7 +276,7 @@ UInt exo_arg =0
struct scan_atoms* search_atoms void
// Slots
handle_t CurSlot =0
yhandle_t CurSlot =0
Term SourceModule =0

View File

@ -373,8 +373,8 @@ PL_EXPORT(int) StryLock(IOSTREAM *s);
PL_EXPORT(int) Sunlock(IOSTREAM *s);
PL_EXPORT(IOSTREAM *) Snew(void *handle, int flags, IOFUNCTIONS *functions);
PL_EXPORT(IOSTREAM *) Sopen_file(const char *path, const char *how);
#if __ANDROID__
PL_EXPORT(IOSTREAM *) Sopen_asset(char *bufp, const char *how);
#ifdef ANDROID_ASSET_MANAGER_H
PL_EXPORT(IOSTREAM *) Sopen_asset(char *bufp, const char *how, AAssetManager* mgr);
#endif
PL_EXPORT(IOSTREAM *) Sfdopen(int fd, const char *type);
PL_EXPORT(int) Sfileno(IOSTREAM *s);

View File

@ -3251,7 +3251,7 @@ openStream(term_t file, term_t mode, term_t options)
{
#if __ANDROID__
if (strstr(path,"/assets/")) {
if (!(s=Sopen_asset(path+8, "r")))
if (!(s=Sopen_asset(path+8, "r", GLOBAL_assetManager)))
{ PL_error(NULL, 0, OsError(), ERR_FILE_OPERATION,
ATOM_open, ATOM_source_sink, file);
return NULL;
@ -5143,6 +5143,31 @@ static const PL_extension foreigns[] = {
LFRG((char *)NULL, 0, NULL, 0)
};
#if __ANDROID__
JNIEnv *Yap_jenv;
void Java_org_swig_simple_SwigSimple_load(JNIEnv *env0, jobject obj, jobject mgr);
void Java_org_swig_simple_SwigSimple_load
(JNIEnv *env0, jobject obj, jobject mgr0)
{
AAssetManager *mgr = AAssetManager_fromJava(env0, mgr0);
Yap_jenv = env0;
if (mgr == NULL) {
} else {
GLOBAL_assetManager = mgr;
}
}
AAssetManager *Yap_assetManager( void );
AAssetManager *Yap_assetManager( void )
{
return GLOBAL_assetManager;
}
#endif
struct PL_local_data *Yap_InitThreadIO(int wid)
{
struct PL_local_data *p;

View File

@ -121,6 +121,29 @@ LastModifiedFile(const char *name, double *tp)
#else
char tmp[MAXPATHLEN];
statstruct buf;
#ifdef __ANDROID__
if (strstr(name,"/assets")) {
AAssetManager* mgr = GLOBAL_assetManager;
*tp = (double)0;
if (!strcmp(name,"/assets"))
return TRUE;
const char *bufp=name+strlen("/assets/");
// check if file is a directory.
AAssetDir *assetDir = AAssetManager_openDir(mgr, bufp);
if (assetDir) {
const char *ptr = AAssetDir_getNextFileName(assetDir) ;
AAssetDir_close(assetDir);
if (ptr)
return TRUE;
}
AAsset *asset = AAssetManager_open(mgr, bufp, AASSET_MODE_UNKNOWN);
if (!asset)
return FALSE;
AAsset_close(asset);
return TRUE;
}
#endif
if ( statfunc(OsPath(name, tmp), &buf) < 0 )
return FALSE;
@ -178,6 +201,29 @@ LastModifiedFile64(const char *name, int64_t *tp)
#else
char tmp[MAXPATHLEN];
statstruct buf;
#ifdef __ANDROID__
if (strstr(name,"/assets")) {
AAssetManager* mgr = GLOBAL_assetManager;
*tp = (int64_t)0;
if (!strcmp(name,"/assets"))
return TRUE;
const char *bufp=name+strlen("/assets/");
// check if file is a directory.
AAssetDir *assetDir = AAssetManager_openDir(mgr, bufp);
if (assetDir) {
const char *ptr = AAssetDir_getNextFileName(assetDir) ;
AAssetDir_close(assetDir);
if (ptr)
return TRUE;
}
AAsset *asset = AAssetManager_open(mgr, bufp, AASSET_MODE_UNKNOWN);
if (!asset)
return FALSE;
AAsset_close(asset);
return TRUE;
}
#endif
if ( statfunc(OsPath(name, tmp), &buf) < 0 )
return FALSE;
@ -199,6 +245,28 @@ SizeFile(const char *path)
{ char tmp[MAXPATHLEN];
statstruct buf;
#ifdef __ANDROID__
if (strstr(path,"/assets")) {
AAssetManager* mgr = GLOBAL_assetManager;
if (!strcmp(path,"/assets"))
return 0;
const char *bufp=path+strlen("/assets/");
// check if file is a directory.
AAssetDir *assetDir = AAssetManager_openDir(mgr, bufp);
if (assetDir) {
const char *ptr = AAssetDir_getNextFileName(assetDir) ;
AAssetDir_close(assetDir);
if (ptr)
return 0;
}
AAsset *asset = AAssetManager_open(mgr, bufp, AASSET_MODE_UNKNOWN);
if (!asset)
return -1;
AAsset_close(asset);
return 0;
}
#endif
if ( statfunc(OsPath(path, tmp), &buf) < 0 )
return -1;
@ -220,6 +288,36 @@ ACCESS_WRITE and ACCESS_EXECUTE.
int
AccessFile(const char *path, int mode)
{ char tmp[MAXPATHLEN];
#ifdef __ANDROID__
if (strstr(path,"/assets")) {
AAssetManager* mgr = GLOBAL_assetManager;
if (!strcmp(path,"/assets"))
return !(mode & ACCESS_WRITE );
const char *bufp=path+strlen("/assets/");
// check if file is a directory.
AAssetDir *assetDir = AAssetManager_openDir(mgr, bufp);
if (assetDir) {
const char *ptr = AAssetDir_getNextFileName(assetDir) ;
AAssetDir_close(assetDir);
if (ptr)
return !(mode & ACCESS_WRITE );
}
AAsset *asset = AAssetManager_open(mgr, bufp, AASSET_MODE_UNKNOWN);
if (!asset)
return FALSE;
AAsset_close(asset);
if ( mode == ACCESS_EXIST )
return TRUE;
else
{
if ( mode & ACCESS_WRITE ) return FALSE;
#ifdef X_OK
if ( mode & ACCESS_EXECUTE ) return FALSE;
#endif
return TRUE;
}
}
#endif
#ifdef HAVE_ACCESS
int m = 0;
@ -249,6 +347,27 @@ ExistsFile(const char *path)
char tmp[MAXPATHLEN];
statstruct buf;
#ifdef __ANDROID__
if (strstr(path,"/assets")) {
AAssetManager* mgr = GLOBAL_assetManager;
if (!strcmp(path,"/assets"))
return TRUE;
const char *bufp=path+strlen("/assets/");
// check if file is a directory.
AAssetDir *assetDir = AAssetManager_openDir(mgr, bufp);
if (assetDir) {
const char *ptr = AAssetDir_getNextFileName(assetDir) ;
AAssetDir_close(assetDir);
if (ptr)
return TRUE;
}
AAsset *asset = AAssetManager_open(mgr, bufp, AASSET_MODE_UNKNOWN);
if (!asset)
return FALSE;
AAsset_close(asset);
return TRUE;
}
#endif
if ( statfunc(OsPath(path, tmp), &buf) == -1 || !S_ISREG(buf.st_mode) )
{ DEBUG(2, perror(tmp));
return FALSE;
@ -268,6 +387,24 @@ ExistsDirectory(const char *path)
char *ospath = OsPath(path, tmp);
statstruct buf;
#ifdef __ANDROID__
if (strstr(ospath,"/assets")) {
AAssetManager* mgr = GLOBAL_assetManager;
const char *ptr = NULL;
if (!strcmp(path,"/assets"))
return TRUE;
const char *bufp=path+strlen("/assets/");
// check if file is a directory.
AAssetDir *assetDir = AAssetManager_openDir(mgr, bufp);
if (assetDir)
ptr = AAssetDir_getNextFileName(assetDir);
if (assetDir) {
AAssetDir_close(assetDir);
}
return ptr != NULL;
}
#endif
if ( statfunc(ospath, &buf) < 0 )
return FALSE;
@ -1016,7 +1153,8 @@ PRED_IMPL("working_directory", 2, working_directory, 0)
{ char *n;
if ( PL_get_file_name(new, &n, 0) )
{ if ( ChDir(n) )
{
if ( ChDir(n) )
return TRUE;
if ( truePrologFlag(PLFLAG_FILEERRORS) )

View File

@ -1525,10 +1525,6 @@ PL_changed_cwd(void)
UNLOCK();
}
#if __ANDROID__
char *Yap_InAssetDir;
#endif
static char *
cwd_unlocked(char *cwd, size_t cwdlen)
{ GET_LD
@ -1548,9 +1544,9 @@ to be implemented directly. What about other Unixes?
#endif
#if __ANDROID__
if (Yap_InAssetDir) {
rval = strncpy(buf, Yap_InAssetDir, sizeof(buf));
}
if (LOCAL_InAssetDir) {
rval = strncpy(buf, LOCAL_InAssetDir, sizeof(buf));
} else
#endif
#if defined(HAVE_GETWD) && !defined(HAVE_GETCWD)
rval = getwd(buf);
@ -1647,9 +1643,6 @@ bool
ChDir(const char *path)
{ char ospath[MAXPATHLEN];
char tmp[MAXPATHLEN];
int hyper_path = FALSE;
__android_log_print(ANDROID_LOG_INFO, __FUNCTION__, " %s ",ospath);
OsPath(path, ospath);
@ -1662,37 +1655,38 @@ ChDir(const char *path)
/* treat "/assets" as a directory (actually as a mounted file system).
*
*/
if (strstr(ospath, "/assets/") == ospath) {
extern AAssetManager *assetManager;
if (LOCAL_InAssetDir) {
free(LOCAL_InAssetDir);
LOCAL_InAssetDir = NULL;
}
if (strstr(ospath, "/assets/") == ospath) {
const char *dirName = ospath+strlen("/assets/");
AAssetManager* mgr = assetManager;
AAssetManager* mgr = GLOBAL_assetManager;
AAssetDir* dir;
if (( dir = AAssetManager_openDir(mgr, dirName))) {
if (( dir = AAssetManager_openDir(mgr, dirName) ) &&
AAssetDir_getNextFileName( dir ) ) {
// valid directpry
size_t sz = strlen(ospath)+1;
AAssetDir_close(dir);
hyper_path = TRUE;
LOCAL_InAssetDir = (char *)malloc(sz);
strncpy(LOCAL_InAssetDir, ospath, sz-1);
succeed;
} else {
fail;
}
hyper_path = FALSE;
} else if (!strcmp(ospath, "/assets"))
hyper_path = TRUE;
if (hyper_path) {
if (Yap_InAssetDir) {
free(Yap_InAssetDir);
Yap_InAssetDir = NULL;
}
Yap_InAssetDir = (char *)malloc(strlen(ospath)+1);
} else if ( !strcmp(ospath,"/assets") ||
!strcmp(ospath,"/assets/") ) {
// valid directpry
size_t sz = strlen("/assets")+1;
LOCAL_InAssetDir = (char *)malloc(sz);
strncpy(LOCAL_InAssetDir, ospath, sz);
succeed;
}
#endif
#endif
if ( hyper_path ||
chdir(ospath) == 0 )
if ( chdir(ospath) == 0 )
{ size_t len;
#if __ANDROID__
if (Yap_InAssetDir) {
free(Yap_InAssetDir);
Yap_InAssetDir = NULL;
}
#endif
len = strlen(tmp);
if ( len == 0 || tmp[len-1] != '/' )
{ tmp[len++] = '/';

View File

@ -895,7 +895,6 @@ put_code(int c, IOSTREAM *s)
#if __ANDROID__
if (Yap_AndroidBufp && (s == Soutput || s == Serror) ) {
__android_log_print(ANDROID_LOG_INFO, __FUNCTION__, "get char %c %p",c, Yap_AndroidBufp);
(Yap_DisplayWithJava)(c);
}
@ -2903,8 +2902,9 @@ Sopen_file(const char *path, const char *how)
#if __ANDROID__
if (strstr(path, "/assets/") == path) {
char * p = (char *)path + strlen("/assets/");
return Sopen_asset( p, how-1);
AAssetManager *Yap_assetManager( void );
char * p = (char *)path + strlen("/assets/");
return Sopen_asset( p, how-1, Yap_assetManager());
}
#endif
@ -3311,23 +3311,6 @@ IOFUNCTIONS Sassetfunctions =
#include <jni.h>
#include <string.h>
AAssetManager *assetManager;
JNIEnv *env;
void Java_org_swig_simple_SwigSimple_load(JNIEnv *env0, jobject obj, jobject mgr);
void Java_org_swig_simple_SwigSimple_load
(JNIEnv *env0, jobject obj, jobject mgr)
{
assetManager = AAssetManager_fromJava(env0, mgr);
env = env0;
if (assetManager == NULL) {
__android_log_print(ANDROID_LOG_DEBUG, "os-stream.c", "error loading asset manager");
} else {
__android_log_print(ANDROID_LOG_DEBUG, "os-stream.c", "loaded asset manager");
}
}
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Sopen_asset(char **buffer, size_t *sizep, const char* mode)
@ -3335,14 +3318,13 @@ Sopen_asset(char **buffer, size_t *sizep, const char* mode)
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
IOSTREAM *
Sopen_asset(char *bufp, const char *how)
Sopen_asset(char *bufp, const char *how, AAssetManager* mgr)
{
AAsset* asset;
int flags = SIO_FILE|SIO_TEXT|SIO_RECORDPOS|SIO_FBUF;
int op = *how++;
IOSTREAM *s;
IOENC enc = ENC_UNKNOWN;
AAssetManager* mgr = assetManager;
for( ; *how; how++)
{ switch(*how)
@ -3383,7 +3365,6 @@ Sopen_asset(char *bufp, const char *how)
errno = EINVAL;
return NULL;
}
__android_log_print(ANDROID_LOG_INFO, "os-stream.c", "got asset %s -> %p", bufp, asset);\
if ( !asset )
return NULL;

View File

@ -38,7 +38,8 @@ jni/libyap.@SO@: jni/yap_wrap.o
$(CXX) -shared $(LDSOFLAGS) -o $@ ../../yapi.o $< $(LIBS) @JPLLDFLAGS@ -L ../.. -lYap -lpthread
jni/yap_wrap.cpp java/yap.java: $(srcdir)/yap.i
$(SWIG) -c++ -java -package pt.up.fc.dcc.yap -outdir java -o $@ $(CXXFLAGS) -Wall $<
mkdir -p jni
$(SWIG) -c++ -java -package pt.up.fc.dcc.yap -outdir java -o jni/yap_wrap.cpp $(CXXFLAGS) -Wall $<
jni/yap_wrap.o: jni/yap_wrap.cpp
$(CXX) -c $(CXXFLAGS) @JPLCFLAGS@ $< -o $@

View File

@ -12,6 +12,7 @@ import android.content.pm.PackageManager.NameNotFoundException;
import android.util.Log;
import android.content.res.AssetManager;
import android.widget.EditText;
import java.text.ParseException;
public class SwigSimple extends Activity
{
@ -22,6 +23,39 @@ public class SwigSimple extends Activity
String str;
String buf;
void runQuery(String str)
{
try
{
YAPQuery q = eng.query( str );
YAPListTerm vs0 = q.namedVars();
// text.setText("");
if (vs0.nil()) {
if (q.next()) {
outputText.append( "yes\n" );
} else {
outputText.append( "no\n" );
}
} else {
int i=1;
while (q.next()) {
YAPListTerm vs = vs0;
while(!vs.nil()){
YAPTerm eq = vs.car();
//outputText.append(Integer.toString(i) + ": " + eq.text() );
outputText.append(Integer.toString(i++) + ":\t" + eq.getArg(1).text() + " = " + eq.getArg(2).text() +"\n" );
vs = vs.cdr();
}
}
}
q.close();
} catch(Exception e){
outputText.append("Exception thrown :" + e);
return;
}
}
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState)
@ -44,7 +78,7 @@ public class SwigSimple extends Activity
text = (EditText)findViewById(R.id.EditText01);
outputText = (TextView)findViewById(R.id.OutputText);
outputText.setText("Application " + s + "\nPress 'Run' to start...\n");
outputText.setText("Application " + s + "\nPress 'Query' to start...\n");
outputText.setMovementMethod(new ScrollingMovementMethod());
scroller = (ScrollView)findViewById(R.id.Scroller);
eng = new YAPEngine( );
@ -57,24 +91,24 @@ public class SwigSimple extends Activity
}
}
public void onResetButtonClick(View view)
public void onClearButtonClick(View view)
{
if (BuildConfig.DEBUG) {
Log.i(TAG, "onReseButtonClick called");
Log.i(TAG, "onClearButtonClick called");
}
// Ensure scroll to end of text
scroller.post(new Runnable() {
public void run() {
scroller.fullScroll(ScrollView.FOCUS_DOWN);
text.setText("");
text.setText("");
}
});
}
public void onRunButtonClick(View view)
public void onQueryButtonClick(View view)
{
if (BuildConfig.DEBUG) {
Log.i(TAG, "onRunButtonClick called");
Log.i(TAG, "onQueryButtonClick called");
}
// Ensure scroll to end of text
scroller.post(new Runnable() {
@ -82,36 +116,16 @@ public class SwigSimple extends Activity
scroller.fullScroll(ScrollView.FOCUS_DOWN);
str = text.getText().toString();
outputText.append("?- " + str);
YAPQuery q = eng.query( str );
YAPListTerm vs = q.namedVars();
// text.setText("");
if (vs.nil()) {
if (q.next()) {
outputText.append( "yes\n" );
} else {
outputText.append( "no\n" );
}
} else {
int i=1;
while (q.next()) {
// outputText.append(Integer.toString(i++) + ": " + vs.text() +"\n");
while(!vs.nil()){
YAPTerm eq = vs.car();
//outputText.append(Integer.toString(i) + ": " + eq.text() );
outputText.append(Integer.toString(i++) + ":\t" + eq.getArg(1).text() + " = " + eq.getArg(2).text() +"\n" );
vs = vs.cdr();
}
}
}
q.close();
Log.i(TAG, "onQueryButtonClick "+str + "\n");
runQuery(str);
}
});
}
public void onRunSelectionButtonClick(View view)
public void onQuerySelectionButtonClick(View view)
{
if (BuildConfig.DEBUG) {
Log.i(TAG, "onRunButtonClick called");
Log.i(TAG, "onQuerySelectionButtonClick called");
}
// Ensure scroll to end of text
scroller.post(new Runnable() {
@ -120,29 +134,9 @@ public class SwigSimple extends Activity
int startSelection = text.getSelectionStart();
int endSelection = text.getSelectionEnd();
str = text.getText().toString().substring( startSelection, endSelection );
outputText.append("?- " + str);
YAPQuery q = eng.query( str );
YAPListTerm vs = q.namedVars();
// text.setText("");
if (vs.nil()) {
if (q.next()) {
outputText.append( "yes\n" );
} else {
outputText.append( "no\n" );
}
} else {
while (q.next()) {
int i=1;
// outputText.append(Integer.toString(i++) + ": " + vs.text() +"\n");
while(!vs.nil()){
YAPTerm eq = vs.car();
//outputText.append(Integer.toString(i) + ": " + eq.text() );
outputText.append(Integer.toString(i++) + ":\t" + eq.getArg(1).text() + " = " + eq.getArg(2).text() +"\n" );
vs = vs.cdr();
}
}
}
q.close();
Log.i(TAG, "onQuerySelectionButtonClick "+str);
outputText.append("?- " + str + "\n");
runQuery(str);
}
});
}

View File

@ -1,52 +1,31 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<LinearLayout
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="wrap_content">
<EditText
android:id="@+id/EditText01"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1.0"
android:lines="6" />
<Button
android:id="@+id/RunButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Run..."
android:onClick="onRunButtonClick"
/>
<Button
android:id="@+id/RunSelectionButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Select"
android:onClick="onRunSelectionButtonClick"
/>
<Button
android:id="@+id/ClearButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Reset"
android:onClick="onClearButtonClick"
/>
</LinearLayout>
<ScrollView
android:id="@+id/Scroller"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<TextView
android:id="@+id/OutputText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
/>
<!-- Set MaxLegth EditText -->
</ScrollView>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="fill_parent"
android:layout_height="fill_parent">
<LinearLayout android:orientation="horizontal"
android:layout_width="fill_parent" android:layout_height="wrap_content">
<EditText android:id="@+id/EditText01" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_weight="1.0"
android:lines="6" />
<LinearLayout android:orientation="vertical"
android:layout_width="wrap_content" android:layout_height="fill_parent">
<Button android:id="@+id/QueryButton" android:layout_width="fill_parent"
android:layout_height="wrap_content" android:text="Query..."
android:onClick="onQueryButtonClick" />
<Button android:id="@+id/QuerySelectionButton"
android:layout_width="fill_parent" android:layout_height="wrap_content"
android:text="Select" android:onClick="onQuerySelectionButtonClick" />
<Button android:id="@+id/ClearButton" android:layout_width="fill_parent"
android:layout_height="wrap_content" android:text="Reset"
android:onClick="onClearButtonClick" />
</LinearLayout>
</LinearLayout>
<ScrollView android:id="@+id/Scroller" android:layout_width="fill_parent"
android:layout_height="fill_parent">
<TextView android:id="@+id/OutputText" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:singleLine = "false"/>
<!-- Set MaxLegth EditText -->
</ScrollView>
</LinearLayout>

View File

@ -25,6 +25,7 @@ mkdir -p packages/swig/python
mkdir -p packages/swig/R
mkdir -p packages/swig/java
mkdir -p packages/swig/fli
mkdir -p packages/swig/jni
AC_SUBST(SWIG)
AC_SUBST(SWIG_TARGET)

View File

@ -9,7 +9,10 @@ engine = yap.YAPEngine();
def go():
while True:
s = raw_input("Prolog Query: ")
q = engine.query(s)
try:
q = engine.query(s)
except:
... print "Oops! That was no valid number. Try again..."
while q.next():
vs = q.namedVars();
while vs.length() > 0:

View File

@ -25,7 +25,33 @@ extern "C" {
/* turn on director wrapping Callback */
%feature("director") YAPCallback;
class YAPPredicate;
#ifdef SWIGPYTHON
%exception YAPPredicate {
try {
$action
} catch (...) {
fprintf(stderr,"here\n");
PyErr_SetString(PyExc_SyntaxError, "syntax error");
return NULL;
}
}
#endif
%include "yapi.hh"
#ifdef SWIGJAVA
%javaexception("java.text.ParseException") YAPPredicate {
try {
$action
} catch (YAPError::SYNTAX_ERROR &e) {
jclass clazz = jenv->FindClass("java/text/ParseException");
jenv->ThrowNew(clazz, "Syntax error");
return $null;
}
}
#endif

View File

@ -329,7 +329,6 @@ absolute_file_name(File0,File) :-
atom_concat([File,NExt],F).
'$add_extensions'([_|Extensions],File,F) :-
'$add_extensions'(Extensions,File,F).
'$mk_sure_true_ext'(Ext,NExt) :-
atom_codes(Ext,[C|L]),
C \= 0'.,

View File

@ -1345,6 +1345,7 @@ catch_ball(C, C).
fail.
'$run_at_thread_start'.
log_event( String, Args ) :-
format( atom( M ), String, Args),
log_event( M ).

View File

@ -91,6 +91,8 @@ otherwise.
:- bootstrap('lists.yap').
:- bootstrap('consult.yap').
:- bootstrap('preddecls.yap').
:- bootstrap('atoms.yap').
:- bootstrap('os.yap').
:- bootstrap('absf.yap').
@ -137,6 +139,8 @@ otherwise.
'qly.yap',
'udi.yap'].
:- meta_predicate(log_event(+,:)).
:- dynamic prolog:'$user_defined_flag'/4.
:- dynamic prolog:'$parent_module'/2.

View File

@ -30,6 +30,7 @@ cd :-
cd('~').
cd(F) :-
format( atom( M ), 'before absolute_file_name ~w', [F]), log_event( M ),
absolute_file_name(F, Dir, [file_type(directory),file_errors(fail),access(execute),expand(true)]),
working_directory(_, Dir).

View File

@ -303,5 +303,3 @@ nb_current(GlobalVariable, Val) :-
subsumes_term(A,B) :-
\+ \+ terms:subsumes(A,B).