get rid of old SWI emulation stuff.
This commit is contained in:
parent
0e447436b3
commit
73541f506f
14
C/init.c
14
C/init.c
@ -1178,20 +1178,6 @@ InitThreadHandle(int wid)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static void
|
|
||||||
InitSWIBuffers(int wid)
|
|
||||||
{
|
|
||||||
int i;
|
|
||||||
|
|
||||||
FOREIGN_WL(wid)->SWI_buffers_[0] = malloc(SWI_BUF_SIZE);
|
|
||||||
FOREIGN_WL(wid)->SWI_buffers_sz_[0] = SWI_BUF_SIZE;
|
|
||||||
for (i=1; i <= SWI_BUF_RINGS; i++) {
|
|
||||||
FOREIGN_WL(wid)->SWI_buffers_[i] = NULL;
|
|
||||||
FOREIGN_WL(wid)->SWI_buffers_sz_[i] = 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
InitFirstWorkerThreadHandle(void)
|
InitFirstWorkerThreadHandle(void)
|
||||||
{
|
{
|
||||||
|
16
H/dglobals.h
16
H/dglobals.h
@ -148,13 +148,6 @@
|
|||||||
#define Yap_LabelFirstArray WL->label_first_array
|
#define Yap_LabelFirstArray WL->label_first_array
|
||||||
#define Yap_LabelFirstArraySz WL->label_first_array_sz
|
#define Yap_LabelFirstArraySz WL->label_first_array_sz
|
||||||
|
|
||||||
#define putc_curp WL->putc_curp_
|
|
||||||
#define putc_cur_buf WL->putc_cur_buf_
|
|
||||||
#define putc_cur_lim WL->putc_cur_lim_
|
|
||||||
#define putc_cur_flags WL->putc_cur_flags_
|
|
||||||
#define SWI_buffers WL->SWI_buffers_
|
|
||||||
#define SWI_buffers_sz WL->SWI_buffers_sz_
|
|
||||||
#define SWI_buf_index WL->SWI_buf_index_
|
|
||||||
#define LD WL->Yap_ld_
|
#define LD WL->Yap_ld_
|
||||||
#define execution WL->_execution
|
#define execution WL->_execution
|
||||||
|
|
||||||
@ -184,15 +177,6 @@
|
|||||||
|
|
||||||
#define BGL Yap_global->bgl
|
#define BGL Yap_global->bgl
|
||||||
#endif
|
#endif
|
||||||
#define FSWIStream Yap_global->f_swi_stream
|
|
||||||
#define SWIGetc Yap_global->swi_getc
|
|
||||||
#define SWIPutc Yap_global->swi_putc
|
|
||||||
#define SWIWideGetc Yap_global->swi_wgetc
|
|
||||||
#define SWIWidePutc Yap_global->swi_wputc
|
|
||||||
#define SWIClose Yap_global->swi_close
|
|
||||||
#define SWIFlush Yap_global->swi_flush
|
|
||||||
#define SWIGetStream Yap_global->swi_get_stream_f
|
|
||||||
#define SWIGetStreamPosition Yap_global->swi_get_stream_position_f
|
|
||||||
|
|
||||||
#define Yap_AllowLocalExpansion Yap_global->allow_local_expansion
|
#define Yap_AllowLocalExpansion Yap_global->allow_local_expansion
|
||||||
#define Yap_AllowGlobalExpansion Yap_global->allow_global_expansion
|
#define Yap_AllowGlobalExpansion Yap_global->allow_global_expansion
|
||||||
|
16
H/hglobals.h
16
H/hglobals.h
@ -150,13 +150,6 @@ typedef struct worker_local {
|
|||||||
Int* label_first_array;
|
Int* label_first_array;
|
||||||
UInt label_first_array_sz;
|
UInt label_first_array_sz;
|
||||||
|
|
||||||
char* putc_curp_;
|
|
||||||
char* putc_cur_buf_;
|
|
||||||
char* putc_cur_lim_;
|
|
||||||
UInt putc_cur_flags_;
|
|
||||||
char* SWI_buffers_[1+SWI_BUF_RINGS];
|
|
||||||
size_t SWI_buffers_sz_[1+SWI_BUF_RINGS];
|
|
||||||
int SWI_buf_index_;
|
|
||||||
struct PL_local_data *Yap_ld_;
|
struct PL_local_data *Yap_ld_;
|
||||||
struct open_query_struct* _execution;
|
struct open_query_struct* _execution;
|
||||||
|
|
||||||
@ -186,15 +179,6 @@ typedef struct worker_shared {
|
|||||||
|
|
||||||
lockvar bgl;
|
lockvar bgl;
|
||||||
#endif
|
#endif
|
||||||
Functor f_swi_stream;
|
|
||||||
SWI_GetFunction swi_getc;
|
|
||||||
SWI_PutFunction swi_putc;
|
|
||||||
SWI_GetWideFunction swi_wgetc;
|
|
||||||
SWI_PutWideFunction swi_wputc;
|
|
||||||
SWI_CloseFunction swi_close;
|
|
||||||
SWI_FlushFunction swi_flush;
|
|
||||||
SWI_PLGetStreamFunction swi_get_stream_f;
|
|
||||||
SWI_PLGetStreamPositionFunction swi_get_stream_position_f;
|
|
||||||
|
|
||||||
int allow_local_expansion;
|
int allow_local_expansion;
|
||||||
int allow_global_expansion;
|
int allow_global_expansion;
|
||||||
|
16
H/iglobals.h
16
H/iglobals.h
@ -148,13 +148,6 @@ static void InitWorker(int wid) {
|
|||||||
FOREIGN_WL(wid)->label_first_array = NULL;
|
FOREIGN_WL(wid)->label_first_array = NULL;
|
||||||
FOREIGN_WL(wid)->label_first_array_sz = 0L;
|
FOREIGN_WL(wid)->label_first_array_sz = 0L;
|
||||||
|
|
||||||
FOREIGN_WL(wid)->putc_curp_ = NULL;
|
|
||||||
FOREIGN_WL(wid)->putc_cur_buf_ = NULL;
|
|
||||||
FOREIGN_WL(wid)->putc_cur_lim_ = NULL;
|
|
||||||
FOREIGN_WL(wid)->putc_cur_flags_ = 0L;
|
|
||||||
InitSWIBuffers(wid);
|
|
||||||
|
|
||||||
FOREIGN_WL(wid)->SWI_buf_index_ = 0;
|
|
||||||
FOREIGN_WL(wid)->Yap_ld_ = NULL;
|
FOREIGN_WL(wid)->Yap_ld_ = NULL;
|
||||||
FOREIGN_WL(wid)->_execution = NULL;
|
FOREIGN_WL(wid)->_execution = NULL;
|
||||||
|
|
||||||
@ -184,15 +177,6 @@ static void InitGlobal(void) {
|
|||||||
|
|
||||||
INIT_LOCK(Yap_global->bgl);
|
INIT_LOCK(Yap_global->bgl);
|
||||||
#endif
|
#endif
|
||||||
Yap_global->f_swi_stream = NULL;
|
|
||||||
Yap_global->swi_getc = NULL;
|
|
||||||
Yap_global->swi_putc = NULL;
|
|
||||||
Yap_global->swi_wgetc = NULL;
|
|
||||||
Yap_global->swi_wputc = NULL;
|
|
||||||
Yap_global->swi_close = NULL;
|
|
||||||
Yap_global->swi_flush = NULL;
|
|
||||||
Yap_global->swi_get_stream_f = NULL;
|
|
||||||
Yap_global->swi_get_stream_position_f = NULL;
|
|
||||||
|
|
||||||
Yap_global->allow_local_expansion = TRUE;
|
Yap_global->allow_local_expansion = TRUE;
|
||||||
Yap_global->allow_global_expansion = TRUE;
|
Yap_global->allow_global_expansion = TRUE;
|
||||||
|
16
H/rglobals.h
16
H/rglobals.h
@ -151,13 +151,6 @@ static void RestoreWorker(int wid) {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#if (defined(YAPOR) || defined(TABLING)) && defined(THREADS)
|
#if (defined(YAPOR) || defined(TABLING)) && defined(THREADS)
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
@ -195,15 +188,6 @@ static void RestoreGlobal(void) {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#if HAVE_LIBREADLINE
|
#if HAVE_LIBREADLINE
|
||||||
|
|
||||||
|
|
||||||
|
@ -2663,41 +2663,6 @@ PL_query(int query)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
typedef int (*GetStreamF)(term_t, int, int, IOSTREAM **s);
|
|
||||||
|
|
||||||
int
|
|
||||||
Yap_get_stream_handle(Term t0, int read_mode, int write_mode, void *s){
|
|
||||||
atom_t t;
|
|
||||||
GetStreamF f = (GetStreamF)SWIGetStream;
|
|
||||||
Atom at = AtomOfTerm(t0);
|
|
||||||
if (at == AtomUserOut && write_mode && !read_mode) {
|
|
||||||
t = 0;
|
|
||||||
} else if (at == AtomUserIn && !write_mode && read_mode) {
|
|
||||||
t = 0;
|
|
||||||
} else {
|
|
||||||
t = AtomToSWIAtom(at);
|
|
||||||
}
|
|
||||||
return (*f)(t, read_mode, write_mode, s);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
typedef int (*GetStreamPosF)(IOSTREAM *s, term_t);
|
|
||||||
|
|
||||||
Term
|
|
||||||
Yap_get_stream_position(void *s){
|
|
||||||
term_t t;
|
|
||||||
Term t0;
|
|
||||||
GetStreamPosF f = (GetStreamPosF)SWIGetStreamPosition;
|
|
||||||
|
|
||||||
t = (term_t)Yap_NewSlots(1);
|
|
||||||
if (!(*f)(s, t))
|
|
||||||
return 0L;
|
|
||||||
t0 = Yap_GetFromSlot((Int)t);
|
|
||||||
Yap_RecoverSlots(1);
|
|
||||||
return t0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
X_API void (*PL_signal(int sig, void (*func)(int)))(int)
|
X_API void (*PL_signal(int sig, void (*func)(int)))(int)
|
||||||
{
|
{
|
||||||
// return Yap_signal2(sig,func);
|
// return Yap_signal2(sig,func);
|
||||||
|
18
misc/GLOBALS
18
misc/GLOBALS
@ -163,14 +163,6 @@ Int* label_first_array Yap_LabelFirstArray =NULL
|
|||||||
UInt label_first_array_sz Yap_LabelFirstArraySz =0L
|
UInt label_first_array_sz Yap_LabelFirstArraySz =0L
|
||||||
|
|
||||||
// Thread Local Area for SWI-Prolog emulation routines.
|
// Thread Local Area for SWI-Prolog emulation routines.
|
||||||
char* putc_curp_ putc_curp =NULL
|
|
||||||
char* putc_cur_buf_ putc_cur_buf =NULL
|
|
||||||
char* putc_cur_lim_ putc_cur_lim =NULL
|
|
||||||
UInt putc_cur_flags_ putc_cur_flags =0L
|
|
||||||
char* SWI_buffers_[1+SWI_BUF_RINGS] SWI_buffers InitSWIBuffers(wid)
|
|
||||||
size_t SWI_buffers_sz_[1+SWI_BUF_RINGS] SWI_buffers_sz void
|
|
||||||
int SWI_buf_index_ SWI_buf_index =0
|
|
||||||
|
|
||||||
struct PL_local_data *Yap_ld_ LD =NULL
|
struct PL_local_data *Yap_ld_ LD =NULL
|
||||||
|
|
||||||
struct open_query_struct* _execution execution =NULL
|
struct open_query_struct* _execution execution =NULL
|
||||||
@ -208,16 +200,6 @@ UInt threads_total_time ThreadsTotalTime =0L
|
|||||||
lockvar bgl BGL MkLock
|
lockvar bgl BGL MkLock
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
Functor f_swi_stream FSWIStream =NULL
|
|
||||||
SWI_GetFunction swi_getc SWIGetc =NULL
|
|
||||||
SWI_PutFunction swi_putc SWIPutc =NULL
|
|
||||||
SWI_GetWideFunction swi_wgetc SWIWideGetc =NULL
|
|
||||||
SWI_PutWideFunction swi_wputc SWIWidePutc =NULL
|
|
||||||
SWI_CloseFunction swi_close SWIClose =NULL
|
|
||||||
SWI_FlushFunction swi_flush SWIFlush =NULL
|
|
||||||
SWI_PLGetStreamFunction swi_get_stream_f SWIGetStream =NULL
|
|
||||||
SWI_PLGetStreamPositionFunction swi_get_stream_position_f SWIGetStreamPosition =NULL
|
|
||||||
|
|
||||||
// stack overflow expansion/gc control
|
// stack overflow expansion/gc control
|
||||||
int allow_local_expansion Yap_AllowLocalExpansion =TRUE
|
int allow_local_expansion Yap_AllowLocalExpansion =TRUE
|
||||||
int allow_global_expansion Yap_AllowGlobalExpansion =TRUE
|
int allow_global_expansion Yap_AllowGlobalExpansion =TRUE
|
||||||
|
Reference in New Issue
Block a user