de-__P, ANSIfy function declarations

This commit is contained in:
perry 2005-02-04 15:52:08 +00:00
parent d806a865f6
commit e738b65d24
4 changed files with 39 additions and 75 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: termcap.c,v 1.47 2004/04/23 14:49:18 christos Exp $ */ /* $NetBSD: termcap.c,v 1.48 2005/02/04 15:52:08 perry Exp $ */
/* /*
* Copyright (c) 1980, 1993 * Copyright (c) 1980, 1993
@ -34,7 +34,7 @@
#if 0 #if 0
static char sccsid[] = "@(#)termcap.c 8.1 (Berkeley) 6/4/93"; static char sccsid[] = "@(#)termcap.c 8.1 (Berkeley) 6/4/93";
#else #else
__RCSID("$NetBSD: termcap.c,v 1.47 2004/04/23 14:49:18 christos Exp $"); __RCSID("$NetBSD: termcap.c,v 1.48 2005/02/04 15:52:08 perry Exp $");
#endif #endif
#endif /* not lint */ #endif /* not lint */
@ -115,9 +115,7 @@ t_setinfo(struct tinfo **bp, const char *entry)
*/ */
int int
t_getent(bp, name) t_getent(struct tinfo **bp, const char *name)
struct tinfo **bp;
const char *name;
{ {
char *p; char *p;
char *cp; char *cp;
@ -273,9 +271,7 @@ out:
* Get an entry for terminal name in buffer bp from the termcap file. * Get an entry for terminal name in buffer bp from the termcap file.
*/ */
int int
tgetent(bp, name) tgetent(char *bp, const char *name)
char *bp;
const char *name;
{ {
int i, plen, elen, c; int i, plen, elen, c;
char *ptrbuf = NULL; char *ptrbuf = NULL;
@ -322,9 +318,7 @@ tgetent(bp, name)
* Note that we handle octal numbers beginning with 0. * Note that we handle octal numbers beginning with 0.
*/ */
int int
t_getnum(info, id) t_getnum(struct tinfo *info, const char *id)
struct tinfo *info;
const char *id;
{ {
long num; long num;
@ -338,8 +332,7 @@ t_getnum(info, id)
} }
int int
tgetnum(id) tgetnum(const char *id)
const char *id;
{ {
return fbuf ? t_getnum(fbuf, id) : -1; return fbuf ? t_getnum(fbuf, id) : -1;
} }
@ -350,9 +343,7 @@ tgetnum(id)
* of the buffer. Return 1 if we find the option, or 0 if it is * of the buffer. Return 1 if we find the option, or 0 if it is
* not given. * not given.
*/ */
int t_getflag(info, id) int t_getflag(struct tinfo *info, const char *id)
struct tinfo *info;
const char *id;
{ {
_DIAGASSERT(info != NULL); _DIAGASSERT(info != NULL);
_DIAGASSERT(id != NULL); _DIAGASSERT(id != NULL);
@ -361,8 +352,7 @@ int t_getflag(info, id)
} }
int int
tgetflag(id) tgetflag(const char *id)
const char *id;
{ {
return fbuf ? t_getflag(fbuf, id) : 0; return fbuf ? t_getflag(fbuf, id) : 0;
} }
@ -377,11 +367,7 @@ tgetflag(id)
* area, this is updated. * area, this is updated.
*/ */
char * char *
t_getstr(info, id, area, limit) t_getstr(struct tinfo *info, const char *id, char **area, size_t *limit)
struct tinfo *info;
const char *id;
char **area;
size_t *limit;
{ {
char *s; char *s;
int i; int i;
@ -433,9 +419,7 @@ t_getstr(info, id, area, limit)
* No checking on area overflow. * No checking on area overflow.
*/ */
char * char *
tgetstr(id, area) tgetstr(const char *id, char **area)
const char *id;
char **area;
{ {
struct tinfo dummy; struct tinfo dummy;
char ids[3]; char ids[3];
@ -516,8 +500,7 @@ t_agetstr(struct tinfo *info, const char *id)
* *
*/ */
void void
t_freent(info) t_freent(struct tinfo *info)
struct tinfo *info;
{ {
struct tbuf *tb, *wb; struct tbuf *tb, *wb;
_DIAGASSERT(info != NULL); _DIAGASSERT(info != NULL);
@ -540,10 +523,7 @@ t_freent(info)
* *
*/ */
int int
t_getterm(info, area, limit) t_getterm(struct tinfo *info, char **area, size_t *limit)
struct tinfo *info;
char **area;
size_t *limit;
{ {
char *endp; char *endp;
size_t count; size_t count;

View File

@ -1,4 +1,4 @@
/* $NetBSD: termcap.h,v 1.14 2003/08/07 16:44:57 agc Exp $ */ /* $NetBSD: termcap.h,v 1.15 2005/02/04 15:52:08 perry Exp $ */
/*- /*-
* Copyright (c) 1992, 1993 * Copyright (c) 1992, 1993
@ -40,28 +40,28 @@
#include <sys/types.h> #include <sys/types.h>
__BEGIN_DECLS __BEGIN_DECLS
int tgetent __P((char *, const char *)); int tgetent(char *, const char *);
char *tgetstr __P((const char *, char **)); char *tgetstr(const char *, char **);
int tgetflag __P((const char *)); int tgetflag(const char *);
int tgetnum __P((const char *)); int tgetnum(const char *);
char *tgoto __P((const char *, int, int)); char *tgoto(const char *, int, int);
void tputs __P((const char *, int, int (*)(int))); void tputs(const char *, int, int (*)(int));
/* /*
* New interface * New interface
*/ */
struct tinfo; struct tinfo;
int t_getent __P((struct tinfo **, const char *)); int t_getent(struct tinfo **, const char *);
int t_getnum __P((struct tinfo *, const char *)); int t_getnum(struct tinfo *, const char *);
int t_getflag __P((struct tinfo *, const char *)); int t_getflag(struct tinfo *, const char *);
char *t_getstr __P((struct tinfo *, const char *, char **, size_t *)); char *t_getstr(struct tinfo *, const char *, char **, size_t *);
char *t_agetstr(struct tinfo *, const char *); char *t_agetstr(struct tinfo *, const char *);
int t_getterm(struct tinfo *, char **, size_t *); int t_getterm(struct tinfo *, char **, size_t *);
int t_goto __P((struct tinfo *, const char *, int, int, char *, size_t)); int t_goto(struct tinfo *, const char *, int, int, char *, size_t);
int t_puts __P((struct tinfo *, const char *, int, int t_puts(struct tinfo *, const char *, int,
void (*)(char, void *), void *)); void (*)(char, void *), void *);
void t_freent __P((struct tinfo *)); void t_freent (struct tinfo *);
int t_setinfo(struct tinfo **, const char *); int t_setinfo(struct tinfo **, const char *);
extern char PC; extern char PC;

View File

@ -1,4 +1,4 @@
/* $NetBSD: tgoto.c,v 1.22 2003/08/07 16:44:57 agc Exp $ */ /* $NetBSD: tgoto.c,v 1.23 2005/02/04 15:52:08 perry Exp $ */
/* /*
* Copyright (c) 1980, 1993 * Copyright (c) 1980, 1993
@ -34,7 +34,7 @@
#if 0 #if 0
static char sccsid[] = "@(#)tgoto.c 8.1 (Berkeley) 6/4/93"; static char sccsid[] = "@(#)tgoto.c 8.1 (Berkeley) 6/4/93";
#else #else
__RCSID("$NetBSD: tgoto.c,v 1.22 2003/08/07 16:44:57 agc Exp $"); __RCSID("$NetBSD: tgoto.c,v 1.23 2005/02/04 15:52:08 perry Exp $");
#endif #endif
#endif /* not lint */ #endif /* not lint */
@ -76,9 +76,7 @@ char *BC;
* all other characters are ``self-inserting''. * all other characters are ``self-inserting''.
*/ */
char * char *
tgoto(CM, destcol, destline) tgoto(const char *CM, int destcol, int destline)
const char *CM;
int destcol, destline;
{ {
static char result[MAXRETURNSIZE]; static char result[MAXRETURNSIZE];
@ -95,13 +93,8 @@ tgoto(CM, destcol, destline)
* returns 0 on success, -1 otherwise. * returns 0 on success, -1 otherwise.
*/ */
int int
t_goto(info, CM, destcol, destline, buffer, limit) t_goto(struct tinfo *info, const char *CM, int destcol, int destline,
struct tinfo *info; char *buffer, size_t limit)
const char *CM;
int destcol;
int destline;
char *buffer;
size_t limit;
{ {
char added[10]; char added[10];
const char *cp = CM; const char *cp = CM;

View File

@ -1,4 +1,4 @@
/* $NetBSD: tputs.c,v 1.21 2003/08/07 16:44:57 agc Exp $ */ /* $NetBSD: tputs.c,v 1.22 2005/02/04 15:52:08 perry Exp $ */
/* /*
* Copyright (c) 1980, 1993 * Copyright (c) 1980, 1993
@ -34,7 +34,7 @@
#if 0 #if 0
static char sccsid[] = "@(#)tputs.c 8.1 (Berkeley) 6/4/93"; static char sccsid[] = "@(#)tputs.c 8.1 (Berkeley) 6/4/93";
#else #else
__RCSID("$NetBSD: tputs.c,v 1.21 2003/08/07 16:44:57 agc Exp $"); __RCSID("$NetBSD: tputs.c,v 1.22 2005/02/04 15:52:08 perry Exp $");
#endif #endif
#endif /* not lint */ #endif /* not lint */
@ -46,7 +46,7 @@ __RCSID("$NetBSD: tputs.c,v 1.21 2003/08/07 16:44:57 agc Exp $");
#undef ospeed #undef ospeed
/* internal functions */ /* internal functions */
int _tputs_convert __P((const char **, int)); int _tputs_convert(const char **, int);
/* /*
* The following array gives the number of tens of milliseconds per * The following array gives the number of tens of milliseconds per
@ -62,9 +62,7 @@ short ospeed;
char PC; char PC;
int int
_tputs_convert(ptr, affcnt) _tputs_convert(const char **ptr, int affcnt)
const char **ptr;
int affcnt;
{ {
int i = 0; int i = 0;
@ -107,10 +105,7 @@ _tputs_convert(ptr, affcnt)
* used to output one character is outc. * used to output one character is outc.
*/ */
void void
tputs(cp, affcnt, outc) tputs(const char *cp, int affcnt, int (*outc)(int))
const char *cp;
int affcnt;
int (*outc) __P((int));
{ {
int i = 0; int i = 0;
int mspc10; int mspc10;
@ -154,12 +149,8 @@ tputs(cp, affcnt, outc)
int int
t_puts(info, cp, affcnt, outc, args) t_puts(struct tinfo *info, const char *cp, int affcnt,
struct tinfo *info; void (*outc)(char, void *), void *args)
const char *cp;
int affcnt;
void (*outc) __P((char, void *));
void *args;
{ {
int i = 0; int i = 0;
size_t limit; size_t limit;