New library

git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@1037 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Johan Danielsson
1996-11-17 22:00:28 +00:00
parent 99dc5f53cf
commit 771895a10e
9 changed files with 2034 additions and 0 deletions

44
lib/editline/sysunix.c Normal file
View File

@@ -0,0 +1,44 @@
/* $Revision$
**
** Unix system-dependant routines for editline library.
*/
#include "editline.h"
#include <termios.h>
void
rl_ttyset(int Reset)
{
static struct termios old;
struct termios new;
if (Reset == 0) {
tcgetattr(0, &old);
rl_erase = old.c_cc[VERASE];
rl_kill = old.c_cc[VKILL];
rl_eof = old.c_cc[VEOF];
rl_intr = old.c_cc[VINTR];
rl_quit = old.c_cc[VQUIT];
new = old;
new.c_cc[VINTR] = -1;
new.c_cc[VQUIT] = -1;
new.c_lflag &= ~(ECHO | ICANON);
new.c_iflag &= ~(ISTRIP | INPCK);
new.c_cc[VMIN] = 1;
new.c_cc[VTIME] = 0;
tcsetattr(0, TCSANOW, &new);
}
else
tcsetattr(0, TCSANOW, &old);
}
void
rl_add_slash(char *path, char *p)
{
struct stat Sb;
if (stat(path, &Sb) >= 0)
strcat(p, S_ISDIR(Sb.st_mode) ? "/" : " ");
}