readline fixes

This commit is contained in:
Vitor Santos Costa 2011-02-16 21:11:45 +00:00
parent dce619f804
commit 0614a8c26e
4 changed files with 7 additions and 54 deletions

View File

@ -2649,21 +2649,6 @@ PL_query(int query)
}
/* glue function to connect back PLStream to YAP IO */
X_API void
PL_YAP_InitSWIIO(struct SWI_IO *swio)
{
FSWIStream = SWIFunctorToFunctor(swio->f);
SWIGetc = swio->get_c;
SWIPutc = swio->put_c;
SWIWideGetc = swio->get_w;
SWIWidePutc = swio->put_w;
SWIFlush = swio->flush_s;
SWIClose = swio->close_s;
SWIGetStream = swio->get_stream_handle;
SWIGetStreamPosition = swio->get_stream_position;
}
typedef int (*GetStreamF)(term_t, int, int, IOSTREAM **s);
int
@ -2720,6 +2705,8 @@ X_API pl_wchar_t *PL_atom_generator_w(const pl_wchar_t *pref, pl_wchar_t *buffer
return NULL;
}
extern atom_t PrologPrompt(void);
char *
PL_prompt_string(int fd)
{ if ( fd == 0 )

View File

@ -4705,18 +4705,7 @@ get_stream_position(IOSTREAM *s, term_t t)
static void
init_yap(void)
{
swi_io_struct swiio;
swiio.f = FUNCTOR_dstream1;
swiio.get_c = Sfgetc;
swiio.put_c = Sputc;
swiio.get_w = Sgetcode;
swiio.put_w = Sputcode;
swiio.flush_s = Sflush;
swiio.close_s = closeStream;
swiio.get_stream_handle = get_stream_handle_no_errors;
swiio.get_stream_position = get_stream_position;
PL_YAP_InitSWIIO(&swiio);
setPrologFlagMask(PLFLAG_TTY_CONTROL);
initCharTypes();
initFiles();
PL_register_extensions(PL_predicates_from_ctype);

View File

@ -384,7 +384,7 @@ event_hook()
static void
reset_readline()
reset_readline(void)
{ if ( in_readline )
{ restore_signals();
}
@ -567,7 +567,7 @@ prolog_completion(const char *text, int start, int end)
#undef read /* UXNT redefinition */
install_t
PL_install_readline()
PL_install_readline(void)
{ GET_LD
bool old;

View File

@ -884,31 +884,8 @@ PL_add_to_protocol(const char *buf, size_t n)
void
PL_license(const char *license, const char *module)
{ GET_LD
/* if ( GD->initialised ) */
{ fid_t fid = PL_open_foreign_frame();
predicate_t pred = PL_predicate("license", 2, "system");
term_t av = PL_new_term_refs(2);
PL_put_atom_chars(av+0, license);
PL_put_atom_chars(av+1, module);
PL_call_predicate(NULL, PL_Q_NORMAL, pred, av);
PL_discard_foreign_frame(fid);
/*
} else
{
VSC: too much work.
struct license *l = allocHeap(sizeof(*l));
l->license_id = store_string(license);
l->module_id = store_string(module);
l->next = pre_registered;
pre_registered = l;
*/
}
{
/* unimplemented */
}