aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorAris Adamantiadis <aris@0xbadc0de.be>2009-09-02 16:34:32 +0300
committerAris Adamantiadis <aris@0xbadc0de.be>2009-09-13 14:03:33 +0300
commit07a9e6b7c634491db1b6875f5a2018fa9f90773a (patch)
treef4f4458f7698cbcca810e9c420fa2262a2750196 /include
parent86e6444656d140a7cb4c7931f32729d2e5a85d81 (diff)
downloadlibssh-07a9e6b7c634491db1b6875f5a2018fa9f90773a.tar.gz
libssh-07a9e6b7c634491db1b6875f5a2018fa9f90773a.tar.xz
libssh-07a9e6b7c634491db1b6875f5a2018fa9f90773a.zip
Change scp API to use integers for perms
Diffstat (limited to 'include')
-rw-r--r--include/libssh/libssh.h18
-rw-r--r--include/libssh/priv.h6
2 files changed, 13 insertions, 11 deletions
diff --git a/include/libssh/libssh.h b/include/libssh/libssh.h
index 8ae0faf..cfb3fbc 100644
--- a/include/libssh/libssh.h
+++ b/include/libssh/libssh.h
@@ -208,7 +208,7 @@ typedef int socket_t;
#define SSH_AGAIN -2 /* The nonblocking call must be repeated */
#define SSH_EOF -127 /* We have already a eof */
-LIBSSH_API const char *ssh_get_error(void *error);
+LIBSSH_API const char *ssh_get_error(void *error);
LIBSSH_API int ssh_get_error_code(void *error);
/* version checks */
@@ -217,7 +217,7 @@ LIBSSH_API const char *ssh_version(int req_version);
/** \addtogroup ssh_log
* @{
*/
- /** \brief Verbosity level for logging and help to debugging
+ /** \brief Verbosity level for logging and help to debugging
*/
enum {
@@ -227,15 +227,15 @@ enum {
/** Only rare and noteworthy events
*/
SSH_LOG_RARE,
- /** High level protocol informations
+ /** High level protocol informations
*/
SSH_LOG_PROTOCOL,
/** Lower level protocol infomations, packet level
*/
- SSH_LOG_PACKET,
+ SSH_LOG_PACKET,
/** Every function path
*/
- SSH_LOG_FUNCTIONS
+ SSH_LOG_FUNCTIONS
};
/** @}
*/
@@ -405,7 +405,7 @@ LIBSSH_API int ssh_options_set_auth_callback(SSH_OPTIONS *opt, ssh_auth_callback
/* buffer.c */
-/** creates a new buffer
+/** creates a new buffer
*/
LIBSSH_API ssh_buffer buffer_new(void);
LIBSSH_API void buffer_free(ssh_buffer buffer);
@@ -481,16 +481,16 @@ LIBSSH_API ssh_scp ssh_scp_new(ssh_session session, int mode, const char *locati
LIBSSH_API int ssh_scp_init(ssh_scp scp);
LIBSSH_API int ssh_scp_close(ssh_scp scp);
LIBSSH_API void ssh_scp_free(ssh_scp scp);
-LIBSSH_API int ssh_scp_push_directory(ssh_scp scp, const char *dirname, const char *perms);
+LIBSSH_API int ssh_scp_push_directory(ssh_scp scp, const char *dirname, int mode);
LIBSSH_API int ssh_scp_leave_directory(ssh_scp scp);
-LIBSSH_API int ssh_scp_push_file(ssh_scp scp, const char *filename, size_t size, const char *perms);
+LIBSSH_API int ssh_scp_push_file(ssh_scp scp, const char *filename, size_t size, int perms);
LIBSSH_API int ssh_scp_write(ssh_scp scp, const void *buffer, size_t len);
LIBSSH_API int ssh_scp_pull_request(ssh_scp scp);
LIBSSH_API int ssh_scp_deny_request(ssh_scp scp, const char *reason);
LIBSSH_API int ssh_scp_accept_request(ssh_scp scp);
LIBSSH_API int ssh_scp_read(ssh_scp scp, void *buffer, size_t size);
LIBSSH_API const char *ssh_scp_request_get_filename(ssh_scp scp);
-LIBSSH_API const char *ssh_scp_request_get_permissions(ssh_scp scp);
+LIBSSH_API int ssh_scp_request_get_permissions(ssh_scp scp);
LIBSSH_API size_t ssh_scp_request_get_size(ssh_scp scp);
diff --git a/include/libssh/priv.h b/include/libssh/priv.h
index 84b424d..8e1c724 100644
--- a/include/libssh/priv.h
+++ b/include/libssh/priv.h
@@ -371,7 +371,7 @@ struct ssh_scp_struct {
size_t processed;
enum ssh_scp_request_types request_type;
char *request_name;
- char *request_mode;
+ int request_mode;
};
struct ssh_message_struct;
@@ -864,6 +864,8 @@ int ssh_execute_message_callbacks(SSH_SESSION *session);
/* scp.c */
int ssh_scp_read_string(ssh_scp scp, char *buffer, size_t len);
+int ssh_scp_integer_mode(const char *mode);
+char *ssh_scp_string_mode(int mode);
/* log.c */
@@ -872,7 +874,7 @@ int ssh_scp_read_string(ssh_scp scp, char *buffer, size_t len);
#define __FUNCTION__ __func__
#endif
#endif
-
+
#define _enter_function(sess) \
do {\
if((sess)->log_verbosity >= SSH_LOG_FUNCTIONS){ \