libssh 0.4.8
Defines | Functions

SSH Buffers

buffer handling More...

Defines

#define buffer_verify(x)
 checks that preconditions and postconditions are valid

Functions

void buffer_free (struct ssh_buffer_struct *buffer)
 deallocate a buffer
void * buffer_get (struct ssh_buffer_struct *buffer)
 get a pointer on the head of the buffer
uint32_t buffer_get_len (struct ssh_buffer_struct *buffer)
 get length of the buffer, not counting position
struct ssh_buffer_struct * buffer_new (void)
 creates a new buffer

Detailed Description

buffer handling


Function Documentation

void buffer_free ( struct ssh_buffer_struct *  buffer)
void* buffer_get ( struct ssh_buffer_struct *  buffer)

get a pointer on the head of the buffer

Parameters:
bufferbuffer
Returns:
data pointer on the head. Doesn't take position into account.
Warning:
don't expect data to be nul-terminated
See also:
buffer_get_rest()
buffer_get_len()

Referenced by publickey_from_file(), and publickey_to_string().

uint32_t buffer_get_len ( struct ssh_buffer_struct *  buffer)

get length of the buffer, not counting position

Parameters:
buffer
Returns:
length of the buffer
See also:
buffer_get()

Referenced by channel_read_buffer(), publickey_from_file(), and publickey_to_string().

struct ssh_buffer_struct* buffer_new ( void  ) [read]