Proposal: libsmbclient API

Andreas Schneider mail at cynapses.org
Sat Mar 21 08:03:45 GMT 2009


On Friday 20 March 2009 19:42:50 David Collier-Brown wrote:
> 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.
>

Hi Dave,

I thought about adding a function for version checks.

const char *smbc_check_version(int req_version_num);

Which returns the version number if we match it or pass 0 to the function. On 
error return NULL.

if (smbc_check_version (SMBC_VERSION_NUM) == NULL) {
	fprintf(stderr, "Runtime version of libsmbclient too old!\n");
   exit(1);
}

if (debug) {
  printf ("libsmbclient %s\n", smbc_check_version(0));
}

And the string could look something like:
0.0.1
0.0.1/heimdal
0.0.1/MIT
0.0.1/heimdal/vendor
...


	-- andreas
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part.
Url : http://lists.samba.org/archive/samba-technical/attachments/20090321/49b0edd3/attachment.bin


More information about the samba-technical mailing list