File:  [MW Coherent from dump] / coherent / g / usr / bin / vsh / winlib / pfkeys.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

/*
 *      Functions for programmable function keys
 *
 *      Copyright (c) 1993 by Udo Munk
 */

#ifdef AIX
#define NLS
#endif

#include <curses.h>
#include "winfun.h"

struct pfkey pfkeys[9];                   /* function keys */

/*
 *      display the function key lables in last line
 */
print_pfkeys()
{
	register int i;
	register char *p;
	char empty[PFKLABLEN];
	char space[80];

	/* compute free space between the labels:        */
	/* 9 labels of size PFKLABLEN and 8 empty spaces */
	p = space;
	i = (COLS - ((PFKLABLEN + 1) * 9)) / 8;
	while (i--)
		*p++ = ' ';
	*p = '\0';

	/* create the string for one empty label */
	p = &empty[0];
	i = PFKLABLEN;
	while (i--)
		*p++ = ' ';
	*p = '\0';

	/* output all labels */
	move(LINES-1, 0);
	for (i = 1; i <= 9; i++) {
		printw("%1d", i);
		attrset(A_REVERSE);
		if (*pfkeys[i-1].label)
			addstr(pfkeys[i-1].label);
		else
			addstr(empty);
		attrset(A_NORMAL);
		if (i < 9)
			addstr(space);
	}
	
	refreshall();
}

unix.superglobalmegacorp.com

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