mirror of
https://git.libssh.org/projects/libssh.git
synced 2026-02-12 11:10:28 +09:00
sftp: Reformat sftp_extensions_* API
Signed-off-by: Jakub Jelen <jjelen@redhat.com>
Reviewed-by: Pavol Žáčik <pzacik@redhat.com>
(cherry picked from commit f0fdfd4f49)
This commit is contained in:
17
src/sftp.c
17
src/sftp.c
@@ -567,7 +567,8 @@ int sftp_init(sftp_session sftp)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned int sftp_extensions_get_count(sftp_session sftp) {
|
unsigned int sftp_extensions_get_count(sftp_session sftp)
|
||||||
|
{
|
||||||
if (sftp == NULL || sftp->ext == NULL) {
|
if (sftp == NULL || sftp->ext == NULL) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -575,9 +576,12 @@ unsigned int sftp_extensions_get_count(sftp_session sftp) {
|
|||||||
return sftp->ext->count;
|
return sftp->ext->count;
|
||||||
}
|
}
|
||||||
|
|
||||||
const char *sftp_extensions_get_name(sftp_session sftp, unsigned int idx) {
|
const char *sftp_extensions_get_name(sftp_session sftp, unsigned int idx)
|
||||||
if (sftp == NULL)
|
{
|
||||||
|
if (sftp == NULL) {
|
||||||
return NULL;
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
if (sftp->ext == NULL || sftp->ext->name == NULL) {
|
if (sftp->ext == NULL || sftp->ext->name == NULL) {
|
||||||
ssh_set_error_invalid(sftp->session);
|
ssh_set_error_invalid(sftp->session);
|
||||||
return NULL;
|
return NULL;
|
||||||
@@ -591,9 +595,12 @@ const char *sftp_extensions_get_name(sftp_session sftp, unsigned int idx) {
|
|||||||
return sftp->ext->name[idx];
|
return sftp->ext->name[idx];
|
||||||
}
|
}
|
||||||
|
|
||||||
const char *sftp_extensions_get_data(sftp_session sftp, unsigned int idx) {
|
const char *sftp_extensions_get_data(sftp_session sftp, unsigned int idx)
|
||||||
if (sftp == NULL)
|
{
|
||||||
|
if (sftp == NULL) {
|
||||||
return NULL;
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
if (sftp->ext == NULL || sftp->ext->name == NULL) {
|
if (sftp->ext == NULL || sftp->ext->name == NULL) {
|
||||||
ssh_set_error_invalid(sftp->session);
|
ssh_set_error_invalid(sftp->session);
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|||||||
Reference in New Issue
Block a user