nightmaremail

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs

commit 8cc697288e096a98feb6d6f73d5c0c0d97a48118
parent bea5a4e43bf3f20e3668978e4fd6e6d21e5547e8
Author: Rolf Eike Beer <eike@sf-mail.de>
Date:   Mon,  4 Jan 2021 12:28:01 +0100

convert already modified functions to C89 interface

Diffstat:
Mbyte_chr.c | 5+----
Mbyte_copy.c | 5+----
Mbyte_cr.c | 5+----
Mbyte_rchr.c | 5+----
Mbyte_zero.c | 4+---
Mcase_diffb.c | 5+----
Mcase_diffs.c | 4+---
Mcase_starts.c | 4+---
Mgetln.c | 6+-----
Mgetln2.c | 9+++------
Mstr_chr.c | 4+---
Mstr_rchr.c | 4+---
Mstr_start.c | 4+---
Msubstdi.c | 12+++---------
Msubstdio_copy.c | 4+---
Msubstdo.c | 15++++-----------
16 files changed, 23 insertions(+), 72 deletions(-)

diff --git a/byte_chr.c b/byte_chr.c @@ -1,9 +1,6 @@ #include "byte.h" -unsigned int byte_chr(s,n,c) -char *s; -unsigned int n; -int c; +unsigned int byte_chr(char *s, unsigned int n, int c) { char ch; char *t; diff --git a/byte_copy.c b/byte_copy.c @@ -1,9 +1,6 @@ #include "byte.h" -void byte_copy(to,n,from) -char *to; -unsigned int n; -char *from; +void byte_copy(char *to, unsigned int n, char *from) { for (;;) { if (!n) return; *to++ = *from++; --n; diff --git a/byte_cr.c b/byte_cr.c @@ -1,9 +1,6 @@ #include "byte.h" -void byte_copyr(to,n,from) -char *to; -unsigned int n; -char *from; +void byte_copyr(char *to, unsigned int n, char *from) { to += n; from += n; diff --git a/byte_rchr.c b/byte_rchr.c @@ -1,9 +1,6 @@ #include "byte.h" -unsigned int byte_rchr(s,n,c) -char *s; -unsigned int n; -int c; +unsigned int byte_rchr(char *s, unsigned int n, int c) { char ch; char *t; diff --git a/byte_zero.c b/byte_zero.c @@ -1,8 +1,6 @@ #include "byte.h" -void byte_zero(s,n) -char *s; -unsigned int n; +void byte_zero(char *s, unsigned int n) { for (;;) { if (!n) break; *s++ = 0; --n; diff --git a/case_diffb.c b/case_diffb.c @@ -1,9 +1,6 @@ #include "case.h" -int case_diffb(s,len,t) -char *s; -unsigned int len; -char *t; +int case_diffb(char *s, unsigned int len, char *t) { unsigned char x; unsigned char y; diff --git a/case_diffs.c b/case_diffs.c @@ -1,8 +1,6 @@ #include "case.h" -int case_diffs(s,t) -char *s; -char *t; +int case_diffs(char *s, char *t) { unsigned char x; unsigned char y; diff --git a/case_starts.c b/case_starts.c @@ -1,8 +1,6 @@ #include "case.h" -int case_starts(s,t) -char *s; -char *t; +int case_starts(char *s, char *t) { unsigned char x; unsigned char y; diff --git a/getln.c b/getln.c @@ -4,11 +4,7 @@ #include "byte.h" #include "stralloc.h" -int getln(ss,sa,match,sep) -substdio *ss; -stralloc *sa; -int *match; -int sep; +int getln(substdio *ss, stralloc *sa, int *match, int sep) { char *cont; unsigned int clen; diff --git a/getln2.c b/getln2.c @@ -3,12 +3,9 @@ #include "byte.h" #include "getln.h" -int getln2(ss,sa,cont,clen,sep) -substdio *ss; -stralloc *sa; -/*@out@*/char **cont; -/*@out@*/unsigned int *clen; -int sep; +int getln2(substdio *ss, stralloc *sa, + /*@out@*/char **cont, /*@out@*/unsigned int *clen, + int sep) { char *x; unsigned int i; diff --git a/str_chr.c b/str_chr.c @@ -1,8 +1,6 @@ #include "str.h" -unsigned int str_chr(s,c) -char *s; -int c; +unsigned int str_chr(char *s, int c) { char ch; char *t; diff --git a/str_rchr.c b/str_rchr.c @@ -1,8 +1,6 @@ #include "str.h" -unsigned int str_rchr(s,c) -char *s; -int c; +unsigned int str_rchr(char *s, int c) { char ch; char *t; diff --git a/str_start.c b/str_start.c @@ -1,8 +1,6 @@ #include "str.h" -int str_start(s,t) -char *s; -char *t; +int str_start(char *s, char *t) { char x; diff --git a/substdi.c b/substdi.c @@ -11,10 +11,7 @@ static ssize_t oneread(ssize_t (*op)(), int fd, char *buf, size_t len) } } -static int getthis(s,buf,len) -substdio *s; -char *buf; -int len; +static int getthis(substdio *s, char *buf, int len) { int r; int q; @@ -68,15 +65,12 @@ ssize_t substdio_get(substdio *s, char *buf, size_t len) return getthis(s,buf,len); } -char *substdio_peek(s) -substdio *s; +char *substdio_peek(substdio *s) { return s->x + s->n; } -void substdio_seek(s,len) -substdio *s; -int len; +void substdio_seek(substdio *s, int len) { s->n += len; s->p -= len; diff --git a/substdio_copy.c b/substdio_copy.c @@ -1,8 +1,6 @@ #include "substdio.h" -int substdio_copy(ssout,ssin) -substdio *ssout; -substdio *ssin; +int substdio_copy(substdio *ssout, substdio *ssin) { char *x; diff --git a/substdo.c b/substdo.c @@ -20,8 +20,7 @@ static int allwrite(ssize_t (*op)(), int fd, char *buf, size_t len) return 0; } -int substdio_flush(s) -substdio *s; +int substdio_flush(substdio *s) { int p; @@ -78,23 +77,17 @@ int substdio_putflush(substdio *s, char *buf, size_t len) return allwrite(s->op,s->fd,buf,len); } -int substdio_bputs(s,buf) -substdio *s; -char *buf; +int substdio_bputs(substdio *s, char *buf) { return substdio_bput(s,buf,str_len(buf)); } -int substdio_puts(s,buf) -substdio *s; -char *buf; +int substdio_puts(substdio *s, char *buf) { return substdio_put(s,buf,str_len(buf)); } -int substdio_putsflush(s,buf) -substdio *s; -char *buf; +int substdio_putsflush(substdio *s, char *buf) { return substdio_putflush(s,buf,str_len(buf)); }