From d15663477be6028b1acc344ac3b2763c9793ea1c Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Fri, 28 May 2010 17:21:39 +0200 Subject: [PATCH] statvfs: use libssh2_sftp_statvfs only, no "_ex" As the long-term goal is to get rid of the extensive set of macros from the API we can just as well start small by not adding new macros when we add new functions. Therefore we let the function be libssh2_sftp_statvfs() plainly without using an _ex suffix. I also made it use size_t instead of unsigned int for the string length as that too is a long-term goal for the API. --- docs/Makefile.am | 1 - docs/libssh2_sftp_statvfs.3 | 6 ++---- docs/libssh2_sftp_statvfs_ex.3 | 1 - include/libssh2_sftp.h | 10 ++++------ src/sftp.c | 6 +++--- 5 files changed, 9 insertions(+), 15 deletions(-) delete mode 100644 docs/libssh2_sftp_statvfs_ex.3 diff --git a/docs/Makefile.am b/docs/Makefile.am index 022e6e4..9f905d8 100644 --- a/docs/Makefile.am +++ b/docs/Makefile.am @@ -138,7 +138,6 @@ dist_man_MANS = \ libssh2_sftp_stat.3 \ libssh2_sftp_stat_ex.3 \ libssh2_sftp_statvfs.3 \ - libssh2_sftp_statvfs_ex.3 \ libssh2_sftp_symlink.3 \ libssh2_sftp_symlink_ex.3 \ libssh2_sftp_tell.3 \ diff --git a/docs/libssh2_sftp_statvfs.3 b/docs/libssh2_sftp_statvfs.3 index e1b058f..6327030 100644 --- a/docs/libssh2_sftp_statvfs.3 +++ b/docs/libssh2_sftp_statvfs.3 @@ -7,10 +7,8 @@ libssh2_sftp_statvfs, libssh2_sftp_fstatvfs - get file system statistics #include int -libssh2_sftp_statvfs_ex(LIBSSH2_SFTP *sftp, const char *path, - unsigned int path_len, LIBSSH2_SFTP_STATVFS *st); -#define libssh2_sftp_statvfs(sftp, path, st) \\ - libssh2_sftp_statvfs_ex((sftp), (path), strlen(path), (st)) +libssh2_sftp_statvfs(LIBSSH2_SFTP *sftp, const char *path, + size_t path_len, LIBSSH2_SFTP_STATVFS *st); int libssh2_sftp_fstatvfs(LIBSSH2_SFTP_HANDLE *handle, diff --git a/docs/libssh2_sftp_statvfs_ex.3 b/docs/libssh2_sftp_statvfs_ex.3 deleted file mode 100644 index 934d2a1..0000000 --- a/docs/libssh2_sftp_statvfs_ex.3 +++ /dev/null @@ -1 +0,0 @@ -.so man3/libssh2_sftp_statvfs.3 diff --git a/include/libssh2_sftp.h b/include/libssh2_sftp.h index fa5925d..c40420d 100644 --- a/include/libssh2_sftp.h +++ b/include/libssh2_sftp.h @@ -291,12 +291,10 @@ LIBSSH2_API int libssh2_sftp_unlink_ex(LIBSSH2_SFTP *sftp, LIBSSH2_API int libssh2_sftp_fstatvfs(LIBSSH2_SFTP_HANDLE *handle, LIBSSH2_SFTP_STATVFS *st); -LIBSSH2_API int libssh2_sftp_statvfs_ex(LIBSSH2_SFTP *sftp, - const char *path, - unsigned int path_len, - LIBSSH2_SFTP_STATVFS *st); -#define libssh2_sftp_statvfs(sftp, path, st) \ - libssh2_sftp_statvfs_ex((sftp), (path), strlen(path), (st)) +LIBSSH2_API int libssh2_sftp_statvfs(LIBSSH2_SFTP *sftp, + const char *path, + size_t path_len, + LIBSSH2_SFTP_STATVFS *st); LIBSSH2_API int libssh2_sftp_mkdir_ex(LIBSSH2_SFTP *sftp, const char *path, diff --git a/src/sftp.c b/src/sftp.c index be8be31..95b5802 100644 --- a/src/sftp.c +++ b/src/sftp.c @@ -2161,12 +2161,12 @@ static int sftp_statvfs(LIBSSH2_SFTP *sftp, const char *path, * support on the server) */ LIBSSH2_API int -libssh2_sftp_statvfs_ex(LIBSSH2_SFTP *sftp, const char *path, - unsigned int path_len, LIBSSH2_SFTP_STATVFS *st) +libssh2_sftp_statvfs(LIBSSH2_SFTP *sftp, const char *path, + size_t path_len, LIBSSH2_SFTP_STATVFS *st) { int rc; BLOCK_ADJUST(rc, sftp->channel->session, sftp_statvfs(sftp, path, path_len, - st)); + st)); return rc; }