From 2dc3b5c67527b9403befb2d54c43a3fab23be4e2 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Wed, 12 Aug 2009 17:12:26 +0200 Subject: Add sftp_extension_supported() function. --- include/libssh/sftp.h | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'include') diff --git a/include/libssh/sftp.h b/include/libssh/sftp.h index 347661d..9d3647b 100644 --- a/include/libssh/sftp.h +++ b/include/libssh/sftp.h @@ -261,6 +261,26 @@ LIBSSH_API const char *sftp_extensions_get_name(SFTP_SESSION *sftp, unsigned int */ LIBSSH_API const char *sftp_extensions_get_data(SFTP_SESSION *sftp, unsigned int index); +/** + * @brief Check if the given extension is supported. + * + * @param sftp The sftp session to use. + * + * @param name The name of the extension. + * + * @param data The data of the extension. + * + * @return 1 if supported, 0 if not. + * + * Example: + * + * @code + * sftp_extension_supported(sftp, "statvfs@openssh.com", "2"); + * @endcode + */ +LIBSSH_API int sftp_extension_supported(SFTP_SESSION *sftp, const char *name, + const char *data); + /** * @brief Open a directory used to obtain directory entries. * -- cgit