implement fill_file

This commit is contained in:
Ryo Nakamura
2022-10-16 22:12:03 +09:00
parent 579629dea2
commit def9cfeba7
8 changed files with 929 additions and 32 deletions

View File

@@ -1,14 +1,15 @@
#ifndef _FILE_H_
#define _FILE_H_
struct path {
char *path;
bool remote;
};
#include <libssh/libssh.h>
#include <libssh/sftp.h>
#include <list.h>
struct file {
struct path src; /* copy source */
struct path dst; /* copy desitnation */
struct list_head list; /* sscp->file_list */
char *path;
bool remote;
size_t size; /* size of this file */
};
@@ -18,11 +19,14 @@ struct chunk {
size_t len; /* length of this chunk */
};
struct file *file_expand(char **src_array, char *dst)
{
/* return array of files expanded from sources and dst */
return NULL;
}
char *file_find_hostname(char *path);
bool file_has_hostname(char *path);
int file_is_directory(char *path, sftp_session sftp);
int file_fill(sftp_session sftp, struct list_head *head, char **src_array, int count);
#ifdef DEBUG
void file_dump(struct list_head *head);
#endif
#endif /* _FILE_H_ */