/*
* Insert "n" copies of the character "c"
* at the current location of dot. In the easy case
* all that happens is the text is stored in the line.
* In the hard case, the line has to be reallocated.
* When the window list is updated, take special
* care; I screwed it up once. You always update dot
* in the current window. You update mark, and a
* dot in another window, if it is greater than
* the place where you did the insert. Return TRUE
* if all is well, and FALSE on errors.
*/
linsert(n, c)
{
#define cp1 (*(char **)0xa0)
#define cp2 (*(char **)0xa2)
register LINE *lp1; /* 23 times. */
#define lp2 (*(LINE **)0xa8)
#define lp3 (*(LINE **)0xa4)
#define doto (*(int *)0xa6)
register WINDOW *wp; /* 15 times, but the best! */
#define localn (*(int *)0xaa)
lchange( WFEDIT );
wp = curwp;
localn = n;
if (( lp1 = wp->w_dotp ) == curbp->b_linep )
{ /* At the end: special. Assert that w_doto == 0 */
/* There is no line at all here, so we must
** allocate a new line ( lp2 ) and link it in.
*/
if ( ( lp2 = lalloc( localn )) == NULL )
{ /* must be out of memory. */
retfalse: return ( 0 );
}