Shutdown of libedit

This commit is contained in:
2014-06-15 09:04:09 +00:00
parent 0cc414b2ae
commit d327430f98
4 changed files with 24 additions and 3 deletions

View File

@ -73,6 +73,7 @@ static EditLine *editline_handle= NULL;
static History *editline_history= NULL;
static int editline_is_initialized= 0;
char *Xorriso__editline_prompt(EditLine *el_handle)
{
return "";
@ -101,12 +102,23 @@ void Xorriso_init_editline(struct XorrisO *xorriso, int flag)
history(editline_history, &ev, H_SETSIZE, 1000);
el_set(editline_handle, EL_HIST, history, editline_history);
/* >>> ??? where to apply history_end() and el_end() ? */;
editline_is_initialized= 1; /* Valid now */
return;
}
int Xorriso__shutdown_editline(int flag)
{
if(editline_history != NULL)
history_end(editline_history);
editline_history= NULL;
if(editline_handle != NULL)
el_end(editline_handle);
editline_handle= NULL;
editline_is_initialized= 0;
return(1);
}
#endif /* Xorriso_with_editlinE */
#ifdef Xorriso_with_line_editoR