add checkpoint.c and .h

This commit is contained in:
Ryo Nakamura
2024-02-16 14:54:24 +09:00
parent 4e895bb72e
commit f71c7a145a
11 changed files with 502 additions and 71 deletions

16
src/checkpoint.h Normal file
View File

@@ -0,0 +1,16 @@
#ifndef _CHECKPOINT_H_
#define _CHECKPOINT_H_
#include <pool.h>
/* checkpoint_save() stores states to a checkponint file (pathname) */
int checkpoint_save(const char *pathname, int dir, char *remote_host, pool *path_pool,
pool *chunk_pool);
/* checkpoint_load() reads a checkpoint file (pathname). If path_pool
* and chunk_pool are NULL, This function fills only *remote and *dir.
*/
int checkpoint_load(const char *pathname, char *remote, size_t len, int *dir,
pool *path_pool, pool *chunk_pool);
#endif /* _CHECKPOINT_H_ */