Changeset 249 for trunk/include


Ignore:
Timestamp:
05/04/11 10:55:22 (13 years ago)
Author:
tim
Message:

reorganized iterator code for simpler locking and easier future key caching

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/regfi.h

    r238 r249  
    653653  REGFI_NTTIME mtime;
    654654
    655   /** Length of keyname_raw */
     655  /** Length of name_raw */
    656656  uint16_t name_length;
    657657
     
    827827
    828828
     829typedef struct _regfi_iter_position
     830{
     831  /* key offset */
     832  uint32_t offset;
     833
     834  /* Index of the current subkey */
     835  uint32_t cur_subkey;
     836
     837  /* Index of the current value */
     838  uint32_t cur_value;
     839
     840  /* The number of subkeys of this key */
     841  uint32_t num_subkeys;
     842
     843  /* The number of values of this key */
     844  uint32_t num_values;
     845
     846} REGFI_ITER_POSITION;
     847
     848
    829849/** Registry hive iterator
    830850 * @ingroup regfiIteratorLayer
     
    838858  void_stack* key_positions;
    839859
    840   /** The current key */
    841   REGFI_NK* cur_key;
    842 
    843   /** Index of the current subkey */
    844   uint32_t cur_subkey;
    845 
    846   /** Index of the current value */
    847   uint32_t cur_value;
     860  REGFI_ITER_POSITION* cur;
    848861} REGFI_ITERATOR;
    849862
    850 
    851 typedef struct _regfi_iter_position
    852 {
    853   REGFI_NK* nk;
    854   uint32_t cur_subkey;
    855   /* We could store a cur_value here as well, but didn't see
    856    * the use in it right now.
    857    */
    858 } REGFI_ITER_POSITION;
    859863
    860864
     
    14051409_EXPORT()
    14061410bool regfi_iterator_find_value(REGFI_ITERATOR* i, const char* name);
     1411
     1412
     1413/** Returns the full path where the iterator is currently located as a list
     1414 *  of NK records
     1415 *
     1416 * @param i     the iterator
     1417 *
     1418 * @return An array of NK record pointers terminated by a NULL pointer. 
     1419 *         This array may be passed directly to regfi_free_record to free
     1420 *         the entire array. 
     1421 *
     1422 * @note In order to use an element of the array independently from the
     1423 *       array (that is, to hold a pointer to an individual NK record while
     1424 *       freeing the remaining array), callers must first use
     1425 *       regfi_reference_record on the elements to be kept.
     1426 *
     1427 * @ingroup regfiIteratorLayer
     1428 */
     1429_EXPORT()
     1430const REGFI_NK** regfi_iterator_cur_path(REGFI_ITERATOR* i);
    14071431
    14081432
Note: See TracChangeset for help on using the changeset viewer.