]> git.ipfire.org Git - thirdparty/gnutls.git/commitdiff
CONTRIBUTING.md: specified rules on boolean functions
authorNikos Mavrogiannopoulos <nmav@gnutls.org>
Fri, 14 Jul 2017 18:52:49 +0000 (20:52 +0200)
committerNikos Mavrogiannopoulos <nmav@redhat.com>
Mon, 17 Jul 2017 15:08:01 +0000 (17:08 +0200)
Based on suggestion by Hubert Kario.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
CONTRIBUTING.md

index 4b120ba7f1b2b2838e2e57a7edb2e2f86bba66f9..d3bf37b35424feaa3a3260ce90912b35d461ebac 100644 (file)
@@ -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