tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: [PATCH] style(5): No struct typedefs




> On Jul 12, 2023, at 5:25 AM, Mouse <mouse%Rodents-Montreal.ORG@localhost> wrote:
> 
> [paragraph-length-line damage repaired manually]
> 
>> What about something like <sys/typedefs/whatever.h> and
>> <sys/impl/whatever_impl.h>?  The type definitions go into the former
>> header file, [...]
> 
> Well, I don't like the "typedefs" name,

Yah, I don't like it either, but.. :-)

> because as I see it the divide
> you're sketching here (which I support, in general) is the divide
> between interface and implementation, and in some cases the interface
> is more than just the typedefs.

Sort of.

<sys/typedefs/vnode.h>  // contains the "vnode_t" opaque type definition
<sys/impl/vnode_impl.h> // contains the guts of "struct vnode" and the other implementation details

<sys/mount.h>  // Contains some of the file system interfaces, some of which use vnode_t
<sys/vnode.h>  // Contains the vnode interfaces, which definitely use vnode_t

The latter if the two would each include <sys/typedefs/vnode.h>.

Feel free to pick a better name, but that's the idea.

-- thorpej



Home | Main Index | Thread Index | Old Index