File:  [MW Coherent from dump] / coherent / g / usr / lib / ncurses / getcap.c
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs
Wed May 29 04:56:35 2019 UTC (7 years ago) by root
Branches: MarkWilliams, MAIN
CVS tags: relic, HEAD
coherent

#include <stdio.h>
#include <ctype.h>

#define	bool	char
#define	TRUE	1
#define	FALSE	0

extern char    buffer[];


/*
 * get_termcap:
 *	read next termcap entry into buffer from standard input.
 */
get_termcap ()
{
    int		c;
    char	*bptr;

    bptr = buffer;
    while ((c = getchar ()) != '\n') {
	if (c == '\\') {
	    if ((c = getchar ()) != '\n') {
		if (ungetc (c, stdin) == EOF) {
		    fprintf (stderr, "ungetc failed.\n");
		    exit (1);
		}
		*(bptr++) = '\\';
	    }
	}
	else {
	    *(bptr++) = c;
	}
    }
    *bptr = '\0';
}

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.