|
libssh 0.12.0
The SSH library
|
String manipulations used in libssh. More...
Functions | |
| struct ssh_string_struct * | ssh_string_new (size_t size) |
| Create a new SSH String object. | |
| int | ssh_string_fill (struct ssh_string_struct *s, const void *data, size_t len) |
| Fill a string with given data. The string should be big enough. | |
| struct ssh_string_struct * | ssh_string_from_char (const char *what) |
| Create a ssh string using a C string. | |
| struct ssh_string_struct * | ssh_string_from_data (const void *data, size_t len) |
| Create a ssh string from an arbitrary data buffer. | |
| size_t | ssh_string_len (struct ssh_string_struct *s) |
| Return the size of a SSH string. | |
| const char * | ssh_string_get_char (struct ssh_string_struct *s) |
| Get the string as a C null-terminated string. | |
| char * | ssh_string_to_char (struct ssh_string_struct *s) |
| Convert a SSH string to a C null-terminated string. | |
| void | ssh_string_free_char (char *s) |
| Deallocate a char string object. | |
| struct ssh_string_struct * | ssh_string_copy (struct ssh_string_struct *s) |
| Copy a string, return a newly allocated string. The caller has to free the string. | |
| int | ssh_string_cmp (struct ssh_string_struct *s1, struct ssh_string_struct *s2) |
| Compare two SSH strings. | |
| void | ssh_string_burn (struct ssh_string_struct *s) |
| Destroy the data in a string so it couldn't appear in a core dump. | |
| void * | ssh_string_data (struct ssh_string_struct *s) |
| Get the payload of the string. | |
| void | ssh_string_free (struct ssh_string_struct *s) |
| Deallocate a SSH string object. | |
String manipulations used in libssh.
| void ssh_string_burn | ( | struct ssh_string_struct * | s | ) |
Destroy the data in a string so it couldn't appear in a core dump.
| [in] | s | The string to burn. |
| int ssh_string_cmp | ( | struct ssh_string_struct * | s1, |
| struct ssh_string_struct * | s2 ) |
Compare two SSH strings.
| [in] | s1 | The first SSH string to compare. |
| [in] | s2 | The second SSH string to compare. |
| struct ssh_string_struct * ssh_string_copy | ( | struct ssh_string_struct * | s | ) |
Copy a string, return a newly allocated string. The caller has to free the string.
| [in] | s | String to copy. |
| void * ssh_string_data | ( | struct ssh_string_struct * | s | ) |
Get the payload of the string.
| s | The string to get the data from. |
| int ssh_string_fill | ( | struct ssh_string_struct * | s, |
| const void * | data, | ||
| size_t | len ) |
Fill a string with given data. The string should be big enough.
| s | An allocated string to fill with data. |
| data | The data to fill the string with. |
| len | Size of data. |
| void ssh_string_free | ( | struct ssh_string_struct * | s | ) |
Deallocate a SSH string object.
| [in] | s | The SSH string to delete. |
| void ssh_string_free_char | ( | char * | s | ) |
Deallocate a char string object.
| [in] | s | The string to delete. |
| struct ssh_string_struct * ssh_string_from_char | ( | const char * | what | ) |
Create a ssh string using a C string.
| [in] | what | The source 0-terminated C string. |
| struct ssh_string_struct * ssh_string_from_data | ( | const void * | data, |
| size_t | len ) |
Create a ssh string from an arbitrary data buffer.
Allocates a new SSH string of length len and copies the provided data into it. If len is 0, returns an empty SSH string. When len > 0, data must not be NULL.
| [in] | data | Pointer to the data buffer to copy from. May be NULL only when len == 0. |
| [in] | len | Length of the data buffer to copy. |
| const char * ssh_string_get_char | ( | struct ssh_string_struct * | s | ) |
Get the string as a C null-terminated string.
This is only available as long as the SSH string exists.
| [in] | s | The SSH string to get the C string from. |
| size_t ssh_string_len | ( | struct ssh_string_struct * | s | ) |
Return the size of a SSH string.
| [in] | s | The input SSH string. |
| struct ssh_string_struct * ssh_string_new | ( | size_t | size | ) |
Create a new SSH String object.
| [in] | size | The size of the string. |
| char * ssh_string_to_char | ( | struct ssh_string_struct * | s | ) |
Convert a SSH string to a C null-terminated string.
| [in] | s | The SSH input string. |