|
|
| version 1.5, 2004/02/05 11:51:54 | version 1.6, 2004/02/25 17:35:29 |
|---|---|
| Line 274 to break precedents in the existing code | Line 274 to break precedents in the existing code |
| .Nm | .Nm |
| guidelines. | guidelines. |
| .Pp | .Pp |
| The kernel has a name associated with parameter types, e.g., in the kernel | Function prototypes for the kernel have parameter names associated |
| use: | with parameter types. E.g., in the kernel use: |
| .Bd -literal | .Bd -literal |
| void function(int fd); | void function(int fd); |
| .Ed | .Ed |
| .Pp | .Pp |
| In header files visible to userland applications, prototypes that are | Prototypes that are visible to userland applications |
| visible must use either | should not include parameter names with the types, to avoid |
| .Dq protected | possible collisions with defined macro names. |
| names (ones beginning with an underscore) | I.e., use: |
| or no names with the types. | |
| It is preferable to use protected names. | |
| E.g., use: | |
| .Bd -literal | .Bd -literal |
| void function(int); | void function(int); |
| .Ed | .Ed |
| .Pp | .Pp |
| or: | |
| .Bd -literal | |
| void function(int _fd); | |
| .Ed | |
| .Pp | |
| Prototypes may have an extra space after a tab to enable function names | Prototypes may have an extra space after a tab to enable function names |
| to line up: | to line up: |
| .Bd -literal | .Bd -literal |