X-Git-Url: https://develop.uap-core.de/gitweb/mizunara.git/blobdiff_plain/2f4baaacb05f4d69dac8d2888b8b8eb07606e67c..963a0109c8244dcc16a829b607a194770a77602f:/mizucp/main.h diff --git a/mizucp/main.h b/mizucp/main.h index 872b06f..e5537e5 100644 --- a/mizucp/main.h +++ b/mizucp/main.h @@ -24,6 +24,8 @@ #define MAIN_H #include +#include +#include #include @@ -41,6 +43,7 @@ extern "C" { #define CLIENT_MSG_BUFSIZE 512 #define MAX_COPY_THREADS 32 +#define MZ_COPY_BUFSIZE 4 * 1024 * 1024 typedef char CPBool; @@ -55,6 +58,7 @@ typedef struct { CPBool url; CPBool pause; CPBool printsocket; + struct stat root_stat; } CPSettings; struct MZLock { @@ -74,9 +78,22 @@ struct SrcFile { CPBool isdir; /* - * file successfully copied + * copy status + * 0: unprocessed + * 1: success + * -1: failure */ - CPBool finished; + int status; + + /* + * file mode + */ + mode_t mode; + + /* + * file size + */ + uint64_t size; /* * processing this file depends on another file (directory) @@ -107,6 +124,8 @@ int enqueue_file(SrcFile *file); int mzcp_start_copy_threads(CPSettings *settings); void* copy_run(void *data); +int mz_copy_dir(CPSettings *settings, SrcFile *file, const char *from, const char *to); +int mz_copy_file(CPSettings *settings, SrcFile *file, const char *from, const char *to, char *buffer, size_t bufsize); #ifdef __cplusplus