ds 0.10.0
A C library to safely yet efficiently work with UTF-8–encoded, growable dynamic strings.
result.c
Go to the documentation of this file.
1//! @file ds/result.c
2//! @author Avinash Maddikonda (svasssakavi@gmail.com)
3//! @brief Implementation of the @ref ds_result_t "Result" enumeration type,
4//! related constants and functions.
5//! @since 0.6.0
6//! @date 2023-08-01
7
8#include <stdbool.h>
9
10#include "ds/result.h"
11
12bool
14{
15 return self == DS_RESULT_OK;
16}
17
18bool
20{
21 return !ds_result_is_ok (self);
22}
bool ds_result_is_err(ds_result_t const self)
Returns true if self is a DS_RESULT_ERR_* variant.
Definition: result.c:19
bool ds_result_is_ok(ds_result_t const self)
Returns true if self is Ok.
Definition: result.c:13
Declaration of the Result enumeration type, related constants and functions.
ds_result_t
Result is a type that represents either success (Ok) or failure (a DS_RESULT_ERR_* variant).
Definition: result.h:26
@ DS_RESULT_OK
Represents success.
Definition: result.h:28