small fixes and code moving around
This commit is contained in:
parent
ed2ecb29e7
commit
cbd0fa14e8
@ -321,9 +321,6 @@ Term Yap_MkNewPairTerm(void);
|
|||||||
Term Yap_Globalise(Term);
|
Term Yap_Globalise(Term);
|
||||||
|
|
||||||
|
|
||||||
/* parser.c */
|
|
||||||
Term Yap_Parse(void);
|
|
||||||
|
|
||||||
/* readutil.c */
|
/* readutil.c */
|
||||||
void Yap_InitReadUtil(void);
|
void Yap_InitReadUtil(void);
|
||||||
|
|
||||||
|
@ -653,7 +653,7 @@ IsValProperty (int flags)
|
|||||||
*/
|
*/
|
||||||
typedef enum
|
typedef enum
|
||||||
{
|
{
|
||||||
QuasiQuotationPredFlag = ((UInt)0x80000000 << EXTRA_FLAG_BASE), /* SWI-like quasi quotations */
|
QuasiQuotationPredFlag = ((UInt)0x00000001 << EXTRA_FLAG_BASE), /* SWI-like quasi quotations */
|
||||||
MegaClausePredFlag = 0x80000000L, /* predicate is implemented as a mega-clause */
|
MegaClausePredFlag = 0x80000000L, /* predicate is implemented as a mega-clause */
|
||||||
ThreadLocalPredFlag = 0x40000000L, /* local to a thread */
|
ThreadLocalPredFlag = 0x40000000L, /* local to a thread */
|
||||||
MultiFileFlag = 0x20000000L, /* is multi-file */
|
MultiFileFlag = 0x20000000L, /* is multi-file */
|
||||||
@ -719,7 +719,7 @@ typedef struct pred_entry
|
|||||||
CELL PredFlags, ExtraPredFlags;
|
CELL PredFlags, ExtraPredFlags;
|
||||||
#else
|
#else
|
||||||
CELL PredFlags;
|
CELL PredFlags;
|
||||||
#define ExtraPredFlags PredFlags;
|
#define ExtraPredFlags PredFlags
|
||||||
#endif
|
#endif
|
||||||
UInt ArityOfPE; /* arity of property */
|
UInt ArityOfPE; /* arity of property */
|
||||||
union
|
union
|
||||||
|
@ -54,4 +54,3 @@ typedef int (*GetsFunc)(int, UInt, char *);
|
|||||||
void Yap_InitStdStreams(void);
|
void Yap_InitStdStreams(void);
|
||||||
Term Yap_StreamPosition(struct io_stream *);
|
Term Yap_StreamPosition(struct io_stream *);
|
||||||
void Yap_InitPlIO(void);
|
void Yap_InitPlIO(void);
|
||||||
|
|
||||||
|
@ -59,6 +59,14 @@ typedef struct pred_entry * Procedure; /* predicate */
|
|||||||
#undef H
|
#undef H
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
// used by swi
|
||||||
|
#ifdef SIZEOF_INT_P
|
||||||
|
#define SIZEOF_VOIDP SIZEOF_INT_P
|
||||||
|
#define SIZEOF_LONG SIZEOF_LONG_INT
|
||||||
|
#else
|
||||||
|
bad config
|
||||||
|
#endif
|
||||||
|
|
||||||
/* swi code called from pl-incl.h */
|
/* swi code called from pl-incl.h */
|
||||||
/* should have messages here */
|
/* should have messages here */
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
|
20
H/pl-read.h
20
H/pl-read.h
@ -1,3 +1,16 @@
|
|||||||
|
|
||||||
|
typedef struct vlist_struct_t {
|
||||||
|
struct VARSTRUCT *ve;
|
||||||
|
struct vlist_struct_t *next;
|
||||||
|
} vlist_t;
|
||||||
|
|
||||||
|
typedef struct qq_struct_t {
|
||||||
|
unsigned char *text;
|
||||||
|
IOPOS start, mid, end;
|
||||||
|
vlist_t *vlist;
|
||||||
|
struct qq_struct_t *next;
|
||||||
|
} qq_t;
|
||||||
|
|
||||||
typedef unsigned char * ucharp;
|
typedef unsigned char * ucharp;
|
||||||
typedef const unsigned char * cucharp;
|
typedef const unsigned char * cucharp;
|
||||||
|
|
||||||
@ -72,7 +85,7 @@ extern IOFUNCTIONS Sstringfunctions;
|
|||||||
#define NULL_ATOM 0
|
#define NULL_ATOM 0
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static void
|
static inline void
|
||||||
setCurrentSourceLocation(ReadData _PL_rd ARG_LD)
|
setCurrentSourceLocation(ReadData _PL_rd ARG_LD)
|
||||||
{ atom_t a;
|
{ atom_t a;
|
||||||
IOSTREAM *s = rb.stream;
|
IOSTREAM *s = rb.stream;
|
||||||
@ -98,3 +111,8 @@ setCurrentSourceLocation(ReadData _PL_rd ARG_LD)
|
|||||||
}
|
}
|
||||||
|
|
||||||
extern int Yap_read_term(term_t t, IOSTREAM *st, struct read_data_t *rdt);
|
extern int Yap_read_term(term_t t, IOSTREAM *st, struct read_data_t *rdt);
|
||||||
|
/* parser.c */
|
||||||
|
extern Term Yap_Parse( struct read_data_t *);
|
||||||
|
extern void init_read_data( struct read_data_t *, IOSTREAM *st ARG_LD);
|
||||||
|
extern void free_read_data( struct read_data_t *);
|
||||||
|
|
||||||
|
@ -8,6 +8,8 @@
|
|||||||
#define __YAP_PROLOG__ 1
|
#define __YAP_PROLOG__ 1
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#include <assert.h>
|
||||||
|
|
||||||
// SWI stuff that is needed everywhere
|
// SWI stuff that is needed everywhere
|
||||||
|
|
||||||
#ifndef __unix__
|
#ifndef __unix__
|
||||||
@ -29,7 +31,7 @@
|
|||||||
// SWI Options
|
// SWI Options
|
||||||
#define O_STRING 1
|
#define O_STRING 1
|
||||||
#define O_QUASIQUOTATIONS 1
|
#define O_QUASIQUOTATIONS 1
|
||||||
//#define O_LOCALE 1
|
#define O_LOCALE 1
|
||||||
//#define O_ATOMGC 1
|
//#define O_ATOMGC 1
|
||||||
//#define O_CLAUSEGC 1
|
//#define O_CLAUSEGC 1
|
||||||
#ifdef HAVE_GMP_H
|
#ifdef HAVE_GMP_H
|
||||||
@ -263,6 +265,18 @@ COMMON(int) tracemode(debug_type new, debug_type *old);
|
|||||||
COMMON(void) Yap_setCurrentSourceLocation(IOSTREAM **s);
|
COMMON(void) Yap_setCurrentSourceLocation(IOSTREAM **s);
|
||||||
|
|
||||||
#define SWIAtomToAtom(X) SWI_Atoms[(X)>>1]
|
#define SWIAtomToAtom(X) SWI_Atoms[(X)>>1]
|
||||||
|
Atom YAP_AtomFromSWIAtom(atom_t at);
|
||||||
|
atom_t YAP_SWIAtomFromAtom(Atom at);
|
||||||
|
|
||||||
|
|
||||||
|
/* This is silly, but let's keep it like that for now */
|
||||||
|
static inline Functor
|
||||||
|
SWIFunctorToFunctor(functor_t f)
|
||||||
|
{
|
||||||
|
if ((CELL)(f) & 2 && ((CELL)f) < N_SWI_FUNCTORS*4+2)
|
||||||
|
return SWI_Functors[((CELL)f)/4];
|
||||||
|
return (Functor)f;
|
||||||
|
}
|
||||||
|
|
||||||
static inline Term
|
static inline Term
|
||||||
OpenList(int n USES_REGS)
|
OpenList(int n USES_REGS)
|
||||||
|
@ -115,8 +115,6 @@ extern word globalWString(size_t size, wchar_t *s);
|
|||||||
#define valHandle(r) valHandle__LD(r PASS_LD)
|
#define valHandle(r) valHandle__LD(r PASS_LD)
|
||||||
|
|
||||||
Int YAP_PLArityOfSWIFunctor(functor_t f);
|
Int YAP_PLArityOfSWIFunctor(functor_t f);
|
||||||
Atom YAP_AtomFromSWIAtom(atom_t at);
|
|
||||||
atom_t YAP_SWIAtomFromAtom(Atom at);
|
|
||||||
struct PL_blob_t* YAP_find_blob_type(Atom at);
|
struct PL_blob_t* YAP_find_blob_type(Atom at);
|
||||||
|
|
||||||
void PL_license(const char *license, const char *module);
|
void PL_license(const char *license, const char *module);
|
||||||
|
Reference in New Issue
Block a user