Changeset 252 for trunk/lib


Ignore:
Timestamp:
05/08/11 13:33:49 (13 years ago)
Author:
tim
Message:

updated pyregfi to work with regfi changes
renamed some functions for more clarity
fixed some issues related to talloc_reference

Location:
trunk/lib
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/lru_cache.c

    r250 r252  
    260260    ht->table[hash] = e;
    261261  }
     262  if(ht->talloc_data)
     263    data = talloc_reference(e, data);
    262264  e->data = data;
    263   if(ht->talloc_data)
    264     talloc_reference(e, e->data);
    265265
    266266  /* Finally, let's insert the element to the newest position in the LRU list.*/
  • trunk/lib/regfi.c

    r251 r252  
    17991799/******************************************************************************
    18001800 *****************************************************************************/
    1801 bool regfi_reference_record(REGFI_FILE* file, const void* record)
    1802 {
    1803   bool ret_val = false;
     1801const void* regfi_reference_record(REGFI_FILE* file, const void* record)
     1802{
     1803  const void* ret_val = NULL;
     1804
    18041805  if(!regfi_lock(file, &file->mem_lock, "regfi_reference_record"))
    18051806    return ret_val;
    1806  
    1807   if(talloc_reference(NULL, record) != NULL)
    1808     ret_val = true;
     1807
     1808  ret_val = talloc_reference(NULL, record);
    18091809
    18101810  regfi_unlock(file, &file->mem_lock, "regfi_reference_record");
     
    19331933  if(subkey == NULL)
    19341934  {
    1935     regfi_log_add(REGFI_LOG_WARN, "Could not obtain cur_subkey during"
    1936                   " iterator_down with subkey index (%d) and key offset=%.8X\n",
    1937                   i->cur->cur_subkey, i->cur->offset);
    19381935    talloc_free(pos);
    19391936    return false;
     
    20262023/******************************************************************************
    20272024 *****************************************************************************/
    2028 bool regfi_iterator_walk_path(REGFI_ITERATOR* i, const char** path)
     2025bool regfi_iterator_descend(REGFI_ITERATOR* i, const char** path)
    20292026{
    20302027  uint32_t x;
     
    21752172/******************************************************************************
    21762173 *****************************************************************************/
    2177 const REGFI_NK** regfi_iterator_cur_path(REGFI_ITERATOR* i)
     2174const REGFI_NK** regfi_iterator_ancestry(REGFI_ITERATOR* i)
    21782175{
    21792176  REGFI_NK** ret_val;
     
    22032200  void_stack_iterator_free(iter);
    22042201
    2205   if(!regfi_lock(i->f, &i->f->mem_lock, "regfi_cur_path"))
     2202  if(!regfi_lock(i->f, &i->f->mem_lock, "regfi_iterator_ancestry"))
    22062203  {
    22072204    talloc_free(ret_val);
     
    22122209    talloc_reparent(NULL, ret_val, ret_val[k]);
    22132210
    2214   regfi_unlock(i->f, &i->f->mem_lock, "regfi_cur_path");
     2211  regfi_unlock(i->f, &i->f->mem_lock, "regfi_iterator_ancestry");
    22152212
    22162213  ret_val[k] = NULL;
Note: See TracChangeset for help on using the changeset viewer.