2013-09-29 00:21:18 +04:00
|
|
|
/* j/6/fink.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
|
|
|
|
|
|
|
/* logic
|
|
|
|
*/
|
2014-09-06 00:13:24 +04:00
|
|
|
u3_noun
|
2014-09-03 09:46:55 +04:00
|
|
|
_cqfu_fink(
|
2014-09-06 00:13:24 +04:00
|
|
|
u3_noun van,
|
|
|
|
u3_noun sut,
|
|
|
|
u3_noun dep,
|
|
|
|
u3_noun way,
|
|
|
|
u3_noun cog)
|
2013-09-29 00:21:18 +04:00
|
|
|
{
|
2014-10-03 21:44:08 +04:00
|
|
|
u3_noun dun = u3_cqfu_dunq(van, "type", sut);
|
2014-09-06 00:13:24 +04:00
|
|
|
u3_noun nuc = (u3_blip == cog)
|
|
|
|
? u3_cqfu_shew
|
2014-08-21 01:18:34 +04:00
|
|
|
(van,
|
2014-09-06 00:13:24 +04:00
|
|
|
u3nc
|
|
|
|
(u3nc('c', u3_ci_string("find-limb")),
|
2013-09-29 00:21:18 +04:00
|
|
|
'$'))
|
2014-09-06 00:13:24 +04:00
|
|
|
: u3_cqfu_shep
|
|
|
|
(van, "find-limb", 'a', u3k(cog));
|
|
|
|
u3_noun pro;
|
2013-09-29 00:21:18 +04:00
|
|
|
|
2014-10-03 21:44:08 +04:00
|
|
|
u3_ct_push(u3nc(c3__mean, dun));
|
2014-09-06 00:13:24 +04:00
|
|
|
u3_ct_push(u3nc(c3__mean, nuc));
|
2013-09-29 00:21:18 +04:00
|
|
|
{
|
2014-09-06 00:13:24 +04:00
|
|
|
u3_noun hoq = u3_cqfu_find(van, sut, dep, way, cog);
|
|
|
|
u3_noun fin = u3t(hoq);
|
2013-09-29 00:21:18 +04:00
|
|
|
|
2014-09-06 00:13:24 +04:00
|
|
|
if ( u3_nul == fin ) {
|
2014-10-06 21:17:33 +04:00
|
|
|
u3_cm_p("cog", cog);
|
2014-09-06 00:13:24 +04:00
|
|
|
return u3_cm_error("find-none");
|
2013-09-29 00:21:18 +04:00
|
|
|
}
|
|
|
|
else {
|
2014-09-06 00:13:24 +04:00
|
|
|
pro = u3k(u3t(fin));
|
|
|
|
u3z(hoq);
|
2013-09-29 00:21:18 +04:00
|
|
|
}
|
|
|
|
}
|
2014-09-06 00:13:24 +04:00
|
|
|
u3_ct_drop();
|
2014-10-03 21:44:08 +04:00
|
|
|
u3_ct_drop();
|
2013-09-29 00:21:18 +04:00
|
|
|
|
|
|
|
return pro;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* boilerplate
|
|
|
|
*/
|
2014-09-06 00:13:24 +04:00
|
|
|
u3_noun
|
|
|
|
u3_cwfu_fink(u3_noun cor)
|
2013-09-29 00:21:18 +04:00
|
|
|
{
|
2014-09-06 00:13:24 +04:00
|
|
|
u3_noun sut, dep, way, cog, van;
|
2013-09-29 00:21:18 +04:00
|
|
|
|
2014-11-05 04:18:47 +03:00
|
|
|
if ( (c3n == u3_cr_mean(cor, u3_cv_sam_2, &dep,
|
2014-09-06 00:13:24 +04:00
|
|
|
u3_cv_sam_6, &way,
|
|
|
|
u3_cv_sam_7, &cog,
|
|
|
|
u3_cv_con, &van,
|
2013-09-29 00:21:18 +04:00
|
|
|
0)) ||
|
2014-11-06 02:36:30 +03:00
|
|
|
(u3_none == (sut = u3_cr_at(u3_cv_sam, van))) )
|
2013-09-29 00:21:18 +04:00
|
|
|
{
|
2014-09-06 00:13:24 +04:00
|
|
|
return u3_cm_bail(c3__fail);
|
2013-09-29 00:21:18 +04:00
|
|
|
} else {
|
2014-09-03 09:46:55 +04:00
|
|
|
return _cqfu_fink(van, sut, dep, way, cog);
|
2013-09-29 00:21:18 +04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-09-06 00:13:24 +04:00
|
|
|
u3_noun
|
|
|
|
u3_cqfu_fink(
|
|
|
|
u3_noun van,
|
|
|
|
u3_noun sut,
|
|
|
|
u3_noun dep,
|
|
|
|
u3_noun way,
|
|
|
|
u3_noun cog)
|
2013-09-29 00:21:18 +04:00
|
|
|
{
|
2014-09-03 09:46:55 +04:00
|
|
|
return _cqfu_fink(van, sut, dep, way, cog);
|
2013-09-29 00:21:18 +04:00
|
|
|
}
|