1
0
mirror of git://projects.qi-hardware.com/eda-tools.git synced 2024-11-30 10:45:53 +02:00
eda-tools/b2/relop.h

48 lines
963 B
C
Raw Normal View History

/*
* relop.h - Relational operators
*
* Copyright 2012 by Werner Almesberger
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*/
#ifndef RELOP_H
#define RELOP_H
#include <stdio.h>
enum relop_idx {
idx_lt = 0,
idx_le = 1,
idx_eq = 2,
idx_ge = 3,
idx_gt = 4,
idx_n = 5
};
enum relop {
rel_lt = 1 << idx_lt,
rel_le = 1 << idx_le,
rel_eq = 1 << idx_eq,
rel_ge = 1 << idx_ge,
rel_gt = 1 << idx_gt,
};
/*
* relop_unreachable checks whether, for all X: !(X opb A) -> !(X opa B)
*/
int relop_unreachable(enum relop opa, enum relop opb,
const void *a, const void *b,
int (*cmp)(const void *a, enum relop op, const void *b, const void *user),
const void *user);
void dump_relop(FILE *file, enum relop op);
#endif /* !RELOP_H */