small fixes and code moving around

This commit is contained in:
Vítor Santos Costa 2013-11-25 12:15:25 +01:00
parent ed2ecb29e7
commit cbd0fa14e8
7 changed files with 44 additions and 10 deletions

View File

@ -321,9 +321,6 @@ Term Yap_MkNewPairTerm(void);
Term Yap_Globalise(Term);
/* parser.c */
Term Yap_Parse(void);
/* readutil.c */
void Yap_InitReadUtil(void);

View File

@ -653,7 +653,7 @@ IsValProperty (int flags)
*/
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 */
ThreadLocalPredFlag = 0x40000000L, /* local to a thread */
MultiFileFlag = 0x20000000L, /* is multi-file */
@ -719,7 +719,7 @@ typedef struct pred_entry
CELL PredFlags, ExtraPredFlags;
#else
CELL PredFlags;
#define ExtraPredFlags PredFlags;
#define ExtraPredFlags PredFlags
#endif
UInt ArityOfPE; /* arity of property */
union

View File

@ -54,4 +54,3 @@ typedef int (*GetsFunc)(int, UInt, char *);
void Yap_InitStdStreams(void);
Term Yap_StreamPosition(struct io_stream *);
void Yap_InitPlIO(void);

View File

@ -59,6 +59,14 @@ typedef struct pred_entry * Procedure; /* predicate */
#undef H
#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 */
/* should have messages here */
#ifdef DEBUG

View File

@ -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 const unsigned char * cucharp;
@ -72,7 +85,7 @@ extern IOFUNCTIONS Sstringfunctions;
#define NULL_ATOM 0
#endif
static void
static inline void
setCurrentSourceLocation(ReadData _PL_rd ARG_LD)
{ atom_t a;
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);
/* 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 *);

View File

@ -8,6 +8,8 @@
#define __YAP_PROLOG__ 1
#endif
#include <assert.h>
// SWI stuff that is needed everywhere
#ifndef __unix__
@ -29,7 +31,7 @@
// SWI Options
#define O_STRING 1
#define O_QUASIQUOTATIONS 1
//#define O_LOCALE 1
#define O_LOCALE 1
//#define O_ATOMGC 1
//#define O_CLAUSEGC 1
#ifdef HAVE_GMP_H
@ -263,6 +265,18 @@ COMMON(int) tracemode(debug_type new, debug_type *old);
COMMON(void) Yap_setCurrentSourceLocation(IOSTREAM **s);
#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
OpenList(int n USES_REGS)

View File

@ -115,8 +115,6 @@ extern word globalWString(size_t size, wchar_t *s);
#define valHandle(r) valHandle__LD(r PASS_LD)
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);
void PL_license(const char *license, const char *module);