diff options
author | Andreas Schneider <mail@cynapses.org> | 2009-07-28 14:13:22 +0200 |
---|---|---|
committer | Andreas Schneider <mail@cynapses.org> | 2009-07-28 14:13:22 +0200 |
commit | b4111c5c187cf9212eba0ae459edb630dbddb656 (patch) | |
tree | 0a8351dffea74df590633c85bc76fde4c0f4c6b0 /libssh | |
parent | b9b7174d858faa070e66db9b7710c384756f90fc (diff) | |
download | libssh-b4111c5c187cf9212eba0ae459edb630dbddb656.tar.gz libssh-b4111c5c187cf9212eba0ae459edb630dbddb656.tar.xz libssh-b4111c5c187cf9212eba0ae459edb630dbddb656.zip |
Add functions to get the extension count, name and data.
Diffstat (limited to 'libssh')
-rw-r--r-- | libssh/sftp.c | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/libssh/sftp.c b/libssh/sftp.c index 9363955a..d8c46909 100644 --- a/libssh/sftp.c +++ b/libssh/sftp.c @@ -587,6 +587,38 @@ int sftp_init(SFTP_SESSION *sftp) { return 0; } +unsigned int sftp_extensions_get_count(SFTP_SESSION *sftp) { + if (sftp == NULL || sftp->ext == NULL) { + return 0; + } + + return sftp->ext->count; +} + +const char *sftp_extensions_get_name(SFTP_SESSION *sftp, unsigned int index) { + if (sftp == NULL || sftp->ext == NULL || sftp->ext->name == NULL) { + return NULL; + } + + if (index > sftp->ext->count) { + return NULL; + } + + return sftp->ext->name[index]; +} + +const char *sftp_extensions_get_data(SFTP_SESSION *sftp, unsigned int index) { + if (sftp == NULL || sftp->ext == NULL || sftp->ext->data == NULL) { + return NULL; + } + + if (index > sftp->ext->count) { + return NULL; + } + + return sftp->ext->data[index]; +} + static REQUEST_QUEUE *request_queue_new(SFTP_MESSAGE *msg) { REQUEST_QUEUE *queue = NULL; |