version 1.5, 2001/04/15 08:43:46 |
version 1.5.2.1, 2001/09/27 19:03:55 |
|
|
|
|
#include <glob.h> |
#include <glob.h> |
|
|
#include "ssh.h" |
|
#include "buffer.h" |
#include "buffer.h" |
#include "bufaux.h" |
#include "bufaux.h" |
#include "getput.h" |
|
#include "xmalloc.h" |
#include "xmalloc.h" |
#include "log.h" |
#include "log.h" |
#include "atomicio.h" |
|
#include "pathnames.h" |
|
|
|
#include "sftp.h" |
#include "sftp.h" |
#include "sftp-common.h" |
#include "sftp-common.h" |
|
|
int fd_out; |
int fd_out; |
} cur; |
} cur; |
|
|
void *fudge_opendir(const char *path) |
static void * |
|
fudge_opendir(const char *path) |
{ |
{ |
struct SFTP_OPENDIR *r; |
struct SFTP_OPENDIR *r; |
|
|
|
|
return((void*)r); |
return((void*)r); |
} |
} |
|
|
struct dirent *fudge_readdir(struct SFTP_OPENDIR *od) |
static struct dirent * |
|
fudge_readdir(struct SFTP_OPENDIR *od) |
{ |
{ |
static struct dirent ret; |
static struct dirent ret; |
|
|
|
|
return(&ret); |
return(&ret); |
} |
} |
|
|
void fudge_closedir(struct SFTP_OPENDIR *od) |
static void |
|
fudge_closedir(struct SFTP_OPENDIR *od) |
{ |
{ |
free_sftp_dirents(od->dir); |
free_sftp_dirents(od->dir); |
xfree(od); |
xfree(od); |
} |
} |
|
|
void attrib_to_stat(Attrib *a, struct stat *st) |
static void |
|
attrib_to_stat(Attrib *a, struct stat *st) |
{ |
{ |
memset(st, 0, sizeof(*st)); |
memset(st, 0, sizeof(*st)); |
|
|
|
|
} |
} |
} |
} |
|
|
int fudge_lstat(const char *path, struct stat *st) |
static int |
|
fudge_lstat(const char *path, struct stat *st) |
{ |
{ |
Attrib *a; |
Attrib *a; |
|
|
|
|
return(0); |
return(0); |
} |
} |
|
|
int fudge_stat(const char *path, struct stat *st) |
static int |
|
fudge_stat(const char *path, struct stat *st) |
{ |
{ |
Attrib *a; |
Attrib *a; |
|
|
|
|
remote_glob(int fd_in, int fd_out, const char *pattern, int flags, |
remote_glob(int fd_in, int fd_out, const char *pattern, int flags, |
int (*errfunc)(const char *, int), glob_t *pglob) |
int (*errfunc)(const char *, int), glob_t *pglob) |
{ |
{ |
pglob->gl_opendir = (void*)fudge_opendir; |
pglob->gl_opendir = fudge_opendir; |
pglob->gl_readdir = (void*)fudge_readdir; |
pglob->gl_readdir = (struct dirent *(*)(void *))fudge_readdir; |
pglob->gl_closedir = (void*)fudge_closedir; |
pglob->gl_closedir = (void (*)(void *))fudge_closedir; |
pglob->gl_lstat = fudge_lstat; |
pglob->gl_lstat = fudge_lstat; |
pglob->gl_stat = fudge_stat; |
pglob->gl_stat = fudge_stat; |
|
|
|
|
cur.fd_in = fd_in; |
cur.fd_in = fd_in; |
cur.fd_out = fd_out; |
cur.fd_out = fd_out; |
|
|
return(glob(pattern, flags | GLOB_ALTDIRFUNC, (void*)errfunc, |
return(glob(pattern, flags | GLOB_ALTDIRFUNC, errfunc, |
pglob)); |
pglob)); |
} |
} |