Proposal: libsmbclient API
David Collier-Brown
davec-b at rogers.com
Fri Mar 20 18:42:50 GMT 2009
Andreas Schneider wrote:
> Hi Derrell,
>
> we already talked about making libsmbclient thread-safe and cleaning up the
> API. I've created two header files and an example how to use it.
>
> I've separated the options from the context. I think this makes it cleaner. I
> think the most important is, that the context is always passed between the
> functions and that there is a function to set errno and get it. errno is only
> thread safe in glibc.
>
> I haven't checked the doxygen documentation completely yet.
>
> Every kind of comment is welcome ;)
>
> Cheers,
>
> -- andreas
>
A minor one: if the context strut is likely to change, or if it's ever
going to be
(evilly) messed about with by the caller, stick a version number in it and
thereby catch misuses.
If there are a bunch of files that use it in the implementation, this will
catch development errors. If, heaven forfend, its callers delve into
it, they can catch their misuses too (;-))
The long form of this tip is at
http://www.multicians.org/stachour.html
--dave
--
David Collier-Brown, | Always do right. This will gratify
System Programmer and Author | some people and astonish the rest
davecb at spamcop.net | -- Mark Twain
(416) 223-8968
More information about the samba-technical
mailing list