ENTIRE_LINE : (tm->cno - fm->cno) + 1, cbp))
CUT_LINE_TO_EOL : (tm->cno - fm->cno) + 1, cbp))
cut(sp, namep, fm, tm, flags)	SCR *sp;	CHAR_T *namep;	MARK *fm, *tm;	int flags;{	CB *cbp;	CHAR_T name;	recno_t lno;	int append, copy_one, copy_def;	/*	 * If the user specified a buffer, put it there.  (This may require	 * a copy into the numeric buffers.  We do the copy so that we don't	 * have to reference count and so we don't have to deal with things	 * like appends to buffers that are used multiple times.)	 *	 * Otherwise, if it's supposed to be put in a numeric buffer (usually	 * a delete) put it there.  The rules for putting things in numeric	 * buffers were historically a little strange.  There were three cases.	 *	 *	1: Some motions are always line mode motions, which means	 *	   that the cut always goes into the numeric buffers.	 *	2: Some motions aren't line mode motions, e.g. d10w, but	 *	   can cross line boundaries.  For these commands, if the	 *	   cut crosses a line boundary, it goes into the numeric	 *	   buffers.  This includes most of the commands.	 *	3: Some motions aren't line mode motions, e.g. d`<char>,	 *	   but always go into the numeric buffers, regardless.  This	 *	   was the commands: % ` / ? ( ) N n { } -- and nvi adds ^A.	 *	 * Otherwise, put it in the unnamed buffer.	 */	append = copy_one = copy_def = 0;	if (namep != NULL) {		name = *namep;		if (LF_ISSET(CUT_NUMREQ) || LF_ISSET(CUT_NUMOPT) &&		    (LF_ISSET(CUT_LINEMODE) || fm->lno != tm->lno)) {			copy_one = 1;			cb_rotate(sp);		}		if ((append = isupper(name)) == 1) {			if (!copy_one)				copy_def = 1;			name = tolower(name);		}namecb:		CBNAME(sp, cbp, name);	} else if (LF_ISSET(CUT_NUMREQ) || LF_ISSET(CUT_NUMOPT) &&	    (LF_ISSET(CUT_LINEMODE) || fm->lno != tm->lno)) {		name = '1';		cb_rotate(sp);		goto namecb;	} else		cbp = &sp->gp->dcb_store;copyloop:	/*	 * If this is a new buffer, create it and add it into the list.	 * Otherwise, if it's not an append, free its current contents.	 */	if (cbp == NULL) {		CALLOC_RET(sp, cbp, CB *, 1, sizeof(CB));		cbp->name = name;		CIRCLEQ_INIT(&cbp->textq);		LIST_INSERT_HEAD(&sp->gp->cutq, cbp, q);	} else if (!append) {		text_lfree(&cbp->textq);		cbp->len = 0;		cbp->flags = 0;	}#define	ENTIRE_LINE	-1	/* In line mode, it's pretty easy, just cut the lines. */	if (LF_ISSET(CUT_LINEMODE)) {		cbp->flags |= CB_LMODE;		for (lno = fm->lno; lno <= tm->lno; ++lno)			if (cut_line(sp, lno, 0, ENTIRE_LINE, cbp))				goto cut_line_err;	} else {		/*		 * Get the first line.  A length of ENTIRE_LINE causes cut_line		 * to cut from the MARK to the end of the line.		 */		if (cut_line(sp, fm->lno, fm->cno, fm->lno != tm->lno ?		    ENTIRE_LINE : (tm->cno - fm->cno) + 1, cbp))			goto cut_line_err;		/* Get the intermediate lines. */		for (lno = fm->lno; ++lno < tm->lno;)			if (cut_line(sp, lno, 0, ENTIRE_LINE, cbp))				goto cut_line_err;		/* Get the last line. */		if (tm->lno != fm->lno &&		    cut_line(sp, lno, 0, tm->cno + 1, cbp))			goto cut_line_err;	}	append = 0;		/* Only append to the named buffer. */	sp->gp->dcbp = cbp;	/* Repoint the default buffer on each pass. */	if (copy_one) {		/* Copy into numeric buffer 1. */		name = '1';		CBNAME(sp, cbp, name);		copy_one = 0;		goto copyloop;	}	if (copy_def) {		/* Copy into the default buffer. */		cbp = &sp->gp->dcb_store;		copy_def = 0;		goto copyloop;	}	return (0);cut_line_err:		text_lfree(&cbp->textq);	cbp->len = 0;	cbp->flags = 0;	return (1);}