/* 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