There are four categories of headers: system, global, library, and implementation.
#include <zircon/foo/bar.h>
These headers define the interface between the kernel and userspace, also known as the vDSO interface. These headers define system calls, included related types and structures. These headers also define some basic C and C++ machinery, for example for crashing in a well-defined sequence.
zircon/
, rather than lib/zircon/
.zx
, are not considered system headers. They are library headers (see below) that depend on the system headers..#include <zircon/process.h>
#include <zircon/syscalls/hypervisor.h>
#include <stdint.h>
#include <algorithm>
#include <fuchsia/foo/bar.h>
These headers define system-wide contracts between userspace components. These headers are generated from FIDL definitions of these contracts.
#include <fuchsia/sys/cpp/fidl.h>
#include <fuchsia/sysmem/llcpp/fidl.h>
#include <lib/foo/bar.h>
Library headers are hand-written code that are used by applications. The interfaces they define are local to that application. Some libraries are Fuchsia-specific and provide an ergonomic wrapper around some lower-level system facilities. Some libraries might not be tied directly to Fuchsia.
lib/
directory to help avoid collisions with other header used by applications.lib/
. Subdirectories (lib/foo/
) are mandatory.#include <lib/fit/function.h>
#include <lib/sys/cpp/component_context.h>
#include <lib/zx/event.h>
#include "src/foo/bar.h"
Implementation headers are internal to the Fuchsia Platform Source Tree. They are never included in SDKs and are referenced by absolute path from the root of the source tree.
"
rather than <
to indicate that the path is relative to the root of the source tree.#include "src/ui/scenic/bin/app.h"
#include "src/lib/fxl/observer_list.h"