2013-09-29 00:21:18 +04:00
|
|
|
/* j/5/lore.c
|
|
|
|
**
|
|
|
|
*/
|
|
|
|
#include "all.h"
|
2014-09-04 07:10:43 +04:00
|
|
|
|
2013-09-29 00:21:18 +04:00
|
|
|
|
2014-09-06 00:13:24 +04:00
|
|
|
u3_noun
|
2014-11-06 22:13:57 +03:00
|
|
|
u3qe_lore(u3_atom lub)
|
2013-09-29 00:21:18 +04:00
|
|
|
{
|
2014-11-06 03:20:01 +03:00
|
|
|
c3_w len_w = u3r_met(3, lub);
|
2013-09-29 00:21:18 +04:00
|
|
|
c3_w pos_w = 0;
|
2014-09-06 00:13:24 +04:00
|
|
|
u3_noun tez = u3_nul;
|
2013-09-29 00:21:18 +04:00
|
|
|
|
|
|
|
while ( 1 ) {
|
2015-10-28 08:27:24 +03:00
|
|
|
c3_w meg_w = 0;
|
|
|
|
c3_y end_y;
|
2013-09-29 00:21:18 +04:00
|
|
|
|
2015-10-28 08:27:24 +03:00
|
|
|
c3_y byt_y;
|
|
|
|
while ( 1 ) {
|
|
|
|
if ( pos_w >= len_w ) {
|
|
|
|
byt_y = 0;
|
|
|
|
end_y = c3y;
|
|
|
|
break;
|
2013-09-29 00:21:18 +04:00
|
|
|
}
|
2015-10-28 08:27:24 +03:00
|
|
|
byt_y = u3r_byte(pos_w + meg_w, lub);
|
2013-09-29 00:21:18 +04:00
|
|
|
|
2015-10-28 08:27:24 +03:00
|
|
|
if ( (10 == byt_y) || (0 == byt_y) ) {
|
|
|
|
end_y = __(byt_y == 0);
|
|
|
|
break;
|
|
|
|
} else meg_w++;
|
|
|
|
}
|
2014-05-29 00:19:49 +04:00
|
|
|
|
2015-10-28 08:27:24 +03:00
|
|
|
if ((byt_y == 0) && ((pos_w + meg_w + 1) < len_w)) {
|
|
|
|
return u3m_bail(c3__exit);
|
|
|
|
}
|
|
|
|
|
|
|
|
{
|
2018-12-09 04:08:23 +03:00
|
|
|
c3_y* byts_y = 0;
|
|
|
|
|
|
|
|
if ( 0 != meg_w ) {
|
|
|
|
byts_y = alloca(meg_w);
|
|
|
|
u3r_bytes(pos_w, meg_w, byts_y, lub);
|
|
|
|
}
|
2013-09-29 00:21:18 +04:00
|
|
|
|
2015-10-28 08:27:24 +03:00
|
|
|
if ( _(end_y) ) {
|
|
|
|
return u3kb_flop(u3nc(u3i_bytes(meg_w, byts_y), tez));
|
|
|
|
}
|
|
|
|
if ( pos_w >= len_w ) {
|
|
|
|
return u3kb_flop(tez);
|
2013-09-29 00:21:18 +04:00
|
|
|
}
|
2015-10-28 08:27:24 +03:00
|
|
|
tez = u3nc(u3i_bytes(meg_w, byts_y), tez);
|
|
|
|
pos_w += (meg_w + 1);
|
2013-09-29 00:21:18 +04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-09-06 00:13:24 +04:00
|
|
|
u3_noun
|
2014-11-06 22:13:57 +03:00
|
|
|
u3we_lore(u3_noun cor)
|
2013-09-29 00:21:18 +04:00
|
|
|
{
|
2014-09-06 00:13:24 +04:00
|
|
|
u3_noun lub;
|
2013-09-29 00:21:18 +04:00
|
|
|
|
2014-11-18 00:56:51 +03:00
|
|
|
if ( (u3_none == (lub = u3r_at(u3x_sam, cor))) ||
|
2014-11-05 04:18:47 +03:00
|
|
|
(c3n == u3ud(lub)) )
|
2013-09-29 00:21:18 +04:00
|
|
|
{
|
2014-11-06 03:20:01 +03:00
|
|
|
return u3m_bail(c3__fail);
|
2013-09-29 00:21:18 +04:00
|
|
|
} else {
|
2014-11-06 22:13:57 +03:00
|
|
|
return u3qe_lore(lub);
|
2013-09-29 00:21:18 +04:00
|
|
|
}
|
|
|
|
}
|