Rizin
unix-like reverse engineering framework and cli tools
bool.c
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: 2021 heersin <teablearcher@gmail.com>
2 // SPDX-License-Identifier: LGPL-3.0-only
3 
5 
11 RZ_API RzILBool *rz_il_bool_new(bool true_or_false) {
12  RzILBool *ret = RZ_NEW0(RzILBool);
13  if (!ret) {
14  return NULL;
15  }
16  ret->b = true_or_false;
17  return ret;
18 }
19 
28  bool result = a->b && b->b;
29  RzILBool *ret = rz_il_bool_new(result);
30  return ret;
31 }
32 
41  bool result = a->b || b->b;
42  RzILBool *ret = rz_il_bool_new(result);
43  return ret;
44 }
45 
54  bool result = a->b != b->b;
55  return rz_il_bool_new(result);
56 }
57 
65  bool result = !a->b;
66  RzILBool *ret = rz_il_bool_new(result);
67  return ret;
68 }
69 
74 RZ_API void rz_il_bool_free(RzILBool *bool_var) {
75  if (!bool_var) {
76  return;
77  }
78  free(bool_var);
79 }
RZ_API RzILBool * rz_il_bool_xor(RZ_NONNULL RzILBool *a, RZ_NONNULL RzILBool *b)
Definition: bool.c:52
RZ_API RzILBool * rz_il_bool_and(RZ_NONNULL RzILBool *a, RZ_NONNULL RzILBool *b)
Definition: bool.c:26
RZ_API RzILBool * rz_il_bool_new(bool true_or_false)
Definition: bool.c:11
RZ_API RzILBool * rz_il_bool_not(RZ_NONNULL RzILBool *a)
Definition: bool.c:63
RZ_API RzILBool * rz_il_bool_or(RZ_NONNULL RzILBool *a, RZ_NONNULL RzILBool *b)
Definition: bool.c:39
RZ_API void rz_il_bool_free(RzILBool *bool_var)
Definition: bool.c:74
#define RZ_API
#define NULL
Definition: cris-opc.c:27
RZ_API void Ht_() free(HtName_(Ht) *ht)
Definition: ht_inc.c:130
#define rz_return_val_if_fail(expr, val)
Definition: rz_assert.h:108
#define RZ_NEW0(x)
Definition: rz_types.h:284
#define RZ_NONNULL
Definition: rz_types.h:64
#define b(i)
Definition: sha256.c:42
#define a(i)
Definition: sha256.c:41
bool b
Definition: bool.h:15