aboutsummaryrefslogtreecommitdiff
path: root/libssh/string.c
diff options
context:
space:
mode:
Diffstat (limited to 'libssh/string.c')
-rw-r--r--libssh/string.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/libssh/string.c b/libssh/string.c
index e56fdce..0a036ad 100644
--- a/libssh/string.c
+++ b/libssh/string.c
@@ -47,7 +47,7 @@
*
* @return The newly allocated string, NULL on error.
*/
-struct ssh_string_struct *string_new(size_t size) {
+struct ssh_string_struct *ssh_string_new(size_t size) {
struct ssh_string_struct *str = NULL;
str = malloc(size + 4);
@@ -70,7 +70,7 @@ struct ssh_string_struct *string_new(size_t size) {
*
* @return 0 on success, < 0 on error.
*/
-int string_fill(struct ssh_string_struct *s, const void *data, size_t len) {
+int ssh_string_fill(struct ssh_string_struct *s, const void *data, size_t len) {
if ((s == NULL) || (data == NULL) ||
(len == 0) || (len > s->size)) {
return -1;
@@ -90,7 +90,7 @@ int string_fill(struct ssh_string_struct *s, const void *data, size_t len) {
*
* @note The nul byte is not copied nor counted in the ouput string.
*/
-struct ssh_string_struct *string_from_char(const char *what) {
+struct ssh_string_struct *ssh_string_from_char(const char *what) {
struct ssh_string_struct *ptr = NULL;
size_t len = strlen(what);
@@ -111,7 +111,7 @@ struct ssh_string_struct *string_from_char(const char *what) {
*
* @return The size of the content of the string, 0 on error.
*/
-size_t string_len(struct ssh_string_struct *s) {
+size_t ssh_string_len(struct ssh_string_struct *s) {
if (s == NULL) {
return ntohl(0);
}
@@ -130,7 +130,7 @@ size_t string_len(struct ssh_string_struct *s) {
* @note If the input SSH string contains zeroes, some parts of the output
* string may not be readable with regular libc functions.
*/
-char *string_to_char(struct ssh_string_struct *s) {
+char *ssh_string_to_char(struct ssh_string_struct *s) {
size_t len = ntohl(s->size) + 1;
char *new = malloc(len);
@@ -150,7 +150,7 @@ char *string_to_char(struct ssh_string_struct *s) {
*
* @return Newly allocated copy of the string, NULL on error.
*/
-struct ssh_string_struct *string_copy(struct ssh_string_struct *s) {
+struct ssh_string_struct *ssh_string_copy(struct ssh_string_struct *s) {
struct ssh_string_struct *new = malloc(ntohl(s->size) + 4);
if (new == NULL) {
@@ -167,11 +167,11 @@ struct ssh_string_struct *string_copy(struct ssh_string_struct *s) {
*
* @param[in] s The string to burn.
*/
-void string_burn(struct ssh_string_struct *s) {
+void ssh_string_burn(struct ssh_string_struct *s) {
if (s == NULL) {
return;
}
- memset(s->string, 'X', string_len(s));
+ memset(s->string, 'X', ssh_string_len(s));
}
/**
@@ -181,7 +181,7 @@ void string_burn(struct ssh_string_struct *s) {
*
* @return Return the data of the string or NULL on error.
*/
-void *string_data(struct ssh_string_struct *s) {
+void *ssh_string_data(struct ssh_string_struct *s) {
if (s == NULL) {
return NULL;
}
@@ -194,7 +194,7 @@ void *string_data(struct ssh_string_struct *s) {
*
* \param[in] s The SSH string to delete.
*/
-void string_free(struct ssh_string_struct *s) {
+void ssh_string_free(struct ssh_string_struct *s) {
SAFE_FREE(s);
}