add mscp_get_stats

move progress bar-related functions from mscp.c to main.c.
This commit is contained in:
Ryo Nakamura
2023-03-03 18:27:14 +09:00
parent 363296f499
commit a0b7482f66
3 changed files with 235 additions and 214 deletions

View File

@@ -52,6 +52,11 @@ struct mscp_ssh_opts {
bool enable_nagle;
};
struct mscp_stats {
size_t total; /* total bytes to be transferred */
size_t done; /* total bytes transferred */
};
struct mscp;
/* initialize and return a mscp instance with option validation */
@@ -75,6 +80,12 @@ int mscp_prepare(struct mscp *m);
/* start to copy files */
int mscp_start(struct mscp *m);
/* stop copying files */
void mscp_stop(struct mscp *m);
/* get stats */
void mscp_get_stats(struct mscp *m, struct mscp_stats *s);
/* cleanup mscp instance. after mscp_cleanup(), process can restart
* from mscp_connect() with the same setting. */
void mscp_cleanup(struct mscp *m);