summaryrefslogtreecommitdiffstats
path: root/bin/sh/input.c
diff options
context:
space:
mode:
authorimp <imp@FreeBSD.org>2002-02-02 06:50:57 +0000
committerimp <imp@FreeBSD.org>2002-02-02 06:50:57 +0000
commit5ef5088ac4e038d0a147a08377ef087fd6edf527 (patch)
tree01a827446e9ba4f34cf1e754fcac691f6c9eb1cf /bin/sh/input.c
parent50014e35418ca00d25ea852fc4f94acf80be4df3 (diff)
downloadFreeBSD-src-5ef5088ac4e038d0a147a08377ef087fd6edf527.zip
FreeBSD-src-5ef5088ac4e038d0a147a08377ef087fd6edf527.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 Change int foo() { ... to int foo(void) { ...
Diffstat (limited to 'bin/sh/input.c')
-rw-r--r--bin/sh/input.c51
1 files changed, 23 insertions, 28 deletions
diff --git a/bin/sh/input.c b/bin/sh/input.c
index 4532b26..b1b9e79 100644
--- a/bin/sh/input.c
+++ b/bin/sh/input.c
@@ -107,8 +107,8 @@ int whichprompt; /* 1 == PS1, 2 == PS2 */
EditLine *el; /* cookie for editline package */
-STATIC void pushfile __P((void));
-static int preadfd __P((void));
+STATIC void pushfile(void);
+static int preadfd(void);
#ifdef mkinit
INCLUDE "input.h"
@@ -137,9 +137,7 @@ SHELLPROC {
*/
char *
-pfgets(line, len)
- char *line;
- int len;
+pfgets(char *line, int len)
{
char *p = line;
int nleft = len;
@@ -168,14 +166,14 @@ pfgets(line, len)
*/
int
-pgetc()
+pgetc(void)
{
return pgetc_macro();
}
static int
-preadfd()
+preadfd(void)
{
int nr;
parsenextc = parsefile->buf;
@@ -227,7 +225,7 @@ retry:
*/
int
-preadbuffer()
+preadbuffer(void)
{
char *p, *q;
int more;
@@ -316,7 +314,8 @@ check:
*/
void
-pungetc() {
+pungetc(void)
+{
parsenleft++;
parsenextc--;
}
@@ -326,11 +325,8 @@ pungetc() {
* We handle aliases this way.
*/
void
-pushstring(s, len, ap)
- char *s;
- int len;
- void *ap;
- {
+pushstring(char *s, int len, void *ap)
+{
struct strpush *sp;
INTOFF;
@@ -353,7 +349,7 @@ pushstring(s, len, ap)
}
void
-popstring()
+popstring(void)
{
struct strpush *sp = parsefile->strpush;
@@ -376,9 +372,7 @@ popstring()
*/
void
-setinputfile(fname, push)
- char *fname;
- int push;
+setinputfile(char *fname, int push)
{
int fd;
int fd2;
@@ -404,8 +398,7 @@ setinputfile(fname, push)
*/
void
-setinputfd(fd, push)
- int fd, push;
+setinputfd(int fd, int push)
{
(void)fcntl(fd, F_SETFD, FD_CLOEXEC);
if (push) {
@@ -427,10 +420,8 @@ setinputfd(fd, push)
*/
void
-setinputstring(string, push)
- char *string;
- int push;
- {
+setinputstring(char *string, int push)
+{
INTOFF;
if (push)
pushfile();
@@ -449,7 +440,8 @@ setinputstring(string, push)
*/
STATIC void
-pushfile() {
+pushfile(void)
+{
struct parsefile *pf;
parsefile->nleft = parsenleft;
@@ -466,7 +458,8 @@ pushfile() {
void
-popfile() {
+popfile(void)
+{
struct parsefile *pf = parsefile;
INTOFF;
@@ -491,7 +484,8 @@ popfile() {
*/
void
-popallfiles() {
+popallfiles(void)
+{
while (parsefile != &basepf)
popfile();
}
@@ -504,7 +498,8 @@ popallfiles() {
*/
void
-closescript() {
+closescript(void)
+{
popallfiles();
if (parsefile->fd > 0) {
close(parsefile->fd);
OpenPOWER on IntegriCloud