headers & booting

This commit is contained in:
Vitor Santos Costa 2016-04-18 16:40:17 +01:00
parent 3ac1a285a9
commit 49699f52e9
2 changed files with 29 additions and 29 deletions

View File

@ -24,10 +24,6 @@
#define C_INTERFACE_C 1
#include "Yap.h"
#include "attvar.h"
#include "clause.h"
#include "yapio.h"
#include <stdlib.h>
#if HAVE_UNISTD_H
#include <unistd.h>
@ -40,11 +36,15 @@
#if _MSC_VER || defined(__MINGW32__)
#include <windows.h>
#endif
#include "iopreds.h"
// we cannot consult YapInterface.h, that conflicts with what we declare, though
// it shouldn't
#include "Yap.h"
#include "YapInterface.h"
#include "YapText.h"
#include "attvar.h"
#include "clause.h"
#include "yapio.h"
#ifdef TABLING
#include "tab.macros.h"
#endif /* TABLING */
@ -56,6 +56,7 @@
#if HAVE_MALLOC_H
#include <malloc.h>
#endif
#include "iopreds.h"
typedef void *atom_t;
typedef void *functor_t;
@ -2243,32 +2244,31 @@ static void do_bootfile(char *bootfilename USES_REGS) {
/* trust YAPSHAREDIR over YAP_PL_SRCDIR, and notice that the code is
* dependent. */
static bool construct_init_file(char *boot_file, char *BootFile)
{
static bool construct_init_file(char *boot_file, char *BootFile) {
#if HAVE_GETENV
if (getenv("YAPSHAREDIR")) {
strncpy(boot_file, getenv("YAPSHAREDIR"), 256);
strncat(boot_file, "/pl/", 255);
if (Yap_Exists( boot_file ) ) {
if (Yap_Exists(boot_file)) {
return true;
}
}
#endif
#if __ANDROID__
strncpy(boot_file, "/assets/share/pl/", 256);
if (Yap_Exists( boot_file ) ) {
if (Yap_Exists(boot_file)) {
return true;
}
#endif
strncpy(boot_file, YAP_SHAREDIR "/pl/" , 256);
strncpy(boot_file, YAP_SHAREDIR "/pl/", 256);
strncat(boot_file, BootFile, 255);
if (Yap_Exists( boot_file ) ) {
if (Yap_Exists(boot_file)) {
return true;
}
strncpy(boot_file, YAP_PL_SRCDIR "/", 256);
strncat(boot_file, BootFile, 255);
if (Yap_Exists( boot_file ) ) {
if (Yap_Exists(boot_file)) {
return true;
}
return false;
@ -2457,8 +2457,7 @@ Int YAP_Init(YAP_init_args *yap_init) {
if (yap_init->QuietMode) {
setVerbosity(TermSilent);
}
if (restore_result == DO_EVERYTHING ||
restore_result == DO_ONLY_CODE) {
if (restore_result == DO_EVERYTHING || restore_result == DO_ONLY_CODE) {
LOCAL_PrologMode &= ~BootMode;
if (restore_result == DO_ONLY_CODE) {
/* first, initialize the saved state */

View File

@ -64,7 +64,8 @@
#define DEFAULT_SCHEDULERLOOP 10
#define DEFAULT_DELAYEDRELEASELOAD 3
static void print_usage(void) {
static void
print_usage(void) {
fprintf(stderr, "\n[ Valid switches for command line arguments: ]\n");
fprintf(stderr, " -? Shows this screen\n");
fprintf(stderr, " -b Boot file \n");