Subject: Re: libssh2 master ed526a0 Add libssh2_sftp_statvfs() and libssh2_sftp_fstatvfs()

Re: libssh2 master ed526a0 Add libssh2_sftp_statvfs() and libssh2_sftp_fstatvfs()

From: Peter Stuge <peter_at_stuge.se>
Date: Mon, 24 May 2010 13:43:25 +0200

Daniel Stenberg wrote:
> I'm very much against the _ex() functions we have all over

I agree for some or even many calls.

> and I'm working hard towards removing the extensive use of macros
> instead of real functions in our API.

Yes, the macros kinda suck, but would a function doing the same thing
be much better?

> New functions and new things we add do not have to make the pains
> worse. We should add sensible functions without "_ex" and that we
> use directly without macros. Please.

Sure! Please suggest an improved API for these functions?

The difference between _ex and non-_ex here is that the macro calls
strlen(). Although not likely to be so common SSH does support
character sets with 0 bytes in them, and even though libssh2 is a C
API I hope you agree that it's not sensible to not be 8-bit clean.
Bindings for higher level language usually like data+length too.

I would be fine with removing the macro and giving the function the
same name as the macro has now, basically remove the convenience
strlen() from libssh2.

But I'd like to hear other suggestions too!

I didn't really have any good suggestion for how to make the API
better, so I pushed what was similar to the code we have.

(I found some other, perhaps even more important, issues throughout
the SFTP code too, it basically doesn't handle short writes correctly
in very many places.) Joey half-promised to look into it. :)

//Peter
_______________________________________________
libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel
Received on 2010-05-24