DataMuseum.dk

Presents historical artifacts from the history of:

DKUUG/EUUG Conference tapes

This is an automatic "excavation" of a thematic subset of
artifacts from Datamuseum.dk's BitArchive.

See our Wiki for more about DKUUG/EUUG Conference tapes

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - download
Index: ┃ T l

⟦279f605b2⟧ TextFile

    Length: 855 (0x357)
    Types: TextFile
    Names: »longname.c.new«

Derivation

└─⟦87ddcff64⟧ Bits:30001253 CPHDIST85 Tape, 1985 Autumn Conference Copenhagen
    └─ ⟦this⟧ »cph85dist/new_curses/longname.c.new« 

TextFile

# define	reg	register

/*
 *	This routine fills in "def" with the long name of the terminal.
 *
 * 1/26/81 (Berkeley) @(#)longname.c	1.1
 *
 * 2/22/84 Corrections made at University of California, San Francisco.
 * This correction makes a private copy of the longname. The original version
 * simply patched a '\0' in the termcap buffer, preventing access to
 * terminal capabilities at a later point.
 * rti-sel!trt: note: this code is still broken wrt the documentation.
 * It operates confusingly and usually gets the wrong answer.
 */

char *
longname(bp, def)
reg char	*bp, *def; {

	reg char	*cp;
	static char longcopy[30] ;

	while (*bp && *bp != ':' && *bp != '|')
		bp++;
	if (*bp == '|') {
		bp++;
		cp = longcopy ;
		while ((cp-longcopy)<29 && *bp && *bp != ':' && *bp != '|')
			*cp++ = *bp++ ;
		*cp = 0;
		return longcopy;
	}
	return def;
}