summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2022-09-01 23:35:15 -0400
committerDavid Robillard <d@drobilla.net>2022-09-02 00:05:26 -0400
commitbb3a59f1eff2ad2ac203d063cb714189955bbc93 (patch)
tree468b9ee9c5e723aa69c56ecdc856e64f738c72f4 /include
parent6dc5d6cd358569f1e9654e0ecd5c385fe508b23d (diff)
downloadzix-bb3a59f1eff2ad2ac203d063cb714189955bbc93.tar.gz
zix-bb3a59f1eff2ad2ac203d063cb714189955bbc93.tar.bz2
zix-bb3a59f1eff2ad2ac203d063cb714189955bbc93.zip
Factor out POSIX-style return pattern
Diffstat (limited to 'include')
-rw-r--r--include/zix/common.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/zix/common.h b/include/zix/common.h
index a097edd..59a61ac 100644
--- a/include/zix/common.h
+++ b/include/zix/common.h
@@ -42,6 +42,11 @@ ZIX_CONST_API
ZixStatus
zix_errno_status(int e);
+/// Return success if `r` is non-zero, or `errno` as a status code otherwise
+ZIX_PURE_API
+ZixStatus
+zix_errno_status_if(int r);
+
/// Function for comparing two elements
typedef int (*ZixComparator)(const void* a,
const void* b,