summaryrefslogtreecommitdiff
path: root/src/fileops.h
diff options
context:
space:
mode:
authorRyo Nakamura <upa@haeena.net>2023-08-03 20:26:13 +0900
committerRyo Nakamura <upa@haeena.net>2023-08-03 20:26:13 +0900
commitba6f53d25333fed24aa9d602262554080697bdf2 (patch)
tree63573c4226cd01e15a963c2d970c9f06d6effb99 /src/fileops.h
parent9f7c135b1515ae297b839f54ea08c1fd16c9521e (diff)
add glob for source paths
https://github.com/upa/mscp/issues/3
Diffstat (limited to 'src/fileops.h')
-rw-r--r--src/fileops.h11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/fileops.h b/src/fileops.h
index 79eb453..0063247 100644
--- a/src/fileops.h
+++ b/src/fileops.h
@@ -1,6 +1,7 @@
#include <dirent.h>
#include <sys/stat.h>
+#include <glob.h>
#include <ssh.h>
@@ -10,17 +11,18 @@ void set_tls_sftp_session(sftp_session sftp);
mscp_lstat_wrapped(). This _wrapped() functions exist for
sftp_glob() */
+/* directory operations */
+
struct mdir_struct {
DIR *local;
sftp_dir remote;
};
typedef struct mdir_struct MDIR;
-/* directory operations */
-MDIR *mscp_opendir(const char *path, sftp_session sftp);
+MDIR *mscp_opendir(const char *path, sftp_session sftp);
MDIR *mscp_opendir_wrapped(const char *path);
-int mscp_closedir(MDIR *md);
+void mscp_closedir(MDIR *md);
struct dirent *mscp_readdir(MDIR *md);
int mscp_mkdir(const char *path, mode_t mode, sftp_session sftp);
@@ -45,3 +47,6 @@ mf *mscp_open(const char *path, int flags, mode_t mode, sftp_session sftp);
void mscp_close(mf *f);
int mscp_lseek(mf *f, size_t off);
int mscp_chmod(const char *path, mode_t mode, sftp_session sftp);
+
+/* remote glob */
+int mscp_glob(const char *pattern, int flags, glob_t *pglob, sftp_session sftp);