Changeset 203 for trunk/python2/regfi
- Timestamp:
- 08/21/10 12:53:19 (14 years ago)
- Location:
- trunk/python2/regfi
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
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;
Note: See TracChangeset
for help on using the changeset viewer.