add multiple access method code back in; signal fix
[unix-history] / usr / src / contrib / ed / c.c
CommitLineData
5496c33f
KB
1/*-
2 * Copyright (c) 1992 The Regents of the University of California.
3 * All rights reserved.
4 *
5 * This code is derived from software contributed to Berkeley by
6 * Rodney Ruddock of the University of Guelph.
7 *
8 * %sccs.include.redist.c%
9 */
10
11#ifndef lint
ecbf4ad0 12static char sccsid[] = "@(#)c.c 5.2 (Berkeley) %G%";
5496c33f
KB
13#endif /* not lint */
14
ecbf4ad0
KB
15#include <sys/types.h>
16
17#include <db.h>
18#include <regex.h>
19#include <setjmp.h>
20#include <stdio.h>
21
5496c33f 22#include "ed.h"
ecbf4ad0 23#include "extern.h"
5496c33f
KB
24
25/*
26 * This deletes the range of lines specified and then sets up things
27 * for the central input routine.
28 */
29
30void
31c(inputt, errnum)
ecbf4ad0
KB
32 FILE *inputt;
33 int *errnum;
5496c33f 34{
ecbf4ad0
KB
35 if (start_default && End_default)
36 start = End = current;
37 else
38 if (start_default)
39 start = End;
40 if (start == NULL) {
41 *errnum = -1;
42 return;
43 }
44 start_default = End_default = 0;
45
46 /* first delete the lines */
47 d(inputt, errnum);
48 if (*errnum < 0)
49 return;
50 *errnum = 0;
51
52 if ((current != NULL) && (current != bottom))
53 current = current->above;
54 if (sigint_flag)
55 SIGINT_ACTION;
56 add_flag = 1;
57 start_default = End_default = 1;
58 /* now get the "change" lines */
59 input_lines(inputt, errnum);
60 add_flag = 0;
61}