From dace013898a450b50606740704c83ba25855e332 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Tue, 27 Jul 2010 10:59:55 +0200 Subject: s3: Remove a typedef (struct file_info) --- source3/client/client.c | 19 ++++++++++--------- source3/client/client_proto.h | 2 +- source3/client/clitar.c | 10 ++++++---- source3/include/client.h | 4 ++-- source3/include/proto.h | 9 ++++++--- source3/libgpo/gpo_filesync.c | 4 ++-- source3/libsmb/clilist.c | 17 ++++++++++------- source3/libsmb/libsmb_dir.c | 4 ++-- source3/torture/masktest.c | 5 +++-- source3/torture/nbio.c | 6 ++++-- source3/torture/torture.c | 12 ++++++++---- source3/utils/net_rpc.c | 2 +- 12 files changed, 55 insertions(+), 39 deletions(-) diff --git a/source3/client/client.c b/source3/client/client.c index cd41699da3..6afdde0ebb 100644 --- a/source3/client/client.c +++ b/source3/client/client.c @@ -484,7 +484,7 @@ static int cmd_cd_oneup(void) 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; @@ -517,7 +517,7 @@ static bool do_this_one(file_info *finfo) 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(); @@ -581,7 +581,7 @@ static void display_finfo(file_info *finfo, const char *dir) 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; @@ -594,7 +594,7 @@ static char *do_list_queue = 0; 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. @@ -711,7 +711,8 @@ static int do_list_queue_empty(void) 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; @@ -784,7 +785,7 @@ static void do_list_helper(const char *mntpoint, file_info *f, const char *mask, 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) { @@ -1153,7 +1154,7 @@ static int cmd_get(void) 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; @@ -2132,7 +2133,7 @@ static int cmd_queue(void) 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; @@ -4202,7 +4203,7 @@ struct completion_remote { }; static void completion_remote_filter(const char *mnt, - file_info *f, + struct file_info *f, const char *mask, void *state) { diff --git a/source3/client/client_proto.h b/source3/client/client_proto.h index aa3eb0e8af..aca0a8d20d 100644 --- a/source3/client/client_proto.h +++ b/source3/client/client_proto.h @@ -30,7 +30,7 @@ const char *client_get_cur_dir(void); 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); diff --git a/source3/client/clitar.c b/source3/client/clitar.c index 0a1adb463e..030362f14d 100644 --- a/source3/client/clitar.c +++ b/source3/client/clitar.c @@ -114,8 +114,9 @@ static int tarhandle; 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); @@ -613,7 +614,8 @@ static void do_setrattr(char *name, uint16 attr, int set) 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; @@ -803,7 +805,7 @@ static void do_atar(const char *rname_in,char *lname,file_info *finfo1) 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(); diff --git a/source3/include/client.h b/source3/include/client.h index d2afecf054..861ae5aace 100644 --- a/source3/include/client.h +++ b/source3/include/client.h @@ -279,7 +279,7 @@ struct cli_state { struct tevent_req **pending; }; -typedef struct file_info { +struct file_info { struct cli_state *cli; uint64_t size; uint16 mode; @@ -291,7 +291,7 @@ typedef struct file_info { 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 diff --git a/source3/include/proto.h b/source3/include/proto.h index 8dbe758e20..a9f77541ec 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -2580,11 +2580,14 @@ bool unwrap_pac(TALLOC_CTX *mem_ctx, DATA_BLOB *auth_data, DATA_BLOB *unwrapped_ /* 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 */ diff --git a/source3/libgpo/gpo_filesync.c b/source3/libgpo/gpo_filesync.c index a3002fe860..461ebb742f 100644 --- a/source3/libgpo/gpo_filesync.c +++ b/source3/libgpo/gpo_filesync.c @@ -31,7 +31,7 @@ struct sync_context { }; static void gpo_sync_func(const char *mnt, - file_info *info, + struct file_info *info, const char *mask, void *state); @@ -130,7 +130,7 @@ static bool gpo_sync_files(struct sync_context *ctx) ****************************************************************/ static void gpo_sync_func(const char *mnt, - file_info *info, + struct file_info *info, const char *mask, void *state) { diff --git a/source3/libsmb/clilist.c b/source3/libsmb/clilist.c index 93f67c7e63..3af1b0dcc0 100644 --- a/source3/libsmb/clilist.c +++ b/source3/libsmb/clilist.c @@ -48,7 +48,7 @@ static size_t interpret_long_filename(TALLOC_CTX *ctx, 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) { @@ -221,7 +221,8 @@ static size_t interpret_long_filename(TALLOC_CTX *ctx, ****************************************************************************/ 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. */ @@ -231,7 +232,7 @@ int cli_list_new(struct cli_state *cli,const char *Mask,uint16 attribute, 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; @@ -502,7 +503,7 @@ int cli_list_new(struct cli_state *cli,const char *Mask,uint16 attribute, 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); @@ -541,7 +542,8 @@ static bool interpret_short_filename(TALLOC_CTX *ctx, ****************************************************************************/ 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; @@ -658,7 +660,7 @@ int cli_list_old(struct cli_state *cli,const char *Mask,uint16 attribute, frame = talloc_stackframe(); for (p=dirlist,i=0;iprotocol <= PROTOCOL_LANMAN1) return cli_list_old(cli, Mask, attribute, fn, state); diff --git a/source3/libsmb/libsmb_dir.c b/source3/libsmb/libsmb_dir.c index de637a80e8..1a1ca68a8a 100644 --- a/source3/libsmb/libsmb_dir.c +++ b/source3/libsmb/libsmb_dir.c @@ -235,7 +235,7 @@ list_fn(const char *name, static void dir_list_fn(const char *mnt, - file_info *finfo, + struct file_info *finfo, const char *mask, void *state) { @@ -1204,7 +1204,7 @@ SMBC_mkdir_ctx(SMBCCTX *context, static void rmdir_list_fn(const char *mnt, - file_info *finfo, + struct file_info *finfo, const char *mask, void *state) { diff --git a/source3/torture/masktest.c b/source3/torture/masktest.c index 768323b9f7..83b70c25f8 100644 --- a/source3/torture/masktest.c +++ b/source3/torture/masktest.c @@ -263,9 +263,10 @@ static struct cli_state *connect_one(char *share) } 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] = '+'; diff --git a/source3/torture/nbio.c b/source3/torture/nbio.c index f69e4c3a2b..db24f10cc5 100644 --- a/source3/torture/nbio.c +++ b/source3/torture/nbio.c @@ -262,7 +262,8 @@ void nb_qfsinfo(int level) 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 */ } @@ -281,7 +282,8 @@ void nb_flush(int fnum) 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; diff --git a/source3/torture/torture.c b/source3/torture/torture.c index 79128cf4a6..df8adbdfdf 100644 --- a/source3/torture/torture.c +++ b/source3/torture/torture.c @@ -4791,7 +4791,8 @@ static bool run_openattrtest(int dummy) 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) { } @@ -4850,7 +4851,8 @@ static bool run_dirtest(int dummy) 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; @@ -6151,7 +6153,8 @@ static bool run_uid_regression_test(int dummy) 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; @@ -6174,7 +6177,8 @@ struct sn_state { 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; diff --git a/source3/utils/net_rpc.c b/source3/utils/net_rpc.c index 8e2cbd1b2e..cafab87a96 100644 --- a/source3/utils/net_rpc.c +++ b/source3/utils/net_rpc.c @@ -3343,7 +3343,7 @@ static int rpc_share_migrate_shares(struct net_context *c, int argc, * @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; -- cgit