Skip to content

Commit c411a8c

Browse files
committed
refactoring. remove unused move_file(), remove_trailing_space(), remove_not_digit() functions
1 parent 109af56 commit c411a8c

File tree

2 files changed

+3
-43
lines changed

2 files changed

+3
-43
lines changed

src/pg_probackup.h

+3-5
Original file line numberDiff line numberDiff line change
@@ -622,8 +622,9 @@ extern void restore_data_file(const char *to_path,
622622
pgFile *file, bool allow_truncate,
623623
bool write_header,
624624
uint32 backup_version);
625-
extern bool copy_file(const char *from_root, fio_location from_location, const char *to_root, fio_location to_location, pgFile *file);
626-
extern void move_file(const char *from_root, const char *to_root, pgFile *file);
625+
extern bool copy_file(const char *from_root, fio_location from_location,
626+
const char *to_root, fio_location to_location,
627+
pgFile *file);
627628

628629
extern bool check_file_pages(pgFile *file, XLogRecPtr stop_lsn,
629630
uint32 checksum_version, uint32 backup_version);
@@ -659,11 +660,8 @@ extern void set_min_recovery_point(pgFile *file, const char *backup_path,
659660
extern void copy_pgcontrol_file(const char *from_root, fio_location location, const char *to_root, fio_location to_location,
660661
pgFile *file);
661662

662-
extern void sanityChecks(void);
663663
extern void time2iso(char *buf, size_t len, time_t time);
664664
extern const char *status2str(BackupStatus status);
665-
extern void remove_trailing_space(char *buf, int comment_mark);
666-
extern void remove_not_digit(char *buf, size_t len, const char *str);
667665
extern const char *base36enc(long unsigned int value);
668666
extern char *base36enc_dup(long unsigned int value);
669667
extern long unsigned int base36dec(const char *text);

src/util.c

-38
Original file line numberDiff line numberDiff line change
@@ -457,41 +457,3 @@ status2str(BackupStatus status)
457457

458458
return statusName[status];
459459
}
460-
461-
void
462-
remove_trailing_space(char *buf, int comment_mark)
463-
{
464-
int i;
465-
char *last_char = NULL;
466-
467-
for (i = 0; buf[i]; i++)
468-
{
469-
if (buf[i] == comment_mark || buf[i] == '\n' || buf[i] == '\r')
470-
{
471-
buf[i] = '\0';
472-
break;
473-
}
474-
}
475-
for (i = 0; buf[i]; i++)
476-
{
477-
if (!isspace(buf[i]))
478-
last_char = buf + i;
479-
}
480-
if (last_char != NULL)
481-
*(last_char + 1) = '\0';
482-
483-
}
484-
485-
void
486-
remove_not_digit(char *buf, size_t len, const char *str)
487-
{
488-
int i, j;
489-
490-
for (i = 0, j = 0; str[i] && j < len; i++)
491-
{
492-
if (!isdigit(str[i]))
493-
continue;
494-
buf[j++] = str[i];
495-
}
496-
buf[j] = '\0';
497-
}

0 commit comments

Comments
 (0)