Changeset 2350 in MondoRescue for branches/2.2.9/mondo/src/common
- Timestamp:
- Aug 28, 2009, 2:24:19 AM (16 years ago)
- Location:
- branches/2.2.9/mondo/src/common
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.2.9/mondo/src/common/libmondo-mountlist-EXT.h
r2202 r2350 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.9/mondo/src/common/libmondo-mountlist.c
r2304 r2350 500 500 * @see evaluate_drive_within_mountlist 501 501 */ 502 int 503 evaluate_mountlist(struct mountlist_itself *mountlist, char *flaws_str_A, 504 char *flaws_str_B, char *flaws_str_C) 505 { 502 char *evaluate_mountlist(struct mountlist_itself *mountlist, int *res) { 506 503 507 504 /*@ buffer *********************************************************** */ … … 512 509 /*@ int ************************************************************** */ 513 510 int i = 0; 514 int res = 0;515 511 516 512 /*@ initialize ******************************************************* */ 517 513 514 *res = 0; 518 515 drivelist = malloc(sizeof(struct list_of_disks)); 519 516 assert(mountlist != NULL); 520 assert(flaws_str_A != NULL);521 assert(flaws_str_B != NULL);522 assert(flaws_str_C != NULL);523 517 524 518 mr_asprintf(&flaws_str, "%s", ""); … … 539 533 tmp = evaluate_drive_within_mountlist(mountlist, drivelist->el[i].device); 540 534 if (tmp == NULL) { 541 res++;535 (*res)++; 542 536 } 543 537 } … … 550 544 } 551 545 } 552 res += look_for_duplicate_mountpoints(mountlist, flaws_str); 553 res = spread_flaws_across_three_lines(flaws_str, flaws_str_A, flaws_str_B, flaws_str_C,res); 554 paranoid_free(flaws_str); 555 return(res); 546 *res += look_for_duplicate_mountpoints(mountlist, flaws_str); 547 return(flaws_str); 556 548 } 557 549 -
branches/2.2.9/mondo/src/common/libmondo-mountlist.h
r2202 r2350 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.9/mondo/src/common/libmondo-string-EXT.h
r1647 r2350 21 21 char *s); 22 22 extern int special_dot_char(int i); 23 extern boolspread_flaws_across_three_lines(char *flaws_str,23 extern void spread_flaws_across_three_lines(char *flaws_str, 24 24 char *flaws_str_A, 25 25 char *flaws_str_B, 26 char *flaws_str_C , int res);26 char *flaws_str_C); 27 27 extern int strcmp_inc_numbers(char *stringA, char *stringB); 28 28 extern char *strip_afio_output_line(char *input); -
branches/2.2.9/mondo/src/common/libmondo-string.c
r2242 r2350 608 608 * @param flaws_str_B Where to put the second 74-or-less characters. 609 609 * @param flaws_str_C Where to put the rest. 610 * @param res The result of the original evaluate_mountlist() operation. 611 * @return TRUE if res == 0, FALSE otherwise. 612 */ 613 bool 610 */ 611 void 614 612 spread_flaws_across_three_lines(char *flaws_str, char *flaws_str_A, 615 char *flaws_str_B, char *flaws_str_C, 616 int res) 613 char *flaws_str_B, char *flaws_str_C) 617 614 { 618 615 … … 621 618 622 619 /*@ initialize ****************************************************** */ 623 assert(flaws_str_A != NULL);624 assert(flaws_str_B != NULL);625 assert(flaws_str_C != NULL);626 620 assert(flaws_str != NULL); 627 621 628 if (!res && !strlen(flaws_str)) {629 return (TRUE);630 }631 622 if (strlen(flaws_str) > 0) { 632 paranoid_free(flaws_str_A);633 623 mr_asprintf(&flaws_str_A, "%s", flaws_str + 1); 634 624 } 635 625 if (strlen(flaws_str_A) >= 74) { 636 626 for (i = 74; flaws_str_A[i] != ' '; i--); 637 paranoid_free(flaws_str_B);638 627 mr_asprintf(&flaws_str_B, "%s", flaws_str_A + i + 1); 639 628 flaws_str_A[i] = '\0'; … … 641 630 if (strlen(flaws_str_B) >= 74) { 642 631 for (i = 74; flaws_str_B[i] != ' '; i--); 643 paranoid_free(flaws_str_C);644 632 mr_asprintf(&flaws_str_C, "%s", flaws_str_B + i + 1); 645 633 flaws_str_B[i] = '\0'; 646 }647 if (res) {648 return (FALSE);649 } else {650 return (TRUE);651 634 } 652 635 } -
branches/2.2.9/mondo/src/common/libmondo-string.h
r1647 r2350 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.