shrub/gen164/3/mas.c

56 lines
1.1 KiB
C
Raw Normal View History

2013-09-29 00:21:18 +04:00
/* j/3/mas.c
**
** This file is in the public domain.
*/
#include "all.h"
#include "../pit.h"
/* functions
*/
u2_weak // transfer
2014-09-03 07:36:29 +04:00
u2_cqc_mas(
2013-09-29 00:21:18 +04:00
u2_atom a) // retain
{
c3_w b_w;
u2_atom c, d, e, f;
2014-08-20 05:39:48 +04:00
b_w = u2_cr_met(0, a);
2013-09-29 00:21:18 +04:00
if ( b_w < 2 ) {
2014-08-20 05:39:48 +04:00
return u2_cm_bail(c3__exit);
}
2013-09-29 00:21:18 +04:00
else {
2014-09-03 07:36:29 +04:00
c = u2_cqc_bex((b_w - 1));
d = u2_cqc_bex((b_w - 2));
e = u2_cqa_sub(a, c);
f = u2_cqc_con(e, d);
2014-08-20 05:39:48 +04:00
u2z(c);
u2z(d);
u2z(e);
2013-09-29 00:21:18 +04:00
return f;
}
}
u2_weak // transfer
2014-08-20 05:39:48 +04:00
j2_mb(Pt3, mas)(
2013-09-29 00:21:18 +04:00
u2_noun cor) // retain
{
u2_noun a;
2014-08-20 05:39:48 +04:00
if ( (u2_none == (a = u2_cr_at(u2_cv_sam, cor))) ||
(u2_no == u2ud(a)) )
2013-09-29 00:21:18 +04:00
{
2014-08-20 05:39:48 +04:00
return u2_cm_bail(c3__exit);
2013-09-29 00:21:18 +04:00
} else {
2014-09-03 07:36:29 +04:00
return u2_cqc_mas(a);
2013-09-29 00:21:18 +04:00
}
}
/* structures
*/
u2_ho_jet
2013-09-29 00:21:18 +04:00
j2_mbj(Pt3, mas)[] = {
{ ".2", c3__lite, j2_mb(Pt3, mas), Tier3, u2_none, u2_none },
{ }
};