From 73541f506fe109739d041fc7ebc3b476f80072b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADtor=20Santos=20Costa?= Date: Tue, 1 Mar 2011 10:41:06 +0000 Subject: [PATCH] get rid of old SWI emulation stuff. --- C/init.c | 14 -------------- H/dglobals.h | 16 ---------------- H/hglobals.h | 16 ---------------- H/iglobals.h | 16 ---------------- H/rglobals.h | 16 ---------------- library/dialect/swi/fli/swi.c | 35 ----------------------------------- misc/GLOBALS | 18 ------------------ 7 files changed, 131 deletions(-) diff --git a/C/init.c b/C/init.c index 1c617b51c..a4079046c 100755 --- a/C/init.c +++ b/C/init.c @@ -1178,20 +1178,6 @@ InitThreadHandle(int wid) } #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 InitFirstWorkerThreadHandle(void) { diff --git a/H/dglobals.h b/H/dglobals.h index 73dd1a5ec..e1483a1de 100644 --- a/H/dglobals.h +++ b/H/dglobals.h @@ -148,13 +148,6 @@ #define Yap_LabelFirstArray WL->label_first_array #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 execution WL->_execution @@ -184,15 +177,6 @@ #define BGL Yap_global->bgl #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_AllowGlobalExpansion Yap_global->allow_global_expansion diff --git a/H/hglobals.h b/H/hglobals.h index 8cd9901c9..f484b0765 100644 --- a/H/hglobals.h +++ b/H/hglobals.h @@ -150,13 +150,6 @@ typedef struct worker_local { Int* label_first_array; 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 open_query_struct* _execution; @@ -186,15 +179,6 @@ typedef struct worker_shared { lockvar bgl; #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_global_expansion; diff --git a/H/iglobals.h b/H/iglobals.h index 40c4e7eae..9969ec050 100644 --- a/H/iglobals.h +++ b/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_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)->_execution = NULL; @@ -184,15 +177,6 @@ static void InitGlobal(void) { INIT_LOCK(Yap_global->bgl); #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_global_expansion = TRUE; diff --git a/H/rglobals.h b/H/rglobals.h index e848779b4..adbc47c78 100644 --- a/H/rglobals.h +++ b/H/rglobals.h @@ -151,13 +151,6 @@ static void RestoreWorker(int wid) { - - - - - - - #if (defined(YAPOR) || defined(TABLING)) && defined(THREADS) #endif @@ -195,15 +188,6 @@ static void RestoreGlobal(void) { - - - - - - - - - #if HAVE_LIBREADLINE diff --git a/library/dialect/swi/fli/swi.c b/library/dialect/swi/fli/swi.c index 1375b7949..0a4b0cd39 100755 --- a/library/dialect/swi/fli/swi.c +++ b/library/dialect/swi/fli/swi.c @@ -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) { // return Yap_signal2(sig,func); diff --git a/misc/GLOBALS b/misc/GLOBALS index 25df39f27..3d475eff5 100644 --- a/misc/GLOBALS +++ b/misc/GLOBALS @@ -163,14 +163,6 @@ Int* label_first_array Yap_LabelFirstArray =NULL UInt label_first_array_sz Yap_LabelFirstArraySz =0L // 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 open_query_struct* _execution execution =NULL @@ -208,16 +200,6 @@ UInt threads_total_time ThreadsTotalTime =0L lockvar bgl BGL MkLock #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 int allow_local_expansion Yap_AllowLocalExpansion =TRUE int allow_global_expansion Yap_AllowGlobalExpansion =TRUE