|
|
Power 6/32 Unix version 1.21
/* D.L.Buck and Associates, Inc. - May, 1984
*
* COPYRIGHT NOTICE:
* Copyright c 1984 - An unpublished work by
* D.L.Buck and Associates, Inc.
*
* PROPRIETARY RIGHTS NOTICE:
* All rights reserved. This document and program contains
* proprietary information of D.L.Buck and Associates,Inc.
* of San Jose, California, U.S.A., embodying confidential
* information, ideas, and expressions, no part of which
* may be reproduced, or transmitted in any form or by any
* means, electronic, mechanical, or otherwise, without
* the written permission of D.L.Buck and Associates, Inc.
*
* NAME
* emgetstr
*
* SYNOPSIS
* char emgetstr()
*
* DESCRIPTION
* emgetstr uses emgetchar to get a string from the window cmd_scr
* entered by the user in command mode.
*/
#include <em.h>
char *emgetstr(buffer)
char *buffer;
{
static char sccsid[] = "@(#)emgetstr.c 1.4 REL";
int emgetchar();
register int cptr;
register int cmd_curs = 9;
register int count = 0;
while ((cptr = emgetchar()) != CARRET && cptr != DOWN) {
if (cptr == NOCHAR) continue;
if (cptr == BACKSP || cptr == LEFT || cptr == DELCHR) {
if (--cmd_curs < 9) {
cmd_curs = 9;
continue;
}
mvwaddch(cmd_scr,0,cmd_curs,' ');
wmove(cmd_scr,0,cmd_curs);
wrefresh(cmd_scr);
buffer[--count] = '\0';
continue;
}
buffer[count] = cptr;
mvwaddch(cmd_scr,0,cmd_curs,cptr);
wrefresh(cmd_scr);
++cmd_curs; ++count;
}
buffer[count] = '\0';
}
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.