up

A priority search queue and LRU cache.
git clone git://git.jtobin.io/up.git
Log | Files | Refs

up_qat_put.c (499B)


      1 #include "all.h"
      2 
      3 u3_noun
      4 u3qdu_qat_put(u3_noun a, u3_noun k, u3_noun p, u3_noun v)
      5 {
      6   u3_noun pre = u3qdu_qat_del(a, k);
      7   u3_noun pro = u3qdu_qat_raw(pre, k, p, v);
      8 
      9   u3z(pre);
     10 
     11   return pro;
     12 }
     13 
     14 u3_noun
     15 u3wdu_qat_put(u3_noun cor)
     16 {
     17   u3_noun a, k, p, v;
     18 
     19   if ( (c3n == u3r_mean(cor, u3x_sam_2, &a, u3x_sam_6, &k, u3x_sam_14, &p,
     20                         u3x_sam_15, &v, 0)) ||
     21        (c3n == u3ud(p)) )
     22   {
     23     return u3m_bail(c3__exit);
     24   } else {
     25     return u3qdu_qat_put(a, k, p, v);
     26   }
     27 }
     28 
     29