|
|
1.1 ! root 1: /* D.L.Buck and Associates, Inc. - May, 1984 ! 2: * ! 3: * COPYRIGHT NOTICE: ! 4: * Copyright c 1984 - An unpublished work by ! 5: * D.L.Buck and Associates, Inc. ! 6: * ! 7: * PROPRIETARY RIGHTS NOTICE: ! 8: * All rights reserved. This document and program contains ! 9: * proprietary information of D.L.Buck and Associates,Inc. ! 10: * of San Jose, California, U.S.A., embodying confidential ! 11: * information, ideas, and expressions, no part of which ! 12: * may be reproduced, or transmitted in any form or by any ! 13: * means, electronic, mechanical, or otherwise, without ! 14: * the written permission of D.L.Buck and Associates, Inc. ! 15: * ! 16: * NAME ! 17: * emgetstr ! 18: * ! 19: * SYNOPSIS ! 20: * char emgetstr() ! 21: * ! 22: * DESCRIPTION ! 23: * emgetstr uses emgetchar to get a string from the window cmd_scr ! 24: * entered by the user in command mode. ! 25: */ ! 26: ! 27: #include <em.h> ! 28: char *emgetstr(buffer) ! 29: char *buffer; ! 30: { ! 31: static char sccsid[] = "@(#)emgetstr.c 1.4 REL"; ! 32: int emgetchar(); ! 33: register int cptr; ! 34: register int cmd_curs = 9; ! 35: register int count = 0; ! 36: ! 37: while ((cptr = emgetchar()) != CARRET && cptr != DOWN) { ! 38: if (cptr == NOCHAR) continue; ! 39: if (cptr == BACKSP || cptr == LEFT || cptr == DELCHR) { ! 40: if (--cmd_curs < 9) { ! 41: cmd_curs = 9; ! 42: continue; ! 43: } ! 44: mvwaddch(cmd_scr,0,cmd_curs,' '); ! 45: wmove(cmd_scr,0,cmd_curs); ! 46: wrefresh(cmd_scr); ! 47: buffer[--count] = '\0'; ! 48: continue; ! 49: } ! 50: buffer[count] = cptr; ! 51: mvwaddch(cmd_scr,0,cmd_curs,cptr); ! 52: wrefresh(cmd_scr); ! 53: ++cmd_curs; ++count; ! 54: } ! 55: buffer[count] = '\0'; ! 56: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.