7 static void usage(void)
10 smbw_sample - a sample program that uses smbw
12 smbw_sample <options> path
22 note that path must start with /smb/
26 int main(int argc, char *argv[])
35 TALLOC_CTX *frame = talloc_stackframe();
37 lp_load(get_dyn_CONFIGFILE(),1,0,0,1);
40 while ((opt = getopt(argc, argv, "W:U:R:d:P:l:hL:")) != EOF) {
43 smbw_setshared("WORKGROUP", optarg);
46 smbw_setshared("LOGFILE", optarg);
49 smbw_setshared("PREFIX", optarg);
52 smbw_setshared("DEBUG", optarg);
55 p = strchr_m(optarg,'%');
58 smbw_setshared("PASSWORD",p+1);
60 smbw_setshared("USER", optarg);
63 smbw_setshared("RESOLVE_ORDER",optarg);
84 dir = smbw_opendir(path);
86 printf("failed to open %s\n", path);
90 while ((dent = smbw_readdir(dir))) {
91 printf("%s\n", dent->d_name);