diff options
| author | Mattias Andrée <m@maandree.se> | 2026-06-01 19:07:14 +0200 |
|---|---|---|
| committer | Mattias Andrée <m@maandree.se> | 2026-06-01 19:07:14 +0200 |
| commit | 77ade8d20906fe9ca2cf6788ff1e1437e0912868 (patch) | |
| tree | 61495e90e057bf792bb1d8ce157cef0ecc2ab696 /libnormalform_contains_clause__.c | |
| parent | First commit (diff) | |
| download | libnormalform-77ade8d20906fe9ca2cf6788ff1e1437e0912868.tar.gz libnormalform-77ade8d20906fe9ca2cf6788ff1e1437e0912868.tar.bz2 libnormalform-77ade8d20906fe9ca2cf6788ff1e1437e0912868.tar.xz | |
Signed-off-by: Mattias Andrée <m@maandree.se>
Diffstat (limited to '')
| -rw-r--r-- | libnormalform_contains_clause__.c | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/libnormalform_contains_clause__.c b/libnormalform_contains_clause__.c new file mode 100644 index 0000000..6736e4a --- /dev/null +++ b/libnormalform_contains_clause__.c @@ -0,0 +1,31 @@ +/* See LICENSE file for copyright and license details. */ +#include "common.h" +#ifndef TEST + + +int +(libnormalform_contains_clause__)(struct expression *this, struct expression *clause, size_t ignore) +{ + size_t i; + int cmp; + if (ignore > this->nterms) + ignore = this->nterms; + for (i = 0; i < ignore; i++) { + cmp = libnormalform_clause_cmp__(clause, this->terms[i]); + if (cmp >= 0) + return !cmp; + } + for (i++; i < this->nterms; i++) { + cmp = libnormalform_clause_cmp__(clause, this->terms[i]); + if (cmp >= 0) + return !cmp; + } + return 0; +} + + +#else + +TODO_TEST + +#endif |
