From d4575c591d6fae32292c9b0a23e44f7f29d935e1 Mon Sep 17 00:00:00 2001 From: Philipp Matthias Schaefer Date: Mon, 29 Feb 2016 20:21:39 +0100 Subject: [PATCH 1/2] Document naming convention for flag types. --- CONVENTIONS.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CONVENTIONS.md b/CONVENTIONS.md index 4e4a4ab233..8e6a37f96a 100644 --- a/CONVENTIONS.md +++ b/CONVENTIONS.md @@ -21,6 +21,8 @@ We do not define integer constants ourselves, but use or reexport them from the We represent sets of constants that are intended to be combined using bitwise operations as parameters to functions by types defined using the `bitflags!` macro from the [bitflags crate][bitflags]. +We name the type for a set of constants whose element's names start with `FOO_` +`FooFlags`. ## Enumerations From 3835777e9302e5962de9982e59d229cc74d24c85 Mon Sep 17 00:00:00 2001 From: Philipp Matthias Schaefer Date: Mon, 29 Feb 2016 20:26:05 +0100 Subject: [PATCH 2/2] Extend section on constants to include functions and structs. --- CONVENTIONS.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/CONVENTIONS.md b/CONVENTIONS.md index 8e6a37f96a..3b0a08754a 100644 --- a/CONVENTIONS.md +++ b/CONVENTIONS.md @@ -10,11 +10,16 @@ of either, feel free to remedy the flaw by opening a pull request with appropriate changes or additions. -## Integer Constants +## libc constants, functions and structs We do not define integer constants ourselves, but use or reexport them from the [libc crate][libc]. +We use the functions exported from [libc][libc] instead of writing our own +`extern` declarations. + +We use the `struct` definitions from [libc][libc] internally instead of writing +our own. ## Bitflags