summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorRichard Sharpe <sharpe@samba.org>2001-01-05 13:11:29 +0000
committerRichard Sharpe <sharpe@samba.org>2001-01-05 13:11:29 +0000
commitdca808cbc4b52e38701f814f7aac043ddd1ca1c1 (patch)
treee46027ede552d316c37c0a615915bb8553002526 /source3
parente70b103fff25f5bf4244a6ba2aed9593c99f749d (diff)
downloadsamba-dca808cbc4b52e38701f814f7aac043ddd1ca1c1.tar.gz
samba-dca808cbc4b52e38701f814f7aac043ddd1ca1c1.tar.bz2
samba-dca808cbc4b52e38701f814f7aac043ddd1ca1c1.zip
Needed a callback arg on cli_list ...
(This used to be commit d45e667a74fc2fcbf69c4819d480269c03dbfae4)
Diffstat (limited to 'source3')
-rw-r--r--source3/client/client.c6
-rw-r--r--source3/libsmb/clilist.c4
-rw-r--r--source3/smbwrapper/smbw_dir.c4
-rw-r--r--source3/utils/masktest.c8
-rw-r--r--source3/utils/torture.c8
5 files changed, 15 insertions, 15 deletions
diff --git a/source3/client/client.c b/source3/client/client.c
index 1a1abaf732..8405926121 100644
--- a/source3/client/client.c
+++ b/source3/client/client.c
@@ -473,7 +473,7 @@ static int do_list_queue_empty(void)
/****************************************************************************
a helper for do_list
****************************************************************************/
-static void do_list_helper(file_info *f, const char *mask)
+static void do_list_helper(file_info *f, const char *mask, void *state)
{
if (f->mode & aDIR) {
if (do_list_dirs && do_this_one(f)) {
@@ -537,7 +537,7 @@ void do_list(const char *mask,uint16 attribute,void (*fn)(file_info *),BOOL rec,
*/
pstring head;
pstrcpy(head, do_list_queue_head());
- cli_list(cli, head, attribute, do_list_helper);
+ cli_list(cli, head, attribute, do_list_helper, NULL);
remove_do_list_queue_head();
if ((! do_list_queue_empty()) && (fn == display_finfo))
{
@@ -561,7 +561,7 @@ void do_list(const char *mask,uint16 attribute,void (*fn)(file_info *),BOOL rec,
}
else
{
- if (cli_list(cli, mask, attribute, do_list_helper) == -1)
+ if (cli_list(cli, mask, attribute, do_list_helper, NULL) == -1)
{
DEBUG(0, ("%s listing %s\n", cli_errstr(cli), mask));
}
diff --git a/source3/libsmb/clilist.c b/source3/libsmb/clilist.c
index 2e904e06b7..ae1607c1c4 100644
--- a/source3/libsmb/clilist.c
+++ b/source3/libsmb/clilist.c
@@ -148,7 +148,7 @@ static int interpret_long_filename(int level,char *p,file_info *finfo)
do a directory listing, calling fn on each file found
****************************************************************************/
int cli_list(struct cli_state *cli,const char *Mask,uint16 attribute,
- void (*fn)(file_info *, const char *))
+ void (*fn)(file_info *, const char *, void *), void *state)
{
int max_matches = 512;
/* NT uses 260, OS/2 uses 2. Both accept 1. */
@@ -300,7 +300,7 @@ int cli_list(struct cli_state *cli,const char *Mask,uint16 attribute,
for (p=dirlist,i=0;i<total_received;i++) {
p += interpret_long_filename(info_level,p,&finfo);
- fn(&finfo, Mask);
+ fn(&finfo, Mask, state);
}
/* free up the dirlist buffer */
diff --git a/source3/smbwrapper/smbw_dir.c b/source3/smbwrapper/smbw_dir.c
index 49355ddf9c..89d137473f 100644
--- a/source3/smbwrapper/smbw_dir.c
+++ b/source3/smbwrapper/smbw_dir.c
@@ -78,7 +78,7 @@ static struct smbw_dir *cur_dir;
/*****************************************************
add a entry to a directory listing
*******************************************************/
-static void smbw_dir_add(struct file_info *finfo, const char *mask)
+static void smbw_dir_add(struct file_info *finfo, const char *mask, void * NULL)
{
DEBUG(5,("%s\n", finfo->name));
@@ -238,7 +238,7 @@ int smbw_dir_open(const char *fname)
}
#endif
if (cli_list(&srv->cli, mask, aHIDDEN|aSYSTEM|aDIR,
- smbw_dir_add) < 0) {
+ smbw_dir_add, NULL) < 0) {
errno = smbw_errno(&srv->cli);
goto failed;
}
diff --git a/source3/utils/masktest.c b/source3/utils/masktest.c
index 3fc7431519..981a508f0a 100644
--- a/source3/utils/masktest.c
+++ b/source3/utils/masktest.c
@@ -157,7 +157,7 @@ struct cli_state *connect_one(char *share)
static char *resultp;
static file_info *finfo;
-void listfn(file_info *f, const char *s)
+void listfn(file_info *f, const char *s, void *state)
{
if (strcmp(f->name,".") == 0) {
resultp[0] = '+';
@@ -172,7 +172,7 @@ void listfn(file_info *f, const char *s)
static void get_short_name(struct cli_state *cli,
char *name, fstring short_name)
{
- cli_list(cli, name, aHIDDEN | aDIR, listfn);
+ cli_list(cli, name, aHIDDEN | aDIR, listfn, NULL);
if (finfo) {
fstrcpy(short_name, finfo->short_name);
strlower(short_name);
@@ -202,12 +202,12 @@ static void testpair(struct cli_state *cli, char *mask, char *file)
fstrcpy(short_name, "");
finfo = NULL;
if (old_list) {
- cli_list_old(cli, mask, aHIDDEN | aDIR, listfn);
+ cli_list_old(cli, mask, aHIDDEN | aDIR, listfn, NULL);
} else {
get_short_name(cli, file, short_name);
finfo = NULL;
fstrcpy(res1, "---");
- cli_list(cli, mask, aHIDDEN | aDIR, listfn);
+ cli_list(cli, mask, aHIDDEN | aDIR, listfn, NULL);
}
res2 = reg_test(mask, file, short_name);
diff --git a/source3/utils/torture.c b/source3/utils/torture.c
index fc917702d3..40b4b123e9 100644
--- a/source3/utils/torture.c
+++ b/source3/utils/torture.c
@@ -2112,7 +2112,7 @@ static void run_opentest(int dummy)
printf("finished open test 1\n");
}
-static void list_fn(file_info *finfo, const char *name)
+static void list_fn(file_info *finfo, const char *name, void *state)
{
}
@@ -2149,9 +2149,9 @@ static void run_dirtest(int dummy)
t1 = end_timer();
- printf("Matched %d\n", cli_list(&cli, "a*.*", 0, list_fn));
- printf("Matched %d\n", cli_list(&cli, "b*.*", 0, list_fn));
- printf("Matched %d\n", cli_list(&cli, "xyzabc", 0, list_fn));
+ printf("Matched %d\n", cli_list(&cli, "a*.*", 0, list_fn, NULL));
+ printf("Matched %d\n", cli_list(&cli, "b*.*", 0, list_fn, NULL));
+ printf("Matched %d\n", cli_list(&cli, "xyzabc", 0, list_fn, NULL));
printf("dirtest core %g seconds\n", end_timer() - t1);