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
[])
37 lp_load(CONFIGFILE
,1,0,0);
38 codepage_initialise(lp_client_code_page());
41 while ((opt
= getopt(argc
, argv
, "W:U:R:d:P:l:hL:")) != EOF
) {
44 smbw_setshared("WORKGROUP", optarg
);
47 smbw_setshared("LOGFILE", optarg
);
50 smbw_setshared("PREFIX", optarg
);
53 smbw_setshared("DEBUG", optarg
);
56 p
= strchr(optarg
,'%');
59 smbw_setshared("PASSWORD",p
+1);
61 smbw_setshared("USER", optarg
);
64 smbw_setshared("RESOLVE_ORDER",optarg
);
85 dir
= smbw_opendir(path
);
87 printf("failed to open %s\n", path
);
91 while ((dent
= smbw_readdir(dir
))) {
92 printf("%s\n", dent
->d_name
);