On Mar 3, 2014, at 4:11 PM, Taylor R Campbell <campbell+netbsd-tech-k...@mumble.net> wrote:
> Date: Mon, 3 Mar 2014 15:55:16 +0100 > From: "J. Hannken-Illjes" <hann...@eis.cs.tu-bs.de> > > On Mar 3, 2014, at 3:28 PM, Taylor R Campbell > <campbell+netbsd-tech-k...@mumble.net> wrote: > >> /* mount.h */ >> struct vnode_iterator; /* opaque */ >> >> void vfs_vnode_iterator_init(struct mount *mp, struct vnode_iterator **vip); >> void vfs_vnode_iterator_destroy(struct vnode_iterator *vi); >> bool vfs_vnode_iterator_next(struct vnode_iterator *vi, struct vnode **vpp); >> >> /* vfs_mount.c */ >> struct vnode_iterator { >> struct vnode vi_vnode; >> }; > > No. I want to keep the state opaque to the caller. There is no need for > the calling party to know anything about state internals. > > That is exactly what I was going for, except with a typed pointer > instead of a void pointer. Please explain in more detail why you prefer a typed pointer over a void pointer for opaque data. What is the benefit? -- J. Hannken-Illjes - hann...@eis.cs.tu-bs.de - TU Braunschweig (Germany)