Changeset 203
- Timestamp:
- 08/21/10 12:53:19 (14 years ago)
- Location:
- trunk
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SConstruct
r201 r203 17 17 # Libraries 18 18 libregfi_static = env.Library(lib_src) 19 libregfi = env.SharedLibrary(lib_src, LIBS=['m','pthread' ])19 libregfi = env.SharedLibrary(lib_src, LIBS=['m','pthread', 'talloc']) 20 20 21 21 -
trunk/include/regfi.h
r202 r203 553 553 */ 554 554 bool data_in_offset; 555 } REGFI_VK _REC;555 } REGFI_VK; 556 556 557 557 … … 593 593 /** The magic number for this record (should be "sk") */ 594 594 uint8_t magic[REGFI_CELL_MAGIC_SIZE]; 595 } REGFI_SK _REC;595 } REGFI_SK; 596 596 597 597 … … 599 599 * @ingroup regfiBase 600 600 */ 601 typedef struct 601 typedef struct _regfi_nk_rec 602 602 { 603 603 /** Real offset of this record's cell in the file */ … … 688 688 /** Virtual offset of SK record */ 689 689 uint32_t sk_off; 690 } REGFI_NK _REC;690 } REGFI_NK; 691 691 692 692 … … 719 719 typedef struct _regfi_file 720 720 { 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 moving727 * the file offset while another thread is in the middle of a multi-read728 * 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 746 721 /* Data parsed from file header */ 747 722 /********************************/ … … 794 769 uint8_t reserved2[REGFI_REGF_RESERVED2_SIZE]; 795 770 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 796 797 } REGFI_FILE; 797 798 … … 809 810 810 811 /** The current key */ 811 REGFI_NK _REC* cur_key;812 REGFI_NK* cur_key; 812 813 813 814 /** The encoding that all strings are converted to as set during iterator … … 826 827 typedef struct _regfi_iter_position 827 828 { 828 REGFI_NK _REC* nk;829 REGFI_NK* nk; 829 830 uint32_t cur_subkey; 830 831 /* We could store a cur_value here as well, but didn't see … … 939 940 /** Frees a record previously returned by one of the API functions. 940 941 * 941 * Can be used to free REGFI_NK _REC, REGFI_VK_REC, REGFI_SK_REC, REGFI_DATA, and942 * Can be used to free REGFI_NK, REGFI_VK, REGFI_SK, REGFI_DATA, and 942 943 * REGFI_CLASSNAME records. 943 944 * … … 1070 1071 */ 1071 1072 _EXPORT 1072 const REGFI_NK _REC* regfi_iterator_cur_key(REGFI_ITERATOR* i);1073 const REGFI_NK* regfi_iterator_cur_key(REGFI_ITERATOR* i); 1073 1074 1074 1075 … … 1082 1083 */ 1083 1084 _EXPORT 1084 const REGFI_SK _REC* regfi_iterator_cur_sk(REGFI_ITERATOR* i);1085 const REGFI_SK* regfi_iterator_cur_sk(REGFI_ITERATOR* i); 1085 1086 1086 1087 … … 1109 1110 */ 1110 1111 _EXPORT 1111 const REGFI_NK _REC* regfi_iterator_cur_subkey(REGFI_ITERATOR* i);1112 const REGFI_NK* regfi_iterator_cur_subkey(REGFI_ITERATOR* i); 1112 1113 1113 1114 … … 1163 1164 */ 1164 1165 _EXPORT 1165 const REGFI_VK _REC* regfi_iterator_cur_value(REGFI_ITERATOR* i);1166 const REGFI_VK* regfi_iterator_cur_value(REGFI_ITERATOR* i); 1166 1167 1167 1168 … … 1205 1206 _EXPORT 1206 1207 const REGFI_CLASSNAME* regfi_iterator_fetch_classname(REGFI_ITERATOR* i, 1207 const REGFI_NK _REC* key);1208 const REGFI_NK* key); 1208 1209 1209 1210 … … 1220 1221 _EXPORT 1221 1222 const REGFI_DATA* regfi_iterator_fetch_data(REGFI_ITERATOR* i, 1222 const REGFI_VK _REC* value);1223 const REGFI_VK* value); 1223 1224 1224 1225 … … 1237 1238 */ 1238 1239 _EXPORT 1239 REGFI_NK _REC* regfi_load_key(REGFI_FILE* file, uint32_t offset,1240 REGFI_NK* regfi_load_key(REGFI_FILE* file, uint32_t offset, 1240 1241 REGFI_ENCODING output_encoding, 1241 1242 bool strict); … … 1249 1250 */ 1250 1251 _EXPORT 1251 REGFI_VK _REC* regfi_load_value(REGFI_FILE* file, uint32_t offset,1252 REGFI_VK* regfi_load_value(REGFI_FILE* file, uint32_t offset, 1252 1253 REGFI_ENCODING output_encoding, 1253 1254 bool strict); … … 1327 1328 */ 1328 1329 _EXPORT 1329 const REGFI_SK _REC* regfi_load_sk(REGFI_FILE* file, uint32_t offset,1330 const REGFI_SK* regfi_load_sk(REGFI_FILE* file, uint32_t offset, 1330 1331 bool strict); 1331 1332 … … 1369 1370 */ 1370 1371 _EXPORT 1371 REGFI_NK _REC* regfi_parse_nk(REGFI_FILE* file, uint32_t offset,1372 REGFI_NK* regfi_parse_nk(REGFI_FILE* file, uint32_t offset, 1372 1373 uint32_t max_size, bool strict); 1373 1374 … … 1391 1392 */ 1392 1393 _EXPORT 1393 REGFI_VK _REC* regfi_parse_vk(REGFI_FILE* file, uint32_t offset,1394 REGFI_VK* regfi_parse_vk(REGFI_FILE* file, uint32_t offset, 1394 1395 uint32_t max_size, bool strict); 1395 1396 … … 1402 1403 */ 1403 1404 _EXPORT 1404 REGFI_SK _REC* regfi_parse_sk(REGFI_FILE* file, uint32_t offset,1405 REGFI_SK* regfi_parse_sk(REGFI_FILE* file, uint32_t offset, 1405 1406 uint32_t max_size, bool strict); 1406 1407 … … 1469 1470 /* Private Functions */ 1470 1471 /******************************************************************************/ 1471 REGFI_NK _REC* regfi_rootkey(REGFI_FILE* file,1472 REGFI_NK* regfi_rootkey(REGFI_FILE* file, 1472 1473 REGFI_ENCODING output_encoding); 1473 1474 … … 1505 1506 void regfi_add_message(REGFI_FILE* file, uint16_t msg_type, 1506 1507 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);1508 REGFI_NK* regfi_copy_nk(const REGFI_NK* nk); 1509 REGFI_VK* regfi_copy_vk(const REGFI_VK* vk); 1509 1510 _EXPORT 1510 1511 int32_t regfi_calc_maxsize(REGFI_FILE* file, uint32_t offset); … … 1524 1525 1525 1526 _EXPORT 1526 void regfi_interpret_keyname(REGFI_FILE* file, REGFI_NK _REC* nk,1527 void regfi_interpret_keyname(REGFI_FILE* file, REGFI_NK* nk, 1527 1528 REGFI_ENCODING output_encoding, bool strict); 1528 1529 _EXPORT 1529 void regfi_interpret_valuename(REGFI_FILE* file, REGFI_VK _REC* vk,1530 void regfi_interpret_valuename(REGFI_FILE* file, REGFI_VK* vk, 1530 1531 REGFI_ENCODING output_encoding, bool strict); 1531 1532 -
trunk/lib/regfi.c
r202 r203 833 833 } 834 834 else if(buf[0] == 'l' && buf[1] == 'i') 835 { 835 836 elem_size = sizeof(uint32_t); 837 } 836 838 else if((buf[0] == 'l') && (buf[1] == 'f' || buf[1] == 'h')) 837 839 elem_size = sizeof(REGFI_SUBKEY_LIST_ELEM); … … 973 975 * 974 976 ******************************************************************************/ 975 REGFI_SK _REC* regfi_parse_sk(REGFI_FILE* file, uint32_t offset, uint32_t max_size,977 REGFI_SK* regfi_parse_sk(REGFI_FILE* file, uint32_t offset, uint32_t max_size, 976 978 bool strict) 977 979 { 978 REGFI_SK _REC* ret_val = NULL;980 REGFI_SK* ret_val = NULL; 979 981 uint8_t* sec_desc_buf = NULL; 980 982 uint32_t cell_length, length; … … 1000 1002 } 1001 1003 1002 ret_val = talloc(NULL, REGFI_SK _REC);1004 ret_val = talloc(NULL, REGFI_SK); 1003 1005 if(ret_val == NULL) 1004 1006 goto fail_locked; … … 1174 1176 1175 1177 1176 void regfi_interpret_valuename(REGFI_FILE* file, REGFI_VK _REC* vk,1178 void regfi_interpret_valuename(REGFI_FILE* file, REGFI_VK* vk, 1177 1179 REGFI_ENCODING output_encoding, bool strict) 1178 1180 { … … 1224 1226 /****************************************************************************** 1225 1227 ******************************************************************************/ 1226 REGFI_VK _REC* regfi_load_value(REGFI_FILE* file, uint32_t offset,1228 REGFI_VK* regfi_load_value(REGFI_FILE* file, uint32_t offset, 1227 1229 REGFI_ENCODING output_encoding, bool strict) 1228 1230 { 1229 REGFI_VK _REC* ret_val = NULL;1231 REGFI_VK* ret_val = NULL; 1230 1232 int32_t max_size; 1231 1233 … … 1270 1272 1271 1273 1272 void regfi_interpret_keyname(REGFI_FILE* file, REGFI_NK _REC* nk,1274 void regfi_interpret_keyname(REGFI_FILE* file, REGFI_NK* nk, 1273 1275 REGFI_ENCODING output_encoding, bool strict) 1274 1276 { … … 1319 1321 * 1320 1322 ******************************************************************************/ 1321 REGFI_NK _REC* regfi_load_key(REGFI_FILE* file, uint32_t offset,1323 REGFI_NK* regfi_load_key(REGFI_FILE* file, uint32_t offset, 1322 1324 REGFI_ENCODING output_encoding, bool strict) 1323 1325 { 1324 REGFI_NK _REC* nk;1326 REGFI_NK* nk; 1325 1327 uint32_t off; 1326 1328 int32_t max_size; … … 1410 1412 /****************************************************************************** 1411 1413 ******************************************************************************/ 1412 const REGFI_SK _REC* regfi_load_sk(REGFI_FILE* file, uint32_t offset, bool strict)1413 { 1414 REGFI_SK _REC* ret_val = NULL;1414 const REGFI_SK* regfi_load_sk(REGFI_FILE* file, uint32_t offset, bool strict) 1415 { 1416 REGFI_SK* ret_val = NULL; 1415 1417 int32_t max_size; 1416 1418 void* failure_ptr = NULL; … … 1427 1429 1428 1430 /* 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); 1430 1432 1431 1433 /* Bail out if we have previously cached a parse failure at this offset. */ … … 1463 1465 /****************************************************************************** 1464 1466 ******************************************************************************/ 1465 REGFI_NK _REC* regfi_find_root_nk(REGFI_FILE* file, const REGFI_HBIN* hbin,1467 REGFI_NK* regfi_find_root_nk(REGFI_FILE* file, const REGFI_HBIN* hbin, 1466 1468 REGFI_ENCODING output_encoding) 1467 1469 { 1468 REGFI_NK _REC* nk = NULL;1470 REGFI_NK* nk = NULL; 1469 1471 uint32_t cell_length; 1470 1472 uint32_t cur_offset = hbin->file_off+REGFI_HBIN_HEADER_SIZE; … … 1576 1578 1577 1579 /* Read file header */ 1578 if ((rb = regfi_parse_regf(file_cb, false)) == NULL) 1580 if ((rb = regfi_parse_regf(file_cb, false)) == NULL) 1579 1581 { 1580 1582 regfi_log_add(REGFI_LOG_ERROR, "Failed to read REGF block."); 1581 1583 return NULL; 1582 1584 } 1583 rb->file_length = file_length; 1585 rb->file_length = file_length; 1584 1586 rb->cb = file_cb; 1585 1587 … … 1662 1664 * rest of the file if that fails. 1663 1665 ******************************************************************************/ 1664 REGFI_NK _REC* regfi_rootkey(REGFI_FILE* file, REGFI_ENCODING output_encoding)1665 { 1666 REGFI_NK _REC* nk = NULL;1666 REGFI_NK* regfi_rootkey(REGFI_FILE* file, REGFI_ENCODING output_encoding) 1667 { 1668 REGFI_NK* nk = NULL; 1667 1669 REGFI_HBIN* hbin; 1668 1670 uint32_t root_offset, i, num_hbins; … … 1718 1720 REGFI_ENCODING output_encoding) 1719 1721 { 1720 REGFI_NK _REC* root;1722 REGFI_NK* root; 1721 1723 REGFI_ITERATOR* ret_val; 1722 1724 … … 1773 1775 bool regfi_iterator_down(REGFI_ITERATOR* i) 1774 1776 { 1775 REGFI_NK _REC* subkey;1777 REGFI_NK* subkey; 1776 1778 REGFI_ITER_POSITION* pos; 1777 1779 … … 1780 1782 return false; 1781 1783 1782 subkey = (REGFI_NK _REC*)regfi_iterator_cur_subkey(i);1784 subkey = (REGFI_NK*)regfi_iterator_cur_subkey(i); 1783 1785 if(subkey == NULL) 1784 1786 { … … 1840 1842 bool regfi_iterator_find_subkey(REGFI_ITERATOR* i, const char* subkey_name) 1841 1843 { 1842 REGFI_NK _REC* subkey;1844 REGFI_NK* subkey; 1843 1845 bool found = false; 1844 1846 uint32_t old_subkey = i->cur_subkey; … … 1899 1901 /****************************************************************************** 1900 1902 *****************************************************************************/ 1901 const REGFI_NK _REC* regfi_iterator_cur_key(REGFI_ITERATOR* i)1903 const REGFI_NK* regfi_iterator_cur_key(REGFI_ITERATOR* i) 1902 1904 { 1903 1905 return i->cur_key; … … 1907 1909 /****************************************************************************** 1908 1910 *****************************************************************************/ 1909 const REGFI_SK _REC* regfi_iterator_cur_sk(REGFI_ITERATOR* i)1911 const REGFI_SK* regfi_iterator_cur_sk(REGFI_ITERATOR* i) 1910 1912 { 1911 1913 if(i->cur_key == NULL || i->cur_key->sk_off == REGFI_OFFSET_NONE) … … 1929 1931 /****************************************************************************** 1930 1932 *****************************************************************************/ 1931 const REGFI_NK _REC* regfi_iterator_cur_subkey(REGFI_ITERATOR* i)1933 const REGFI_NK* regfi_iterator_cur_subkey(REGFI_ITERATOR* i) 1932 1934 { 1933 1935 uint32_t nk_offset; … … 1961 1963 bool regfi_iterator_find_value(REGFI_ITERATOR* i, const char* value_name) 1962 1964 { 1963 const REGFI_VK _REC* cur;1965 const REGFI_VK* cur; 1964 1966 bool found = false; 1965 1967 uint32_t old_value = i->cur_value; … … 2007 2009 /****************************************************************************** 2008 2010 *****************************************************************************/ 2009 const REGFI_VK _REC* regfi_iterator_cur_value(REGFI_ITERATOR* i)2010 { 2011 REGFI_VK _REC* ret_val = NULL;2011 const REGFI_VK* regfi_iterator_cur_value(REGFI_ITERATOR* i) 2012 { 2013 REGFI_VK* ret_val = NULL; 2012 2014 uint32_t voffset; 2013 2015 … … 2037 2039 *****************************************************************************/ 2038 2040 const REGFI_CLASSNAME* regfi_iterator_fetch_classname(REGFI_ITERATOR* i, 2039 const REGFI_NK _REC* key)2041 const REGFI_NK* key) 2040 2042 { 2041 2043 REGFI_CLASSNAME* ret_val; … … 2101 2103 *****************************************************************************/ 2102 2104 const REGFI_DATA* regfi_iterator_fetch_data(REGFI_ITERATOR* i, 2103 const REGFI_VK _REC* value)2105 const REGFI_VK* value) 2104 2106 { 2105 2107 REGFI_DATA* ret_val = NULL; … … 2565 2567 /******************************************************************* 2566 2568 *******************************************************************/ 2567 REGFI_NK _REC* regfi_parse_nk(REGFI_FILE* file, uint32_t offset,2568 2569 REGFI_NK* regfi_parse_nk(REGFI_FILE* file, uint32_t offset, 2570 uint32_t max_size, bool strict) 2569 2571 { 2570 2572 uint8_t nk_header[REGFI_NK_MIN_LENGTH]; 2571 REGFI_NK _REC* ret_val;2573 REGFI_NK* ret_val; 2572 2574 uint32_t length,cell_length; 2573 2575 bool unalloc = false; 2574 2576 2575 ret_val = talloc(NULL, REGFI_NK _REC);2577 ret_val = talloc(NULL, REGFI_NK); 2576 2578 if(ret_val == NULL) 2577 2579 { … … 2784 2786 /****************************************************************************** 2785 2787 *******************************************************************************/ 2786 REGFI_VK _REC* regfi_parse_vk(REGFI_FILE* file, uint32_t offset,2788 REGFI_VK* regfi_parse_vk(REGFI_FILE* file, uint32_t offset, 2787 2789 uint32_t max_size, bool strict) 2788 2790 { 2789 REGFI_VK _REC* ret_val;2791 REGFI_VK* ret_val; 2790 2792 uint8_t vk_header[REGFI_VK_MIN_LENGTH]; 2791 2793 uint32_t raw_data_size, length, cell_length; 2792 2794 bool unalloc = false; 2793 2795 2794 ret_val = talloc(NULL, REGFI_VK _REC);2796 ret_val = talloc(NULL, REGFI_VK); 2795 2797 if(ret_val == NULL) 2796 2798 goto fail; -
trunk/python2/regfi/pyregfi.h
r202 r203 37 37 struct TreeIterator_t; 38 38 39 BIND_STRUCT(REGFI_NK _REC)40 BIND_STRUCT(REGFI_VK _REC)39 BIND_STRUCT(REGFI_NK) 40 BIND_STRUCT(REGFI_VK) 41 41 BIND_STRUCT(REGFI_DATA) 42 42 … … 44 44 CLASS(RawData, Object) 45 45 const REGFI_DATA *data; 46 const REGFI_VK _REC*rec;46 const REGFI_VK *rec; 47 47 48 RawData METHOD(RawData, Con, REGFI_DATA *data, REGFI_VK _REC*record);48 RawData METHOD(RawData, Con, REGFI_DATA *data, REGFI_VK *record); 49 49 50 50 /** Return the raw buffer as a string. By default we only return … … 73 73 char **path, REGFI_ENCODING encoding); 74 74 75 /* struct ValueIterator_t *METHOD(TreeIterator, list_values);*/76 77 75 void METHOD(TreeIterator, __iter__); 78 76 struct RegistryKey_t *METHOD(TreeIterator, iternext); 79 77 78 80 79 int METHOD(TreeIterator, down); 81 80 int METHOD(TreeIterator, up); 81 82 struct RegistryKey_t *METHOD(TreeIterator, current); 83 int METHOD(TreeIterator, to_root); 84 82 85 END_CLASS 83 86 … … 86 89 CLASS(RegistryKey, Object) 87 90 struct RegistryFile_t *file; 88 const REGFI_NK _REC *key; /* XXX: temporary */91 const REGFI_NK *key; 89 92 90 93 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); 92 95 93 96 struct SubkeyIterator_t *METHOD(RegistryKey, subkeys); … … 104 107 105 108 SubkeyIterator METHOD(SubkeyIterator, Con, 106 struct RegistryFile_t *file, REGFI_NK _REC*key);109 struct RegistryFile_t *file, REGFI_NK *key); 107 110 108 111 void METHOD(SubkeyIterator, __iter__); … … 119 122 120 123 ValueIterator METHOD(ValueIterator, Con, 121 struct RegistryFile_t *file, REGFI_NK _REC*key);124 struct RegistryFile_t *file, REGFI_NK *key); 122 125 123 126 void METHOD(ValueIterator, __iter__); 124 REGFI_VK _REC*METHOD(ValueIterator, iternext);127 REGFI_VK *METHOD(ValueIterator, iternext); 125 128 END_CLASS 126 129 -
trunk/python2/regfi/regfi.c
r202 r203 82 82 83 83 static RegistryKey RegistryKey_Con(RegistryKey self, 84 RegistryFile file, REGFI_NK _REC* base_key)84 RegistryFile file, REGFI_NK* base_key) 85 85 { 86 86 if(base_key == NULL) … … 191 191 } 192 192 193 194 193 static int TreeIterator_down(TreeIterator self) 195 194 { … … 205 204 } 206 205 207 /* 208 static ValueIterator TreeIterator_list_values(TreeIterator self) 209 { 210 return CONSTRUCT(ValueIterator, ValueIterator, Con, NULL, self); 211 } 212 */ 206 static RegistryKey TreeIterator_current(TreeIterator self) 207 { 208 return CONSTRUCT(RegistryKey, RegistryKey, Con, NULL, self->file, 209 regfi_iterator_cur_key(self->iter)); 210 } 211 212 static int TreeIterator_to_root(TreeIterator self) 213 { 214 return regfi_iterator_to_root(self->iter); 215 } 216 213 217 214 218 VIRTUAL(TreeIterator, Object) { … … 217 221 VMETHOD(down) = TreeIterator_down; 218 222 VMETHOD(up) = TreeIterator_up; 223 VMETHOD(current) = TreeIterator_current; 224 VMETHOD(to_root) = TreeIterator_to_root; 219 225 VMETHOD(__iter__) = TreeIterator__iter__; 220 226 /* VMETHOD(list_values) = TreeIterator_list_values;*/ … … 234 240 static SubkeyIterator SubkeyIterator_Con(SubkeyIterator self, 235 241 struct RegistryFile_t* file, 236 REGFI_NK _REC* key)242 REGFI_NK* key) 237 243 { 238 244 /* XXX: add a talloc reference? */ … … 256 262 static RegistryKey SubkeyIterator_iternext(SubkeyIterator self) 257 263 { 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) 261 267 { 262 268 /* XXX: can we switch to UTF-8 and have Python properly import that? */ … … 291 297 static ValueIterator ValueIterator_Con(ValueIterator self, 292 298 struct RegistryFile_t* file, 293 REGFI_NK _REC* key)299 REGFI_NK* key) 294 300 { 295 301 /* XXX: add a talloc reference? */ … … 312 318 } 313 319 314 static REGFI_VK _REC* ValueIterator_iternext(ValueIterator self)315 { 316 const REGFI_VK _REC* vk;320 static REGFI_VK* ValueIterator_iternext(ValueIterator self) 321 { 322 const REGFI_VK* vk; 317 323 318 324 if(self->list != NULL && self->cur < self->list->num_values) … … 386 392 } 387 393 388 static RawData RawData_Con(RawData self, REGFI_DATA *data, REGFI_VK _REC*record)394 static RawData RawData_Con(RawData self, REGFI_DATA *data, REGFI_VK *record) 389 395 { 390 396 self->rec = record; -
trunk/src/common.c
r186 r203 320 320 321 321 322 static char* get_quoted_keyname(const REGFI_NK _REC* nk)322 static char* get_quoted_keyname(const REGFI_NK* nk) 323 323 { 324 324 char* ret_val; … … 333 333 334 334 335 static char* get_quoted_valuename(const REGFI_VK _REC* vk)335 static char* get_quoted_valuename(const REGFI_VK* vk) 336 336 { 337 337 char* ret_val; -
trunk/src/reglookup-recover.c
r185 r203 67 67 68 68 /* 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)69 void printKey(REGFI_FILE* f, REGFI_NK* nk, const char* prefix) 70 70 { 71 71 char mtime[24]; … … 103 103 104 104 105 void printValue(REGFI_FILE* f, REGFI_VK _REC* vk, const char* prefix)105 void printValue(REGFI_FILE* f, REGFI_VK* vk, const char* prefix) 106 106 { 107 107 char* quoted_value = NULL; … … 181 181 182 182 183 void printSK(REGFI_FILE* f, REGFI_SK _REC* sk)183 void printSK(REGFI_FILE* f, REGFI_SK* sk) 184 184 { 185 185 char* quoted_raw = NULL; … … 246 246 * repeatedly. Should try to add caching. 247 247 */ 248 char* getParentPath(REGFI_FILE* f, REGFI_NK _REC* nk)248 char* getParentPath(REGFI_FILE* f, REGFI_NK* nk) 249 249 { 250 250 void_stack* path_stack = void_stack_new(REGFI_MAX_DEPTH); 251 REGFI_NK _REC* cur_ancestor;251 REGFI_NK* cur_ancestor; 252 252 char* ret_val; 253 253 uint32_t virt_offset, i, stack_size, ret_val_size, ret_val_used, offset; … … 410 410 { 411 411 const range_list_element* cur_elem; 412 REGFI_VK _REC* vk;412 REGFI_VK* vk; 413 413 uint32_t i, j; 414 414 … … 453 453 { 454 454 const range_list_element* cur_elem; 455 REGFI_VK _REC* vk;455 REGFI_VK* vk; 456 456 range_list* bd_cells; 457 457 REGFI_BUFFER data; … … 469 469 { 470 470 cur_elem = range_list_get(unalloc_values, i); 471 vk = (REGFI_VK _REC*)cur_elem->data;471 vk = (REGFI_VK*)cur_elem->data; 472 472 if(vk == NULL) 473 473 return 11; … … 588 588 { 589 589 const range_list_element* cur_elem; 590 REGFI_NK _REC* key;590 REGFI_NK* key; 591 591 uint32_t i, j; 592 592 int error_code = 0; … … 640 640 range_list* unalloc_linked_values) 641 641 { 642 REGFI_NK _REC* nk;643 REGFI_VK _REC* vk;642 REGFI_NK* nk; 643 REGFI_VK* vk; 644 644 const range_list_element* cur_elem; 645 645 uint32_t i, j, num_keys, off, values_length; … … 732 732 { 733 733 const range_list_element* cur_elem; 734 REGFI_SK _REC* sk;734 REGFI_SK* sk; 735 735 uint32_t i, j; 736 736 … … 782 782 char* tmp_name; 783 783 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; 786 786 uint32_t argi, arge, i, j, ret, num_unalloc_keys; 787 787 int fd; … … 922 922 { 923 923 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; 925 925 926 926 if(tmp_key == NULL) … … 936 936 { 937 937 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; 939 939 940 940 printKey(f, tmp_key, parent_paths[i]); … … 956 956 { 957 957 tmp_value = 958 (REGFI_VK _REC*)range_list_find_data(unalloc_linked_values,959 960 958 (REGFI_VK*)range_list_find_data(unalloc_linked_values, 959 tmp_key->values->elements[j] 960 + REGFI_REGF_SIZE); 961 961 if(tmp_value != NULL) 962 962 printValue(f, tmp_value, tmp_path); … … 973 973 { 974 974 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; 976 976 977 977 printValue(f, tmp_value, ""); -
trunk/src/reglookup.c
r199 r203 52 52 53 53 54 void printValue(REGFI_ITERATOR* iter, const REGFI_VK _REC* vk, char* prefix)54 void printValue(REGFI_ITERATOR* iter, const REGFI_VK* vk, char* prefix) 55 55 { 56 56 const REGFI_DATA* data; … … 205 205 { 206 206 const REGFI_ITER_POSITION* cur; 207 const REGFI_NK _REC* tmp_key;207 const REGFI_NK* tmp_key; 208 208 uint32_t buf_left = 127; 209 209 uint32_t buf_len = buf_left+1; … … 275 275 void printValueList(REGFI_ITERATOR* iter, char* prefix) 276 276 { 277 const REGFI_VK _REC* value;277 const REGFI_VK* value; 278 278 279 279 regfi_iterator_first_value(iter); … … 298 298 char mtime[24]; 299 299 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); 302 302 const REGFI_CLASSNAME* classname; 303 303 … … 371 371 void printKeyTree(REGFI_ITERATOR* iter) 372 372 { 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; 376 376 char* path = NULL; 377 377 int key_type = regfi_type_str2val("KEY"); … … 460 460 int retrievePath(REGFI_ITERATOR* iter, char** path) 461 461 { 462 const REGFI_VK _REC* value;462 const REGFI_VK* value; 463 463 char* tmp_path_joined; 464 464 const char** tmp_path;
Note: See TracChangeset
for help on using the changeset viewer.