Example #1
0
/* _http_pox_to_noun(): translate srv/con/req to path noun (pox).
*/
static u3_noun
_http_pox_to_noun(c3_w sev_l, c3_w coq_l, c3_w seq_l)
{
  return
    u3nt(
      u3_blip,
      c3__http,
      u3nq(u3dc("scot", c3_s2('u','v'), sev_l),
           u3dc("scot", c3_s2('u','d'), coq_l),
           u3dc("scot", c3_s2('u','d'), seq_l),
           u3_nul));
}
Example #2
0
/* _http_pox_to_noun(): translate srv/con/req to path noun (pox).
*/
static u2_noun
_http_pox_to_noun(c3_w sev_l, c3_w coq_l, c3_w seq_l)
{
  return
    u2nt(
      c3__iron,
      c3__http,
      u2nq(u2_dc("scot", c3_s2('u','v'), sev_l),
           u2_dc("scot", c3_s2('u','d'), coq_l),
           u2_dc("scot", c3_s2('u','d'), seq_l),
           u2_nul));
}
  /* _cf_path_1: write at/inpath.
  */
  static c3_w
  _cf_path_1(c3_c*   buf_c,
             c3_w    pos_w,
             u2_noun hut)                                         //  retain
  {
    if ( u2_no == u2_cr_du(hut) ) {
      c3_w met_w = u2_cr_met(3, hut);

      if ( buf_c ) u2_cr_bytes(0, met_w, (c3_y*)(buf_c + pos_w), hut);
      return (pos_w + met_w);
    }
    else {
      c3_w met_w  = u2_cr_met(3, u2h(hut));
      c3_w end_w  = _cf_path_1(buf_c, pos_w, u2t(hut));
      u2_noun san = u2h(hut);

      if ( buf_c ) buf_c[end_w] = '/';
      end_w++;

      // little security thing - last ditch
      //
      if ( c3_s2('.', '.') == san ) {
        san = c3_s3('.','.','.');
      }
      if ( buf_c ) u2_cr_bytes(0, met_w, (c3_y*)(buf_c + end_w), san);
      end_w += met_w;

      return end_w;
    }
  }
Example #4
0
File: unix.c Project: esaul/urbit
/* _unix_desk_peek(): peek for ankh.
*/
static u2_noun
_unix_desk_peek(u2_noun hox,
                u2_noun syd,
                u2_noun lok)
{
  u2_noun cay;

  cay = u2_reck_prick
    (u2A, u2nc(c3_s2('c','z'), u2nq(hox, syd, lok, u2_nul)));

  if ( u2_nul == cay ) {
    return u2nt(0, u2_nul, u2_nul);
  } else {
    u2_noun ank = u2k(u2t(cay));

    u2z(cay); return ank;
  }
}