- Timestamp:
- 07/17/05 15:03:02 (19 years ago)
- Location:
- trunk/lib
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/lib/regfio.c
r32 r33 254 254 /******************************************************************* 255 255 *******************************************************************/ 256 static bool prs_nk_rec( const char *desc, prs_struct *ps, int depth, REGF_NK_REC *nk ) 256 static bool prs_nk_rec( const char *desc, prs_struct *ps, 257 int depth, REGF_NK_REC *nk ) 257 258 { 258 259 uint16 class_length, name_length; … … 266 267 depth++; 267 268 268 /* back up and get the data_size */ 269 269 /* back up and get the data_size */ 270 270 if ( !prs_set_offset( ps, ps->data_offset-sizeof(uint32)) ) 271 271 return false; … … 274 274 return false; 275 275 276 if ( !prs_uint8s( true, "header", ps, depth, nk->header, sizeof( nk->header )))276 if (!prs_uint8s(true, "header", ps, depth, nk->header, sizeof(nk->header))) 277 277 return false; 278 278 … … 307 307 return false; 308 308 309 if ( !prs_uint32( "max_bytes_subkeyname", ps, depth, &nk->max_bytes_subkeyname)) 310 return false; 311 if ( !prs_uint32( "max_bytes_subkeyclassname", ps, depth, &nk->max_bytes_subkeyclassname)) 312 return false; 309 if (!prs_uint32("max_bytes_subkeyname", ps, depth, &nk->max_bytes_subkeyname)) 310 return false; 311 if ( !prs_uint32( "max_bytes_subkeyclassname", ps, 312 depth, &nk->max_bytes_subkeyclassname)) 313 { return false; } 313 314 if ( !prs_uint32( "max_bytes_valuename", ps, depth, &nk->max_bytes_valuename)) 314 315 return false; … … 325 326 return false; 326 327 327 if ( class_length ) { 328 if ( class_length ) 329 { 328 330 ;; 329 331 } 330 332 331 if ( name_length ) {332 if ( ps->io ){333 if ( !(nk->keyname = (char*)zcalloc(sizeof(char), name_length+1 )))333 if ( name_length ) 334 { 335 if(ps->io && !(nk->keyname = (char*)zcalloc(sizeof(char), name_length+1))) 334 336 return false; 335 }336 337 337 338 if ( !prs_uint8s( true, "name", ps, depth, nk->keyname, name_length) ) … … 344 345 end_off = ps->data_offset; 345 346 346 /* data_size must be divisible by 8 and large enough to hold the original record */ 347 /* data_size must be divisible by 8 and large enough to hold 348 the original record */ 347 349 348 350 data_size = ((start_off - end_off) & 0xfffffff8 ); 349 if ( data_size > nk->rec_size ) 350 /*DEBUG(10,("Encountered reused record (0x%x < 0x%x)\n", data_size, nk->rec_size));*/ 351 352 if ( !ps->io ) 353 nk->hbin->dirty = true; 354 351 /*if ( data_size > nk->rec_size ) 352 DEBUG(10,("Encountered reused record (0x%x < 0x%x)\n", data_size, nk->rec_size));*/ 353 354 if ( !ps->io ) 355 nk->hbin->dirty = true; 356 357 nk->subkey_index = 0; 355 358 return true; 356 359 } … … 627 630 628 631 data_size = ((start_off - end_off) & 0xfffffff8 ); 629 if ( data_size > lf->rec_size )632 /* if ( data_size > lf->rec_size )*/ 630 633 /*DEBUG(10,("Encountered reused record (0x%x < 0x%x)\n", data_size, lf->rec_size));*/ 631 634 632 633 635 if ( !hbin->ps.io ) 636 hbin->dirty = true; 634 637 635 638 return true; … … 681 684 682 685 data_size = ((start_off - end_off) & 0xfffffff8 ); 683 if ( data_size > sk->rec_size )686 /* if ( data_size > sk->rec_size )*/ 684 687 /*DEBUG(10,("Encountered reused record (0x%x < 0x%x)\n", data_size, sk->rec_size));*/ 685 688 686 687 689 if ( !hbin->ps.io ) 690 hbin->dirty = true; 688 691 689 692 return true; … … 937 940 938 941 /* get the initial nk record */ 939 940 if ( !prs_nk_rec( "nk_rec", &hbin->ps, depth, nk )) 942 if (!prs_nk_rec("nk_rec", &hbin->ps, depth, nk)) 941 943 return false; 942 944 943 945 /* fill in values */ 944 945 946 if ( nk->num_values && (nk->values_off!=REGF_OFFSET_NONE) ) 946 947 { … … 1224 1225 1225 1226 1227 /* XXX: An interator struct should be used instead, and this function 1228 * should operate on it, so the state of iteration isn't stored in the 1229 * REGF_NK_REC struct itself. 1230 */ 1226 1231 /******************************************************************* 1227 1232 This acts as an interator over the subkeys defined for a given -
trunk/lib/void_stack.c
r31 r33 56 56 free(stack->elements[i]); 57 57 free(stack); 58 } 59 60 61 unsigned short void_stack_size(void_stack* stack) 62 { 63 return stack->top; 58 64 } 59 65 … … 121 127 122 128 123 void* void_stack_iterator_next(void_stack_iterator* iter)129 const void* void_stack_iterator_next(void_stack_iterator* iter) 124 130 { 125 131 if(iter->cur < iter->stack->top)
Note: See TracChangeset
for help on using the changeset viewer.