[BACK]Return to apropos_db.c CVS log [TXT][DIR] Up to [cvsweb.bsd.lv] / mandoc

Diff for /mandoc/Attic/apropos_db.c between version 1.24 and 1.27

version 1.24, 2011/12/16 12:06:35 version 1.27, 2011/12/20 21:41:11
Line 117  static const struct type types[] = {
Line 117  static const struct type types[] = {
         { TYPE_Va, "Va" },          { TYPE_Va, "Va" },
         { TYPE_Va, "Vt" },          { TYPE_Va, "Vt" },
         { TYPE_Xr, "Xr" },          { TYPE_Xr, "Xr" },
         { INT_MAX, "any" },          { UINT64_MAX, "any" },
         { 0, NULL }          { 0, NULL }
 };  };
   
Line 171  btree_read(const DBT *k, const DBT *v, 
Line 171  btree_read(const DBT *k, const DBT *v, 
                 const struct mchars *mc,                  const struct mchars *mc,
                 struct db_val *dbv, char **buf)                  struct db_val *dbv, char **buf)
 {  {
         const struct db_val *vp;          struct db_val    raw_dbv;
   
         /* Are our sizes sane? */          /* Are our sizes sane? */
         if (k->size < 2 || sizeof(struct db_val) != v->size)          if (k->size < 2 || sizeof(struct db_val) != v->size)
Line 181  btree_read(const DBT *k, const DBT *v, 
Line 181  btree_read(const DBT *k, const DBT *v, 
         if ('\0' != ((const char *)k->data)[(int)k->size - 1])          if ('\0' != ((const char *)k->data)[(int)k->size - 1])
                 return(0);                  return(0);
   
         vp = v->data;  
         norm_string((const char *)k->data, mc, buf);          norm_string((const char *)k->data, mc, buf);
         dbv->rec = betoh32(vp->rec);          memcpy(&raw_dbv, v->data, v->size);
         dbv->mask = betoh64(vp->mask);          dbv->rec = betoh32(raw_dbv.rec);
           dbv->mask = betoh64(raw_dbv.mask);
         return(1);          return(1);
 }  }
   
Line 197  btree_read(const DBT *k, const DBT *v, 
Line 197  btree_read(const DBT *k, const DBT *v, 
 static size_t  static size_t
 norm_utf8(unsigned int cp, char out[7])  norm_utf8(unsigned int cp, char out[7])
 {  {
         size_t           rc;          int              rc;
   
         rc = 0;          rc = 0;
   
Line 238  norm_utf8(unsigned int cp, char out[7])
Line 238  norm_utf8(unsigned int cp, char out[7])
                 return(0);                  return(0);
   
         out[rc] = '\0';          out[rc] = '\0';
         return(rc);          return((size_t)rc);
 }  }
   
 /*  /*
Line 380  index_read(const DBT *key, const DBT *val, int index,
Line 380  index_read(const DBT *key, const DBT *val, int index,
                 return(0);                  return(0);
   
         cp = val->data;          cp = val->data;
         rec->res.rec = *(recno_t *)key->data;          assert(sizeof(recno_t) == key->size);
           memcpy(&rec->res.rec, key->data, key->size);
         rec->res.volume = index;          rec->res.volume = index;
   
         if ('d' == (type = *cp++))          if ('d' == (type = *cp++))

Legend:
Removed from v.1.24  
changed lines
  Added in v.1.27

CVSweb