The following guidelines apply to libraries which are meant to be used extensively, e.g. in an upper layer of the Fuchsia codebase or via an SDK, where “upper layer of the Fuchsia codebase” means “garnet” and above (peridot, topaz, vendor/foo).
There are three categories of headers: system, fuchsia, other.
<zircon/foo/bar.h>
These headers describe kernel interfaces (syscalls, related structs and defines), shared definitions and data structures between kernel and userspace (and bootloader), that are often useful to higher layers as well.
zircon/
.zircon/process.h
zircon/syscalls/hypervisor.h
<fuchsia/foo/bar.h>
These are libraries that define a low level ABI/API in Fuchsia but are not specific to the kernel.
fuchsia/
.fuchsia/fdio/fdio.h
fuchsia/pixelformat.h
<lib/foo/bar.h>
Some libraries in that space are not necessarily Fuchsia-specific, or they may be Fuchsia-specific but do not fall into either of the above categories. We use a rather bland namespace that will likely not cause any collisions in the outside world: “lib”.
lib/
. Subdirectories (lib/foo/
) are mandatory.lib/app/cpp/startup_context.h
lib/fbl/array.h
lib/zx/event.h