booting from prolog plus indenting
This commit is contained in:
parent
7312765824
commit
40765a6afb
@ -25,7 +25,6 @@
|
|||||||
|
|
||||||
#define C_INTERFACE_C 1
|
#define C_INTERFACE_C 1
|
||||||
|
|
||||||
|
|
||||||
#include "Yap.h"
|
#include "Yap.h"
|
||||||
#include "attvar.h"
|
#include "attvar.h"
|
||||||
#include "clause.h"
|
#include "clause.h"
|
||||||
@ -1135,7 +1134,6 @@ Int YAP_ExecuteOnCut(PredEntry *pe, CPredicate exec_code,
|
|||||||
while (B < (choiceptr)top) {
|
while (B < (choiceptr)top) {
|
||||||
oB = LCL0 - (CELL *)B;
|
oB = LCL0 - (CELL *)B;
|
||||||
B = B->cp_b;
|
B = B->cp_b;
|
||||||
|
|
||||||
}
|
}
|
||||||
PP = pe;
|
PP = pe;
|
||||||
if (pe->PredFlags & (SWIEnvPredFlag | CArgsPredFlag)) {
|
if (pe->PredFlags & (SWIEnvPredFlag | CArgsPredFlag)) {
|
||||||
@ -2178,9 +2176,6 @@ X_API char *YAP_CompileClause(Term t) {
|
|||||||
|
|
||||||
static int yap_lineno = 0;
|
static int yap_lineno = 0;
|
||||||
|
|
||||||
static char InitFile[] = "init.yap";
|
|
||||||
static char BootFile[] = "boot.yap";
|
|
||||||
|
|
||||||
/* do initial boot by consulting the file boot.yap */
|
/* do initial boot by consulting the file boot.yap */
|
||||||
static void do_bootfile(char *bootfilename USES_REGS) {
|
static void do_bootfile(char *bootfilename USES_REGS) {
|
||||||
Term t;
|
Term t;
|
||||||
@ -2266,10 +2261,12 @@ static void construct_init_file(char *boot_file, char *BootFile) {
|
|||||||
that wants to control Yap */
|
that wants to control Yap */
|
||||||
|
|
||||||
#define BOOT_FROM_SAVED_STATE TRUE
|
#define BOOT_FROM_SAVED_STATE TRUE
|
||||||
|
static char BootFile[] = "boot.yap";
|
||||||
|
static char InitFile[] = "init.yap";
|
||||||
|
|
||||||
Int YAP_Init(YAP_init_args *yap_init) {
|
Int YAP_Init(YAP_init_args *yap_init) {
|
||||||
int restore_result;
|
int restore_result;
|
||||||
int do_bootstrap = (yap_init->YapPrologBootFile != NULL);
|
bool do_bootstrap = (yap_init->YapPrologBootFile != NULL);
|
||||||
CELL Trail = 0, Stack = 0, Heap = 0, Atts = 0;
|
CELL Trail = 0, Stack = 0, Heap = 0, Atts = 0;
|
||||||
char boot_file[YAP_FILENAME_MAX + 1];
|
char boot_file[YAP_FILENAME_MAX + 1];
|
||||||
static int initialized = FALSE;
|
static int initialized = FALSE;
|
||||||
@ -2296,7 +2293,7 @@ Int YAP_Init(YAP_init_args *yap_init) {
|
|||||||
|
|
||||||
#else
|
#else
|
||||||
if (yap_init->SavedState) {
|
if (yap_init->SavedState) {
|
||||||
fprintf(stderr, "[ WARNING: threaded YAP will ignore saved state %s ]\n",
|
fprintf(stderr, "[ WARNING: YAP will ignore saved state %s ]\n",
|
||||||
yap_init->SavedState);
|
yap_init->SavedState);
|
||||||
yap_init->SavedState = NULL;
|
yap_init->SavedState = NULL;
|
||||||
}
|
}
|
||||||
@ -2332,6 +2329,7 @@ Int YAP_Init(YAP_init_args *yap_init) {
|
|||||||
} else {
|
} else {
|
||||||
Heap = yap_init->HeapSize;
|
Heap = yap_init->HeapSize;
|
||||||
}
|
}
|
||||||
|
|
||||||
Yap_InitWorkspace(Heap, Stack, Trail, Atts, yap_init->MaxTableSpaceSize,
|
Yap_InitWorkspace(Heap, Stack, Trail, Atts, yap_init->MaxTableSpaceSize,
|
||||||
yap_init->NumberWorkers, yap_init->SchedulerLoop,
|
yap_init->NumberWorkers, yap_init->SchedulerLoop,
|
||||||
yap_init->DelayedReleaseLoad);
|
yap_init->DelayedReleaseLoad);
|
||||||
@ -2511,8 +2509,13 @@ Int Yap_InitDefaults(YAP_init_args *init_args, char saved_state[]) {
|
|||||||
init_args->MaxGlobalSize = 0;
|
init_args->MaxGlobalSize = 0;
|
||||||
init_args->MaxTrailSize = 0;
|
init_args->MaxTrailSize = 0;
|
||||||
init_args->YapLibDir = NULL;
|
init_args->YapLibDir = NULL;
|
||||||
|
#if __ANDROID__
|
||||||
|
init_args->YapPrologBootFile = "pl/boot.yap";
|
||||||
|
init_args->YapPrologInitGoal = "bootstrap";
|
||||||
|
#else
|
||||||
init_args->YapPrologBootFile = NULL;
|
init_args->YapPrologBootFile = NULL;
|
||||||
init_args->YapPrologInitFile = NULL;
|
init_args->YapPrologInitGoal = NULL;
|
||||||
|
#endif
|
||||||
init_args->YapPrologRCFile = NULL;
|
init_args->YapPrologRCFile = NULL;
|
||||||
init_args->YapPrologGoal = NULL;
|
init_args->YapPrologGoal = NULL;
|
||||||
init_args->YapPrologTopLevelGoal = NULL;
|
init_args->YapPrologTopLevelGoal = NULL;
|
||||||
|
Reference in New Issue
Block a user