clientgen and cwd

Luke Kenneth Casson Leighton lkcl at
Mon Nov 9 22:18:38 GMT 1998

On Tue, 10 Nov 1998, Andrew Tridgell wrote:

> > > > OH YEHHHHHH!  ok, next stage is to divide the functions out from client.c
> > > > into clientgen.c so o have do_getcwd and cli_getcwd.  this makes client.c
> > > > a little smaller and clientgen.c gets a bit unwieldy instead.  in
> > > > BRANCH_NTDOM this prompted me to split clientgen.c down into about four
> > > > modules: setup, print, ipc and file.
> > > 
> > > do we want clientgen.c to know about the current working directory?
> > 
> > hm, nooo... i created a "struct client_info" which contained all the
> > global variables in client.c and a "struct client_tar_info" that contained
> > all the global variables in clitar.c.
> fine, but don't move them into clientgen.c

i didn't.  i won't.
> clientgen.c has a reasonable interface now, I don't think we want to
> burden it with concepts that are alien to SMB (such as cwd).

or recurse subdirectories.  or

> I'm not really sure what that gains us. It would just mean that
> instead of having several small global variables we have one large
> one. That isn't really any better.

well, i actually passed them around the client.c functions as a parameter.
the struct client_info contained, as well as all the other blurb, a struct
cli_info, and the struct client_info was static in client.c

> The right way to do this is to have structures that represent
the > server context and structures for a file context. This is what I did
> for smbwrapper, see "struct smbw_server", "struct smbw_file", "struct
> smbw_filedes" and "struct smbw_dir" in smbw.h.

> Each of these structures contain just the info they need to do the job
> they are intended for, rather than containing the kitchen sink.


> Using
> this design meant that having lots of simultaneous connections to
> different servers, and different trees on those servers, was quite
> natural in smbwrapper.


ok, i suggested the global search/replace as it makes for a simple first
step.  i like the smbw_xxx principles.

More information about the samba-technical mailing list