7 extern DIR *smbw_opendir(const char *fname
);
8 extern struct dirent
*smbw_readdir(DIR *dirp
);
10 static void usage(void)
13 smbw_sample - a sample program that uses smbw\n \
15 smbw_sample <options> path\n \
22 -U username%%password\n \
25 note that path must start with /smb/\n \
29 int main(int argc
, char *argv
[])
40 lp_load(CONFIGFILE
,1,0,0);
41 codepage_initialise(lp_client_code_page());
44 while ((opt
= getopt(argc
, argv
, "W:U:R:d:P:l:hL:")) != EOF
) {
47 smbw_setshared("WORKGROUP", optarg
);
50 smbw_setshared("LOGFILE", optarg
);
53 smbw_setshared("PREFIX", optarg
);
56 smbw_setshared("DEBUG", optarg
);
59 p
= strchr(optarg
,'%');
62 smbw_setshared("PASSWORD",p
+1);
64 smbw_setshared("USER", optarg
);
67 smbw_setshared("RESOLVE_ORDER",optarg
);
88 dir
= smbw_opendir(path
);
90 printf("failed to open %s\n", path
);
94 while ((dent
= smbw_readdir(dir
))) {
95 printf("%s\n", dent
->d_name
);