Changeset 89 in MondoRescue for trunk/mondo/mondo/common/newt-specific.c


Ignore:
Timestamp:
Oct 27, 2005, 10:45:34 PM (18 years ago)
Author:
bcornec
Message:

merge r87:88 of the 2.04_berlios branch
indent some files

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/mondo/mondo/common/newt-specific.c

    r87 r89  
    6262 */
    6363    char **err_log_lines = NULL,    ///< The list of log lines to show on the screen.
    64         *g_blurb_str_1, ///< The string for line 1 of the blurb in the progress form
    65         *g_blurb_str_2, ///< The string for line 2 of the blurb in the progress form
    66         *g_blurb_str_3; ///< The string for line 3 (updated continuously) of the blurb in the progress form
     64        *g_blurb_str_1,         ///< The string for line 1 of the blurb in the progress form
     65        *g_blurb_str_2,         ///< The string for line 2 of the blurb in the progress form
     66        *g_blurb_str_3;         ///< The string for line 3 (updated continuously) of the blurb in the progress form
    6767    newtComponent g_isoform_main = NULL,    ///< The evalcall form component itself
    6868        g_isoform_header = NULL,    ///< The component for the evalcall form title
     
    8686    bool g_called_by_xmondo = FALSE;    ///< @bug Unneeded w/current XMondo.
    8787    char *g_erase_tmpdir_and_scratchdir;    ///< The command to run to erase the tmpdir and scratchdir at the end of Mondo.
    88 char *g_selfmounted_isodir; ///< Holds the NFS mountpoint if mounted via mondoarchive.
     88    char *g_selfmounted_isodir; ///< Holds the NFS mountpoint if mounted via mondoarchive.
    8989
    9090/* @} - end of globalGroup */
     
    300300
    301301        if (g_selfmounted_isodir) {
    302           asprintf(&command, "umount %s", g_selfmounted_isodir);
    303           run_program_and_log_output(command, 5);
    304           asprintf(&command, "rmdir %s", g_selfmounted_isodir);
    305           run_program_and_log_output(command, 5);
     302            asprintf(&command, "umount %s", g_selfmounted_isodir);
     303            run_program_and_log_output(command, 5);
     304            asprintf(&command, "rmdir %s", g_selfmounted_isodir);
     305            run_program_and_log_output(command, 5);
    306306        }
    307307
     
    316316            ("cat /var/log/mondo-archive.log | gzip -9 > /tmp/MA.log.gz 2> /dev/null");
    317317        if (!strstr(g_version, "cvs") && !strstr(g_version, "svn")) {
    318             printf
    319                 ("Please try the latest SVN version ");
     318            printf("Please try the latest SVN version ");
    320319            printf
    321320                ("to see if that fixes the problem.\nPlease don't bother the mailing list with");
     
    358357    void
    359358     finish(int signal) {
    360             char *command;
    361             malloc_string(command);
    362        
    363             /*  if (signal==0) { popup_and_OK("Please press <enter> to quit."); } */
     359        char *command;
     360        malloc_string(command);
     361
     362        /*  if (signal==0) { popup_and_OK("Please press <enter> to quit."); } */
    364363
    365364        /* newtPopHelpLine(); */
     
    374373        }
    375374        if (g_selfmounted_isodir) {
    376           asprintf(&command, "umount %s", g_selfmounted_isodir);
    377           run_program_and_log_output(command, 1);
    378           asprintf(&command, "rmdir %s", g_selfmounted_isodir);
    379           run_program_and_log_output(command, 1);
     375            asprintf(&command, "umount %s", g_selfmounted_isodir);
     376            run_program_and_log_output(command, 1);
     377            asprintf(&command, "rmdir %s", g_selfmounted_isodir);
     378            run_program_and_log_output(command, 1);
    380379        }
    381380//  iamhere("foo");
     
    793792                printf("%s (%s or %s) --> ", p, button1, button2);
    794793            }
    795             for (asprintf(&tmp,"");
     794            for (asprintf(&tmp, "");
    796795                 strcmp(tmp, button1) && (strlen(button2) == 0
    797796                                          || strcmp(tmp, button2));) {
     
    945944            percentage = 1;
    946945        } else {
    947             percentage = (int)trunc(num) ;
     946            percentage = (int) trunc(num);
    948947        }
    949948
     
    965964            g_isoform_old_progress = percentage;
    966965            asprintf(&timeline_str,
    967                     "%2ld:%02ld taken            %2ld:%02ld remaining",
    968                     time_taken / 60, time_taken % 60, time_remaining / 60,
    969                     time_remaining % 60);
     966                     "%2ld:%02ld taken            %2ld:%02ld remaining",
     967                     time_taken / 60, time_taken % 60, time_remaining / 60,
     968                     time_remaining % 60);
    970969            if (percentage < 3) {
    971                 tmp1 = (char *)malloc(g_mysterious_dot_counter * sizeof(char));
    972                 for (i = 0, p = tmp1 ; i < g_mysterious_dot_counter - 1 ; i++, p++) {
    973                         *p = '.';
     970                tmp1 =
     971                    (char *) malloc(g_mysterious_dot_counter *
     972                                    sizeof(char));
     973                for (i = 0, p = tmp1; i < g_mysterious_dot_counter - 1;
     974                     i++, p++) {
     975                    *p = '.';
    974976                }
    975977                *p = '\0';
    976978
    977979                /* BERLIOS: 27 should be a parameter */
    978                 tmp2 = (char *)malloc(27-g_mysterious_dot_counter * sizeof(char));
    979                 for (i = 0, p = tmp2 ; i < 27 - g_mysterious_dot_counter - 1 ; i++, p++) {
    980                         *p = ' ';
     980                tmp2 =
     981                    (char *) malloc(27 -
     982                                    g_mysterious_dot_counter *
     983                                    sizeof(char));
     984                for (i = 0, p = tmp2;
     985                     i < 27 - g_mysterious_dot_counter - 1; i++, p++) {
     986                    *p = ' ';
    981987                }
    982988                *p = '\0';
    983989
    984                 asprintf(&pcline_str, " Working%s%s %c", tmp1, tmp2, special_dot_char(g_mysterious_dot_counter));
     990                asprintf(&pcline_str, " Working%s%s %c", tmp1, tmp2,
     991                         special_dot_char(g_mysterious_dot_counter));
    985992                paranoid_free(tmp1);
    986993                paranoid_free(tmp2);
    987994            } else {
    988                 asprintf(&pcline_str, " %3d%% done              %3d%% to go",
    989                         percentage, 100 - percentage);
     995                asprintf(&pcline_str,
     996                         " %3d%% done              %3d%% to go",
     997                         percentage, 100 - percentage);
    990998            }
    991999            if (g_text_mode) {
    992                 j = trunc(percentage/5);
    993                 tmp1 = (char *)malloc((j + 1) * sizeof(char));
    994                 for (i = 0, p = tmp1 ; i < j ; i++, p++) {
    995                         *p = '*';
     1000                j = trunc(percentage / 5);
     1001                tmp1 = (char *) malloc((j + 1) * sizeof(char));
     1002                for (i = 0, p = tmp1; i < j; i++, p++) {
     1003                    *p = '*';
    9961004                }
    9971005                *p = '\0';
    9981006
    999                 tmp2 = (char *)malloc((20 - j + 1) * sizeof(char));
    1000                 for (i = 0, p = tmp2 ; i < 20 - j ; i++, p++) {
    1001                         *p = '.';
     1007                tmp2 = (char *) malloc((20 - j + 1) * sizeof(char));
     1008                for (i = 0, p = tmp2; i < 20 - j; i++, p++) {
     1009                    *p = '.';
    10021010                }
    10031011                *p = '\0';
    10041012
    10051013                if (percentage >= 3) {
    1006                     asprintf(&taskprogress, "TASK:  [%s%s] %3d%% done; %2ld:%02ld to go", tmp1, tmp2, percentage, time_remaining / 60, time_remaining % 60);
     1014                    asprintf(&taskprogress,
     1015                             "TASK:  [%s%s] %3d%% done; %2ld:%02ld to go",
     1016                             tmp1, tmp2, percentage, time_remaining / 60,
     1017                             time_remaining % 60);
    10071018                    printf("---evalcall---1--- %s\r\n",
    10081019                           g_isoform_header_str);
     
    10911102            if (g_current_progress > g_maximum_progress) {
    10921103                asprintf(&tmp,
    1093                         "update_progress_form_full(%s,%s,%s) --- g_current_progress=%ld; g_maximum_progress=%ld",
    1094                         blurb1, blurb2, blurb3, g_current_progress,
    1095                         g_maximum_progress);
     1104                         "update_progress_form_full(%s,%s,%s) --- g_current_progress=%ld; g_maximum_progress=%ld",
     1105                         blurb1, blurb2, blurb3, g_current_progress,
     1106                         g_maximum_progress);
    10961107                log_msg(0, tmp);
    10971108                paranoid_free(tmp);
     
    11181129        //g_mysterious_dot_counter = (g_mysterious_dot_counter + 1) % 27;
    11191130        asprintf(&timeline_str,
    1120                 "%2ld:%02ld taken               %2ld:%02ld remaining  ",
    1121                 time_taken / 60, time_taken % 60, time_remaining / 60,
    1122                 time_remaining % 60);
    1123         asprintf(&percentline_str, " %3d%% done                 %3d%% to go",
    1124                 percentage, 100 - percentage);
     1131                 "%2ld:%02ld taken               %2ld:%02ld remaining  ",
     1132                 time_taken / 60, time_taken % 60, time_remaining / 60,
     1133                 time_remaining % 60);
     1134        asprintf(&percentline_str,
     1135                 " %3d%% done                 %3d%% to go", percentage,
     1136                 100 - percentage);
    11251137
    11261138        if (g_text_mode) {
     
    11301142            printf("---progress-form---E---\n");
    11311143
    1132             j = trunc(percentage/5);
    1133             tmp1 = (char *)malloc((j + 1) * sizeof(char));
    1134             for (i = 0, p = tmp1 ; i < j ; i++, p++) {
    1135                     *p = '*';
     1144            j = trunc(percentage / 5);
     1145            tmp1 = (char *) malloc((j + 1) * sizeof(char));
     1146            for (i = 0, p = tmp1; i < j; i++, p++) {
     1147                *p = '*';
    11361148            }
    11371149            *p = '\0';
    11381150
    1139             tmp2 = (char *)malloc((20 - j + 1) * sizeof(char));
    1140             for (i = 0, p = tmp2 ; i <  20 - j ; i++, p++) {
    1141                     *p = '.';
     1151            tmp2 = (char *) malloc((20 - j + 1) * sizeof(char));
     1152            for (i = 0, p = tmp2; i < 20 - j; i++, p++) {
     1153                *p = '.';
    11421154            }
    11431155            *p = '\0';
     
    11461158                log_msg(2, "percentage = %d", percentage);
    11471159            }
    1148             asprintf(&taskprogress, "TASK:  [%s%s] %3d%% done; %2ld:%02ld to go", tmp1, tmp2, percentage, time_remaining / 60, time_remaining % 60);
     1160            asprintf(&taskprogress,
     1161                     "TASK:  [%s%s] %3d%% done; %2ld:%02ld to go", tmp1,
     1162                     tmp2, percentage, time_remaining / 60,
     1163                     time_remaining % 60);
    11491164
    11501165            printf("---progress-form---4--- %s\r\n", taskprogress);
     
    12331248        if (restoring) {
    12341249            asprintf(&title_sz,
    1235                   "Please choose the backup media from which you want to read data.");
     1250                    "Please choose the backup media from which you want to read data.");
    12361251            asprintf(&minimsg_sz, "Read from:");
    12371252        } else {
    12381253            asprintf(&title_sz,
    1239                   "Please choose the backup media to which you want to archive data.");
     1254                    "Please choose the backup media to which you want to archive data.");
    12401255            asprintf(&minimsg_sz, "Backup to:");
    12411256        }
     
    15241539        }
    15251540        asprintf(&differ_sz,
    1526                 "  %d files differ. Hit 'Select' to pick a file. Hit 'Close' to quit the list.",
    1527                 i);
     1541                 "  %d files differ. Hit 'Select' to pick a file. Hit 'Close' to quit the list.",
     1542                 i);
    15281543        newtPushHelpLine(differ_sz);
    15291544        paranoid_free(differ_sz);
     
    15311546        bClose = newtCompactButton(10, 15, " Close  ");
    15321547        bSelect = newtCompactButton(30, 15, " Select ");
    1533         asprintf(&tmp, "%-10s               %-20s", "Priority", "Filename");
     1548        asprintf(&tmp, "%-10s               %-20s", "Priority",
     1549                 "Filename");
    15341550        headerMsg = newtLabel(2, 1, tmp);
    15351551        paranoid_free(tmp);
     
    15561572                                               filename, reason);
    15571573                        asprintf(&tmp, "%s --- %s",
    1558                                 filelist->el[currline].filename, reason);
     1574                                 filelist->el[currline].filename, reason);
    15591575                        popup_and_OK(tmp);
    15601576                        paranoid_free(tmp);
Note: See TracChangeset for help on using the changeset viewer.