# C

_Standards and Conventions / Language Profiles_

> Peios coding conventions for C.

Prefer explicit struct names, such as `struct Buffer`, rather than introducing
a typedef solely to omit the `struct` keyword. Allow typedefs when they
provide a useful abstraction, such as an opaque library handle.
Kernel-specific rules remain separately scoped.

Write pointer declarations with the star next to the declared name, as in
`char *name`. Normally declare one variable per statement. Allow compact loop
declarations when their meaning remains clear. Avoid declarations such as
`char* first, second`, where only the first variable is a pointer.

Prefer ordinary functions, including inline functions where appropriate, over
function-like macros. Use function-like macros when preprocessor capabilities
are actually needed. Named constants and conditional compilation remain valid
uses of the preprocessor.

The common formatting and naming defaults apply outside documented repository
exceptions. This means, for example, four spaces and same-line function braces
for ordinary Peios C, but the Linux profile for kernel C.
