mirror of
https://github.com/ilyakooo0/urbit.git
synced 2024-12-01 03:23:09 +03:00
Refactor peek.
This commit is contained in:
parent
e7ae289002
commit
2f83452f42
@ -640,7 +640,7 @@
|
||||
/* u2_reck_peek(): query the reck namespace (protected).
|
||||
*/
|
||||
u2_noun
|
||||
u2_reck_peek(u2_reck* rec_u, u2_noun our, u2_noun hap);
|
||||
u2_reck_peek(u2_reck* rec_u, u2_noun hap);
|
||||
|
||||
/* u2_reck_keep(): measure timer.
|
||||
*/
|
||||
@ -655,7 +655,7 @@
|
||||
/* u2_reck_prick(): query the reck namespace (unprotected).
|
||||
*/
|
||||
u2_noun
|
||||
u2_reck_prick(u2_reck* rec_u, u2_noun our, u2_noun hap);
|
||||
u2_reck_prick(u2_reck* rec_u, u2_noun hap);
|
||||
|
||||
/* u2_reck_kick(): handle effect.
|
||||
*/
|
||||
|
12
v/reck.c
12
v/reck.c
@ -57,10 +57,10 @@ _reck_nock_poke(u2_reck* rec_u, u2_noun ovo)
|
||||
/* _reck_nock_peek(): call peek through hardcoded interface.
|
||||
*/
|
||||
static u2_noun
|
||||
_reck_nock_peek(u2_reck* rec_u, u2_noun our, u2_noun hap)
|
||||
_reck_nock_peek(u2_reck* rec_u, u2_noun hap)
|
||||
{
|
||||
u2_noun fun = u2_cn_nock(u2k(rec_u->roc), u2k(u2_cx_at(87, rec_u->roc)));
|
||||
u2_noun sam = u2nt(our, u2k(rec_u->now), hap);
|
||||
u2_noun sam = u2nc(u2k(rec_u->now), hap);
|
||||
|
||||
return u2_cn_mung(fun, sam);
|
||||
}
|
||||
@ -223,9 +223,9 @@ _reck_time_bump(u2_reck* rec_u)
|
||||
/* u2_reck_peek(): query the reck namespace (protected).
|
||||
*/
|
||||
u2_noun
|
||||
u2_reck_peek(u2_reck* rec_u, u2_noun our, u2_noun hap)
|
||||
u2_reck_peek(u2_reck* rec_u, u2_noun hap)
|
||||
{
|
||||
return _reck_nock_peek(rec_u, our, hap);
|
||||
return _reck_nock_peek(rec_u, hap);
|
||||
}
|
||||
|
||||
/* u2_reck_keep(): measure timer.
|
||||
@ -857,7 +857,7 @@ u2_reck_http_request(u2_reck* rec_u, u2_bean sec, u2_noun pox, u2_noun req)
|
||||
/* u2_reck_prick(): query the reck namespace (unprotected).
|
||||
*/
|
||||
u2_noun
|
||||
u2_reck_prick(u2_reck* rec_u, u2_noun our, u2_noun hap)
|
||||
u2_reck_prick(u2_reck* rec_u, u2_noun hap)
|
||||
{
|
||||
u2_noun hoe;
|
||||
u2_noun que;
|
||||
@ -871,7 +871,7 @@ u2_reck_prick(u2_reck* rec_u, u2_noun our, u2_noun hap)
|
||||
return u2_nul;
|
||||
}
|
||||
else {
|
||||
que = u2_reck_peek(rec_u, our, hap);
|
||||
que = u2_reck_peek(rec_u, hap);
|
||||
u2_cm_done();
|
||||
|
||||
u2_cm_purge();
|
||||
|
16
v/unix.c
16
v/unix.c
@ -734,15 +734,14 @@ _unix_dir_ankh(u2_udir* dir_u)
|
||||
/* _unix_desk_peek(): peek for ankh.
|
||||
*/
|
||||
static u2_noun
|
||||
_unix_desk_peek(u2_noun who,
|
||||
u2_noun hox,
|
||||
_unix_desk_peek(u2_noun hox,
|
||||
u2_noun syd,
|
||||
u2_noun lok)
|
||||
{
|
||||
u2_noun cay;
|
||||
|
||||
cay = u2_reck_prick
|
||||
(u2A, who, u2nc(c3_s2('c','z'), u2nq(hox, syd, lok, u2_nul)));
|
||||
(u2A, u2nc(c3_s2('c','z'), u2nq(hox, syd, lok, u2_nul)));
|
||||
|
||||
if ( u2_nul == cay ) {
|
||||
return u2nt(0, u2_nul, u2_nul);
|
||||
@ -764,7 +763,7 @@ _unix_desk_sync_into(u2_noun who,
|
||||
u2_noun xun, bur, doz, fav, pax;
|
||||
|
||||
xun = _unix_dir_ankh(dir_u);
|
||||
bur = _unix_desk_peek(u2k(who), hox, u2k(syd), u2k(u2A->wen));
|
||||
bur = _unix_desk_peek(hox, u2k(syd), u2k(u2A->wen));
|
||||
|
||||
if ( u2_no == u2_sing(xun, bur) ) {
|
||||
doz = u2_dc("cost", xun, bur);
|
||||
@ -1041,8 +1040,7 @@ _unix_desk_sync_soba(u2_udir* dir_u, u2_noun doz)
|
||||
/* _unix_desk_sync_ergo(): sync desk changes to unix.
|
||||
*/
|
||||
static void
|
||||
_unix_desk_sync_ergo(u2_noun who,
|
||||
u2_noun hox,
|
||||
_unix_desk_sync_ergo(u2_noun hox,
|
||||
u2_noun syd,
|
||||
u2_noun lok,
|
||||
u2_uhot* hot_u)
|
||||
@ -1066,7 +1064,7 @@ _unix_desk_sync_ergo(u2_noun who,
|
||||
}
|
||||
|
||||
{
|
||||
u2_noun bur = _unix_desk_peek(who, hox, syd, lok);
|
||||
u2_noun bur = _unix_desk_peek(hox, syd, lok);
|
||||
|
||||
if ( u2_no == u2_sing(xun, bur) ) {
|
||||
u2_noun doz = u2_dc("cost", bur, xun);
|
||||
@ -1104,10 +1102,10 @@ u2_unix_ef_ergo(u2_noun who,
|
||||
u2_noun lok = u2_dc("scot", c3__ud, rel);
|
||||
u2_uhot* hot_u;
|
||||
|
||||
hot_u = _unix_home(u2k(who));
|
||||
hot_u = _unix_home(who);
|
||||
|
||||
if ( 0 != hot_u ) {
|
||||
_unix_desk_sync_ergo(who, hox, syd, lok, hot_u);
|
||||
_unix_desk_sync_ergo(hox, syd, lok, hot_u);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user