shrub/gen164/4/by_get.c

60 lines
1.5 KiB
C
Raw Normal View History

2013-09-29 00:21:18 +04:00
/* j/4/by_get.c
**
** This file is in the public domain.
*/
#include "all.h"
#include "../pit.h"
/* functions
*/
u2_noun // transfer
2014-08-20 08:30:55 +04:00
j2_mcc(Pt4, by, get)(
2013-09-29 00:21:18 +04:00
u2_noun a, // retain
u2_noun b) // retain
{
if ( u2_nul == a ) {
return u2_nul;
}
else {
u2_noun l_a, n_a, r_a;
u2_noun pn_a, qn_a;
2014-08-20 08:30:55 +04:00
if ( (u2_no == u2_cr_trel(a, &n_a, &l_a, &r_a)) ||
(u2_no == u2_cr_cell(n_a, &pn_a, &qn_a) ) )
2013-09-29 00:21:18 +04:00
{
2014-08-20 08:30:55 +04:00
return u2_cm_bail(c3__exit);
2013-09-29 00:21:18 +04:00
}
else {
2014-08-20 08:30:55 +04:00
if ( (u2_yes == u2_cr_sing(b, pn_a)) ) {
return u2nc(u2_nul, u2k(qn_a));
}
2013-09-29 00:21:18 +04:00
else {
2014-08-20 08:30:55 +04:00
if ( u2_yes == j2_mbc(Pt3, gor)(b, pn_a) ) {
return j2_mcc(Pt4, by, get)(l_a, b);
}
2014-08-20 08:30:55 +04:00
else return j2_mcc(Pt4, by, get)(r_a, b);
2013-09-29 00:21:18 +04:00
}
}
}
}
u2_weak // transfer
2014-08-20 08:30:55 +04:00
j2_mc(Pt4, by, get)(
2013-09-29 00:21:18 +04:00
u2_noun cor) // retain
{
u2_noun a, b;
2014-08-20 08:30:55 +04:00
if ( u2_no == u2_cr_mean(cor, u2_cv_sam, &b, u2_cv_con_sam, &a, 0) ) {
return u2_cm_bail(c3__exit);
2013-09-29 00:21:18 +04:00
} else {
2014-08-20 08:30:55 +04:00
return j2_mcc(Pt4, by, get)(a, b);
2013-09-29 00:21:18 +04:00
}
}
/* structures
*/
u2_ho_jet
2013-09-29 00:21:18 +04:00
j2_mcj(Pt4, by, get)[] = {
{ ".2", c3__lite, j2_mc(Pt4, by, get), Tier4, u2_none, u2_none },
{ }
};