summaryrefslogtreecommitdiff
path: root/CONTRIBUTING.md
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@gnutls.org>2017-07-14 20:52:49 +0200
committerNikos Mavrogiannopoulos <nmav@redhat.com>2017-07-17 17:08:01 +0200
commit96d8dd8bfa8daa271ddd022270fe7c077952d496 (patch)
treef0d73bf5d1326fe12bd35137d8e13f9327a1cf6a /CONTRIBUTING.md
parent3aa23a31bf4ae26c9d6ab9a8688ad6c410d1a201 (diff)
downloadgnutls-96d8dd8bfa8daa271ddd022270fe7c077952d496.tar.gz
CONTRIBUTING.md: specified rules on boolean functions
Based on suggestion by Hubert Kario. Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
Diffstat (limited to 'CONTRIBUTING.md')
-rw-r--r--CONTRIBUTING.md14
1 files changed, 14 insertions, 0 deletions
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 4b120ba7f1..d3bf37b354 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -139,6 +139,20 @@ error codes are defined in gnutls.h and a description
is available in gnutls_errors.c
+Functions which are intended to return a boolean value should return
+a type of bool, and it is recommended to contain the string '_is_'
+on its function name; e.g.,
+```
+bool _gnutls_is_not_prehashed();
+```
+
+That allows the distinguishing functions that return negative errors
+from boolean functions to both the developer and the compiler. Note
+that in the past the 'unsigned' type was used to distinguish boolean functions
+and several of these still exist.
+
+
+
# Usage of assert()
The assert() macro --not to be confused with gnutls_assert()-- is used