YAP
7.1.0
qly.h
Go to the documentation of this file.
1
2
/*************************************************************************
3
* *
4
* YAP Prolog *
5
* *
6
* Yap Prolog was developed at NCCUP - Universidade do Porto *
7
* *
8
* Copyright L.Damas, V. Santos Costa and Universidade do Porto 1985-- *
9
* *
10
**************************************************************************
11
* *
12
* File: qly.h *
13
* comments: quick saver/loader *
14
* *
15
* Last rev: $Date: 2011-08-29$,$Author: vsc $ *
16
* $Log: not supported by cvs2svn $ *
17
* *
18
*************************************************************************/
19
31
#define EXPORT_ATOM_TABLE_SIZE (16 * 4096)
32
#define EXPORT_FUNCTOR_TABLE_SIZE (16 * 4096)
33
#define EXPORT_OPCODE_TABLE_SIZE (4096)
34
#define EXPORT_PRED_ENTRY_TABLE_SIZE (128)
35
#define EXPORT_DBREF_TABLE_SIZE (128)
36
37
typedef
struct
export_atom_hash_entry_struct
{
38
Atom
val;
39
}
export_atom_hash_entry_t
;
40
41
typedef
struct
import_atom_hash_entry_struct
{
42
Atom
oval;
43
Atom
val;
44
struct
import_atom_hash_entry_struct
*next;
45
}
import_atom_hash_entry_t
;
46
47
typedef
struct
export_functor_hash_entry_struct
{
48
Functor
val;
49
Atom
name;
50
UInt arity;
51
}
export_functor_hash_entry_t
;
52
53
typedef
struct
import_functor_hash_entry_struct
{
54
Functor
val;
55
Functor
oval;
56
struct
import_functor_hash_entry_struct
*next;
57
}
import_functor_hash_entry_t
;
58
59
typedef
struct
import_opcode_hash_entry_struct
{
60
OPCODE val;
61
int
id;
62
OPCODE oval;
63
struct
import_opcode_hash_entry_struct
*next;
64
}
import_opcode_hash_entry_t
;
65
66
typedef
struct
export_pred_entry_hash_entry_struct
{
67
PredEntry
*val;
68
union
{
69
Functor
f;
70
Atom
a;
71
} u_af;
72
Atom
module;
73
UInt arity;
74
}
export_pred_entry_hash_entry_t
;
75
76
typedef
struct
import_pred_entry_hash_entry_struct
{
77
PredEntry
*val;
78
PredEntry
*oval;
79
struct
import_pred_entry_hash_entry_struct
*next;
80
}
import_pred_entry_hash_entry_t
;
81
82
typedef
struct
export_dbref_hash_entry_struct
{
83
DBRef
val;
84
UInt sz;
85
UInt refs;
86
}
export_dbref_hash_entry_t
;
87
88
typedef
struct
import_dbref_hash_entry_struct
{
89
DBRef
val;
90
DBRef
oval;
91
int
count;
92
struct
import_dbref_hash_entry_struct
*next;
93
}
import_dbref_hash_entry_t
;
94
95
typedef
enum
{
96
QLY_START_X = 0,
97
QLY_START_OPCODES = 1,
98
QLY_START_ATOMS = 2,
99
QLY_START_FUNCTORS = 3,
100
QLY_START_PRED_ENTRIES = 4,
101
QLY_START_DBREFS = 5,
102
QLY_START_MODULE = 6,
103
QLY_END_MODULES = 7,
104
QLY_START_LU_CLAUSE = 8,
105
QLY_END_LU_CLAUSES = 9,
106
QLY_NEW_OP = 10,
107
QLY_END_OPS = 11,
108
QLY_START_PREDICATE = 12,
109
QLY_END_PREDICATES = 13,
110
QLY_FAILCODE = 15,
111
QLY_ATOM = 16,
112
QLY_ATOM_BLOB = 14
113
} qlf_tag_t;
114
115
#define STATIC_PRED_FLAGS \
116
(SourcePredFlag | DynamicPredFlag | LogUpdatePredFlag | CompiledPredFlag | \
117
MultiFileFlag | TabledPredFlag | MegaClausePredFlag | CountPredFlag | \
118
ProfiledPredFlag | ThreadLocalPredFlag | AtomDBPredFlag | \
119
ModuleTransparentPredFlag | NumberDBPredFlag | MetaPredFlag | \
120
SyncPredFlag | BackCPredFlag)
121
#define EXTRA_PRED_FLAGS \
122
(QuasiQuotationPredFlag | NoTracePredFlag | NoSpyPredFlag)
123
124
#define SYSTEM_PRED_FLAGS \
125
(BackCPredFlag | UserCPredFlag | CArgsPredFlag | AsmPredFlag | CPredFlag | \
126
BinaryPredFlag)
127
128
#define CHECK(F) \
129
{ \
130
size_t r = (F); \
131
if (!r) \
132
return r; \
133
}
134
#define RCHECK(F) \
135
if (!(F)) { \
136
QLYR_ERROR(MISMATCH); \
137
return; \
138
}
139
140
#define AllocTempSpace() (HR)
141
#define EnoughTempSpace(sz) ((ASP - HR) * sizeof(CELL) > sz)
142
export_atom_hash_entry_struct
Definition:
qly.h:37
export_dbref_hash_entry_struct
Definition:
qly.h:82
export_functor_hash_entry_struct
Definition:
qly.h:47
export_pred_entry_hash_entry_struct
Definition:
qly.h:66
import_atom_hash_entry_struct
Definition:
qly.h:41
import_dbref_hash_entry_struct
Definition:
qly.h:88
import_functor_hash_entry_struct
Definition:
qly.h:53
import_opcode_hash_entry_struct
Definition:
qly.h:59
import_pred_entry_hash_entry_struct
Definition:
qly.h:76
AtomEntryStruct
Definition:
Atoms.h:52
DB_STRUCT
Definition:
Yatom.h:716
FunctorEntryStruct
Definition:
Atoms.h:122
pred_entry
Definition:
Yatom.h:544
H
qly.h
Generated by
1.9.3