aboutsummaryrefslogtreecommitdiffstats
path: root/libnormalform_make_binary__.c
diff options
context:
space:
mode:
authorMattias Andrée <m@maandree.se>2026-06-01 19:07:14 +0200
committerMattias Andrée <m@maandree.se>2026-06-01 19:07:14 +0200
commit77ade8d20906fe9ca2cf6788ff1e1437e0912868 (patch)
tree61495e90e057bf792bb1d8ce157cef0ecc2ab696 /libnormalform_make_binary__.c
parentFirst commit (diff)
downloadlibnormalform-77ade8d20906fe9ca2cf6788ff1e1437e0912868.tar.gz
libnormalform-77ade8d20906fe9ca2cf6788ff1e1437e0912868.tar.bz2
libnormalform-77ade8d20906fe9ca2cf6788ff1e1437e0912868.tar.xz
Second commitHEADmaster
Signed-off-by: Mattias Andrée <m@maandree.se>
Diffstat (limited to 'libnormalform_make_binary__.c')
-rw-r--r--libnormalform_make_binary__.c31
1 files changed, 31 insertions, 0 deletions
diff --git a/libnormalform_make_binary__.c b/libnormalform_make_binary__.c
new file mode 100644
index 0000000..11bc0e1
--- /dev/null
+++ b/libnormalform_make_binary__.c
@@ -0,0 +1,31 @@
+/* See LICENSE file for copyright and license details. */
+#include "common.h"
+#ifndef TEST
+
+
+struct expression *
+(libnormalform_make_binary__)(int invert_left, struct expression *left,
+ int invert_right, struct expression *right, enum libnormalform_term_type type)
+{
+ struct expression *ret;
+ ret = malloc(sizeof(*ret));
+ if (!ret)
+ return NULL;
+ *ret = EXPRESSION_INIT(type);
+ ret->nterms = 2;
+ ret->terms = malloc(2 * sizeof(*ret->terms));
+ if (!ret->terms) {
+ free(ret);
+ return NULL;
+ }
+ (ret->terms[0] = left)->invert ^= (unsigned char)invert_left;
+ (ret->terms[1] = right)->invert ^= (unsigned char)invert_right;
+ return ret;
+}
+
+
+#else
+
+TODO_TEST
+
+#endif