summaryrefslogtreecommitdiffstats
path: root/bin/ed/io.c
diff options
context:
space:
mode:
authorimp <imp@FreeBSD.org>2002-02-02 06:36:49 +0000
committerimp <imp@FreeBSD.org>2002-02-02 06:36:49 +0000
commit3fc8df52e3856eeac730574d5ae122806dd1e1ef (patch)
tree331e1d7f986e20bcd52361067fc4b66cab14b048 /bin/ed/io.c
parent5203a0a465a65bd5e6e40b6364bb0dbe05feb7cf (diff)
downloadFreeBSD-src-3fc8df52e3856eeac730574d5ae122806dd1e1ef.zip
FreeBSD-src-3fc8df52e3856eeac730574d5ae122806dd1e1ef.tar.gz
o __P has been reoved
o Old-style K&R declarations have been converted to new C89 style o register has been removed o prototype for main() has been removed (gcc3 makes it an error) o int main(int argc, char *argv[]) is the preferred main definition. o Attempt to not break style(9) conformance for declarations more than they already are. o gc some #ifdef sun ... #endif code Approved by: arch@, new style(9)
Diffstat (limited to 'bin/ed/io.c')
-rw-r--r--bin/ed/io.c39
1 files changed, 9 insertions, 30 deletions
diff --git a/bin/ed/io.c b/bin/ed/io.c
index 47d0502..b0edf24 100644
--- a/bin/ed/io.c
+++ b/bin/ed/io.c
@@ -37,9 +37,7 @@ extern int scripted;
/* read_file: read a named file/pipe into the buffer; return line count */
long
-read_file(fn, n)
- char *fn;
- long n;
+read_file(char *fn, long n)
{
FILE *fp;
long size;
@@ -70,9 +68,7 @@ int newline_added; /* if set, newline appended to input file */
/* read_stream: read a stream into the editor buffer; return status */
long
-read_stream(fp, n)
- FILE *fp;
- long n;
+read_stream(FILE *fp, long n)
{
line_t *lp = get_addressed_line_node(n);
undo_t *up = NULL;
@@ -121,8 +117,7 @@ read_stream(fp, n)
/* get_stream_line: read a line of text from a stream; return line length */
int
-get_stream_line(fp)
- FILE *fp;
+get_stream_line(FILE *fp)
{
int c;
int i = 0;
@@ -151,11 +146,7 @@ get_stream_line(fp)
/* write_file: write a range of lines to a named file/pipe; return line count */
long
-write_file(fn, mode, n, m)
- char *fn;
- const char *mode;
- long n;
- long m;
+write_file(char *fn, const char *mode, long n, long m)
{
FILE *fp;
long size;
@@ -179,10 +170,7 @@ write_file(fn, mode, n, m)
/* write_stream: write a range of lines to a stream; return status */
long
-write_stream(fp, n, m)
- FILE *fp;
- long n;
- long m;
+write_stream(FILE *fp, long n, long m)
{
line_t *lp = get_addressed_line_node(n);
unsigned long size = 0;
@@ -211,10 +199,7 @@ write_stream(fp, n, m)
/* put_stream_line: write a line of text to a stream; return status */
int
-put_stream_line(fp, s, len)
- FILE *fp;
- const char *s;
- int len;
+put_stream_line(FILE *fp, const char *s, int len)
{
while (len--)
if ((des ? put_des_char(*s++, fp) : fputc(*s++, fp)) < 0) {
@@ -227,9 +212,7 @@ put_stream_line(fp, s, len)
/* get_extended_line: get a an extended line from stdin */
char *
-get_extended_line(sizep, nonl)
- int *sizep;
- int nonl;
+get_extended_line(int *sizep, int nonl)
{
static char *cvbuf = NULL; /* buffer */
static int cvbufsz = 0; /* buffer size */
@@ -272,7 +255,7 @@ get_extended_line(sizep, nonl)
/* get_tty_line: read a line of text from stdin; return line length */
int
-get_tty_line()
+get_tty_line(void)
{
int oi = 0;
int i = 0;
@@ -320,11 +303,7 @@ extern int cols;
/* put_tty_line: print text to stdout */
int
-put_tty_line(s, l, n, gflag)
- const char *s;
- int l;
- long n;
- int gflag;
+put_tty_line(const char *s, int l, long n, int gflag)
{
int col = 0;
int lc = 0;
OpenPOWER on IntegriCloud