aboutsummaryrefslogtreecommitdiffstats
path: root/libnormalform_make_binary__.c
diff options
context:
space:
mode:
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