This repository has been archived on 2023-08-20. You can view files and clone it, but cannot push or open issues or pull requests.
yap-6.3/H/qly.h
Vitor Santos Costa ec438106a0 more qly stuff
2011-08-27 21:23:14 -03:00

97 lines
2.5 KiB
C

/*************************************************************************
* *
* YAP Prolog *
* *
* Yap Prolog was developed at NCCUP - Universidade do Porto *
* *
* Copyright L.Damas, V. Santos Costa and Universidade do Porto 1985-- *
* *
**************************************************************************
* *
* File: qly.h *
* comments: quick saver/loader *
* *
* Last rev: $Date: 2011-08-29$,$Author: vsc $ *
* $Log: not supported by cvs2svn $ *
* *
*************************************************************************/
#define EXPORT_ATOM_TABLE_SIZE (16*4096)
#define EXPORT_FUNCTOR_TABLE_SIZE (16*4096)
#define EXPORT_OPCODE_TABLE_SIZE (4096)
#define EXPORT_PRED_ENTRY_TABLE_SIZE (128)
typedef struct export_atom_hash_entry_struct {
Atom val;
struct export_atom_hash_entry_struct *next;
} export_atom_hash_entry_t;
typedef struct import_atom_hash_entry_struct {
Atom oval;
Atom val;
struct import_atom_hash_entry_struct *next;
} import_atom_hash_entry_t;
typedef struct export_functor_hash_entry_struct {
Functor val;
Atom name;
UInt arity;
struct export_functor_hash_entry_struct *next;
} export_functor_hash_entry_t;
typedef struct import_functor_hash_entry_struct {
Functor val;
Functor oval;
struct import_functor_hash_entry_struct *next;
} import_functor_hash_entry_t;
typedef struct import_opcode_hash_entry_struct {
OPCODE val;
int id;
OPCODE oval;
struct import_opcode_hash_entry_struct *next;
} import_opcode_hash_entry_t;
typedef struct export_pred_entry_hash_entry_struct {
PredEntry *val;
union {
Functor f;
Atom a;
} u;
Atom module;
UInt arity;
struct export_pred_entry_hash_entry_struct *next;
} export_pred_entry_hash_entry_t;
typedef struct import_pred_entry_hash_entry_struct {
PredEntry *val;
PredEntry *oval;
struct import_pred_entry_hash_entry_struct *next;
} import_pred_entry_hash_entry_t;
typedef enum {
QLY_START_X = 0,
QLY_START_OPCODES = 1,
QLY_START_ATOMS = 2,
QLY_START_FUNCTORS = 3,
QLY_START_PRED_ENTRIES = 4,
QLY_START_MODULE = 5,
QLY_END_MODULES = 6,
QLY_NEW_OP = 7,
QLY_END_OPS = 8,
QLY_START_PREDICATE = 9,
QLY_END_PREDICATES = 10,
QLY_ATOM_WIDE = 11,
QLY_ATOM = 12
} qlf_tag_t;
#define NEXTOP(V,TYPE) ((yamop *)(&((V)->u.TYPE.next)))
#define CHECK(F) { size_t r = (F); if (!r) return r; }
#define RCHECK(F) if(!(F)) { ERROR(MISMATCH); return; }
#define AllocTempSpace() (H)
#define EnoughTempSpace(sz) ((ASP-H)*sizeof(CELL) > sz)