Changeset 2352 in MondoRescue for branches/2.2.10/mondo/src/common
- Timestamp:
- Aug 28, 2009, 2:46:29 AM (15 years ago)
- Location:
- branches/2.2.10/mondo/src/common
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.2.10/mondo/src/common/libmondo-mountlist-EXT.h
r2202 r2352 1 1 /* libmondo-mountlist-EXT.h */ 2 2 3 extern int evaluate_mountlist(struct mountlist_itself *mountlist, 4 char *flaws_str_A, char *flaws_str_B, 5 char *flaws_str_C); 3 extern char *evaluate_mountlist(struct mountlist_itself *mountlist, int *res); 6 4 extern int find_device_in_mountlist(struct mountlist_itself *mountlist, 7 5 char *device); -
branches/2.2.10/mondo/src/common/libmondo-mountlist.c
r2331 r2352 519 519 * @see evaluate_drive_within_mountlist 520 520 */ 521 int 522 evaluate_mountlist(struct mountlist_itself *mountlist, char *flaws_str_A, 523 char *flaws_str_B, char *flaws_str_C) 524 { 521 char *evaluate_mountlist(struct mountlist_itself *mountlist, int *res) { 525 522 526 523 /*@ buffer *********************************************************** */ … … 531 528 /*@ int ************************************************************** */ 532 529 int i = 0; 533 int res = 0;534 530 535 531 /*@ initialize ******************************************************* */ 536 532 533 *res = 0; 537 534 drivelist = malloc(sizeof(struct list_of_disks)); 538 535 assert(mountlist != NULL); 539 assert(flaws_str_A != NULL);540 assert(flaws_str_B != NULL);541 assert(flaws_str_C != NULL);542 536 543 537 mr_asprintf(flaws_str, "%s", ""); … … 556 550 tmp = evaluate_drive_within_mountlist(mountlist, drivelist->el[i].device); 557 551 if (tmp == NULL) { 558 res++;552 (*res)++; 559 553 } 560 554 } … … 567 561 } 568 562 } 569 res += look_for_duplicate_mountpoints(mountlist, flaws_str); 570 res = spread_flaws_across_three_lines(flaws_str, flaws_str_A, flaws_str_B, flaws_str_C,res); 571 mr_free(flaws_str); 572 return(res); 563 *res += look_for_duplicate_mountpoints(mountlist, flaws_str); 564 return(flaws_str); 573 565 } 574 566 -
branches/2.2.10/mondo/src/common/libmondo-mountlist.h
r2202 r2352 4 4 5 5 6 int evaluate_mountlist(struct mountlist_itself *mountlist, 7 char *flaws_str_A, char *flaws_str_B, 8 char *flaws_str_C); 6 char *evaluate_mountlist(struct mountlist_itself *mountlist, int *res); 9 7 int find_device_in_mountlist(struct mountlist_itself *mountlist, 10 8 char *device); -
branches/2.2.10/mondo/src/common/libmondo-string-EXT.h
r2316 r2352 19 19 char *s); 20 20 extern int special_dot_char(int i); 21 extern boolspread_flaws_across_three_lines(char *flaws_str,21 extern void spread_flaws_across_three_lines(char *flaws_str, 22 22 char *flaws_str_A, 23 23 char *flaws_str_B, 24 char *flaws_str_C , int res);24 char *flaws_str_C); 25 25 extern int strcmp_inc_numbers(char *stringA, char *stringB); 26 26 extern char *strip_afio_output_line(char *input); -
branches/2.2.10/mondo/src/common/libmondo-string.c
r2334 r2352 599 599 * @param flaws_str_B Where to put the second 74-or-less characters. 600 600 * @param flaws_str_C Where to put the rest. 601 * @param res The result of the original evaluate_mountlist() operation. 602 * @return TRUE if res == 0, FALSE otherwise. 603 */ 604 bool 601 */ 602 void 605 603 spread_flaws_across_three_lines(char *flaws_str, char *flaws_str_A, 606 char *flaws_str_B, char *flaws_str_C, 607 int res) 604 char *flaws_str_B, char *flaws_str_C) 608 605 { 609 606 … … 612 609 613 610 /*@ initialize ****************************************************** */ 614 assert(flaws_str_A != NULL);615 assert(flaws_str_B != NULL);616 assert(flaws_str_C != NULL);617 611 assert(flaws_str != NULL); 618 612 619 if (!res && !strlen(flaws_str)) {620 return (TRUE);621 }622 613 if (strlen(flaws_str) > 0) { 623 paranoid_free(flaws_str_A);624 614 mr_asprintf(flaws_str_A, "%s", flaws_str + 1); 625 615 } 626 616 if (strlen(flaws_str_A) >= 74) { 627 617 for (i = 74; flaws_str_A[i] != ' '; i--); 628 paranoid_free(flaws_str_B);629 618 mr_asprintf(flaws_str_B, "%s", flaws_str_A + i + 1); 630 619 flaws_str_A[i] = '\0'; … … 632 621 if (strlen(flaws_str_B) >= 74) { 633 622 for (i = 74; flaws_str_B[i] != ' '; i--); 634 paranoid_free(flaws_str_C);635 623 mr_asprintf(flaws_str_C, "%s", flaws_str_B + i + 1); 636 624 flaws_str_B[i] = '\0'; 637 }638 if (res) {639 return (FALSE);640 } else {641 return (TRUE);642 625 } 643 626 } -
branches/2.2.10/mondo/src/common/libmondo-string.h
r2316 r2352 17 17 char *slice_fname(long bigfileno, long sliceno, char *path, char *s); 18 18 int special_dot_char(int i); 19 bool spread_flaws_across_three_lines(char *flaws_str, char *flaws_str_A, 20 char *flaws_str_B, char *flaws_str_C, 21 int res); 19 void spread_flaws_across_three_lines(char *flaws_str, char *flaws_str_A, 20 char *flaws_str_B, char *flaws_str_C); 22 21 int strcmp_inc_numbers(char *stringA, char *stringB); 23 22 char *strip_afio_output_line(char *input);
Note:
See TracChangeset
for help on using the changeset viewer.