summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFabiano Fidêncio <fidencio@redhat.com>2015-09-25 01:21:42 +0200
committerFabiano Fidêncio <fidencio@redhat.com>2016-01-19 11:31:08 +0100
commite0a5674f2566b32720d728658c20b0ad1bd172f4 (patch)
tree62d9d39fcec9df48695a0d2116b6b14363fce38f
parent805a602870c2273b0d213dd1d0ed96e50581ff83 (diff)
downloadlibssh-e0a5674f2566b32720d728658c20b0ad1bd172f4.tar.gz
libssh-e0a5674f2566b32720d728658c20b0ad1bd172f4.tar.xz
libssh-e0a5674f2566b32720d728658c20b0ad1bd172f4.zip
buffer: remove ssh_buffer_get_rest_len()
Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
-rw-r--r--include/libssh/buffer.h5
-rw-r--r--src/buffer.c17
2 files changed, 3 insertions, 19 deletions
diff --git a/include/libssh/buffer.h b/include/libssh/buffer.h
index 15294b2d..656db958 100644
--- a/include/libssh/buffer.h
+++ b/include/libssh/buffer.h
@@ -43,7 +43,6 @@ struct ssh_buffer_struct {
LIBSSH_API void ssh_buffer_free(ssh_buffer buffer);
LIBSSH_API void *ssh_buffer_get_begin(ssh_buffer buffer);
-LIBSSH_API uint32_t ssh_buffer_get_len(ssh_buffer buffer);
LIBSSH_API ssh_buffer ssh_buffer_new(void);
void ssh_buffer_set_secure(ssh_buffer buffer);
int ssh_buffer_add_ssh_string(ssh_buffer buffer, ssh_string string);
@@ -80,8 +79,8 @@ int ssh_buffer_reinit(ssh_buffer buffer);
/* ssh_buffer_get_rest returns a pointer to the current position into the buffer */
void *ssh_buffer_get(ssh_buffer buffer);
-/* ssh_buffer_get_rest_len returns the number of bytes which can be read */
-uint32_t ssh_buffer_get_rest_len(ssh_buffer buffer);
+/* ssh_buffer_get_len returns the number of bytes which can be read */
+LIBSSH_API uint32_t ssh_buffer_get_len(ssh_buffer buffer);
/* buffer_read_*() returns the number of bytes read, except for ssh strings */
int ssh_buffer_get_u8(ssh_buffer buffer, uint8_t *data);
diff --git a/src/buffer.c b/src/buffer.c
index 09c6ac7e..fe6ef8fc 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -467,21 +467,6 @@ void *ssh_buffer_get(struct ssh_buffer_struct *buffer){
}
/**
- * @brief Get the length of the buffer, not counting position.
- *
- * @param[in] buffer The buffer to get the length from.
- *
- * @return The length of the buffer.
- *
- * @see ssh_buffer_get()
- */
-uint32_t ssh_buffer_get_len(struct ssh_buffer_struct *buffer){
- return ssh_buffer_get_rest_len(buffer);
-}
-
-/**
- * @internal
- *
* @brief Get the length of the buffer from the current position.
*
* @param[in] buffer The buffer to get the length from.
@@ -490,7 +475,7 @@ uint32_t ssh_buffer_get_len(struct ssh_buffer_struct *buffer){
*
* @see ssh_buffer_get()
*/
-uint32_t ssh_buffer_get_rest_len(struct ssh_buffer_struct *buffer){
+uint32_t ssh_buffer_get_len(struct ssh_buffer_struct *buffer){
buffer_verify(buffer);
return buffer->used - buffer->pos;
}