--- ray/src/rt/editline.c 1995/09/29 20:49:37 2.3 +++ ray/src/rt/editline.c 2004/03/30 16:13:01 2.8 @@ -1,15 +1,21 @@ -/* Copyright (c) 1995 Regents of the University of California */ - #ifndef lint -static char SCCSid[] = "$SunId$ LBL"; +static const char RCSid[] = "$Id: editline.c,v 2.8 2004/03/30 16:13:01 schorsch Exp $"; #endif - /* * editline.c - routine for editing raw input for rview. * - * 10/5/88 + * External symbols declared in driver.h */ +#include "copyright.h" + +#include +#include + +#include "color.h" + +#include "driver.h" + #define iscntrl(c) ((c) < ' ') #define isblank(c) ((c) == ' ') #define iserase(c) ((c) == '\b' || (c) == 127) @@ -17,9 +23,12 @@ static char SCCSid[] = "$SunId$ LBL"; #define iskill(c) ((c) == 'U'-'@' || (c) == 'X'-'@') -editline(buf, c_get, s_put) /* edit input line */ -char *buf; -int (*c_get)(), (*s_put)(); +extern void +editline( /* edit input line */ + char *buf, + dr_getchf_t *c_get, + dr_comoutf_t *s_put +) { static char erases[] = "\b \b"; static char obuf[4]; @@ -63,11 +72,10 @@ int (*c_get)(), (*s_put)(); } -#include "driver.h" - static char mybuf[512]; +void tocombuf(b, d) /* add command(s) to my buffer */ register char *b; register struct driver *d; @@ -78,7 +86,7 @@ register struct driver *d; for (cp = mybuf; *cp; cp++) ; comstart = cp; - while (*cp++ = *b) + while ( (*cp++ = *b) ) if (cp >= mybuf+sizeof(mybuf)) { *comstart = '\0'; return; /* what should I do about this? */ @@ -89,6 +97,7 @@ register struct driver *d; } +int fromcombuf(b, d) /* get command from my buffer */ char *b; struct driver *d;