[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 05/24] cleanup: use ssh_ prefix in the channels (non-static) functions


Having "ssh_" prefix in the functions' name will avoid possible clashes
when compiling libssh statically.

Signed-off-by: Fabiano Fidêncio <fidencio@xxxxxxxxxx>
---
 include/libssh/channels.h | 12 ++++++------
 src/channels.c            | 12 ++++++------
 src/channels1.c           | 12 ++++++------
 3 files changed, 18 insertions(+), 18 deletions(-)

diff --git a/include/libssh/channels.h b/include/libssh/channels.h
index b05c4c0..44258ba 100644
--- a/include/libssh/channels.h
+++ b/include/libssh/channels.h
@@ -105,13 +105,13 @@ SSH_PACKET_CALLBACK(ssh_packet_close1);
 SSH_PACKET_CALLBACK(ssh_packet_exist_status1);
 
 /* channels1.c */
-int channel_open_session1(ssh_channel channel);
-int channel_request_pty_size1(ssh_channel channel, const char *terminal,
+int ssh_channel_open_session1(ssh_channel channel);
+int ssh_channel_request_pty_size1(ssh_channel channel, const char *terminal,
     int cols, int rows);
-int channel_change_pty_size1(ssh_channel channel, int cols, int rows);
-int channel_request_shell1(ssh_channel channel);
-int channel_request_exec1(ssh_channel channel, const char *cmd);
-int channel_write1(ssh_channel channel, const void *data, int len);
+int ssh_channel_change_pty_size1(ssh_channel channel, int cols, int rows);
+int ssh_channel_request_shell1(ssh_channel channel);
+int ssh_channel_request_exec1(ssh_channel channel, const char *cmd);
+int ssh_channel_write1(ssh_channel channel, const void *data, int len);
 ssh_channel ssh_get_channel1(ssh_session session);
 #endif
 
diff --git a/src/channels.c b/src/channels.c
index 84e9608..6082320 100644
--- a/src/channels.c
+++ b/src/channels.c
@@ -864,7 +864,7 @@ int ssh_channel_open_session(ssh_channel channel) {
 
 #ifdef WITH_SSH1
   if (channel->session->version == 1) {
-    return channel_open_session1(channel);
+    return ssh_channel_open_session1(channel);
   }
 #endif
 
@@ -1250,7 +1250,7 @@ static int channel_write_common(ssh_channel channel,
   }
 #ifdef WITH_SSH1
   if (channel->version == 1) {
-    rc = channel_write1(channel, data, len);
+    rc = ssh_channel_write1(channel, data, len);
 
     return rc;
   }
@@ -1633,7 +1633,7 @@ int ssh_channel_request_pty_size(ssh_channel channel, const char *terminal,
 
 #ifdef WITH_SSH1
   if (channel->version==1) {
-    rc = channel_request_pty_size1(channel,terminal, col, row);
+    rc = ssh_channel_request_pty_size1(channel,terminal, col, row);
 
     return rc;
     }
@@ -1711,7 +1711,7 @@ int ssh_channel_change_pty_size(ssh_channel channel, int cols, int rows) {
 
 #ifdef WITH_SSH1
   if (channel->version == 1) {
-    rc = channel_change_pty_size1(channel,cols,rows);
+    rc = ssh_channel_change_pty_size1(channel,cols,rows);
 
     return rc;
   }
@@ -1757,7 +1757,7 @@ int ssh_channel_request_shell(ssh_channel channel) {
     }
 #ifdef WITH_SSH1
   if (channel->version == 1) {
-    return channel_request_shell1(channel);
+    return ssh_channel_request_shell1(channel);
   }
 #endif
   return channel_request(channel, "shell", NULL, 1);
@@ -2398,7 +2398,7 @@ int ssh_channel_request_exec(ssh_channel channel, const char *cmd) {
 
 #ifdef WITH_SSH1
   if (channel->version == 1) {
-    return channel_request_exec1(channel, cmd);
+    return ssh_channel_request_exec1(channel, cmd);
   }
 #endif
   switch(channel->request_state){
diff --git a/src/channels1.c b/src/channels1.c
index c3e7b92..730649a 100644
--- a/src/channels1.c
+++ b/src/channels1.c
@@ -51,7 +51,7 @@
  * protocol.
  */
 
-int channel_open_session1(ssh_channel chan) {
+int ssh_channel_open_session1(ssh_channel chan) {
   ssh_session session;
 
   if (chan == NULL) {
@@ -91,7 +91,7 @@ int channel_open_session1(ssh_channel chan) {
  *  much simplier under ssh2. I just hope the defaults values are ok ...
  */
 
-int channel_request_pty_size1(ssh_channel channel, const char *terminal, int col,
+int ssh_channel_request_pty_size1(ssh_channel channel, const char *terminal, int col,
     int row) {
   ssh_session session;
   ssh_string str = NULL;
@@ -158,7 +158,7 @@ int channel_request_pty_size1(ssh_channel channel, const char *terminal, int col
   return SSH_ERROR;
 }
 
-int channel_change_pty_size1(ssh_channel channel, int cols, int rows) {
+int ssh_channel_change_pty_size1(ssh_channel channel, int cols, int rows) {
   ssh_session session;
 
   if (channel == NULL) {
@@ -207,7 +207,7 @@ int channel_change_pty_size1(ssh_channel channel, int cols, int rows) {
 
 }
 
-int channel_request_shell1(ssh_channel channel) {
+int ssh_channel_request_shell1(ssh_channel channel) {
   ssh_session session;
 
   if (channel == NULL) {
@@ -228,7 +228,7 @@ int channel_request_shell1(ssh_channel channel) {
   return 0;
 }
 
-int channel_request_exec1(ssh_channel channel, const char *cmd) {
+int ssh_channel_request_exec1(ssh_channel channel, const char *cmd) {
   ssh_session session;
   ssh_string command = NULL;
 
@@ -338,7 +338,7 @@ SSH_PACKET_CALLBACK(ssh_packet_exist_status1){
 }
 
 
-int channel_write1(ssh_channel channel, const void *data, int len) {
+int ssh_channel_write1(ssh_channel channel, const void *data, int len) {
   ssh_session session;
   int origlen = len;
   int effectivelen;
-- 
2.5.0


Archive administrator: postmaster@lists.cynapses.org