GNU PROLOG with UTF8 support
All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros
pred.h
Go to the documentation of this file.
1 /*-------------------------------------------------------------------------*
2  * GNU Prolog *
3  * *
4  * Part : Prolog engine *
5  * File : pred.h *
6  * Descr.: predicate table management - 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 
40 /*---------------------------------*
41  * Constants *
42  *---------------------------------*/
43 
44  /* if modified -> modif wam2ma.c */
45 #define MASK_PRED_NATIVE_CODE 1 /* codep is set, except for control constructs */
46 #define MASK_PRED_DYNAMIC 2 /* dynamic or static */
47 #define MASK_PRED_PUBLIC 4 /* public or private */
48 #define MASK_PRED_BUILTIN 8 /* built-in (procedure provided by the system) */
49 #define MASK_PRED_BUILTIN_FD 16 /* FD built-in pred (==> MASK_PRED_BUILTIN) */
50 #define MASK_PRED_CONTROL_CONSTRUCT 32 /* control_construct (==> MASK_PRED_BUILTIN) */
51 #define MASK_PRED_MULTIFILE 64 /* multifile or monofile */
52 #define MASK_PRED_EXPORTED 128 /* exported by module not yet used - for future */
53 
54 
55 
56 
57 
58 /*---------------------------------*
59  * Type Definitions *
60  *---------------------------------*/
61 
62 typedef struct /* Predicate information */
63 { /* ------------------------------ */
64  PlLong f_n; /* key is <functor_atom,arity> */
65  int pl_file; /* atom pl file of its definiton */
66  int pl_line; /* pl file line of its definition */
67  int prop; /* predicate props (cf BipsPl) */
68  PlLong *codep; /* compiled code */
69  PlLong *dyn; /* dynamic info (cf BipsPl) */
70 }
71 PredInf;
72 
73 
74 
75 
76 /*---------------------------------*
77  * Global Variables *
78  *---------------------------------*/
79 
80 #ifdef PRED_FILE
81 
82 char *pl_pred_tbl;
83 
84 #else
85 
86 extern char *pl_pred_tbl;
87 
88 #endif
89 
90 
91 
92 
93 /*---------------------------------*
94  * Function Prototypes *
95  *---------------------------------*/
96 
97 void Pl_Init_Pred(void);
98 
99 PredInf * FC Pl_Create_Pred(int func, int arity, int pl_file, int pl_line,
100  int prop, PlLong *codep);
101 
102 PredInf * FC Pl_Lookup_Pred(int func, int arity);
103 
104 void FC Pl_Delete_Pred(int func, int arity);
void FC Pl_Delete_Pred(int func, int arity)
Definition: pred.c:197
PredInf *FC Pl_Lookup_Pred(int func, int arity)
Definition: pred.c:182
intptr_t PlLong
Definition: gprolog.h:88
PlLong f_n
Definition: pred.h:64
int prop
Definition: pred.h:67
void Pl_Init_Pred(void)
Definition: pred.c:82
int pl_file
Definition: pred.h:65
PredInf *FC Pl_Create_Pred(int func, int arity, int pl_file, int pl_line, int prop, PlLong *codep)
Definition: pred.c:134
PlLong * dyn
Definition: pred.h:69
Definition: pred.h:62
char * pl_pred_tbl
#define FC
Definition: arch_dep.h:294
PlLong * codep
Definition: pred.h:68
int pl_line
Definition: pred.h:66