X-Git-Url: https://git.m6w6.name/?p=m6w6%2Fext-psi;a=blobdiff_plain;f=src%2Fcalc.h;h=8e1ea6b01612821b90db5892a9b71f3215d4716f;hp=d294cfbb14dc6057c2ff252911738a74837cf1ad;hb=de4f7cc512bbffb5e71290ac48e659dae5e9601d;hpb=9bcb1df0786a8193d65949c857baaba2f4296e84 diff --git a/src/calc.h b/src/calc.h index d294cfb..8e1ea6b 100644 --- a/src/calc.h +++ b/src/calc.h @@ -27,11 +27,29 @@ #define PSI_CALC_H #include "token.h" -#include "impl_val.h" +#include "types/impl_val.h" + +#define PRIfval "f" +#define PRIdval "lf" +#define PRIldval "Lf" + +typedef token_t (*psi_calc)(token_t t1, impl_val *v1, token_t t2, impl_val *v2, impl_val *res); token_t psi_calc_add(token_t t1, impl_val *v1, token_t t2, impl_val *v2, impl_val *res); token_t psi_calc_sub(token_t t1, impl_val *v1, token_t t2, impl_val *v2, impl_val *res); token_t psi_calc_mul(token_t t1, impl_val *v1, token_t t2, impl_val *v2, impl_val *res); token_t psi_calc_div(token_t t1, impl_val *v1, token_t t2, impl_val *v2, impl_val *res); +token_t psi_calc_mod(token_t t1, impl_val *v1, token_t t2, impl_val *v2, impl_val *res); + +token_t psi_calc_not(token_t t1, impl_val *v1, token_t t2, impl_val *v2, impl_val *res); +token_t psi_calc_bin_not(token_t t1, impl_val *v1, token_t t2, impl_val *v2, impl_val *res); + +token_t psi_calc_bin_lshift(token_t t1, impl_val *v1, token_t t2, impl_val *v2, impl_val *res); +token_t psi_calc_bin_rshift(token_t t1, impl_val *v1, token_t t2, impl_val *v2, impl_val *res); +token_t psi_calc_bin_and(token_t t1, impl_val *v1, token_t t2, impl_val *v2, impl_val *res); +token_t psi_calc_bin_xor(token_t t1, impl_val *v1, token_t t2, impl_val *v2, impl_val *res); +token_t psi_calc_bin_or(token_t t1, impl_val *v1, token_t t2, impl_val *v2, impl_val *res); + +void psi_calc_cast(token_t in_type, impl_val *in_val, token_t out_type, impl_val *out_val); #endif