Bug 4340 - smbc_open prototype should be (furl,flags,...)
smbc_open prototype should be (furl,flags,...)
Product: Samba 3.0
Classification: Unclassified
Component: libsmbclient
Other Other
: P3 normal
: none
Assigned To: Derrell Lipman
Samba QA Contact
Depends on:
  Show dependency treegraph
Reported: 2007-01-14 18:14 UTC by Samuel Thibault
Modified: 2007-02-03 15:46 UTC (History)
0 users

See Also:


Note You need to log in before you can comment on or make changes to this bug.
Description Samuel Thibault 2007-01-14 18:14:45 UTC
The prototype of smbc_open() (and the open member of SMBCCTX) should be

int smbc_open(const char *furl, int flags);

and the mode parameter should be obtained through
va_start/va_arg/va_end, so that people can write

fd = smbc_open("foo", O_RDONLY);

just like with open()
Comment 1 Derrell Lipman 2007-02-03 08:59:28 UTC
You're absolutely right that that's what the prototype should have been.  At this point, though, I don't want to change it.  Although your suggested change should be backward compatible, I prefer not to make interface changes when this has so many existing users already.
Comment 2 Samuel Thibault 2007-02-03 15:46:33 UTC
That wouldn't change the API at all, so existing code would just compile fine.  That said, in the meanwhile, I realized that on some architectures, the ABI changes between functions with static number of parameters and functions with variable number of parameter. _That_ would break existing _binaries_.