YAP 7.1.0
YapInit.h
Go to the documentation of this file.
1
8#ifndef YAPINIT_H
9#define YAPINIT_H
10
11#define YAP_BOOT_FROM_SAVED_CODE 1
12#define YAP_BOOT_FROM_SAVED_STACKS 2
13#define YAP_BOOT_ERROR -1
14
15#define YAP_CONSULT_MODE 0
16#define YAP_RECONSULT_MODE 1
17#define YAP_BOOT_MODE 2
18
19X_API YAP_file_type_t Yap_InitDefaults(void *init_args, char saved_state[],
20 int Argc, char *Argv[]);
21
22typedef struct yap_boot_params {
23 //> struct marker
24 void *start;
25 //> boot type as suggested by the user
26 YAP_file_type_t boot_file_type;
27 //> how files are organised: NULL is GNU/Linux way
28 // const char *directory_structure;
29 //> if NON-NULL, set value for Yap_ROOTDIR
30 const char *ROOTDIR;
31 //> if NON-NULL, location of yaap, sets Yap_BINDIR
32 const char *BINDIR;
33 //> if NON-NULL, location of libYap, sets Yap_LIBDIR
34 const char *LIBDIR;
35 //> if NON-NULL, architecture independent files, sets Yap_SHAREDIR
36 const char *SHAREDIR;
37 //> if NON-NULL, include files, sets Yap_INCLUDEDIR
38 const char *INCLUDEDIR;
39 //> if NON-NULL, Prolog DLL location, sets Yap_DLLDIR
40 const char *DLLDIR;
41 //> if NON-NULL, Prolog library, sets Yap_DLLDIR
42 const char *PLDIR;
43 //> if NON-NULL, Prolog library, sets Yap_COMMONSDIR
44 const char *COMMONSDIR;
45 //> if NON-NULL, name for a Prolog file to use when booting at run-time
46 const char *BOOTDIR;
47 //> if NON-NULL, name for a Prolog directory that we shall use to start booting
48 const char *SOURCEBOOT;
49 //> if NON-NULL, name for a Prolog file to use when booting at compile-time
50 const char *BOOTSTRAP;
51 //> if NON-NULL, path where we can find the saved state
52 const char *INPUT_STARTUP;
53 //> bootstrapping mode: YAP is not properly installed
54 bool install;
55 //> jupyter mode: YAP is in space
56 bool jupyter;
57 //> generats a saved space at this path
58 const char *OUTPUT_STARTUP;
59 //> if NON-0, minimal size for Heap or Code Area
60 size_t HeapSize;
61 //> if NON-0, maximal size for Heap or Code Area
62 size_t MaxHeapSize;
63 //> if NON-0, minimal size for Local+Global Stack
64 size_t StackSize;
65 //> if NON-0, maximal size for Local+Global Stack
66 size_t MaxStackSize;
67 //*> deprecated
68 size_t MaxGlobalSize;
69 //> if NON-0, minimal size for Trail
70 size_t TrailSize;
71 //> if NON-0, maximal size for Trail
72 size_t MaxTrailSize;
73 //> if NON-0, minimal size for AttributeVarStack
74 size_t AttsSize;
75 //> if NON-0, maximal size for AttributeVarStack
76 size_t MaxAttsSize;
77 //> if NON-NULL, name for a Prolog file to use when initializing
78 const char *YapPrologInitGoal;
79 //> if NON-NULL, name for a Prolog file to consult before entering top-level
80 const char *PrologRCFile;
81 //> if NON-NULL, a goal to run before top-level
82 const char *PrologGoal;
83 //> if NON-NULL, a goal to run as top-level
84 const char *PrologTopLevelGoal;
85 //> if NON-NULL, a path to extend file-search-path
86 const char *PrologAddPath;
87 //> if previous NON-NULL and TRUE, halt after consulting that file
88 bool HaltAfterBoot;
89 //> ignore .yaprc, .prolog.ini, etc. files.
90 bool FastBoot;
91 //> the next field only interest YAPTAB
92 //> if NON-0, maximum size for Table Space
93 size_t MaxTableSpaceSize;
94 /* the next three fields only interest YAPOR, but we keep them so that
95 users don't need to recompile DLL in order to use YAPOR */
96 //> if NON-0, number of workers we want to have (default=1)
97 unsigned long int NumberWorkers;
98 //> if NON-0, manage the inner scheduler loop (default = 10)
99 unsigned long int SchedulerLoop;
100 //> if NON-0, say how long to keep nodes (default = 3)
101 unsigned long int DelayedReleaseLoad;
102 //> end of YAPOR fields
103 /* whether Prolog should handle interrupts. Note that
104 interrupts will always be disabled in embedded mode. */
105 bool PrologCannotHandleInterrupts;
106 //> flag for JIT mode
107 int ExecutionMode;
108 //> number of arguments that Prolog will see
109 int Argc;
110 //> array of arguments as seen by Prolog
111 char **Argv;
112 //> embedded in some other system: no signals, readline, etc
113 bool Embedded;
114 //> QuietMode
115 int QuietMode;
116 //> 0, maintain default, > 0 use fd-1, < 0 close
117 int inp, out, err;
118#if __ANDROID__
119 //> android asset support
120 AAssetManager *assetManager;
121#endif
122/* support nf's ypp preprocessor code */
123#define YAP_MAX_YPP_DEFS 100
124 char *def_var[YAP_MAX_YPP_DEFS];
125 char *def_value[YAP_MAX_YPP_DEFS];
126 int def_c;
127 /* End preprocessor code */
128
129#ifdef MYDDAS_MYSQL
130 //> If any myddas option was given
131 short myddas;
132 //> MYDDAS Fields
133 char *myddas_user;
134 char *myddas_pass;
135 char *myddas_db;
136 char *myddas_host;
137#endif
138 /* errornumber */
139 int ErrorNo;
140 //> errorstring
141 char *ErrorCause;
143
144#endif