From 77ade8d20906fe9ca2cf6788ff1e1437e0912868 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Mon, 1 Jun 2026 19:07:14 +0200 Subject: Second commit MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- libnormalform_make_binary__.c | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 libnormalform_make_binary__.c (limited to 'libnormalform_make_binary__.c') 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 -- cgit v1.3.1