diff options
author | bde <bde@FreeBSD.org> | 1995-12-03 17:14:38 +0000 |
---|---|---|
committer | bde <bde@FreeBSD.org> | 1995-12-03 17:14:38 +0000 |
commit | 74fff1ae895ae3def1dbed7a222f33cfd91d1c08 (patch) | |
tree | 35669fdc86bcce3106b8953fb6d088edab5cb106 /sys/fs | |
parent | 7d54fff460aa976d599a5456a3b7f53c7e5020ee (diff) | |
download | FreeBSD-src-74fff1ae895ae3def1dbed7a222f33cfd91d1c08.zip FreeBSD-src-74fff1ae895ae3def1dbed7a222f33cfd91d1c08.tar.gz |
Added prototypes.
cd9660_rrip.c:
Added lots of bogus casts to hide type errors exposed by the prototypes.
(Different structs are assumed to have a common prefix.)
cd9660_vnops.c:
Finished staticizing.
Diffstat (limited to 'sys/fs')
-rw-r--r-- | sys/fs/cd9660/cd9660_node.c | 4 | ||||
-rw-r--r-- | sys/fs/cd9660/cd9660_rrip.c | 94 | ||||
-rw-r--r-- | sys/fs/cd9660/cd9660_vnops.c | 13 |
3 files changed, 79 insertions, 32 deletions
diff --git a/sys/fs/cd9660/cd9660_node.c b/sys/fs/cd9660/cd9660_node.c index 7b321a7..e0cea29 100644 --- a/sys/fs/cd9660/cd9660_node.c +++ b/sys/fs/cd9660/cd9660_node.c @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * @(#)cd9660_node.c 8.2 (Berkeley) 1/23/94 - * $Id: cd9660_node.c,v 1.10 1995/03/16 18:12:15 bde Exp $ + * $Id: cd9660_node.c,v 1.11 1995/05/30 08:04:59 rgrimes Exp $ */ #include <sys/param.h> @@ -80,6 +80,8 @@ union iso_dhead { } iso_dhead[DNOHSZ]; #endif +static unsigned cd9660_chars2ui __P((unsigned char *begin, int len)); + /* * Initialize hash links for inodes and dnodes. */ diff --git a/sys/fs/cd9660/cd9660_rrip.c b/sys/fs/cd9660/cd9660_rrip.c index 279b8b2..d745411 100644 --- a/sys/fs/cd9660/cd9660_rrip.c +++ b/sys/fs/cd9660/cd9660_rrip.c @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * @(#)cd9660_rrip.c 8.2 (Berkeley) 1/23/94 - * $Id: cd9660_rrip.c,v 1.7 1995/05/30 08:05:00 rgrimes Exp $ + * $Id: cd9660_rrip.c,v 1.8 1995/11/14 09:37:03 phk Exp $ */ #include <sys/param.h> @@ -57,6 +57,45 @@ #include <isofs/cd9660/cd9660_rrip.h> #include <isofs/cd9660/iso_rrip.h> +typedef int rrt_func_t __P((void *, ISO_RRIP_ANALYZE *ana)); + +typedef struct { + char type[2]; + rrt_func_t *func; + void (*func2) __P((struct iso_directory_record *isodir, ISO_RRIP_ANALYZE *ana)); + int result; +} RRIP_TABLE; + +static int cd9660_rrip_altname __P((ISO_RRIP_ALTNAME *p, + ISO_RRIP_ANALYZE *ana)); +static int cd9660_rrip_attr __P((ISO_RRIP_ATTR *p, ISO_RRIP_ANALYZE *ana)); +static int cd9660_rrip_cont __P((ISO_RRIP_CONT *p, ISO_RRIP_ANALYZE *ana)); +static void cd9660_rrip_defattr __P((struct iso_directory_record *isodir, + ISO_RRIP_ANALYZE *ana)); +static void cd9660_rrip_defname __P((struct iso_directory_record *isodir, + ISO_RRIP_ANALYZE *ana)); +static void cd9660_rrip_deftstamp __P((struct iso_directory_record *isodir, + ISO_RRIP_ANALYZE *ana)); +static int cd9660_rrip_device __P((ISO_RRIP_DEVICE *p, + ISO_RRIP_ANALYZE *ana)); +static int cd9660_rrip_extref __P((ISO_RRIP_EXTREF *p, + ISO_RRIP_ANALYZE *ana)); +static int cd9660_rrip_idflag __P((ISO_RRIP_IDFLAG *p, + ISO_RRIP_ANALYZE *ana)); +static int cd9660_rrip_loop __P((struct iso_directory_record *isodir, + ISO_RRIP_ANALYZE *ana, + RRIP_TABLE *table)); +static int cd9660_rrip_pclink __P((ISO_RRIP_CLINK *p, + ISO_RRIP_ANALYZE *ana)); +static int cd9660_rrip_reldir __P((ISO_RRIP_RELDIR *p, + ISO_RRIP_ANALYZE *ana)); +static int cd9660_rrip_slink __P((ISO_RRIP_SLINK *p, + ISO_RRIP_ANALYZE *ana)); +static int cd9660_rrip_stop __P((ISO_SUSP_HEADER *p, + ISO_RRIP_ANALYZE *ana)); +static int cd9660_rrip_tstamp __P((ISO_RRIP_TSTAMP *p, + ISO_RRIP_ANALYZE *ana)); + /* * POSIX file attribute */ @@ -409,7 +448,7 @@ cd9660_rrip_idflag(p,ana) ana->fields &= isonum_711(p->flags)|~0xff; /* don't touch high bits */ /* special handling of RE field */ if (ana->fields&ISO_SUSP_RELDIR) - return cd9660_rrip_reldir(p,ana); + return cd9660_rrip_reldir(/* XXX */ (ISO_RRIP_RELDIR *)p,ana); return ISO_SUSP_IDFLAG; } @@ -457,13 +496,6 @@ cd9660_rrip_extref(p,ana) return ISO_SUSP_EXTREF; } -typedef struct { - char type[2]; - int (*func)(); - void (*func2)(); - int result; -} RRIP_TABLE; - static int cd9660_rrip_loop(isodir,ana,table) struct iso_directory_record *isodir; @@ -546,13 +578,17 @@ cd9660_rrip_loop(isodir,ana,table) return result; } +/* + * XXX the casts are bogus but will do for now. + */ +#define BC (rrt_func_t *) static RRIP_TABLE rrip_table_analyze[] = { - { "PX", cd9660_rrip_attr, cd9660_rrip_defattr, ISO_SUSP_ATTR }, - { "TF", cd9660_rrip_tstamp, cd9660_rrip_deftstamp, ISO_SUSP_TSTAMP }, - { "PN", cd9660_rrip_device, 0, ISO_SUSP_DEVICE }, - { "RR", cd9660_rrip_idflag, 0, ISO_SUSP_IDFLAG }, - { "CE", cd9660_rrip_cont, 0, ISO_SUSP_CONT }, - { "ST", cd9660_rrip_stop, 0, ISO_SUSP_STOP }, + { "PX", BC cd9660_rrip_attr, cd9660_rrip_defattr, ISO_SUSP_ATTR }, + { "TF", BC cd9660_rrip_tstamp, cd9660_rrip_deftstamp, ISO_SUSP_TSTAMP }, + { "PN", BC cd9660_rrip_device, 0, ISO_SUSP_DEVICE }, + { "RR", BC cd9660_rrip_idflag, 0, ISO_SUSP_IDFLAG }, + { "CE", BC cd9660_rrip_cont, 0, ISO_SUSP_CONT }, + { "ST", BC cd9660_rrip_stop, 0, ISO_SUSP_STOP }, { "", 0, 0, 0 } }; @@ -577,13 +613,13 @@ cd9660_rrip_analyze(isodir,inop,imp) * it will be return the translated ISO9660 name, */ static RRIP_TABLE rrip_table_getname[] = { - { "NM", cd9660_rrip_altname, cd9660_rrip_defname, ISO_SUSP_ALTNAME }, - { "CL", cd9660_rrip_pclink, 0, ISO_SUSP_CLINK|ISO_SUSP_PLINK }, - { "PL", cd9660_rrip_pclink, 0, ISO_SUSP_CLINK|ISO_SUSP_PLINK }, - { "RE", cd9660_rrip_reldir, 0, ISO_SUSP_RELDIR }, - { "RR", cd9660_rrip_idflag, 0, ISO_SUSP_IDFLAG }, - { "CE", cd9660_rrip_cont, 0, ISO_SUSP_CONT }, - { "ST", cd9660_rrip_stop, 0, ISO_SUSP_STOP }, + { "NM", BC cd9660_rrip_altname, cd9660_rrip_defname, ISO_SUSP_ALTNAME }, + { "CL", BC cd9660_rrip_pclink, 0, ISO_SUSP_CLINK|ISO_SUSP_PLINK }, + { "PL", BC cd9660_rrip_pclink, 0, ISO_SUSP_CLINK|ISO_SUSP_PLINK }, + { "RE", BC cd9660_rrip_reldir, 0, ISO_SUSP_RELDIR }, + { "RR", BC cd9660_rrip_idflag, 0, ISO_SUSP_IDFLAG }, + { "CE", BC cd9660_rrip_cont, 0, ISO_SUSP_CONT }, + { "ST", BC cd9660_rrip_stop, 0, ISO_SUSP_STOP }, { "", 0, 0, 0 } }; @@ -624,10 +660,10 @@ cd9660_rrip_getname(isodir,outbuf,outlen,inump,imp) * Note: isodir should contains SL record! */ static RRIP_TABLE rrip_table_getsymname[] = { - { "SL", cd9660_rrip_slink, 0, ISO_SUSP_SLINK }, - { "RR", cd9660_rrip_idflag, 0, ISO_SUSP_IDFLAG }, - { "CE", cd9660_rrip_cont, 0, ISO_SUSP_CONT }, - { "ST", cd9660_rrip_stop, 0, ISO_SUSP_STOP }, + { "SL", BC cd9660_rrip_slink, 0, ISO_SUSP_SLINK }, + { "RR", BC cd9660_rrip_idflag, 0, ISO_SUSP_IDFLAG }, + { "CE", BC cd9660_rrip_cont, 0, ISO_SUSP_CONT }, + { "ST", BC cd9660_rrip_stop, 0, ISO_SUSP_STOP }, { "", 0, 0, 0 } }; @@ -652,9 +688,9 @@ cd9660_rrip_getsymname(isodir,outbuf,outlen,imp) } static RRIP_TABLE rrip_table_extref[] = { - { "ER", cd9660_rrip_extref, 0, ISO_SUSP_EXTREF }, - { "CE", cd9660_rrip_cont, 0, ISO_SUSP_CONT }, - { "ST", cd9660_rrip_stop, 0, ISO_SUSP_STOP }, + { "ER", BC cd9660_rrip_extref, 0, ISO_SUSP_EXTREF }, + { "CE", BC cd9660_rrip_cont, 0, ISO_SUSP_CONT }, + { "ST", BC cd9660_rrip_stop, 0, ISO_SUSP_STOP }, { "", 0, 0, 0 } }; diff --git a/sys/fs/cd9660/cd9660_vnops.c b/sys/fs/cd9660/cd9660_vnops.c index 8c8f724..367ab7e 100644 --- a/sys/fs/cd9660/cd9660_vnops.c +++ b/sys/fs/cd9660/cd9660_vnops.c @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * @(#)cd9660_vnops.c 8.3 (Berkeley) 1/23/94 - * $Id: cd9660_vnops.c,v 1.21 1995/11/12 10:36:19 davidg Exp $ + * $Id: cd9660_vnops.c,v 1.22 1995/11/20 03:57:50 dyson Exp $ */ #include <sys/param.h> @@ -60,6 +60,7 @@ #include <isofs/cd9660/cd9660_node.h> #include <isofs/cd9660/iso_rrip.h> +static int cd9660_setattr __P((struct vop_setattr_args *)); static int cd9660_open __P((struct vop_open_args *)); static int cd9660_close __P((struct vop_close_args *)); static int cd9660_access __P((struct vop_access_args *)); @@ -69,18 +70,26 @@ static int cd9660_ioctl __P((struct vop_ioctl_args *)); static int cd9660_select __P((struct vop_select_args *)); static int cd9660_mmap __P((struct vop_mmap_args *)); static int cd9660_seek __P((struct vop_seek_args *)); +struct isoreaddir; +static int iso_uiodir __P((struct isoreaddir *idp, struct dirent *dp, + off_t off)); +static int iso_shipdir __P((struct isoreaddir *idp)); static int cd9660_readdir __P((struct vop_readdir_args *)); +static int cd9660_readlink __P((struct vop_readlink_args *ap)); static int cd9660_abortop __P((struct vop_abortop_args *)); static int cd9660_lock __P((struct vop_lock_args *)); static int cd9660_unlock __P((struct vop_unlock_args *)); static int cd9660_strategy __P((struct vop_strategy_args *)); static int cd9660_print __P((struct vop_print_args *)); +static int cd9660_enotsupp __P((void)); static int cd9660_islocked __P((struct vop_islocked_args *)); + #if 0 /* * Mknod vnode call * Actually remap the device number */ +static int cd9660_mknod(ndp, vap, cred, p) struct nameidata *ndp; struct ucred *cred; @@ -135,7 +144,7 @@ cd9660_mknod(ndp, vap, cred, p) /* * Setattr call. Only allowed for block and character special devices. */ -int +static int cd9660_setattr(ap) struct vop_setattr_args /* { struct vnodeop_desc *a_desc; |