From 1c435ae29d78647046944d11dee019abe47329f1 Mon Sep 17 00:00:00 2001 From: Philipp Storz Date: Fri, 27 Mar 2015 15:50:33 +0100 Subject: [PATCH] Refactor "prtit" to "printit" --- src/dird/protos.h | 2 +- src/dird/ua_output.c | 36 ++++++++++++++++++------------------ src/dird/ua_query.c | 10 +++++----- src/dird/ua_restore.c | 12 ++++++------ src/dird/ua_select.c | 4 ++-- src/dird/ua_update.c | 2 +- 6 files changed, 33 insertions(+), 33 deletions(-) diff --git a/src/dird/protos.h b/src/dird/protos.h index 9ba7ae15af9..fa1a7b5448f 100644 --- a/src/dird/protos.h +++ b/src/dird/protos.h @@ -291,7 +291,7 @@ void update_inchanger_for_export(UAContext *ua, STORERES *store, dlist *vol_list /* ua_output.c */ void bsendmsg(void *ua_ctx, const char *fmt, ...); -void prtit(void *ctx, const char *msg); +void printit(void *ctx, const char *msg); bool complete_jcr_for_job(JCR *jcr, JOBRES *job, POOLRES *pool); RUNRES *find_next_run(RUNRES *run, JOBRES *job, utime_t &runtime, int ndays); diff --git a/src/dird/ua_output.c b/src/dird/ua_output.c index b098b3eb80c..a97a3a29525 100644 --- a/src/dird/ua_output.c +++ b/src/dird/ua_output.c @@ -391,11 +391,11 @@ static int do_list_cmd(UAContext *ua, const char *cmd, e_list_type llist) for (i = 1; i < ua->argc; i++) { /* List JOBS */ if (bstrcasecmp(ua->argk[i], NT_("jobs"))) { - db_list_job_records(ua->jcr, ua->db, &jr, prtit, ua, llist); + db_list_job_records(ua->jcr, ua->db, &jr, printit, ua, llist); /* List JOBTOTALS */ } else if (bstrcasecmp(ua->argk[i], NT_("jobtotals"))) { - db_list_job_totals(ua->jcr, ua->db, &jr, prtit, ua); + db_list_job_totals(ua->jcr, ua->db, &jr, printit, ua); /* List JOBID=nn */ } else if (bstrcasecmp(ua->argk[i], NT_("jobid"))) { @@ -403,7 +403,7 @@ static int do_list_cmd(UAContext *ua, const char *cmd, e_list_type llist) jobid = str_to_int64(ua->argv[i]); if (jobid > 0) { jr.JobId = jobid; - db_list_job_records(ua->jcr, ua->db, &jr, prtit, ua, llist); + db_list_job_records(ua->jcr, ua->db, &jr, printit, ua, llist); } } @@ -412,13 +412,13 @@ static int do_list_cmd(UAContext *ua, const char *cmd, e_list_type llist) bstrcasecmp(ua->argk[i], NT_("jobname"))) && ua->argv[i]) { bstrncpy(jr.Name, ua->argv[i], MAX_NAME_LENGTH); jr.JobId = 0; - db_list_job_records(ua->jcr, ua->db, &jr, prtit, ua, llist); + db_list_job_records(ua->jcr, ua->db, &jr, printit, ua, llist); /* List UJOBID=xxx */ } else if (bstrcasecmp(ua->argk[i], NT_("ujobid")) && ua->argv[i]) { bstrncpy(jr.Job, ua->argv[i], MAX_NAME_LENGTH); jr.JobId = 0; - db_list_job_records(ua->jcr, ua->db, &jr, prtit, ua, llist); + db_list_job_records(ua->jcr, ua->db, &jr, printit, ua, llist); /* List Base files */ } else if (bstrcasecmp(ua->argk[i], NT_("basefiles"))) { @@ -436,7 +436,7 @@ static int do_list_cmd(UAContext *ua, const char *cmd, e_list_type llist) continue; } if (jobid > 0) { - db_list_base_files_for_job(ua->jcr, ua->db, jobid, prtit, ua); + db_list_base_files_for_job(ua->jcr, ua->db, jobid, printit, ua); } } @@ -457,7 +457,7 @@ static int do_list_cmd(UAContext *ua, const char *cmd, e_list_type llist) continue; } if (jobid > 0) { - db_list_files_for_job(ua->jcr, ua->db, jobid, prtit, ua); + db_list_files_for_job(ua->jcr, ua->db, jobid, printit, ua); } } @@ -477,12 +477,12 @@ static int do_list_cmd(UAContext *ua, const char *cmd, e_list_type llist) } else { continue; } - db_list_jobmedia_records(ua->jcr, ua->db, jobid, prtit, ua, llist); + db_list_jobmedia_records(ua->jcr, ua->db, jobid, printit, ua, llist); done = true; } if (!done) { /* List for all jobs (jobid=0) */ - db_list_jobmedia_records(ua->jcr, ua->db, 0, prtit, ua, llist); + db_list_jobmedia_records(ua->jcr, ua->db, 0, printit, ua, llist); } /* List JOBLOG */ @@ -501,12 +501,12 @@ static int do_list_cmd(UAContext *ua, const char *cmd, e_list_type llist) } else { continue; } - db_list_joblog_records(ua->jcr, ua->db, jobid, prtit, ua, llist); + db_list_joblog_records(ua->jcr, ua->db, jobid, printit, ua, llist); done = true; } if (!done) { /* List for all jobs (jobid=0) */ - db_list_joblog_records(ua->jcr, ua->db, 0, prtit, ua, llist); + db_list_joblog_records(ua->jcr, ua->db, 0, printit, ua, llist); } @@ -518,10 +518,10 @@ static int do_list_cmd(UAContext *ua, const char *cmd, e_list_type llist) if (ua->argv[i]) { bstrncpy(pr.Name, ua->argv[i], sizeof(pr.Name)); } - db_list_pool_records(ua->jcr, ua->db, &pr, prtit, ua, llist); + db_list_pool_records(ua->jcr, ua->db, &pr, printit, ua, llist); } else if (bstrcasecmp(ua->argk[i], NT_("clients"))) { - db_list_client_records(ua->jcr, ua->db, prtit, ua, llist); + db_list_client_records(ua->jcr, ua->db, printit, ua, llist); /* List MEDIA or VOLUMES */ } else if (bstrcasecmp(ua->argk[i], NT_("media")) || @@ -554,7 +554,7 @@ static int do_list_cmd(UAContext *ua, const char *cmd, e_list_type llist) /* List a specific volume? */ if (ua->argv[i]) { bstrncpy(mr.VolumeName, ua->argv[i], sizeof(mr.VolumeName)); - db_list_media_records(ua->jcr, ua->db, &mr, prtit, ua, llist); + db_list_media_records(ua->jcr, ua->db, &mr, printit, ua, llist); return 1; } /* Is a specific pool wanted? */ @@ -565,7 +565,7 @@ static int do_list_cmd(UAContext *ua, const char *cmd, e_list_type llist) return 1; } mr.PoolId = pr.PoolId; - db_list_media_records(ua->jcr, ua->db, &mr, prtit, ua, llist); + db_list_media_records(ua->jcr, ua->db, &mr, printit, ua, llist); return 1; } } @@ -585,7 +585,7 @@ static int do_list_cmd(UAContext *ua, const char *cmd, e_list_type llist) ua->send_msg(_("Pool: %s\n"), pr.Name); } mr.PoolId = ids[i]; - db_list_media_records(ua->jcr, ua->db, &mr, prtit, ua, llist); + db_list_media_records(ua->jcr, ua->db, &mr, printit, ua, llist); } free(ids); return 1; @@ -615,7 +615,7 @@ static int do_list_cmd(UAContext *ua, const char *cmd, e_list_type llist) limit = atoi(ua->argv[j]); } } - db_list_copies_records(ua->jcr,ua->db,limit,jobids,prtit,ua,llist); + db_list_copies_records(ua->jcr,ua->db,limit,jobids,printit,ua,llist); } else if (bstrcasecmp(ua->argk[i], NT_("limit")) || bstrcasecmp(ua->argk[i], NT_("days"))) { /* Ignore it */ @@ -904,7 +904,7 @@ int messages_cmd(UAContext *ua, const char *cmd) /* * Callback routine for "printing" database file listing */ -void prtit(void *ctx, const char *msg) +void printit(void *ctx, const char *msg) { UAContext *ua = (UAContext *)ctx; diff --git a/src/dird/ua_query.c b/src/dird/ua_query.c index d088316b7cd..88c866208bc 100644 --- a/src/dird/ua_query.c +++ b/src/dird/ua_query.c @@ -126,8 +126,8 @@ int query_cmd(UAContext *ua, const char *cmd) query = substitute_prompts(ua, query, prompt, nprompt); Dmsg1(100, "Query2=%s\n", query); if (query[0] == '!') { - db_list_sql_query(ua->jcr, ua->db, query+1, prtit, ua, false, VERT_LIST); - } else if (!db_list_sql_query(ua->jcr, ua->db, query, prtit, ua, true, HORZ_LIST)) { + db_list_sql_query(ua->jcr, ua->db, query+1, printit, ua, false, VERT_LIST); + } else if (!db_list_sql_query(ua->jcr, ua->db, query, printit, ua, true, HORZ_LIST)) { ua->send_msg("%s\n", query); } query[0] = 0; @@ -138,8 +138,8 @@ int query_cmd(UAContext *ua, const char *cmd) query = substitute_prompts(ua, query, prompt, nprompt); Dmsg1(100, "Query2=%s\n", query); if (query[0] == '!') { - db_list_sql_query(ua->jcr, ua->db, query+1, prtit, ua, false, VERT_LIST); - } else if (!db_list_sql_query(ua->jcr, ua->db, query, prtit, ua, true, HORZ_LIST)) { + db_list_sql_query(ua->jcr, ua->db, query+1, printit, ua, false, VERT_LIST); + } else if (!db_list_sql_query(ua->jcr, ua->db, query, printit, ua, true, HORZ_LIST)) { ua->error_msg("%s\n", query); } } @@ -271,7 +271,7 @@ int sqlquery_cmd(UAContext *ua, const char *cmd) if (ua->cmd[len-1] == ';') { ua->cmd[len-1] = 0; /* zap ; */ /* Submit query */ - db_list_sql_query(ua->jcr, ua->db, query.c_str(), prtit, ua, true, HORZ_LIST); + db_list_sql_query(ua->jcr, ua->db, query.c_str(), printit, ua, true, HORZ_LIST); *query.c_str() = 0; /* start new query */ msg = _("Enter SQL query: "); } else { diff --git a/src/dird/ua_restore.c b/src/dird/ua_restore.c index d69543eec7b..78a3463267a 100644 --- a/src/dird/ua_restore.c +++ b/src/dird/ua_restore.c @@ -349,7 +349,7 @@ static void get_and_display_basejobs(UAContext *ua, RESTORE_CTX *rx) Mmsg(q, uar_print_jobs, jobids.list); ua->send_msg(_("The restore will use the following job(s) as Base\n")); - db_list_sql_query(ua->jcr, ua->db, q.c_str(), prtit, ua, true, HORZ_LIST); + db_list_sql_query(ua->jcr, ua->db, q.c_str(), printit, ua, true, HORZ_LIST); } pm_strcpy(rx->BaseJobIds, jobids.list); } @@ -645,7 +645,7 @@ static int user_select_jobids_or_files(UAContext *ua, RESTORE_CTX *rx) } gui_save = ua->jcr->gui; ua->jcr->gui = true; - db_list_sql_query(ua->jcr, ua->db, uar_list_jobs, prtit, ua, true, HORZ_LIST); + db_list_sql_query(ua->jcr, ua->db, uar_list_jobs, printit, ua, true, HORZ_LIST); ua->jcr->gui = gui_save; done = false; break; @@ -663,7 +663,7 @@ static int user_select_jobids_or_files(UAContext *ua, RESTORE_CTX *rx) free(fname); gui_save = ua->jcr->gui; ua->jcr->gui = true; - db_list_sql_query(ua->jcr, ua->db, rx->query, prtit, ua, true, HORZ_LIST); + db_list_sql_query(ua->jcr, ua->db, rx->query, printit, ua, true, HORZ_LIST); ua->jcr->gui = gui_save; done = false; break; @@ -683,7 +683,7 @@ static int user_select_jobids_or_files(UAContext *ua, RESTORE_CTX *rx) } gui_save = ua->jcr->gui; ua->jcr->gui = true; - db_list_sql_query(ua->jcr, ua->db, ua->cmd, prtit, ua, true, HORZ_LIST); + db_list_sql_query(ua->jcr, ua->db, ua->cmd, printit, ua, true, HORZ_LIST); ua->jcr->gui = gui_save; done = false; break; @@ -1455,13 +1455,13 @@ static bool select_backups_before_date(UAContext *ua, RESTORE_CTX *rx, char *dat * Display a list of all copies */ db_list_copies_records(ua->jcr, ua->db, 0, rx->JobIds, - prtit, ua, HORZ_LIST); + printit, ua, HORZ_LIST); } /* * Display a list of Jobs selected for this restore */ - db_list_sql_query(ua->jcr, ua->db, uar_list_temp, prtit, ua, true, HORZ_LIST); + db_list_sql_query(ua->jcr, ua->db, uar_list_temp, printit, ua, true, HORZ_LIST); ok = true; } else { ua->warning_msg(_("No jobs found.\n")); diff --git a/src/dird/ua_select.c b/src/dird/ua_select.c index bc8b72e30bb..5296acb95e7 100644 --- a/src/dird/ua_select.c +++ b/src/dird/ua_select.c @@ -674,7 +674,7 @@ int select_media_dbr(UAContext *ua, MEDIA_DBR *mr) goto bail_out; } mr->PoolId = pr.PoolId; - db_list_media_records(ua->jcr, ua->db, mr, prtit, ua, HORZ_LIST); + db_list_media_records(ua->jcr, ua->db, mr, printit, ua, HORZ_LIST); if (!get_cmd(ua, _("Enter *MediaId or Volume name: "))) { goto bail_out; } @@ -750,7 +750,7 @@ POOLRES *get_pool_resource(UAContext *ua) */ int select_job_dbr(UAContext *ua, JOB_DBR *jr) { - db_list_job_records(ua->jcr, ua->db, jr, prtit, ua, HORZ_LIST); + db_list_job_records(ua->jcr, ua->db, jr, printit, ua, HORZ_LIST); if (!get_pint(ua, _("Enter the JobId to select: "))) { return 0; } diff --git a/src/dird/ua_update.c b/src/dird/ua_update.c index cba0aa58feb..6b655e59420 100644 --- a/src/dird/ua_update.c +++ b/src/dird/ua_update.c @@ -899,7 +899,7 @@ static bool update_pool(UAContext *ua) } query = get_pool_memory(PM_MESSAGE); Mmsg(query, list_pool, edit_int64(pr.PoolId, ed1)); - db_list_sql_query(ua->jcr, ua->db, query, prtit, ua, true, HORZ_LIST); + db_list_sql_query(ua->jcr, ua->db, query, printit, ua, true, HORZ_LIST); free_pool_memory(query); ua->info_msg(_("Pool DB record updated from resource.\n")); return true;