aboutsummaryrefslogtreecommitdiff
path: root/libssh
diff options
context:
space:
mode:
authorAris Adamantiadis <aris@0xbadc0de.be>2010-03-01 18:11:40 +0100
committerAris Adamantiadis <aris@0xbadc0de.be>2010-03-01 18:11:40 +0100
commitc987fd8c53b4ebabd8ca3d9b32216ac7f7ba6a9e (patch)
treed1099949b005c796546a8176847dc1b8fbb1a6f7 /libssh
parentd083554dff7101a01a636e140367c64a254f0972 (diff)
downloadlibssh-c987fd8c53b4ebabd8ca3d9b32216ac7f7ba6a9e.tar.gz
libssh-c987fd8c53b4ebabd8ca3d9b32216ac7f7ba6a9e.tar.xz
libssh-c987fd8c53b4ebabd8ca3d9b32216ac7f7ba6a9e.zip
renamed ssh_list_get_head to ssh_list_pop_head
Diffstat (limited to 'libssh')
-rw-r--r--libssh/messages.c2
-rw-r--r--libssh/misc.c9
-rw-r--r--libssh/server.c4
-rw-r--r--libssh/session.c2
4 files changed, 12 insertions, 5 deletions
diff --git a/libssh/messages.c b/libssh/messages.c
index 0d3620c0..9b9900e5 100644
--- a/libssh/messages.c
+++ b/libssh/messages.c
@@ -710,7 +710,7 @@ ssh_message ssh_message_get(ssh_session session) {
leave_function();
return NULL;
}
- msg=ssh_list_get_head(ssh_message, session->ssh_message_list);
+ msg=ssh_list_pop_head(ssh_message, session->ssh_message_list);
} while(msg==NULL);
msg=ssh_message_pop_head(session);
leave_function();
diff --git a/libssh/misc.c b/libssh/misc.c
index f64c395a..a86a163b 100644
--- a/libssh/misc.c
+++ b/libssh/misc.c
@@ -261,7 +261,14 @@ void ssh_list_remove(struct ssh_list *list, struct ssh_iterator *iterator){
SAFE_FREE(iterator);
}
-const void *_ssh_list_get_head(struct ssh_list *list){
+/** @internal
+ * @brief Removes the top element of the list and returns the data value attached
+ * to it
+ * @param list the ssh_list
+ * @returns pointer to the element being stored in head, or
+ * NULL if the list is empty.
+ */
+const void *_ssh_list_pop_head(struct ssh_list *list){
struct ssh_iterator *iterator=list->root;
const void *data;
if(!list->root)
diff --git a/libssh/server.c b/libssh/server.c
index a1d234f3..8b36149c 100644
--- a/libssh/server.c
+++ b/libssh/server.c
@@ -912,7 +912,7 @@ int ssh_execute_message_callbacks(ssh_session session){
if(!session->ssh_message_list)
return SSH_OK;
if(session->ssh_message_callback){
- while(ssh_list_get_head(ssh_message , session->ssh_message_list) != NULL){
+ while(ssh_list_pop_head(ssh_message , session->ssh_message_list) != NULL){
msg=ssh_message_pop_head(session);
ret=session->ssh_message_callback(session,msg);
if(ret==1){
@@ -925,7 +925,7 @@ int ssh_execute_message_callbacks(ssh_session session){
}
}
} else {
- while(ssh_list_get_head(ssh_message , session->ssh_message_list) != NULL){
+ while(ssh_list_pop_head(ssh_message , session->ssh_message_list) != NULL){
msg=ssh_message_pop_head(session);
ret = ssh_message_reply_default(msg);
ssh_message_free(msg);
diff --git a/libssh/session.c b/libssh/session.c
index 2e1ee2be..a39a68c5 100644
--- a/libssh/session.c
+++ b/libssh/session.c
@@ -166,7 +166,7 @@ void ssh_free(ssh_session session) {
privatekey_free(session->rsa_key);
if(session->ssh_message_list){
ssh_message msg;
- while((msg=ssh_list_get_head(ssh_message ,session->ssh_message_list))
+ while((msg=ssh_list_pop_head(ssh_message ,session->ssh_message_list))
!= NULL){
ssh_message_free(msg);
}