ex_yank.c revision 1.3
1/*	$OpenBSD: ex_yank.c,v 1.3 2001/01/29 01:58:45 niklas Exp $	*/
2
3/*-
4 * Copyright (c) 1992, 1993, 1994
5 *	The Regents of the University of California.  All rights reserved.
6 * Copyright (c) 1992, 1993, 1994, 1995, 1996
7 *	Keith Bostic.  All rights reserved.
8 *
9 * See the LICENSE file for redistribution information.
10 */
11
12#include "config.h"
13
14#ifndef lint
15static const char sccsid[] = "@(#)ex_yank.c	10.7 (Berkeley) 3/6/96";
16#endif /* not lint */
17
18#include <sys/types.h>
19#include <sys/queue.h>
20
21#include <bitstring.h>
22#include <limits.h>
23#include <stdio.h>
24
25#include "../common/common.h"
26
27/*
28 * ex_yank -- :[line [,line]] ya[nk] [buffer] [count]
29 *	Yank the lines into a buffer.
30 *
31 * PUBLIC: int ex_yank __P((SCR *, EXCMD *));
32 */
33int
34ex_yank(sp, cmdp)
35	SCR *sp;
36	EXCMD *cmdp;
37{
38	NEEDFILE(sp, cmdp);
39
40	/*
41	 * !!!
42	 * Historically, yanking lines in ex didn't count toward the
43	 * number-of-lines-yanked report.
44	 */
45	return (cut(sp,
46	    FL_ISSET(cmdp->iflags, E_C_BUFFER) ? &cmdp->buffer : NULL,
47	    &cmdp->addr1, &cmdp->addr2, CUT_LINEMODE));
48}
49