Decide if a file should be operated on.
********************************************************************/
-static bool do_this_one(file_info *finfo)
+static bool do_this_one(struct file_info *finfo)
{
if (!finfo->name) {
return false;
Display info about a file.
****************************************************************************/
-static void display_finfo(file_info *finfo, const char *dir)
+static void display_finfo(struct file_info *finfo, const char *dir)
{
time_t t;
TALLOC_CTX *ctx = talloc_tos();
Accumulate size of a file.
****************************************************************************/
-static void do_du(file_info *finfo, const char *dir)
+static void do_du(struct file_info *finfo, const char *dir)
{
if (do_this_one(finfo)) {
dir_total += finfo->size;
static long do_list_queue_size = 0;
static long do_list_queue_start = 0;
static long do_list_queue_end = 0;
-static void (*do_list_fn)(file_info *, const char *dir);
+static void (*do_list_fn)(struct file_info *, const char *dir);
/****************************************************************************
Functions for do_list_queue.
A helper for do_list.
****************************************************************************/
-static void do_list_helper(const char *mntpoint, file_info *f, const char *mask, void *state)
+static void do_list_helper(const char *mntpoint, struct file_info *f,
+ const char *mask, void *state)
{
TALLOC_CTX *ctx = talloc_tos();
char *dir = NULL;
void do_list(const char *mask,
uint16 attribute,
- void (*fn)(file_info *, const char *dir),
+ void (*fn)(struct file_info *, const char *dir),
bool rec,
bool dirs)
{
Do an mget operation on one file.
****************************************************************************/
-static void do_mget(file_info *finfo, const char *dir)
+static void do_mget(struct file_info *finfo, const char *dir)
{
TALLOC_CTX *ctx = talloc_tos();
char *rname = NULL;
Delete some files.
****************************************************************************/
-static void do_del(file_info *finfo, const char *dir)
+static void do_del(struct file_info *finfo, const char *dir)
{
TALLOC_CTX *ctx = talloc_tos();
char *mask = NULL;
};
static void completion_remote_filter(const char *mnt,
- file_info *f,
+ struct file_info *f,
const char *mask,
void *state)
{
const char *client_set_cur_dir(const char *newdir);
void do_list(const char *mask,
uint16 attribute,
- void (*fn)(file_info *, const char *dir),
+ void (*fn)(struct file_info *, const char *dir),
bool rec,
bool dirs);
int cmd_iosize(void);
static void writetarheader(int f, const char *aname, uint64_t size, time_t mtime,
const char *amode, unsigned char ftype);
-static void do_atar(const char *rname_in,char *lname,file_info *finfo1);
-static void do_tar(file_info *finfo, const char *dir);
+static void do_atar(const char *rname_in, char *lname,
+ struct file_info *finfo1);
+static void do_tar(struct file_info *finfo, const char *dir);
static void oct_it(uint64_t value, int ndgs, char *p);
static void fixtarname(char *tptr, const char *fp, size_t l);
static int dotarbuf(int f, char *b, int n);
append one remote file to the tar file
***************************************************************************/
-static void do_atar(const char *rname_in,char *lname,file_info *finfo1)
+static void do_atar(const char *rname_in, char *lname,
+ struct file_info *finfo1)
{
uint16_t fnum = (uint16_t)-1;
uint64_t nread=0;
Append single file to tar file (or not)
***************************************************************************/
-static void do_tar(file_info *finfo, const char *dir)
+static void do_tar(struct file_info *finfo, const char *dir)
{
TALLOC_CTX *ctx = talloc_stackframe();
struct tevent_req **pending;
};
-typedef struct file_info {
+struct file_info {
struct cli_state *cli;
uint64_t size;
uint16 mode;
struct timespec ctime_ts;
char *name;
char short_name[13*3]; /* the *3 is to cope with multi-byte */
-} file_info;
+};
#define CLI_FULL_CONNECTION_DONT_SPNEGO 0x0001
#define CLI_FULL_CONNECTION_USE_KERBEROS 0x0002
/* The following definitions come from libsmb/clilist.c */
int cli_list_new(struct cli_state *cli,const char *Mask,uint16 attribute,
- void (*fn)(const char *, file_info *, const char *, void *), void *state);
+ void (*fn)(const char *, struct file_info *, const char *,
+ void *), void *state);
int cli_list_old(struct cli_state *cli,const char *Mask,uint16 attribute,
- void (*fn)(const char *, file_info *, const char *, void *), void *state);
+ void (*fn)(const char *, struct file_info *, const char *,
+ void *), void *state);
int cli_list(struct cli_state *cli,const char *Mask,uint16 attribute,
- void (*fn)(const char *, file_info *, const char *, void *), void *state);
+ void (*fn)(const char *, struct file_info *, const char *,
+ void *), void *state);
/* The following definitions come from libsmb/climessage.c */
};
static void gpo_sync_func(const char *mnt,
- file_info *info,
+ struct file_info *info,
const char *mask,
void *state);
****************************************************************/
static void gpo_sync_func(const char *mnt,
- file_info *info,
+ struct file_info *info,
const char *mask,
void *state)
{
int level,
const char *p,
const char *pdata_end,
- file_info *finfo,
+ struct file_info *finfo,
uint32 *p_resume_key,
DATA_BLOB *p_last_name_raw)
{
****************************************************************************/
int cli_list_new(struct cli_state *cli,const char *Mask,uint16 attribute,
- void (*fn)(const char *, file_info *, const char *, void *), void *state)
+ void (*fn)(const char *, struct file_info *, const char *,
+ void *), void *state)
{
#if 1
int max_matches = 1366; /* Match W2k - was 512. */
int info_level;
char *p, *p2, *rdata_end;
char *mask = NULL;
- file_info finfo;
+ struct file_info finfo;
int i;
char *dirlist = NULL;
int dirlist_len = 0;
static bool interpret_short_filename(TALLOC_CTX *ctx,
struct cli_state *cli,
char *p,
- file_info *finfo)
+ struct file_info *finfo)
{
size_t ret;
ZERO_STRUCTP(finfo);
****************************************************************************/
int cli_list_old(struct cli_state *cli,const char *Mask,uint16 attribute,
- void (*fn)(const char *, file_info *, const char *, void *), void *state)
+ void (*fn)(const char *, struct file_info *, const char *,
+ void *), void *state)
{
char *p;
int received = 0;
frame = talloc_stackframe();
for (p=dirlist,i=0;i<num_received;i++) {
- file_info finfo;
+ struct file_info finfo;
if (!interpret_short_filename(frame, cli, p, &finfo)) {
break;
}
****************************************************************************/
int cli_list(struct cli_state *cli,const char *Mask,uint16 attribute,
- void (*fn)(const char *, file_info *, const char *, void *), void *state)
+ void (*fn)(const char *, struct file_info *, const char *,
+ void *), void *state)
{
if (cli->protocol <= PROTOCOL_LANMAN1)
return cli_list_old(cli, Mask, attribute, fn, state);
static void
dir_list_fn(const char *mnt,
- file_info *finfo,
+ struct file_info *finfo,
const char *mask,
void *state)
{
static void
rmdir_list_fn(const char *mnt,
- file_info *finfo,
+ struct file_info *finfo,
const char *mask,
void *state)
{
}
static char *resultp;
-static file_info *f_info;
+static struct file_info *f_info;
-static void listfn(const char *mnt, file_info *f, const char *s, void *state)
+static void listfn(const char *mnt, struct file_info *f, const char *s,
+ void *state)
{
if (strcmp(f->name,".") == 0) {
resultp[0] = '+';
cli_dskattr(c, &bsize, &total, &avail);
}
-static void find_fn(const char *mnt, file_info *finfo, const char *name, void *state)
+static void find_fn(const char *mnt, struct file_info *finfo, const char *name,
+ void *state)
{
/* noop */
}
static int total_deleted;
-static void delete_fn(const char *mnt, file_info *finfo, const char *name, void *state)
+static void delete_fn(const char *mnt, struct file_info *finfo,
+ const char *name, void *state)
{
char *s, *n;
if (finfo->name[0] == '.') return;
return correct;
}
-static void list_fn(const char *mnt, file_info *finfo, const char *name, void *state)
+static void list_fn(const char *mnt, struct file_info *finfo,
+ const char *name, void *state)
{
}
return correct;
}
-static void del_fn(const char *mnt, file_info *finfo, const char *mask, void *state)
+static void del_fn(const char *mnt, struct file_info *finfo, const char *mask,
+ void *state)
{
struct cli_state *pcli = (struct cli_state *)state;
fstring fname;
static const char *illegal_chars = "*\\/?<>|\":";
static char force_shortname_chars[] = " +,.[];=\177";
-static void shortname_del_fn(const char *mnt, file_info *finfo, const char *mask, void *state)
+static void shortname_del_fn(const char *mnt, struct file_info *finfo,
+ const char *mask, void *state)
{
struct cli_state *pcli = (struct cli_state *)state;
fstring fname;
bool val;
};
-static void shortname_list_fn(const char *mnt, file_info *finfo, const char *name, void *state)
+static void shortname_list_fn(const char *mnt, struct file_info *finfo,
+ const char *name, void *state)
{
struct sn_state *s = (struct sn_state *)state;
int i = s->i;
* @param state arg-pointer
*
**/
-static void copy_fn(const char *mnt, file_info *f,
+static void copy_fn(const char *mnt, struct file_info *f,
const char *mask, void *state)
{
static NTSTATUS nt_status;