 d4fe90b42d
			
		
	
	d4fe90b42d
	
	
	
		
			
			git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@1460 ec53bebd-3082-4978-b11e-865c3cabbd6b
		
			
				
	
	
		
			66 lines
		
	
	
		
			1.8 KiB
		
	
	
	
		
			C
		
	
	
	
	
	
			
		
		
	
	
			66 lines
		
	
	
		
			1.8 KiB
		
	
	
	
		
			C
		
	
	
	
	
	
| /*  Copyright 1992 Simmule Turner and Rich Salz.  All rights reserved. 
 | |
|  *
 | |
|  *  This software is not subject to any license of the American Telephone 
 | |
|  *  and Telegraph Company or of the Regents of the University of California. 
 | |
|  *
 | |
|  *  Permission is granted to anyone to use this software for any purpose on
 | |
|  *  any computer system, and to alter it and redistribute it freely, subject
 | |
|  *  to the following restrictions:
 | |
|  *  1. The authors are not responsible for the consequences of use of this
 | |
|  *     software, no matter how awful, even if they arise from flaws in it.
 | |
|  *  2. The origin of this software must not be misrepresented, either by
 | |
|  *     explicit claim or by omission.  Since few users ever read sources,
 | |
|  *     credits must appear in the documentation.
 | |
|  *  3. Altered versions must be plainly marked as such, and must not be
 | |
|  *     misrepresented as being the original software.  Since few users
 | |
|  *     ever read sources, credits must appear in the documentation.
 | |
|  *  4. This notice may not be removed or altered.
 | |
|  */
 | |
| 
 | |
| /*
 | |
| **  Unix system-dependant routines for editline library.
 | |
| */
 | |
| #include <config.h>
 | |
| #include "editline.h"
 | |
| 
 | |
| #include <termios.h>
 | |
| 
 | |
| RCSID("$Id$");
 | |
| 
 | |
| 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) ? "/" : " ");
 | |
| }
 |