GNU PROLOG with UTF8 support
engine.h
Go to the documentation of this file.
1 /*-------------------------------------------------------------------------*
2  * GNU Prolog *
3  * *
4  * Part : Prolog engine *
5  * File : engine.h *
6  * Descr.: general engine - header file *
7  * Author: Daniel Diaz *
8  * *
9  * Copyright (C) 1999-2015 Daniel Diaz *
10  * *
11  * This file is part of GNU Prolog *
12  * *
13  * GNU Prolog is free software: you can redistribute it and/or *
14  * modify it under the terms of either: *
15  * *
16  * - the GNU Lesser General Public License as published by the Free *
17  * Software Foundation; either version 3 of the License, or (at your *
18  * option) any later version. *
19  * *
20  * or *
21  * *
22  * - the GNU General Public License as published by the Free *
23  * Software Foundation; either version 2 of the License, or (at your *
24  * option) any later version. *
25  * *
26  * or both in parallel, as here. *
27  * *
28  * GNU Prolog is distributed in the hope that it will be useful, *
29  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
30  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
31  * General Public License for more details. *
32  * *
33  * You should have received copies of the GNU General Public License and *
34  * the GNU Lesser General Public License along with this program. If *
35  * not, see http://www.gnu.org/licenses/. *
36  *-------------------------------------------------------------------------*/
37 
38 
39 #ifdef NO_STACK_TEST
40 # undef M_Check_Stacks()
41 # define M_Check_Stacks()
42 #endif
43 
44 
45 
46 
47 /*---------------------------------*
48  * Constants *
49  *---------------------------------*/
50 
51 
52 #define cpp_recurs(p, n) p##__a##n
53 #define Prolog_Predicate(p, n) cpp_recurs(p, n)
54 
55 #define Prolog_Prototype(p, n) void Prolog_Predicate(p, n)()
56 
57 
58 
59 
60 /*---------------------------------*
61  * Type Definitions *
62  *---------------------------------*/
63 
64 
65 
66 /*---------------------------------*
67  * Global Variables *
68  *---------------------------------*/
69 
70 #ifdef ENGINE_FILE
71 
72 int pl_os_argc;
73 char **pl_os_argv;
74 
75 char *pl_home;
76 int pl_devel_mode;
77 
78 char pl_glob_buff[10240];
79 
80 PlLong *pl_base_fl; /* overwritten by foreign if present */
81 double *pl_base_fd; /* overwritten by foreign if present */
82 
83 int pl_le_mode; /* LE_MODE_HOOK if GUI */
84 
85 #else
86 
87 extern int pl_os_argc;
88 extern char **pl_os_argv;
89 
90 extern char *pl_home;
91 extern int pl_devel_mode;
92 
93 extern char pl_glob_buff[];
94 
95 extern PlLong *pl_base_fl;
96 extern double *pl_base_fd;
97 
98 extern int pl_le_mode;
99 
100 #endif
101 
102 
103 
104 /*---------------------------------*
105  * Function Prototypes *
106  *---------------------------------*/
107 
108 int Pl_Start_Prolog(int argc, char *argv[]);
109 
110 void Pl_Stop_Prolog(void);
111 
112 void Pl_Reset_Prolog(void);
113 
114 void Pl_Reset_Prolog_In_Signal(void);
115 
117 
118 
119 
120 void Pl_Execute_Directive(int pl_file, int pl_line, Bool is_system,
121  CodePtr proc);
122 
124 
125 Bool Pl_Call_Prolog(CodePtr codep);
126 
128 
129 void Pl_Keep_Rest_For_Prolog(WamWord *query_b);
130 
131 void Pl_Exit_With_Exception(void);
132 
133 void Pl_Execute_A_Continuation(CodePtr codep);
134 
135 
136 
137 #define Goto_Predicate(p, n) ((*Prolog_Predicate(p, n))())
int Pl_Start_Prolog(int argc, char *argv[])
Definition: engine.c:122
void Pl_Reset_Prolog_In_Signal(void)
Definition: engine.c:271
int pl_devel_mode
int pl_os_argc
void Pl_Reset_Prolog(void)
Definition: engine.c:248
void Pl_Keep_Rest_For_Prolog(WamWord *query_b)
Definition: engine.c:414
char pl_glob_buff[]
void Pl_Execute_A_Continuation(CodePtr codep)
Definition: engine.c:554
char ** pl_os_argv
intptr_t PlLong
Definition: gprolog.h:88
void Pl_Execute_Directive(int pl_file, int pl_line, Bool is_system, CodePtr proc)
Definition: engine.c:299
static WamWord * heap_actual_start
Definition: engine.c:91
void Pl_Stop_Prolog(void)
Definition: engine.c:230
double * pl_base_fd
Definition: foreign_supp.c:72
int pl_le_mode
void Pl_Set_Heap_Actual_Start(WamWord *heap_actual_start)
Definition: engine.c:285
void Pl_Exit_With_Exception(void)
Definition: engine.c:536
PlLong * pl_base_fl
Definition: foreign_supp.c:71
Bool Pl_Call_Prolog_Next_Sol(WamWord *query_b)
Definition: engine.c:385
char * pl_home
Bool Pl_Try_Execute_Top_Level(void)
Definition: engine.c:322
long WamWord
Definition: LINUX_SIGSEGV.c:4
Bool Pl_Call_Prolog(CodePtr codep)
Definition: engine.c:357
int Bool
Definition: bool.h:65