de-__P() and use ANSI function declarations.

This commit is contained in:
rpaulo 2005-09-02 21:26:47 +00:00
parent aede7f6775
commit 3f51653817

View File

@ -1,4 +1,4 @@
/* $NetBSD: pstat.c,v 1.90 2005/08/19 02:09:50 christos Exp $ */ /* $NetBSD: pstat.c,v 1.91 2005/09/02 21:26:47 rpaulo Exp $ */
/*- /*-
* Copyright (c) 1980, 1991, 1993, 1994 * Copyright (c) 1980, 1991, 1993, 1994
@ -39,7 +39,7 @@ __COPYRIGHT("@(#) Copyright (c) 1980, 1991, 1993, 1994\n\
#if 0 #if 0
static char sccsid[] = "@(#)pstat.c 8.16 (Berkeley) 5/9/95"; static char sccsid[] = "@(#)pstat.c 8.16 (Berkeley) 5/9/95";
#else #else
__RCSID("$NetBSD: pstat.c,v 1.90 2005/08/19 02:09:50 christos Exp $"); __RCSID("$NetBSD: pstat.c,v 1.91 2005/09/02 21:26:47 rpaulo Exp $");
#endif #endif
#endif /* not lint */ #endif /* not lint */
@ -156,35 +156,33 @@ struct flagbit_desc {
} while (/* CONSTCOND */0) } while (/* CONSTCOND */0)
#endif #endif
void filemode __P((void)); void filemode(void);
int getfiles __P((char **, int *, char **)); int getfiles(char **, int *, char **);
int getflags __P((const struct flagbit_desc *, char *, u_int)); int getflags(const struct flagbit_desc *, char *, u_int);
struct mount * struct mount *
getmnt __P((struct mount *)); getmnt(struct mount *);
char * kinfo_vnodes __P((int *)); char * kinfo_vnodes(int *);
void layer_header __P((void)); void layer_header(void);
int layer_print __P((struct vnode *, int)); int layer_print(struct vnode *, int);
char * loadvnodes __P((int *)); char * loadvnodes(int *);
int main __P((int, char **)); int main(int, char **);
void mount_print __P((struct mount *)); void mount_print(struct mount *);
void nfs_header __P((void)); void nfs_header(void);
int nfs_print __P((struct vnode *, int)); int nfs_print(struct vnode *, int);
void ttymode __P((void)); void ttymode(void);
void ttyprt __P((struct tty *)); void ttyprt(struct tty *);
void ufs_header __P((void)); void ufs_header(void);
int ufs_print __P((struct vnode *, int)); int ufs_print(struct vnode *, int);
int ext2fs_print __P((struct vnode *, int)); int ext2fs_print(struct vnode *, int);
void union_header __P((void)); void union_header(void);
int union_print __P((struct vnode *, int)); int union_print(struct vnode *, int);
void usage __P((void)); void usage(void);
void vnode_header __P((void)); void vnode_header(void);
int vnode_print __P((struct vnode *, struct vnode *)); int vnode_print(struct vnode *, struct vnode *);
void vnodemode __P((void)); void vnodemode(void);
int int
main(argc, argv) main(int argc, char *argv[])
int argc;
char *argv[];
{ {
int ch, i, quit, ret; int ch, i, quit, ret;
int fileflag, swapflag, ttyflag, vnodeflag; int fileflag, swapflag, ttyflag, vnodeflag;
@ -286,14 +284,13 @@ main(argc, argv)
in hexadecimal. */ in hexadecimal. */
void void
vnodemode() vnodemode(void)
{ {
char *e_vnodebase, *endvnode, *evp; char *e_vnodebase, *endvnode, *evp;
struct vnode *vp; struct vnode *vp;
struct mount *maddr, *mp; struct mount *maddr, *mp;
int numvnodes, ovflw; int numvnodes, ovflw;
int (*vnode_fsprint) int (*vnode_fsprint) (struct vnode *, int); /* per-fs data printer */
__P((struct vnode *, int)); /* per-fs data printer */
mp = NULL; mp = NULL;
e_vnodebase = loadvnodes(&numvnodes); e_vnodebase = loadvnodes(&numvnodes);
@ -353,10 +350,7 @@ vnodemode()
} }
int int
getflags(fd, p, flags) getflags(const struct flagbit_desc *fd, char *p, u_int flags)
const struct flagbit_desc *fd;
char *p;
u_int flags;
{ {
char *q = p; char *q = p;
@ -390,7 +384,7 @@ const struct flagbit_desc vnode_flags[] = {
}; };
void void
vnode_header() vnode_header(void)
{ {
(void)printf("%-*s TYP VFLAG USE HOLD TAG NPAGE", (void)printf("%-*s TYP VFLAG USE HOLD TAG NPAGE",
@ -398,9 +392,7 @@ vnode_header()
} }
int int
vnode_print(avnode, vp) vnode_print(struct vnode *avnode, struct vnode *vp)
struct vnode *avnode;
struct vnode *vp;
{ {
char *type, flags[sizeof(vnode_flags) / sizeof(vnode_flags[0])]; char *type, flags[sizeof(vnode_flags) / sizeof(vnode_flags[0])];
int ovflw; int ovflw;
@ -462,16 +454,14 @@ const struct flagbit_desc ufs_flags[] = {
}; };
void void
ufs_header() ufs_header(void)
{ {
(void)printf(" FILEID IFLAG RDEV|SZ"); (void)printf(" FILEID IFLAG RDEV|SZ");
} }
int int
ufs_print(vp, ovflw) ufs_print(struct vnode *vp, int ovflw)
struct vnode *vp;
int ovflw;
{ {
struct inode inode, *ip = &inode; struct inode inode, *ip = &inode;
union dinode { union dinode {
@ -518,9 +508,7 @@ ufs_print(vp, ovflw)
} }
int int
ext2fs_print(vp, ovflw) ext2fs_print(struct vnode *vp, int ovflw)
struct vnode *vp;
int ovflw;
{ {
struct inode inode, *ip = &inode; struct inode inode, *ip = &inode;
char flags[sizeof(ufs_flags) / sizeof(ufs_flags[0])]; char flags[sizeof(ufs_flags) / sizeof(ufs_flags[0])];
@ -566,16 +554,14 @@ const struct flagbit_desc nfs_flags[] = {
}; };
void void
nfs_header() nfs_header(void)
{ {
(void)printf(" FILEID NFLAG RDEV|SZ"); (void)printf(" FILEID NFLAG RDEV|SZ");
} }
int int
nfs_print(vp, ovflw) nfs_print(struct vnode *vp, int ovflw)
struct vnode *vp;
int ovflw;
{ {
struct nfsnode nfsnode, *np = &nfsnode; struct nfsnode nfsnode, *np = &nfsnode;
char flags[sizeof(nfs_flags) / sizeof(nfs_flags[0])]; char flags[sizeof(nfs_flags) / sizeof(nfs_flags[0])];
@ -613,16 +599,14 @@ nfs_print(vp, ovflw)
} }
void void
layer_header() layer_header(void)
{ {
(void)printf(" %*s", PTRSTRWIDTH, "LOWER"); (void)printf(" %*s", PTRSTRWIDTH, "LOWER");
} }
int int
layer_print(vp, ovflw) layer_print(struct vnode *vp, int ovflw)
struct vnode *vp;
int ovflw;
{ {
struct layer_node lnode, *lp = &lnode; struct layer_node lnode, *lp = &lnode;
@ -633,16 +617,14 @@ layer_print(vp, ovflw)
} }
void void
union_header() union_header(void)
{ {
(void)printf(" %*s %*s", PTRSTRWIDTH, "UPPER", PTRSTRWIDTH, "LOWER"); (void)printf(" %*s %*s", PTRSTRWIDTH, "UPPER", PTRSTRWIDTH, "LOWER");
} }
int int
union_print(vp, ovflw) union_print(struct vnode *vp, int ovflw)
struct vnode *vp;
int ovflw;
{ {
struct union_node unode, *up = &unode; struct union_node unode, *up = &unode;
@ -658,8 +640,7 @@ union_print(vp, ovflw)
* read it in and return a usable pointer to it. * read it in and return a usable pointer to it.
*/ */
struct mount * struct mount *
getmnt(maddr) getmnt(struct mount *maddr)
struct mount *maddr;
{ {
static struct mtab { static struct mtab {
struct mtab *next; struct mtab *next;
@ -681,8 +662,7 @@ getmnt(maddr)
} }
void void
mount_print(mp) mount_print(struct mount *mp)
struct mount *mp;
{ {
int flags; int flags;
@ -707,8 +687,7 @@ mount_print(mp)
} }
char * char *
loadvnodes(avnodes) loadvnodes(int *avnodes)
int *avnodes;
{ {
int mib[2]; int mib[2];
size_t copysize; size_t copysize;
@ -739,8 +718,7 @@ loadvnodes(avnodes)
* simulate what a running kernel does in in kinfo_vnode * simulate what a running kernel does in in kinfo_vnode
*/ */
char * char *
kinfo_vnodes(avnodes) kinfo_vnodes(int *avnodes)
int *avnodes;
{ {
struct mntlist mountlist; struct mntlist mountlist;
struct mount *mp, mount; struct mount *mp, mount;
@ -776,7 +754,7 @@ kinfo_vnodes(avnodes)
} }
void void
ttymode() ttymode(void)
{ {
int ntty; int ntty;
struct ttylist_head tty_head; struct ttylist_head tty_head;
@ -815,8 +793,7 @@ static const struct flagbit_desc ttystates[] = {
}; };
void void
ttyprt(tp) ttyprt(struct tty *tp)
struct tty *tp;
{ {
char state[sizeof(ttystates) / sizeof(ttystates[0]) + 1]; char state[sizeof(ttystates) / sizeof(ttystates[0]) + 1];
char dev[2 + 3 + 1 + 5 + 1]; /* 12bit major + 20bit minor */ char dev[2 + 3 + 1 + 5 + 1]; /* 12bit major + 20bit minor */
@ -877,7 +854,7 @@ static const struct flagbit_desc filemode_flags[] = {
}; };
void void
filemode() filemode(void)
{ {
struct file *fp; struct file *fp;
struct file *addr; struct file *addr;
@ -930,10 +907,7 @@ filemode()
} }
int int
getfiles(abuf, alen, aoffset) getfiles(char **abuf, int *alen, char **aoffset)
char **abuf;
int *alen;
char **aoffset;
{ {
size_t len; size_t len;
int mib[2]; int mib[2];
@ -968,7 +942,7 @@ getfiles(abuf, alen, aoffset)
} }
void void
usage() usage(void)
{ {
(void)fprintf(stderr, (void)fprintf(stderr,