io.c (99109) | io.c (108533) |
---|---|
1/* io.c: This file contains the i/o routines for the ed line editor */ 2/*- 3 * Copyright (c) 1993 Andrew Moore, Talke Studio. 4 * All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions 8 * are met: --- 12 unchanged lines hidden (view full) --- 21 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 22 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 23 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 24 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 25 * SUCH DAMAGE. 26 */ 27 28#include <sys/cdefs.h> | 1/* io.c: This file contains the i/o routines for the ed line editor */ 2/*- 3 * Copyright (c) 1993 Andrew Moore, Talke Studio. 4 * All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions 8 * are met: --- 12 unchanged lines hidden (view full) --- 21 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 22 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 23 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 24 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 25 * SUCH DAMAGE. 26 */ 27 28#include <sys/cdefs.h> |
29__FBSDID("$FreeBSD: head/bin/ed/io.c 99109 2002-06-30 05:13:54Z obrien $"); | 29__FBSDID("$FreeBSD: head/bin/ed/io.c 108533 2003-01-01 18:49:04Z schweikh $"); |
30 31#include "ed.h" 32 33 34extern int scripted; 35 36/* read_file: read a named file/pipe into the buffer; return line count */ 37long --- 165 unchanged lines hidden (view full) --- 203 if ((des ? put_des_char(*s++, fp) : fputc(*s++, fp)) < 0) { 204 fprintf(stderr, "%s\n", strerror(errno)); 205 errmsg = "cannot write file"; 206 return ERR; 207 } 208 return 0; 209} 210 | 30 31#include "ed.h" 32 33 34extern int scripted; 35 36/* read_file: read a named file/pipe into the buffer; return line count */ 37long --- 165 unchanged lines hidden (view full) --- 203 if ((des ? put_des_char(*s++, fp) : fputc(*s++, fp)) < 0) { 204 fprintf(stderr, "%s\n", strerror(errno)); 205 errmsg = "cannot write file"; 206 return ERR; 207 } 208 return 0; 209} 210 |
211/* get_extended_line: get a an extended line from stdin */ | 211/* get_extended_line: get an extended line from stdin */ |
212char * 213get_extended_line(int *sizep, int nonl) 214{ 215 static char *cvbuf = NULL; /* buffer */ 216 static int cvbufsz = 0; /* buffer size */ 217 218 int l, n; 219 char *t = ibufp; --- 134 unchanged lines hidden --- | 212char * 213get_extended_line(int *sizep, int nonl) 214{ 215 static char *cvbuf = NULL; /* buffer */ 216 static int cvbufsz = 0; /* buffer size */ 217 218 int l, n; 219 char *t = ibufp; --- 134 unchanged lines hidden --- |