2013-09-29 00:21:18 +04:00
|
|
|
/* j/4/in_tap.c
|
|
|
|
**
|
|
|
|
** This file is in the public domain.
|
|
|
|
*/
|
|
|
|
#include "all.h"
|
2014-09-04 07:10:43 +04:00
|
|
|
|
2013-09-29 00:21:18 +04:00
|
|
|
|
|
|
|
/* functions
|
|
|
|
*/
|
2014-09-04 01:33:18 +04:00
|
|
|
static u2_noun
|
2014-08-20 08:30:55 +04:00
|
|
|
_tap_in(
|
2014-09-04 01:33:18 +04:00
|
|
|
u2_noun a,
|
|
|
|
u2_noun b)
|
2013-09-29 00:21:18 +04:00
|
|
|
{
|
|
|
|
if ( u2_nul == a ) {
|
|
|
|
return b;
|
|
|
|
} else {
|
|
|
|
u2_noun l_a, n_a, r_a;
|
|
|
|
|
2014-08-20 08:30:55 +04:00
|
|
|
if ( (u2_no == u2_cr_trel(a, &n_a, &l_a, &r_a)) ) {
|
|
|
|
u2z(b);
|
|
|
|
return u2_cm_bail(c3__exit);
|
2013-09-29 00:21:18 +04:00
|
|
|
} else {
|
|
|
|
return _tap_in
|
2014-08-20 08:30:55 +04:00
|
|
|
(r_a,
|
|
|
|
u2nc(u2k(n_a),
|
|
|
|
_tap_in(l_a, b)));
|
2013-09-29 00:21:18 +04:00
|
|
|
}
|
2014-04-22 05:22:11 +04:00
|
|
|
}
|
2013-09-29 00:21:18 +04:00
|
|
|
}
|
|
|
|
|
2014-09-04 01:33:18 +04:00
|
|
|
u2_noun
|
2014-09-03 07:36:29 +04:00
|
|
|
u2_cqdi_tap(
|
2014-09-04 01:33:18 +04:00
|
|
|
u2_noun a,
|
|
|
|
u2_noun b)
|
2013-09-29 00:21:18 +04:00
|
|
|
{
|
2014-08-20 08:30:55 +04:00
|
|
|
return _tap_in(a, u2k(b));
|
2013-09-29 00:21:18 +04:00
|
|
|
}
|
2014-09-04 01:33:18 +04:00
|
|
|
u2_noun
|
2014-09-03 09:46:55 +04:00
|
|
|
u2_cwdi_tap(
|
2014-09-04 01:33:18 +04:00
|
|
|
u2_noun cor)
|
2013-09-29 00:21:18 +04:00
|
|
|
{
|
|
|
|
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-09-03 07:36:29 +04:00
|
|
|
return u2_cqdi_tap(a, b);
|
2013-09-29 00:21:18 +04:00
|
|
|
}
|
|
|
|
}
|
2014-09-05 23:55:16 +04:00
|
|
|
u2_noun
|
|
|
|
u2_ckdi_tap(u2_noun a, u2_noun b)
|
|
|
|
{
|
|
|
|
u2_weak c = u2_cqdi_tap(a, b);
|
|
|
|
|
|
|
|
u2z(a); u2z(b);
|
|
|
|
if ( u2_none == c ) {
|
|
|
|
return u2_cm_bail(c3__exit);
|
|
|
|
}
|
|
|
|
else return c;
|
|
|
|
}
|