diff options
author | Shawn O. Pearce <spearce@spearce.org> | 2008-10-31 18:30:22 -0700 |
---|---|---|
committer | Shawn O. Pearce <spearce@spearce.org> | 2008-10-31 18:30:43 -0700 |
commit | 6dafd0566786a417cfe1131ab804b162fcc79d15 (patch) | |
tree | af55d0cdeb280af2db8697e5afa506e081012719 /CONVENTIONS | |
parent | 6533aadc21270052d8d05835b1e30d8b13a2f164 (diff) | |
download | libgit2-6dafd0566786a417cfe1131ab804b162fcc79d15.tar.gz |
Document the return NULL style of calling convention
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Diffstat (limited to 'CONVENTIONS')
-rw-r--r-- | CONVENTIONS | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/CONVENTIONS b/CONVENTIONS index e3c672819..ea9fa2b55 100644 --- a/CONVENTIONS +++ b/CONVENTIONS @@ -57,6 +57,18 @@ This permits common POSIX result testing: abort("odb open failed"); ---- +Functions returning a pointer may return NULL instead of an int +if there is only one type of failure (ENOMEM). + +Functions returning a pointer may also return NULL if the common +case needed by the application is strictly success/failure and a +(possibly slower) function exists that the caller can use to get +more detailed information. Parsing common data structures from +on-disk formats is a good example of this pattern; in general a +"corrupt" entity can be treated as though it does not exist but +a more sophisticated "fsck" support function can report how the +entity is malformed. + Documentation Fomatting ----------------------- |