Mon, 11 Apr 2016 15:59:53 +0200 Mike Belopuhov <[email protected]>
> On 11 April 2016 at 15:51, Mark Kettenis <[email protected]> wrote:
> >
> > And prototypes with names in public headers are still an issue.
> >  
> 
> Interesting point.  What's a public header though?
> Are files that end up in /usr/include/dev/pci/ public headers?
> If so, why do we install all of them indiscriminately?

With the risk of quoting the obvious, public here means reusable.

$ mandoc /usr/share/man/man9/style.9 | grep -B1 -A5 -ni prototyp \
> | sed '/83/q'
56-
57:     All functions are prototyped somewhere.
58-
59:     Function prototypes for private functions (i.e., functions not used
60-     elsewhere) go at the top of the first source module.  In userland,
61-     functions local to one source module should be declared ‘static’.  This
62-     should not be done in kernel land since it makes it impossible to use 
the
63-     kernel debugger.
64-
65:     Functions used from other parts of the kernel are prototyped in the
66-     relevant include file.
67-
68-     Functions that are used locally in more than one module go into a
69-     separate header file, e.g., extern.h.
70-
71:     Prototypes should not have variable names associated with the types;
72-     i.e.,
73-
74-           void    function(int);
75-     not:
76-           void    function(int a);
77-
78:     Prototypes may have an extra space after a tab to enable function names
79-     to line up:
80-
81-           static char     *function(int, const char *);
82-           static void      usage(void);
83-

Reply via email to