diff options
author | Andreas Schneider <mail@cynapses.org> | 2009-04-01 08:37:26 +0000 |
---|---|---|
committer | Andreas Schneider <mail@cynapses.org> | 2009-04-01 08:37:26 +0000 |
commit | 04d916f3aa2ace814bb505822f762d3feef45f46 (patch) | |
tree | 47a3023e7d004ca55caea8a3407e439b301cc10e /include/libssh/libssh.h | |
parent | 15d0dc7a4e28c400748cd2e8b5cf93c832e3298f (diff) | |
download | libssh-04d916f3aa2ace814bb505822f762d3feef45f46.tar.gz libssh-04d916f3aa2ace814bb505822f762d3feef45f46.tar.xz libssh-04d916f3aa2ace814bb505822f762d3feef45f46.zip |
Add arg and error checking for the string functions.
git-svn-id: svn+ssh://svn.berlios.de/svnroot/repos/libssh/trunk@310 7dcaeef0-15fb-0310-b436-a5af3365683c
Diffstat (limited to 'include/libssh/libssh.h')
-rw-r--r-- | include/libssh/libssh.h | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/include/libssh/libssh.h b/include/libssh/libssh.h index d865aa36..20c057d1 100644 --- a/include/libssh/libssh.h +++ b/include/libssh/libssh.h @@ -212,16 +212,17 @@ int ssh_service_request(SSH_SESSION *session,char *service); char *ssh_get_issue_banner(SSH_SESSION *session); /* get copyright informations */ const char *ssh_copyright(void); + /* string.h */ /* You can use these functions, they won't change */ -/* makestring returns a newly allocated string from a char * ptr */ +/* string_from_char returns a newly allocated string from a char *ptr */ STRING *string_from_char(const char *what); /* it returns the string len in host byte orders. str->size is big endian warning ! */ -u32 string_len(STRING *str); -STRING *string_new(unsigned int size); -/* string_fill copies the data in the string. it does NOT check for boundary so allocate enough place with string_new */ -void string_fill(STRING *str, const void *data,int len); +size_t string_len(STRING *str); +STRING *string_new(size_t size); +/* string_fill copies the data in the string. */ +int string_fill(STRING *str, const void *data, size_t len); /* returns a newly allocated char array with the str string and a final nul caracter */ char *string_to_char(STRING *str); STRING *string_copy(STRING *str); |