Changeset 203 for trunk


Ignore:
Timestamp:
08/21/10 12:53:19 (14 years ago)
Author:
tim
Message:

misc fixes

stripped _REC from some data type names

Location:
trunk
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/SConstruct

    r201 r203  
    1717# Libraries
    1818libregfi_static = env.Library(lib_src)
    19 libregfi = env.SharedLibrary(lib_src, LIBS=['m','pthread'])
     19libregfi = env.SharedLibrary(lib_src, LIBS=['m','pthread', 'talloc'])
    2020
    2121
  • trunk/include/regfi.h

    r202 r203  
    553553   */
    554554  bool     data_in_offset;
    555 } REGFI_VK_REC;
     555} REGFI_VK;
    556556
    557557
     
    593593  /** The magic number for this record (should be "sk") */
    594594  uint8_t  magic[REGFI_CELL_MAGIC_SIZE];
    595 } REGFI_SK_REC;
     595} REGFI_SK;
    596596
    597597
     
    599599 * @ingroup regfiBase
    600600 */
    601 typedef struct
     601typedef struct _regfi_nk_rec
    602602{
    603603  /** Real offset of this record's cell in the file */
     
    688688  /** Virtual offset of SK record */
    689689  uint32_t sk_off;
    690 } REGFI_NK_REC;
     690} REGFI_NK;
    691691
    692692
     
    719719typedef struct _regfi_file
    720720{
    721   /* Run-time information */
    722   /************************/
    723   /* Functions for accessing the file */
    724   REGFI_RAW_FILE* cb;
    725 
    726   /* Mutex for all cb access.  This is done to prevent one thread from moving
    727    * the file offset while another thread is in the middle of a multi-read
    728    * parsing transaction */
    729   pthread_mutex_t cb_lock;
    730 
    731   /* For sanity checking (not part of the registry header) */
    732   uint32_t file_length;
    733 
    734   /* Metadata about hbins */
    735   range_list* hbins;
    736 
    737   /* Multiple read access allowed, write access is exclusive */
    738   pthread_rwlock_t hbins_lock;
    739 
    740   /* SK record cached since they're repeatedly reused */
    741   lru_cache* sk_cache;
    742 
    743   /* Need exclusive access for LRUs, since lookups make changes */
    744   pthread_mutex_t sk_lock;
    745 
    746721  /* Data parsed from file header */
    747722  /********************************/
     
    794769  uint8_t reserved2[REGFI_REGF_RESERVED2_SIZE];
    795770
     771
     772  /* Run-time information */
     773  /************************/
     774  /* Functions for accessing the file */
     775  REGFI_RAW_FILE* cb;
     776
     777  /* Mutex for all cb access.  This is done to prevent one thread from moving
     778   * the file offset while another thread is in the middle of a multi-read
     779   * parsing transaction */
     780  pthread_mutex_t cb_lock;
     781
     782  /* For sanity checking (not part of the registry header) */
     783  uint32_t file_length;
     784
     785  /* Metadata about hbins */
     786  range_list* hbins;
     787
     788  /* Multiple read access allowed, write access is exclusive */
     789  pthread_rwlock_t hbins_lock;
     790
     791  /* SK record cached since they're repeatedly reused */
     792  lru_cache* sk_cache;
     793
     794  /* Need exclusive access for LRUs, since lookups make changes */
     795  pthread_mutex_t sk_lock;
     796
    796797} REGFI_FILE;
    797798
     
    809810
    810811  /** The current key */
    811   REGFI_NK_REC* cur_key;
     812  REGFI_NK* cur_key;
    812813
    813814  /** The encoding that all strings are converted to as set during iterator
     
    826827typedef struct _regfi_iter_position
    827828{
    828   REGFI_NK_REC* nk;
     829  REGFI_NK* nk;
    829830  uint32_t cur_subkey;
    830831  /* We could store a cur_value here as well, but didn't see
     
    939940/** Frees a record previously returned by one of the API functions.
    940941 *
    941  * Can be used to free REGFI_NK_REC, REGFI_VK_REC, REGFI_SK_REC, REGFI_DATA, and
     942 * Can be used to free REGFI_NK, REGFI_VK, REGFI_SK, REGFI_DATA, and
    942943 * REGFI_CLASSNAME records.
    943944 *
     
    10701071 */
    10711072_EXPORT
    1072 const REGFI_NK_REC* regfi_iterator_cur_key(REGFI_ITERATOR* i);
     1073const REGFI_NK* regfi_iterator_cur_key(REGFI_ITERATOR* i);
    10731074
    10741075
     
    10821083 */
    10831084_EXPORT
    1084 const REGFI_SK_REC* regfi_iterator_cur_sk(REGFI_ITERATOR* i);
     1085const REGFI_SK* regfi_iterator_cur_sk(REGFI_ITERATOR* i);
    10851086
    10861087
     
    11091110 */
    11101111_EXPORT
    1111 const REGFI_NK_REC* regfi_iterator_cur_subkey(REGFI_ITERATOR* i);
     1112const REGFI_NK* regfi_iterator_cur_subkey(REGFI_ITERATOR* i);
    11121113
    11131114
     
    11631164 */
    11641165_EXPORT
    1165 const REGFI_VK_REC* regfi_iterator_cur_value(REGFI_ITERATOR* i);
     1166const REGFI_VK* regfi_iterator_cur_value(REGFI_ITERATOR* i);
    11661167
    11671168
     
    12051206_EXPORT
    12061207const REGFI_CLASSNAME* regfi_iterator_fetch_classname(REGFI_ITERATOR* i,
    1207                                                       const REGFI_NK_REC* key);
     1208                                                      const REGFI_NK* key);
    12081209
    12091210
     
    12201221_EXPORT
    12211222const REGFI_DATA* regfi_iterator_fetch_data(REGFI_ITERATOR* i,
    1222                                             const REGFI_VK_REC* value);
     1223                                            const REGFI_VK* value);
    12231224
    12241225
     
    12371238 */
    12381239_EXPORT
    1239 REGFI_NK_REC* regfi_load_key(REGFI_FILE* file, uint32_t offset,
     1240REGFI_NK* regfi_load_key(REGFI_FILE* file, uint32_t offset,
    12401241                             REGFI_ENCODING output_encoding,
    12411242                             bool strict);
     
    12491250 */
    12501251_EXPORT
    1251 REGFI_VK_REC* regfi_load_value(REGFI_FILE* file, uint32_t offset,
     1252REGFI_VK* regfi_load_value(REGFI_FILE* file, uint32_t offset,
    12521253                               REGFI_ENCODING output_encoding,
    12531254                               bool strict);
     
    13271328 */
    13281329_EXPORT
    1329 const REGFI_SK_REC* regfi_load_sk(REGFI_FILE* file, uint32_t offset,
     1330const REGFI_SK* regfi_load_sk(REGFI_FILE* file, uint32_t offset,
    13301331                                  bool strict);
    13311332
     
    13691370 */
    13701371_EXPORT
    1371 REGFI_NK_REC* regfi_parse_nk(REGFI_FILE* file, uint32_t offset,
     1372REGFI_NK* regfi_parse_nk(REGFI_FILE* file, uint32_t offset,
    13721373                             uint32_t max_size, bool strict);
    13731374
     
    13911392 */
    13921393_EXPORT
    1393 REGFI_VK_REC* regfi_parse_vk(REGFI_FILE* file, uint32_t offset,
     1394REGFI_VK* regfi_parse_vk(REGFI_FILE* file, uint32_t offset,
    13941395                             uint32_t max_size, bool strict);
    13951396
     
    14021403 */
    14031404_EXPORT
    1404 REGFI_SK_REC* regfi_parse_sk(REGFI_FILE* file, uint32_t offset,
     1405REGFI_SK* regfi_parse_sk(REGFI_FILE* file, uint32_t offset,
    14051406                             uint32_t max_size, bool strict);
    14061407
     
    14691470/*    Private Functions                                                       */
    14701471/******************************************************************************/
    1471 REGFI_NK_REC*         regfi_rootkey(REGFI_FILE* file,
     1472REGFI_NK*         regfi_rootkey(REGFI_FILE* file,
    14721473                                    REGFI_ENCODING output_encoding);
    14731474
     
    15051506void                  regfi_add_message(REGFI_FILE* file, uint16_t msg_type,
    15061507                                        const char* fmt, ...);
    1507 REGFI_NK_REC*         regfi_copy_nk(const REGFI_NK_REC* nk);
    1508 REGFI_VK_REC*         regfi_copy_vk(const REGFI_VK_REC* vk);
     1508REGFI_NK*         regfi_copy_nk(const REGFI_NK* nk);
     1509REGFI_VK*         regfi_copy_vk(const REGFI_VK* vk);
    15091510_EXPORT
    15101511int32_t               regfi_calc_maxsize(REGFI_FILE* file, uint32_t offset);
     
    15241525
    15251526_EXPORT
    1526 void regfi_interpret_keyname(REGFI_FILE* file, REGFI_NK_REC* nk,
     1527void regfi_interpret_keyname(REGFI_FILE* file, REGFI_NK* nk,
    15271528                             REGFI_ENCODING output_encoding, bool strict);
    15281529_EXPORT
    1529 void regfi_interpret_valuename(REGFI_FILE* file, REGFI_VK_REC* vk,
     1530void regfi_interpret_valuename(REGFI_FILE* file, REGFI_VK* vk,
    15301531                               REGFI_ENCODING output_encoding, bool strict);
    15311532
  • trunk/lib/regfi.c

    r202 r203  
    833833  }
    834834  else if(buf[0] == 'l' && buf[1] == 'i')
     835  {
    835836    elem_size = sizeof(uint32_t);
     837  }
    836838  else if((buf[0] == 'l') && (buf[1] == 'f' || buf[1] == 'h'))
    837839    elem_size = sizeof(REGFI_SUBKEY_LIST_ELEM);
     
    973975 *
    974976 ******************************************************************************/
    975 REGFI_SK_REC* regfi_parse_sk(REGFI_FILE* file, uint32_t offset, uint32_t max_size,
     977REGFI_SK* regfi_parse_sk(REGFI_FILE* file, uint32_t offset, uint32_t max_size,
    976978                             bool strict)
    977979{
    978   REGFI_SK_REC* ret_val = NULL;
     980  REGFI_SK* ret_val = NULL;
    979981  uint8_t* sec_desc_buf = NULL;
    980982  uint32_t cell_length, length;
     
    10001002  }
    10011003
    1002   ret_val = talloc(NULL, REGFI_SK_REC);
     1004  ret_val = talloc(NULL, REGFI_SK);
    10031005  if(ret_val == NULL)
    10041006    goto fail_locked;
     
    11741176
    11751177
    1176 void regfi_interpret_valuename(REGFI_FILE* file, REGFI_VK_REC* vk,
     1178void regfi_interpret_valuename(REGFI_FILE* file, REGFI_VK* vk,
    11771179                               REGFI_ENCODING output_encoding, bool strict)
    11781180{
     
    12241226/******************************************************************************
    12251227 ******************************************************************************/
    1226 REGFI_VK_REC* regfi_load_value(REGFI_FILE* file, uint32_t offset,
     1228REGFI_VK* regfi_load_value(REGFI_FILE* file, uint32_t offset,
    12271229                               REGFI_ENCODING output_encoding, bool strict)
    12281230{
    1229   REGFI_VK_REC* ret_val = NULL;
     1231  REGFI_VK* ret_val = NULL;
    12301232  int32_t max_size;
    12311233
     
    12701272
    12711273
    1272 void regfi_interpret_keyname(REGFI_FILE* file, REGFI_NK_REC* nk,
     1274void regfi_interpret_keyname(REGFI_FILE* file, REGFI_NK* nk,
    12731275                             REGFI_ENCODING output_encoding, bool strict)
    12741276{
     
    13191321 *
    13201322 ******************************************************************************/
    1321 REGFI_NK_REC* regfi_load_key(REGFI_FILE* file, uint32_t offset,
     1323REGFI_NK* regfi_load_key(REGFI_FILE* file, uint32_t offset,
    13221324                             REGFI_ENCODING output_encoding, bool strict)
    13231325{
    1324   REGFI_NK_REC* nk;
     1326  REGFI_NK* nk;
    13251327  uint32_t off;
    13261328  int32_t max_size;
     
    14101412/******************************************************************************
    14111413 ******************************************************************************/
    1412 const REGFI_SK_REC* regfi_load_sk(REGFI_FILE* file, uint32_t offset, bool strict)
    1413 {
    1414   REGFI_SK_REC* ret_val = NULL;
     1414const REGFI_SK* regfi_load_sk(REGFI_FILE* file, uint32_t offset, bool strict)
     1415{
     1416  REGFI_SK* ret_val = NULL;
    14151417  int32_t max_size;
    14161418  void* failure_ptr = NULL;
     
    14271429
    14281430  /* First look if we have already parsed it */
    1429   ret_val = (REGFI_SK_REC*)lru_cache_find(file->sk_cache, &offset, 4);
     1431  ret_val = (REGFI_SK*)lru_cache_find(file->sk_cache, &offset, 4);
    14301432
    14311433  /* Bail out if we have previously cached a parse failure at this offset. */
     
    14631465/******************************************************************************
    14641466 ******************************************************************************/
    1465 REGFI_NK_REC* regfi_find_root_nk(REGFI_FILE* file, const REGFI_HBIN* hbin,
     1467REGFI_NK* regfi_find_root_nk(REGFI_FILE* file, const REGFI_HBIN* hbin,
    14661468                                 REGFI_ENCODING output_encoding)
    14671469{
    1468   REGFI_NK_REC* nk = NULL;
     1470  REGFI_NK* nk = NULL;
    14691471  uint32_t cell_length;
    14701472  uint32_t cur_offset = hbin->file_off+REGFI_HBIN_HEADER_SIZE;
     
    15761578
    15771579  /* Read file header */
    1578   if ((rb = regfi_parse_regf(file_cb, false)) == NULL) 
     1580  if ((rb = regfi_parse_regf(file_cb, false)) == NULL)
    15791581  {
    15801582    regfi_log_add(REGFI_LOG_ERROR, "Failed to read REGF block.");
    15811583    return NULL;
    15821584  }
    1583   rb->file_length = file_length; 
     1585  rb->file_length = file_length;
    15841586  rb->cb = file_cb;
    15851587
     
    16621664 * rest of the file if that fails.
    16631665 ******************************************************************************/
    1664 REGFI_NK_REC* regfi_rootkey(REGFI_FILE* file, REGFI_ENCODING output_encoding)
    1665 {
    1666   REGFI_NK_REC* nk = NULL;
     1666REGFI_NK* regfi_rootkey(REGFI_FILE* file, REGFI_ENCODING output_encoding)
     1667{
     1668  REGFI_NK* nk = NULL;
    16671669  REGFI_HBIN* hbin;
    16681670  uint32_t root_offset, i, num_hbins;
     
    17181720                                   REGFI_ENCODING output_encoding)
    17191721{
    1720   REGFI_NK_REC* root;
     1722  REGFI_NK* root;
    17211723  REGFI_ITERATOR* ret_val;
    17221724
     
    17731775bool regfi_iterator_down(REGFI_ITERATOR* i)
    17741776{
    1775   REGFI_NK_REC* subkey;
     1777  REGFI_NK* subkey;
    17761778  REGFI_ITER_POSITION* pos;
    17771779
     
    17801782    return false;
    17811783
    1782   subkey = (REGFI_NK_REC*)regfi_iterator_cur_subkey(i);
     1784  subkey = (REGFI_NK*)regfi_iterator_cur_subkey(i);
    17831785  if(subkey == NULL)
    17841786  {
     
    18401842bool regfi_iterator_find_subkey(REGFI_ITERATOR* i, const char* subkey_name)
    18411843{
    1842   REGFI_NK_REC* subkey;
     1844  REGFI_NK* subkey;
    18431845  bool found = false;
    18441846  uint32_t old_subkey = i->cur_subkey;
     
    18991901/******************************************************************************
    19001902 *****************************************************************************/
    1901 const REGFI_NK_REC* regfi_iterator_cur_key(REGFI_ITERATOR* i)
     1903const REGFI_NK* regfi_iterator_cur_key(REGFI_ITERATOR* i)
    19021904{
    19031905  return i->cur_key;
     
    19071909/******************************************************************************
    19081910 *****************************************************************************/
    1909 const REGFI_SK_REC* regfi_iterator_cur_sk(REGFI_ITERATOR* i)
     1911const REGFI_SK* regfi_iterator_cur_sk(REGFI_ITERATOR* i)
    19101912{
    19111913  if(i->cur_key == NULL || i->cur_key->sk_off == REGFI_OFFSET_NONE)
     
    19291931/******************************************************************************
    19301932 *****************************************************************************/
    1931 const REGFI_NK_REC* regfi_iterator_cur_subkey(REGFI_ITERATOR* i)
     1933const REGFI_NK* regfi_iterator_cur_subkey(REGFI_ITERATOR* i)
    19321934{
    19331935  uint32_t nk_offset;
     
    19611963bool regfi_iterator_find_value(REGFI_ITERATOR* i, const char* value_name)
    19621964{
    1963   const REGFI_VK_REC* cur;
     1965  const REGFI_VK* cur;
    19641966  bool found = false;
    19651967  uint32_t old_value = i->cur_value;
     
    20072009/******************************************************************************
    20082010 *****************************************************************************/
    2009 const REGFI_VK_REC* regfi_iterator_cur_value(REGFI_ITERATOR* i)
    2010 {
    2011   REGFI_VK_REC* ret_val = NULL;
     2011const REGFI_VK* regfi_iterator_cur_value(REGFI_ITERATOR* i)
     2012{
     2013  REGFI_VK* ret_val = NULL;
    20122014  uint32_t voffset;
    20132015
     
    20372039 *****************************************************************************/
    20382040const REGFI_CLASSNAME* regfi_iterator_fetch_classname(REGFI_ITERATOR* i,
    2039                                                       const REGFI_NK_REC* key)
     2041                                                      const REGFI_NK* key)
    20402042{
    20412043  REGFI_CLASSNAME* ret_val;
     
    21012103 *****************************************************************************/
    21022104const REGFI_DATA* regfi_iterator_fetch_data(REGFI_ITERATOR* i,
    2103                                             const REGFI_VK_REC* value)
     2105                                            const REGFI_VK* value)
    21042106{
    21052107  REGFI_DATA* ret_val = NULL;
     
    25652567/*******************************************************************
    25662568 *******************************************************************/
    2567 REGFI_NK_REC* regfi_parse_nk(REGFI_FILE* file, uint32_t offset,
    2568                              uint32_t max_size, bool strict)
     2569REGFI_NK* regfi_parse_nk(REGFI_FILE* file, uint32_t offset,
     2570                         uint32_t max_size, bool strict)
    25692571{
    25702572  uint8_t nk_header[REGFI_NK_MIN_LENGTH];
    2571   REGFI_NK_REC* ret_val;
     2573  REGFI_NK* ret_val;
    25722574  uint32_t length,cell_length;
    25732575  bool unalloc = false;
    25742576
    2575   ret_val = talloc(NULL, REGFI_NK_REC);
     2577  ret_val = talloc(NULL, REGFI_NK);
    25762578  if(ret_val == NULL)
    25772579  {
     
    27842786/******************************************************************************
    27852787*******************************************************************************/
    2786 REGFI_VK_REC* regfi_parse_vk(REGFI_FILE* file, uint32_t offset,
     2788REGFI_VK* regfi_parse_vk(REGFI_FILE* file, uint32_t offset,
    27872789                             uint32_t max_size, bool strict)
    27882790{
    2789   REGFI_VK_REC* ret_val;
     2791  REGFI_VK* ret_val;
    27902792  uint8_t vk_header[REGFI_VK_MIN_LENGTH];
    27912793  uint32_t raw_data_size, length, cell_length;
    27922794  bool unalloc = false;
    27932795
    2794   ret_val = talloc(NULL, REGFI_VK_REC);
     2796  ret_val = talloc(NULL, REGFI_VK);
    27952797  if(ret_val == NULL)
    27962798    goto fail;
  • trunk/python2/regfi/pyregfi.h

    r202 r203  
    3737struct TreeIterator_t;
    3838
    39 BIND_STRUCT(REGFI_NK_REC)
    40 BIND_STRUCT(REGFI_VK_REC)
     39BIND_STRUCT(REGFI_NK)
     40BIND_STRUCT(REGFI_VK)
    4141BIND_STRUCT(REGFI_DATA)
    4242
     
    4444CLASS(RawData, Object)
    4545    const REGFI_DATA *data;
    46     const REGFI_VK_REC *rec;
     46    const REGFI_VK *rec;
    4747
    48     RawData METHOD(RawData, Con, REGFI_DATA *data, REGFI_VK_REC *record);
     48    RawData METHOD(RawData, Con, REGFI_DATA *data, REGFI_VK *record);
    4949
    5050    /** Return the raw buffer as a string. By default we only return
     
    7373                                   char **path, REGFI_ENCODING encoding);
    7474
    75 /*     struct ValueIterator_t *METHOD(TreeIterator, list_values);*/
    76 
    7775     void METHOD(TreeIterator, __iter__);
    7876     struct RegistryKey_t *METHOD(TreeIterator, iternext);
    7977
     78
    8079     int METHOD(TreeIterator, down);
    8180     int METHOD(TreeIterator, up);
     81
     82     struct RegistryKey_t *METHOD(TreeIterator, current);
     83     int METHOD(TreeIterator, to_root);
     84
    8285END_CLASS
    8386
     
    8689CLASS(RegistryKey, Object)
    8790     struct RegistryFile_t *file;
    88      const REGFI_NK_REC *key;      /* XXX: temporary */
     91     const REGFI_NK *key;
    8992
    9093     struct RegistryKey_t *METHOD(RegistryKey, Con,
    91                                   struct RegistryFile_t *file, REGFI_NK_REC *base_key);
     94                                  struct RegistryFile_t *file, REGFI_NK *base_key);
    9295
    9396     struct SubkeyIterator_t *METHOD(RegistryKey, subkeys);
     
    104107     
    105108     SubkeyIterator METHOD(SubkeyIterator, Con,
    106                            struct RegistryFile_t *file, REGFI_NK_REC *key);
     109                           struct RegistryFile_t *file, REGFI_NK *key);
    107110
    108111     void METHOD(SubkeyIterator, __iter__);
     
    119122     
    120123     ValueIterator METHOD(ValueIterator, Con,
    121                           struct RegistryFile_t *file, REGFI_NK_REC *key);
     124                          struct RegistryFile_t *file, REGFI_NK *key);
    122125
    123126     void METHOD(ValueIterator, __iter__);
    124      REGFI_VK_REC *METHOD(ValueIterator, iternext);
     127     REGFI_VK *METHOD(ValueIterator, iternext);
    125128END_CLASS
    126129
  • trunk/python2/regfi/regfi.c

    r202 r203  
    8282
    8383static RegistryKey RegistryKey_Con(RegistryKey self,
    84                                    RegistryFile file, REGFI_NK_REC* base_key)
     84                                   RegistryFile file, REGFI_NK* base_key)
    8585{
    8686  if(base_key == NULL)
     
    191191}
    192192
    193 
    194193static int TreeIterator_down(TreeIterator self)
    195194{
     
    205204}
    206205
    207 /*
    208 static ValueIterator TreeIterator_list_values(TreeIterator self)
    209 {
    210   return CONSTRUCT(ValueIterator, ValueIterator, Con, NULL, self);
    211 }
    212 */
     206static RegistryKey TreeIterator_current(TreeIterator self)
     207{
     208  return CONSTRUCT(RegistryKey, RegistryKey, Con, NULL, self->file,
     209                   regfi_iterator_cur_key(self->iter));
     210}
     211
     212static int TreeIterator_to_root(TreeIterator self)
     213{
     214  return regfi_iterator_to_root(self->iter);
     215}
     216
    213217
    214218VIRTUAL(TreeIterator, Object) {
     
    217221  VMETHOD(down) = TreeIterator_down;
    218222  VMETHOD(up) = TreeIterator_up;
     223  VMETHOD(current) = TreeIterator_current;
     224  VMETHOD(to_root) = TreeIterator_to_root;
    219225  VMETHOD(__iter__) = TreeIterator__iter__;
    220226  /*  VMETHOD(list_values) = TreeIterator_list_values;*/
     
    234240static SubkeyIterator SubkeyIterator_Con(SubkeyIterator self,
    235241                                         struct RegistryFile_t* file,
    236                                          REGFI_NK_REC* key)
     242                                         REGFI_NK* key)
    237243{
    238244  /* XXX: add a talloc reference? */
     
    256262static RegistryKey SubkeyIterator_iternext(SubkeyIterator self)
    257263{
    258   const REGFI_NK_REC* nk;
    259 
    260   if(self->cur < self->list->num_keys)
     264  const REGFI_NK* nk;
     265
     266  if(self->list != NULL && self->cur < self->list->num_keys)
    261267  {
    262268    /* XXX: can we switch to UTF-8 and have Python properly import that? */
     
    291297static ValueIterator ValueIterator_Con(ValueIterator self,
    292298                                       struct RegistryFile_t* file,
    293                                        REGFI_NK_REC* key)
     299                                       REGFI_NK* key)
    294300{
    295301  /* XXX: add a talloc reference? */
     
    312318}
    313319
    314 static REGFI_VK_REC* ValueIterator_iternext(ValueIterator self)
    315 {
    316   const REGFI_VK_REC* vk;
     320static REGFI_VK* ValueIterator_iternext(ValueIterator self)
     321{
     322  const REGFI_VK* vk;
    317323
    318324  if(self->list != NULL && self->cur < self->list->num_values)
     
    386392}
    387393
    388 static RawData RawData_Con(RawData self, REGFI_DATA *data, REGFI_VK_REC *record)
     394static RawData RawData_Con(RawData self, REGFI_DATA *data, REGFI_VK *record)
    389395{
    390396  self->rec = record;
  • trunk/src/common.c

    r186 r203  
    320320
    321321
    322 static char* get_quoted_keyname(const REGFI_NK_REC* nk)
     322static char* get_quoted_keyname(const REGFI_NK* nk)
    323323{
    324324  char* ret_val;
     
    333333
    334334
    335 static char* get_quoted_valuename(const REGFI_VK_REC* vk)
     335static char* get_quoted_valuename(const REGFI_VK* vk)
    336336{
    337337  char* ret_val;
  • trunk/src/reglookup-recover.c

    r185 r203  
    6767
    6868/* XXX: Somewhere in here, need to start looking for and handling classnames */
    69 void printKey(REGFI_FILE* f, REGFI_NK_REC* nk, const char* prefix)
     69void printKey(REGFI_FILE* f, REGFI_NK* nk, const char* prefix)
    7070{
    7171  char mtime[24];
     
    103103
    104104
    105 void printValue(REGFI_FILE* f, REGFI_VK_REC* vk, const char* prefix)
     105void printValue(REGFI_FILE* f, REGFI_VK* vk, const char* prefix)
    106106{
    107107  char* quoted_value = NULL;
     
    181181
    182182
    183 void printSK(REGFI_FILE* f, REGFI_SK_REC* sk)
     183void printSK(REGFI_FILE* f, REGFI_SK* sk)
    184184{
    185185  char* quoted_raw = NULL;
     
    246246 *      repeatedly.  Should try to add caching.
    247247 */
    248 char* getParentPath(REGFI_FILE* f, REGFI_NK_REC* nk)
     248char* getParentPath(REGFI_FILE* f, REGFI_NK* nk)
    249249{
    250250  void_stack* path_stack = void_stack_new(REGFI_MAX_DEPTH);
    251   REGFI_NK_REC* cur_ancestor;
     251  REGFI_NK* cur_ancestor;
    252252  char* ret_val;
    253253  uint32_t virt_offset, i, stack_size, ret_val_size, ret_val_used, offset;
     
    410410{
    411411  const range_list_element* cur_elem;
    412   REGFI_VK_REC* vk;
     412  REGFI_VK* vk;
    413413  uint32_t i, j;
    414414
     
    453453{
    454454  const range_list_element* cur_elem;
    455   REGFI_VK_REC* vk;
     455  REGFI_VK* vk;
    456456  range_list* bd_cells;
    457457  REGFI_BUFFER data;
     
    469469  {
    470470    cur_elem = range_list_get(unalloc_values, i);
    471     vk = (REGFI_VK_REC*)cur_elem->data;
     471    vk = (REGFI_VK*)cur_elem->data;
    472472    if(vk == NULL)
    473473      return 11;
     
    588588{
    589589  const range_list_element* cur_elem;
    590   REGFI_NK_REC* key;
     590  REGFI_NK* key;
    591591  uint32_t i, j;
    592592  int error_code = 0;
     
    640640                      range_list* unalloc_linked_values)
    641641{
    642   REGFI_NK_REC* nk;
    643   REGFI_VK_REC* vk;
     642  REGFI_NK* nk;
     643  REGFI_VK* vk;
    644644  const range_list_element* cur_elem;
    645645  uint32_t i, j, num_keys, off, values_length;
     
    732732{
    733733  const range_list_element* cur_elem;
    734   REGFI_SK_REC* sk;
     734  REGFI_SK* sk;
    735735  uint32_t i, j;
    736736
     
    782782  char* tmp_name;
    783783  char* tmp_path;
    784   REGFI_NK_REC* tmp_key;
    785   REGFI_VK_REC* tmp_value;
     784  REGFI_NK* tmp_key;
     785  REGFI_VK* tmp_value;
    786786  uint32_t argi, arge, i, j, ret, num_unalloc_keys;
    787787  int fd;
     
    922922  {
    923923    cur_elem = range_list_get(unalloc_keys, i);
    924     tmp_key = (REGFI_NK_REC*)cur_elem->data;
     924    tmp_key = (REGFI_NK*)cur_elem->data;
    925925
    926926    if(tmp_key == NULL)
     
    936936  {
    937937    cur_elem = range_list_get(unalloc_keys, i);
    938     tmp_key = (REGFI_NK_REC*)cur_elem->data;
     938    tmp_key = (REGFI_NK*)cur_elem->data;
    939939
    940940    printKey(f, tmp_key, parent_paths[i]);
     
    956956      {
    957957        tmp_value =
    958           (REGFI_VK_REC*)range_list_find_data(unalloc_linked_values,
    959                                               tmp_key->values->elements[j]
    960                                               + REGFI_REGF_SIZE);
     958          (REGFI_VK*)range_list_find_data(unalloc_linked_values,
     959                                          tmp_key->values->elements[j]
     960                                          + REGFI_REGF_SIZE);
    961961        if(tmp_value != NULL)
    962962          printValue(f, tmp_value, tmp_path);
     
    973973  {
    974974    cur_elem = range_list_get(unalloc_values, i);
    975     tmp_value = (REGFI_VK_REC*)cur_elem->data;
     975    tmp_value = (REGFI_VK*)cur_elem->data;
    976976
    977977    printValue(f, tmp_value, "");
  • trunk/src/reglookup.c

    r199 r203  
    5252
    5353
    54 void printValue(REGFI_ITERATOR* iter, const REGFI_VK_REC* vk, char* prefix)
     54void printValue(REGFI_ITERATOR* iter, const REGFI_VK* vk, char* prefix)
    5555{
    5656  const REGFI_DATA* data;
     
    205205{
    206206  const REGFI_ITER_POSITION* cur;
    207   const REGFI_NK_REC* tmp_key;
     207  const REGFI_NK* tmp_key;
    208208  uint32_t buf_left = 127;
    209209  uint32_t buf_len = buf_left+1;
     
    275275void printValueList(REGFI_ITERATOR* iter, char* prefix)
    276276{
    277   const REGFI_VK_REC* value;
     277  const REGFI_VK* value;
    278278
    279279  regfi_iterator_first_value(iter);
     
    298298  char mtime[24];
    299299  char* quoted_classname;
    300   const REGFI_SK_REC* sk;
    301   const REGFI_NK_REC* key = regfi_iterator_cur_key(iter);
     300  const REGFI_SK* sk;
     301  const REGFI_NK* key = regfi_iterator_cur_key(iter);
    302302  const REGFI_CLASSNAME* classname;
    303303
     
    371371void printKeyTree(REGFI_ITERATOR* iter)
    372372{
    373   const REGFI_NK_REC* root = NULL;
    374   const REGFI_NK_REC* cur = NULL;
    375   const REGFI_NK_REC* sub = NULL;
     373  const REGFI_NK* root = NULL;
     374  const REGFI_NK* cur = NULL;
     375  const REGFI_NK* sub = NULL;
    376376  char* path = NULL;
    377377  int key_type = regfi_type_str2val("KEY");
     
    460460int retrievePath(REGFI_ITERATOR* iter, char** path)
    461461{
    462   const REGFI_VK_REC* value;
     462  const REGFI_VK* value;
    463463  char* tmp_path_joined;
    464464  const char** tmp_path;
Note: See TracChangeset for help on using the changeset viewer.