add VI_SEL_END, VI_SEL_START
[nvi.git] / ex / ex_put.c
blobab57882a66ad7818895d839ffa503dca1d6ace4f
1 /*-
2 * Copyright (c) 1992, 1993, 1994
3 * The Regents of the University of California. All rights reserved.
4 * Copyright (c) 1992, 1993, 1994, 1995, 1996
5 * Keith Bostic. All rights reserved.
7 * See the LICENSE file for redistribution information.
8 */
10 #include "config.h"
12 #ifndef lint
13 static const char sccsid[] = "$Id: ex_put.c,v 10.7 1996/03/06 19:52:33 bostic Exp $ (Berkeley) $Date: 1996/03/06 19:52:33 $";
14 #endif /* not lint */
16 #include <sys/types.h>
17 #include <sys/queue.h>
19 #include <bitstring.h>
20 #include <ctype.h>
21 #include <limits.h>
22 #include <stdio.h>
23 #include <string.h>
25 #include "../common/common.h"
28 * ex_put -- [line] pu[t] [buffer]
29 * Append a cut buffer into the file.
31 * PUBLIC: int ex_put __P((SCR *, EXCMD *));
33 int
34 ex_put(sp, cmdp)
35 SCR *sp;
36 EXCMD *cmdp;
38 MARK m;
40 NEEDFILE(sp, cmdp);
42 m.lno = sp->lno;
43 m.cno = sp->cno;
44 if (put(sp, NULL,
45 FL_ISSET(cmdp->iflags, E_C_BUFFER) ? &cmdp->buffer : NULL,
46 &cmdp->addr1, &m, 1))
47 return (1);
48 sp->lno = m.lno;
49 sp->cno = m.cno;
50 return (0);